diff options
author | Andrew Tridgell <tridge@samba.org> | 2003-11-15 09:18:02 +0000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2003-11-15 09:18:02 +0000 |
commit | 4cadb043d7a99f835a5893283b63bbe13281e665 (patch) | |
tree | a69bd4bd2c60f6a4ce5a132784e70156dd340795 | |
parent | 1e9ea7fe86a0d826cbb013c40e418a3927d01ef1 (diff) | |
download | samba-4cadb043d7a99f835a5893283b63bbe13281e665.tar.gz samba-4cadb043d7a99f835a5893283b63bbe13281e665.tar.xz samba-4cadb043d7a99f835a5893283b63bbe13281e665.zip |
added another 11 levels of QueryDomainInfo
(This used to be commit 219cfabaeb38c5fd2fcabd1e6f05da206bab21e4)
-rw-r--r-- | source4/librpc/idl/samr.idl | 84 | ||||
-rw-r--r-- | source4/librpc/ndr/ndr_dfs.c | 62 | ||||
-rw-r--r-- | source4/librpc/ndr/ndr_echo.c | 6 | ||||
-rw-r--r-- | source4/librpc/ndr/ndr_lsa.c | 78 | ||||
-rw-r--r-- | source4/librpc/ndr/ndr_samr.c | 430 | ||||
-rw-r--r-- | source4/librpc/ndr/ndr_samr.h | 85 | ||||
-rw-r--r-- | source4/librpc/ndr/ndr_spoolss.c | 6 | ||||
-rw-r--r-- | source4/torture/rpc/samr.c | 25 |
8 files changed, 686 insertions, 90 deletions
diff --git a/source4/librpc/idl/samr.idl b/source4/librpc/idl/samr.idl index 440b5ab9e7f..17a6b626876 100644 --- a/source4/librpc/idl/samr.idl +++ b/source4/librpc/idl/samr.idl @@ -90,8 +90,92 @@ NTTIME min_passwordage; } samr_DomInfo1; + typedef struct { + HYPER_T force_logoff_time; + samr_Name unknown_name; + samr_Name domain; /* domain name */ + samr_Name primary; /* PDC name if this is a BDC */ + HYPER_T sequence_num; + uint32 unknown_2; + uint32 role; + uint32 unknown_3; + uint32 num_users; + uint32 num_groups; + uint32 num_aliases; + } samr_DomInfo2; + + typedef struct { + HYPER_T force_logoff_time; + } samr_DomInfo3; + + typedef struct { + samr_Name unknown_name; + } samr_DomInfo4; + + typedef struct { + samr_Name domain; + } samr_DomInfo5; + + typedef struct { + samr_Name primary; + } samr_DomInfo6; + + typedef struct { + uint32 role; + } samr_DomInfo7; + + typedef struct { + HYPER_T sequence_num; + NTTIME last_xxx_time; + } samr_DomInfo8; + + typedef struct { + uint32 unknown; + } samr_DomInfo9; + + typedef struct { + HYPER_T force_logoff_time; + samr_Name unknown_name; + samr_Name domain; + samr_Name primary; + HYPER_T sequence_num; + uint32 unknown_2; + uint32 role; + uint32 unknown_3; + uint32 num_users; + uint32 num_groups; + uint32 num_aliases; + HYPER_T lockout_duration; + HYPER_T lockout_window; + uint16 lockout_threshold; + } samr_DomInfo11; + + typedef struct { + HYPER_T lockout_duration; + HYPER_T lockout_window; + uint16 lockout_threshold; + } samr_DomInfo12; + + typedef struct { + HYPER_T sequence_num; + NTTIME last_xxx_time; + uint32 foo7; + uint32 foo8; + } samr_DomInfo13; + typedef union { case(1) samr_DomInfo1 info1; + case(2) samr_DomInfo2 info2; + case(3) samr_DomInfo3 info3; + case(4) samr_DomInfo4 info4; + case(5) samr_DomInfo5 info5; + case(6) samr_DomInfo6 info6; + case(7) samr_DomInfo7 info7; + case(8) samr_DomInfo8 info8; + case(9) samr_DomInfo9 info9; + case(11) samr_DomInfo11 info11; + case(12) samr_DomInfo12 info12; + case(13) samr_DomInfo13 info13; } samr_DomainInfo; NTSTATUS samr_QueryDomainInfo( diff --git a/source4/librpc/ndr/ndr_dfs.c b/source4/librpc/ndr/ndr_dfs.c index 325e88adad9..6b85e0c61bb 100644 --- a/source4/librpc/ndr/ndr_dfs.c +++ b/source4/librpc/ndr/ndr_dfs.c @@ -48,8 +48,8 @@ NTSTATUS ndr_push_dfs_SetInfo(struct ndr_push *ndr, struct dfs_SetInfo *r) static NTSTATUS ndr_push_dfs_Info1(struct ndr_push *ndr, int ndr_flags, struct dfs_Info1 *r) { - NDR_CHECK(ndr_push_align(ndr, 4)); if (!(ndr_flags & NDR_SCALARS)) goto buffers; + NDR_CHECK(ndr_push_align(ndr, 4)); NDR_CHECK(ndr_push_ptr(ndr, r->path)); buffers: if (!(ndr_flags & NDR_BUFFERS)) goto done; @@ -62,8 +62,8 @@ done: static NTSTATUS ndr_push_dfs_Info2(struct ndr_push *ndr, int ndr_flags, struct dfs_Info2 *r) { - NDR_CHECK(ndr_push_align(ndr, 4)); if (!(ndr_flags & NDR_SCALARS)) goto buffers; + NDR_CHECK(ndr_push_align(ndr, 4)); NDR_CHECK(ndr_push_ptr(ndr, r->path)); NDR_CHECK(ndr_push_ptr(ndr, r->comment)); NDR_CHECK(ndr_push_uint32(ndr, r->state)); @@ -82,8 +82,8 @@ done: static NTSTATUS ndr_push_dfs_StorageInfo(struct ndr_push *ndr, int ndr_flags, struct dfs_StorageInfo *r) { - NDR_CHECK(ndr_push_align(ndr, 4)); if (!(ndr_flags & NDR_SCALARS)) goto buffers; + NDR_CHECK(ndr_push_align(ndr, 4)); NDR_CHECK(ndr_push_uint32(ndr, r->state)); NDR_CHECK(ndr_push_ptr(ndr, r->server)); NDR_CHECK(ndr_push_ptr(ndr, r->share)); @@ -101,8 +101,8 @@ done: static NTSTATUS ndr_push_dfs_Info3(struct ndr_push *ndr, int ndr_flags, struct dfs_Info3 *r) { - NDR_CHECK(ndr_push_align(ndr, 4)); if (!(ndr_flags & NDR_SCALARS)) goto buffers; + NDR_CHECK(ndr_push_align(ndr, 4)); NDR_CHECK(ndr_push_ptr(ndr, r->path)); NDR_CHECK(ndr_push_ptr(ndr, r->comment)); NDR_CHECK(ndr_push_uint32(ndr, r->state)); @@ -126,8 +126,8 @@ done: static NTSTATUS ndr_push_dfs_Info4(struct ndr_push *ndr, int ndr_flags, struct dfs_Info4 *r) { - NDR_CHECK(ndr_push_align(ndr, 4)); if (!(ndr_flags & NDR_SCALARS)) goto buffers; + NDR_CHECK(ndr_push_align(ndr, 4)); NDR_CHECK(ndr_push_ptr(ndr, r->path)); NDR_CHECK(ndr_push_ptr(ndr, r->comment)); NDR_CHECK(ndr_push_uint32(ndr, r->state)); @@ -154,8 +154,8 @@ done: static NTSTATUS ndr_push_dfs_Info200(struct ndr_push *ndr, int ndr_flags, struct dfs_Info200 *r) { - NDR_CHECK(ndr_push_align(ndr, 4)); if (!(ndr_flags & NDR_SCALARS)) goto buffers; + NDR_CHECK(ndr_push_align(ndr, 4)); NDR_CHECK(ndr_push_ptr(ndr, r->dom_root)); buffers: if (!(ndr_flags & NDR_BUFFERS)) goto done; @@ -168,8 +168,8 @@ done: static NTSTATUS ndr_push_dfs_Info300(struct ndr_push *ndr, int ndr_flags, struct dfs_Info300 *r) { - NDR_CHECK(ndr_push_align(ndr, 4)); if (!(ndr_flags & NDR_SCALARS)) goto buffers; + NDR_CHECK(ndr_push_align(ndr, 4)); NDR_CHECK(ndr_push_uint32(ndr, r->flags)); NDR_CHECK(ndr_push_ptr(ndr, r->dom_root)); buffers: @@ -199,8 +199,8 @@ NTSTATUS ndr_push_dfs_GetInfo(struct ndr_push *ndr, struct dfs_GetInfo *r) static NTSTATUS ndr_push_dfs_EnumArray1(struct ndr_push *ndr, int ndr_flags, struct dfs_EnumArray1 *r) { - NDR_CHECK(ndr_push_align(ndr, 4)); if (!(ndr_flags & NDR_SCALARS)) goto buffers; + NDR_CHECK(ndr_push_align(ndr, 4)); NDR_CHECK(ndr_push_uint32(ndr, r->count)); NDR_CHECK(ndr_push_ptr(ndr, r->s)); buffers: @@ -215,8 +215,8 @@ done: static NTSTATUS ndr_push_dfs_EnumArray2(struct ndr_push *ndr, int ndr_flags, struct dfs_EnumArray2 *r) { - NDR_CHECK(ndr_push_align(ndr, 4)); if (!(ndr_flags & NDR_SCALARS)) goto buffers; + NDR_CHECK(ndr_push_align(ndr, 4)); NDR_CHECK(ndr_push_uint32(ndr, r->count)); NDR_CHECK(ndr_push_ptr(ndr, r->s)); buffers: @@ -231,8 +231,8 @@ done: static NTSTATUS ndr_push_dfs_EnumArray3(struct ndr_push *ndr, int ndr_flags, struct dfs_EnumArray3 *r) { - NDR_CHECK(ndr_push_align(ndr, 4)); if (!(ndr_flags & NDR_SCALARS)) goto buffers; + NDR_CHECK(ndr_push_align(ndr, 4)); NDR_CHECK(ndr_push_uint32(ndr, r->count)); NDR_CHECK(ndr_push_ptr(ndr, r->s)); buffers: @@ -247,8 +247,8 @@ done: static NTSTATUS ndr_push_dfs_EnumArray4(struct ndr_push *ndr, int ndr_flags, struct dfs_EnumArray4 *r) { - NDR_CHECK(ndr_push_align(ndr, 4)); if (!(ndr_flags & NDR_SCALARS)) goto buffers; + NDR_CHECK(ndr_push_align(ndr, 4)); NDR_CHECK(ndr_push_uint32(ndr, r->count)); NDR_CHECK(ndr_push_ptr(ndr, r->s)); buffers: @@ -263,8 +263,8 @@ done: static NTSTATUS ndr_push_dfs_EnumArray200(struct ndr_push *ndr, int ndr_flags, struct dfs_EnumArray200 *r) { - NDR_CHECK(ndr_push_align(ndr, 4)); if (!(ndr_flags & NDR_SCALARS)) goto buffers; + NDR_CHECK(ndr_push_align(ndr, 4)); NDR_CHECK(ndr_push_uint32(ndr, r->count)); NDR_CHECK(ndr_push_ptr(ndr, r->s)); buffers: @@ -279,8 +279,8 @@ done: static NTSTATUS ndr_push_dfs_EnumArray300(struct ndr_push *ndr, int ndr_flags, struct dfs_EnumArray300 *r) { - NDR_CHECK(ndr_push_align(ndr, 4)); if (!(ndr_flags & NDR_SCALARS)) goto buffers; + NDR_CHECK(ndr_push_align(ndr, 4)); NDR_CHECK(ndr_push_uint32(ndr, r->count)); NDR_CHECK(ndr_push_ptr(ndr, r->s)); buffers: @@ -373,8 +373,8 @@ done: static NTSTATUS ndr_push_dfs_EnumStruct(struct ndr_push *ndr, int ndr_flags, struct dfs_EnumStruct *r) { - NDR_CHECK(ndr_push_align(ndr, 4)); if (!(ndr_flags & NDR_SCALARS)) goto buffers; + NDR_CHECK(ndr_push_align(ndr, 4)); NDR_CHECK(ndr_push_uint32(ndr, r->level)); NDR_CHECK(ndr_push_dfs_EnumInfo(ndr, NDR_SCALARS, r->level, &r->e)); buffers: @@ -435,8 +435,8 @@ NTSTATUS ndr_pull_dfs_SetInfo(struct ndr_pull *ndr, struct dfs_SetInfo *r) static NTSTATUS ndr_pull_dfs_Info1(struct ndr_pull *ndr, int ndr_flags, struct dfs_Info1 *r) { uint32 _ptr_path; - NDR_CHECK(ndr_pull_align(ndr, 4)); if (!(ndr_flags & NDR_SCALARS)) goto buffers; + NDR_CHECK(ndr_pull_align(ndr, 4)); NDR_CHECK(ndr_pull_uint32(ndr, &_ptr_path)); if (_ptr_path) { NDR_ALLOC(ndr, r->path); @@ -456,8 +456,8 @@ static NTSTATUS ndr_pull_dfs_Info2(struct ndr_pull *ndr, int ndr_flags, struct d { uint32 _ptr_path; uint32 _ptr_comment; - NDR_CHECK(ndr_pull_align(ndr, 4)); if (!(ndr_flags & NDR_SCALARS)) goto buffers; + NDR_CHECK(ndr_pull_align(ndr, 4)); NDR_CHECK(ndr_pull_uint32(ndr, &_ptr_path)); if (_ptr_path) { NDR_ALLOC(ndr, r->path); @@ -488,8 +488,8 @@ static NTSTATUS ndr_pull_dfs_StorageInfo(struct ndr_pull *ndr, int ndr_flags, st { uint32 _ptr_server; uint32 _ptr_share; - NDR_CHECK(ndr_pull_align(ndr, 4)); if (!(ndr_flags & NDR_SCALARS)) goto buffers; + NDR_CHECK(ndr_pull_align(ndr, 4)); NDR_CHECK(ndr_pull_uint32(ndr, &r->state)); NDR_CHECK(ndr_pull_uint32(ndr, &_ptr_server)); if (_ptr_server) { @@ -520,8 +520,8 @@ static NTSTATUS ndr_pull_dfs_Info3(struct ndr_pull *ndr, int ndr_flags, struct d uint32 _ptr_path; uint32 _ptr_comment; uint32 _ptr_stores; - NDR_CHECK(ndr_pull_align(ndr, 4)); if (!(ndr_flags & NDR_SCALARS)) goto buffers; + NDR_CHECK(ndr_pull_align(ndr, 4)); NDR_CHECK(ndr_pull_uint32(ndr, &_ptr_path)); if (_ptr_path) { NDR_ALLOC(ndr, r->path); @@ -570,8 +570,8 @@ static NTSTATUS ndr_pull_dfs_Info4(struct ndr_pull *ndr, int ndr_flags, struct d uint32 _ptr_path; uint32 _ptr_comment; uint32 _ptr_stores; - NDR_CHECK(ndr_pull_align(ndr, 4)); if (!(ndr_flags & NDR_SCALARS)) goto buffers; + NDR_CHECK(ndr_pull_align(ndr, 4)); NDR_CHECK(ndr_pull_uint32(ndr, &_ptr_path)); if (_ptr_path) { NDR_ALLOC(ndr, r->path); @@ -621,8 +621,8 @@ done: static NTSTATUS ndr_pull_dfs_Info100(struct ndr_pull *ndr, int ndr_flags, struct dfs_Info100 *r) { uint32 _ptr_comment; - NDR_CHECK(ndr_pull_align(ndr, 4)); if (!(ndr_flags & NDR_SCALARS)) goto buffers; + NDR_CHECK(ndr_pull_align(ndr, 4)); NDR_CHECK(ndr_pull_uint32(ndr, &_ptr_comment)); if (_ptr_comment) { NDR_ALLOC(ndr, r->comment); @@ -640,8 +640,8 @@ done: static NTSTATUS ndr_pull_dfs_Info101(struct ndr_pull *ndr, int ndr_flags, struct dfs_Info101 *r) { - NDR_CHECK(ndr_pull_align(ndr, 4)); if (!(ndr_flags & NDR_SCALARS)) goto buffers; + NDR_CHECK(ndr_pull_align(ndr, 4)); NDR_CHECK(ndr_pull_uint32(ndr, &r->state)); buffers: if (!(ndr_flags & NDR_BUFFERS)) goto done; @@ -651,8 +651,8 @@ done: static NTSTATUS ndr_pull_dfs_Info102(struct ndr_pull *ndr, int ndr_flags, struct dfs_Info102 *r) { - NDR_CHECK(ndr_pull_align(ndr, 4)); if (!(ndr_flags & NDR_SCALARS)) goto buffers; + NDR_CHECK(ndr_pull_align(ndr, 4)); NDR_CHECK(ndr_pull_uint32(ndr, &r->timeout)); buffers: if (!(ndr_flags & NDR_BUFFERS)) goto done; @@ -663,8 +663,8 @@ done: static NTSTATUS ndr_pull_dfs_Info200(struct ndr_pull *ndr, int ndr_flags, struct dfs_Info200 *r) { uint32 _ptr_dom_root; - NDR_CHECK(ndr_pull_align(ndr, 4)); if (!(ndr_flags & NDR_SCALARS)) goto buffers; + NDR_CHECK(ndr_pull_align(ndr, 4)); NDR_CHECK(ndr_pull_uint32(ndr, &_ptr_dom_root)); if (_ptr_dom_root) { NDR_ALLOC(ndr, r->dom_root); @@ -683,8 +683,8 @@ done: static NTSTATUS ndr_pull_dfs_Info300(struct ndr_pull *ndr, int ndr_flags, struct dfs_Info300 *r) { uint32 _ptr_dom_root; - NDR_CHECK(ndr_pull_align(ndr, 4)); if (!(ndr_flags & NDR_SCALARS)) goto buffers; + NDR_CHECK(ndr_pull_align(ndr, 4)); NDR_CHECK(ndr_pull_uint32(ndr, &r->flags)); NDR_CHECK(ndr_pull_uint32(ndr, &_ptr_dom_root)); if (_ptr_dom_root) { @@ -877,8 +877,8 @@ NTSTATUS ndr_pull_dfs_GetInfo(struct ndr_pull *ndr, struct dfs_GetInfo *r) static NTSTATUS ndr_pull_dfs_EnumArray1(struct ndr_pull *ndr, int ndr_flags, struct dfs_EnumArray1 *r) { uint32 _ptr_s; - NDR_CHECK(ndr_pull_align(ndr, 4)); if (!(ndr_flags & NDR_SCALARS)) goto buffers; + NDR_CHECK(ndr_pull_align(ndr, 4)); NDR_CHECK(ndr_pull_uint32(ndr, &r->count)); NDR_CHECK(ndr_pull_uint32(ndr, &_ptr_s)); if (_ptr_s) { @@ -906,8 +906,8 @@ done: static NTSTATUS ndr_pull_dfs_EnumArray2(struct ndr_pull *ndr, int ndr_flags, struct dfs_EnumArray2 *r) { uint32 _ptr_s; - NDR_CHECK(ndr_pull_align(ndr, 4)); if (!(ndr_flags & NDR_SCALARS)) goto buffers; + NDR_CHECK(ndr_pull_align(ndr, 4)); NDR_CHECK(ndr_pull_uint32(ndr, &r->count)); NDR_CHECK(ndr_pull_uint32(ndr, &_ptr_s)); if (_ptr_s) { @@ -935,8 +935,8 @@ done: static NTSTATUS ndr_pull_dfs_EnumArray3(struct ndr_pull *ndr, int ndr_flags, struct dfs_EnumArray3 *r) { uint32 _ptr_s; - NDR_CHECK(ndr_pull_align(ndr, 4)); if (!(ndr_flags & NDR_SCALARS)) goto buffers; + NDR_CHECK(ndr_pull_align(ndr, 4)); NDR_CHECK(ndr_pull_uint32(ndr, &r->count)); NDR_CHECK(ndr_pull_uint32(ndr, &_ptr_s)); if (_ptr_s) { @@ -964,8 +964,8 @@ done: static NTSTATUS ndr_pull_dfs_EnumArray4(struct ndr_pull *ndr, int ndr_flags, struct dfs_EnumArray4 *r) { uint32 _ptr_s; - NDR_CHECK(ndr_pull_align(ndr, 4)); if (!(ndr_flags & NDR_SCALARS)) goto buffers; + NDR_CHECK(ndr_pull_align(ndr, 4)); NDR_CHECK(ndr_pull_uint32(ndr, &r->count)); NDR_CHECK(ndr_pull_uint32(ndr, &_ptr_s)); if (_ptr_s) { @@ -993,8 +993,8 @@ done: static NTSTATUS ndr_pull_dfs_EnumArray200(struct ndr_pull *ndr, int ndr_flags, struct dfs_EnumArray200 *r) { uint32 _ptr_s; - NDR_CHECK(ndr_pull_align(ndr, 4)); if (!(ndr_flags & NDR_SCALARS)) goto buffers; + NDR_CHECK(ndr_pull_align(ndr, 4)); NDR_CHECK(ndr_pull_uint32(ndr, &r->count)); NDR_CHECK(ndr_pull_uint32(ndr, &_ptr_s)); if (_ptr_s) { @@ -1022,8 +1022,8 @@ done: static NTSTATUS ndr_pull_dfs_EnumArray300(struct ndr_pull *ndr, int ndr_flags, struct dfs_EnumArray300 *r) { uint32 _ptr_s; - NDR_CHECK(ndr_pull_align(ndr, 4)); if (!(ndr_flags & NDR_SCALARS)) goto buffers; + NDR_CHECK(ndr_pull_align(ndr, 4)); NDR_CHECK(ndr_pull_uint32(ndr, &r->count)); NDR_CHECK(ndr_pull_uint32(ndr, &_ptr_s)); if (_ptr_s) { @@ -1164,8 +1164,8 @@ done: static NTSTATUS ndr_pull_dfs_EnumStruct(struct ndr_pull *ndr, int ndr_flags, struct dfs_EnumStruct *r) { - NDR_CHECK(ndr_pull_align(ndr, 4)); if (!(ndr_flags & NDR_SCALARS)) goto buffers; + NDR_CHECK(ndr_pull_align(ndr, 4)); NDR_CHECK(ndr_pull_uint32(ndr, &r->level)); { uint16 _level; NDR_CHECK(ndr_pull_dfs_EnumInfo(ndr, NDR_SCALARS, &_level, &r->e)); diff --git a/source4/librpc/ndr/ndr_echo.c b/source4/librpc/ndr/ndr_echo.c index 909c06cd18c..568255f993a 100644 --- a/source4/librpc/ndr/ndr_echo.c +++ b/source4/librpc/ndr/ndr_echo.c @@ -93,8 +93,8 @@ NTSTATUS ndr_pull_echo_SourceData(struct ndr_pull *ndr, struct echo_SourceData * static NTSTATUS ndr_pull_echo_Enum1(struct ndr_pull *ndr, int ndr_flags, struct echo_Enum1 *r) { uint32 _ptr_count; - NDR_CHECK(ndr_pull_align(ndr, 4)); if (!(ndr_flags & NDR_SCALARS)) goto buffers; + NDR_CHECK(ndr_pull_align(ndr, 4)); NDR_CHECK(ndr_pull_uint32(ndr, &_ptr_count)); if (_ptr_count) { NDR_ALLOC(ndr, r->count); @@ -113,8 +113,8 @@ done: static NTSTATUS ndr_pull_echo_Enum3(struct ndr_pull *ndr, int ndr_flags, struct echo_Enum3 *r) { uint32 _ptr_count; - NDR_CHECK(ndr_pull_align(ndr, 4)); if (!(ndr_flags & NDR_SCALARS)) goto buffers; + NDR_CHECK(ndr_pull_align(ndr, 4)); NDR_CHECK(ndr_pull_uint32(ndr, &_ptr_count)); if (_ptr_count) { NDR_ALLOC(ndr, r->count); @@ -166,8 +166,8 @@ done: static NTSTATUS ndr_pull_Struct1(struct ndr_pull *ndr, int ndr_flags, struct Struct1 *r) { - NDR_CHECK(ndr_pull_align(ndr, 4)); if (!(ndr_flags & NDR_SCALARS)) goto buffers; + NDR_CHECK(ndr_pull_align(ndr, 4)); NDR_CHECK(ndr_pull_uint32(ndr, &r->level)); { uint16 _level; NDR_CHECK(ndr_pull_echo_EnumInfo(ndr, NDR_SCALARS, &_level, &r->e)); diff --git a/source4/librpc/ndr/ndr_lsa.c b/source4/librpc/ndr/ndr_lsa.c index db17c1e63de..4d43ce4a948 100644 --- a/source4/librpc/ndr/ndr_lsa.c +++ b/source4/librpc/ndr/ndr_lsa.c @@ -18,8 +18,8 @@ NTSTATUS ndr_push_lsa_Delete(struct ndr_push *ndr, struct lsa_Delete *r) static NTSTATUS ndr_push_lsa_Name(struct ndr_push *ndr, int ndr_flags, struct lsa_Name *r) { - NDR_CHECK(ndr_push_align(ndr, 4)); if (!(ndr_flags & NDR_SCALARS)) goto buffers; + NDR_CHECK(ndr_push_align(ndr, 4)); NDR_CHECK(ndr_push_uint16(ndr, 2*strlen_m(r->name))); NDR_CHECK(ndr_push_uint16(ndr, 2*strlen_m(r->name))); NDR_CHECK(ndr_push_ptr(ndr, r->name)); @@ -63,8 +63,8 @@ NTSTATUS ndr_push_lsa_ChangePassword(struct ndr_push *ndr, struct lsa_ChangePass static NTSTATUS ndr_push_lsa_QosInfo(struct ndr_push *ndr, int ndr_flags, struct lsa_QosInfo *r) { - NDR_CHECK(ndr_push_align(ndr, 4)); if (!(ndr_flags & NDR_SCALARS)) goto buffers; + NDR_CHECK(ndr_push_align(ndr, 4)); NDR_CHECK(ndr_push_uint32(ndr, r->len)); NDR_CHECK(ndr_push_uint16(ndr, r->impersonation_level)); NDR_CHECK(ndr_push_uint8(ndr, r->context_mode)); @@ -77,8 +77,8 @@ done: static NTSTATUS ndr_push_lsa_ObjectAttribute(struct ndr_push *ndr, int ndr_flags, struct lsa_ObjectAttribute *r) { - NDR_CHECK(ndr_push_align(ndr, 4)); if (!(ndr_flags & NDR_SCALARS)) goto buffers; + NDR_CHECK(ndr_push_align(ndr, 4)); NDR_CHECK(ndr_push_uint32(ndr, r->len)); NDR_CHECK(ndr_push_ptr(ndr, r->root_dir)); NDR_CHECK(ndr_push_ptr(ndr, r->object_name)); @@ -143,8 +143,8 @@ NTSTATUS ndr_push_lsa_CreateAccount(struct ndr_push *ndr, struct lsa_CreateAccou static NTSTATUS ndr_push_lsa_SidPtr(struct ndr_push *ndr, int ndr_flags, struct lsa_SidPtr *r) { - NDR_CHECK(ndr_push_align(ndr, 4)); if (!(ndr_flags & NDR_SCALARS)) goto buffers; + NDR_CHECK(ndr_push_align(ndr, 4)); NDR_CHECK(ndr_push_ptr(ndr, r->sid)); buffers: if (!(ndr_flags & NDR_BUFFERS)) goto done; @@ -157,8 +157,8 @@ done: static NTSTATUS ndr_push_lsa_SidArray(struct ndr_push *ndr, int ndr_flags, struct lsa_SidArray *r) { - NDR_CHECK(ndr_push_align(ndr, 4)); if (!(ndr_flags & NDR_SCALARS)) goto buffers; + NDR_CHECK(ndr_push_align(ndr, 4)); NDR_CHECK(ndr_push_uint32(ndr, r->num_sids)); NDR_CHECK(ndr_push_ptr(ndr, r->sids)); buffers: @@ -197,8 +197,8 @@ NTSTATUS ndr_push_lsa_EnumTrustDom(struct ndr_push *ndr, struct lsa_EnumTrustDom static NTSTATUS ndr_push_lsa_TranslatedSid(struct ndr_push *ndr, int ndr_flags, struct lsa_TranslatedSid *r) { - NDR_CHECK(ndr_push_align(ndr, 4)); if (!(ndr_flags & NDR_SCALARS)) goto buffers; + NDR_CHECK(ndr_push_align(ndr, 4)); NDR_CHECK(ndr_push_uint16(ndr, r->sid_type)); NDR_CHECK(ndr_push_uint32(ndr, r->rid)); NDR_CHECK(ndr_push_uint32(ndr, r->sid_index)); @@ -210,8 +210,8 @@ done: static NTSTATUS ndr_push_lsa_TransSidArray(struct ndr_push *ndr, int ndr_flags, struct lsa_TransSidArray *r) { - NDR_CHECK(ndr_push_align(ndr, 4)); if (!(ndr_flags & NDR_SCALARS)) goto buffers; + NDR_CHECK(ndr_push_align(ndr, 4)); NDR_CHECK(ndr_push_uint32(ndr, r->count)); NDR_CHECK(ndr_push_ptr(ndr, r->sids)); buffers: @@ -242,8 +242,8 @@ NTSTATUS ndr_push_lsa_LookupNames(struct ndr_push *ndr, struct lsa_LookupNames * static NTSTATUS ndr_push_lsa_TranslatedName(struct ndr_push *ndr, int ndr_flags, struct lsa_TranslatedName *r) { - NDR_CHECK(ndr_push_align(ndr, 4)); if (!(ndr_flags & NDR_SCALARS)) goto buffers; + NDR_CHECK(ndr_push_align(ndr, 4)); NDR_CHECK(ndr_push_uint16(ndr, r->sid_type)); NDR_CHECK(ndr_push_lsa_Name(ndr, NDR_SCALARS, &r->name)); NDR_CHECK(ndr_push_uint32(ndr, r->sid_index)); @@ -256,8 +256,8 @@ done: static NTSTATUS ndr_push_lsa_TransNameArray(struct ndr_push *ndr, int ndr_flags, struct lsa_TransNameArray *r) { - NDR_CHECK(ndr_push_align(ndr, 4)); if (!(ndr_flags & NDR_SCALARS)) goto buffers; + NDR_CHECK(ndr_push_align(ndr, 4)); NDR_CHECK(ndr_push_uint32(ndr, r->count)); NDR_CHECK(ndr_push_ptr(ndr, r->names)); buffers: @@ -298,8 +298,8 @@ NTSTATUS ndr_push_lsa_OpenAccount(struct ndr_push *ndr, struct lsa_OpenAccount * static NTSTATUS ndr_push_lsa_LUID(struct ndr_push *ndr, int ndr_flags, struct lsa_LUID *r) { - NDR_CHECK(ndr_push_align(ndr, 4)); if (!(ndr_flags & NDR_SCALARS)) goto buffers; + NDR_CHECK(ndr_push_align(ndr, 4)); NDR_CHECK(ndr_push_uint32(ndr, r->low)); NDR_CHECK(ndr_push_uint32(ndr, r->high)); buffers: @@ -511,8 +511,8 @@ NTSTATUS ndr_pull_lsa_Delete(struct ndr_pull *ndr, struct lsa_Delete *r) static NTSTATUS ndr_pull_lsa_Name(struct ndr_pull *ndr, int ndr_flags, struct lsa_Name *r) { uint32 _ptr_name; - NDR_CHECK(ndr_pull_align(ndr, 4)); if (!(ndr_flags & NDR_SCALARS)) goto buffers; + NDR_CHECK(ndr_pull_align(ndr, 4)); NDR_CHECK(ndr_pull_uint16(ndr, &r->name_len)); NDR_CHECK(ndr_pull_uint16(ndr, &r->name_size)); NDR_CHECK(ndr_pull_uint32(ndr, &_ptr_name)); @@ -532,8 +532,8 @@ done: static NTSTATUS ndr_pull_lsa_PrivEntry(struct ndr_pull *ndr, int ndr_flags, struct lsa_PrivEntry *r) { - NDR_CHECK(ndr_pull_align(ndr, 4)); if (!(ndr_flags & NDR_SCALARS)) goto buffers; + NDR_CHECK(ndr_pull_align(ndr, 4)); NDR_CHECK(ndr_pull_lsa_Name(ndr, NDR_SCALARS, &r->name)); NDR_CHECK(ndr_pull_uint32(ndr, &r->luid_low)); NDR_CHECK(ndr_pull_uint32(ndr, &r->luid_high)); @@ -547,8 +547,8 @@ done: static NTSTATUS ndr_pull_lsa_PrivArray(struct ndr_pull *ndr, int ndr_flags, struct lsa_PrivArray *r) { uint32 _ptr_privs; - NDR_CHECK(ndr_pull_align(ndr, 4)); if (!(ndr_flags & NDR_SCALARS)) goto buffers; + NDR_CHECK(ndr_pull_align(ndr, 4)); NDR_CHECK(ndr_pull_uint32(ndr, &r->count)); NDR_CHECK(ndr_pull_uint32(ndr, &_ptr_privs)); if (_ptr_privs) { @@ -623,8 +623,8 @@ NTSTATUS ndr_pull_lsa_OpenPolicy(struct ndr_pull *ndr, struct lsa_OpenPolicy *r) static NTSTATUS ndr_pull_lsa_AuditLogInfo(struct ndr_pull *ndr, int ndr_flags, struct lsa_AuditLogInfo *r) { - NDR_CHECK(ndr_pull_align(ndr, 4)); if (!(ndr_flags & NDR_SCALARS)) goto buffers; + NDR_CHECK(ndr_pull_align(ndr, 4)); NDR_CHECK(ndr_pull_uint32(ndr, &r->percent_full)); NDR_CHECK(ndr_pull_uint32(ndr, &r->log_size)); NDR_CHECK(ndr_pull_NTTIME(ndr, &r->retention_time)); @@ -642,8 +642,8 @@ static NTSTATUS ndr_pull_lsa_AuditSettings(struct ndr_pull *ndr, int ndr_flags, { uint32 _conformant_size; NDR_CHECK(ndr_pull_uint32(ndr, &_conformant_size)); - NDR_CHECK(ndr_pull_align(ndr, 4)); if (!(ndr_flags & NDR_SCALARS)) goto buffers; + NDR_CHECK(ndr_pull_align(ndr, 4)); NDR_CHECK(ndr_pull_uint32(ndr, &r->count)); buffers: if (!(ndr_flags & NDR_BUFFERS)) goto done; @@ -659,8 +659,8 @@ done: static NTSTATUS ndr_pull_lsa_AuditEventsInfo(struct ndr_pull *ndr, int ndr_flags, struct lsa_AuditEventsInfo *r) { uint32 _ptr_settings; - NDR_CHECK(ndr_pull_align(ndr, 4)); if (!(ndr_flags & NDR_SCALARS)) goto buffers; + NDR_CHECK(ndr_pull_align(ndr, 4)); NDR_CHECK(ndr_pull_uint32(ndr, &r->auditing_mode)); NDR_CHECK(ndr_pull_uint32(ndr, &_ptr_settings)); if (_ptr_settings) { @@ -680,8 +680,8 @@ done: static NTSTATUS ndr_pull_lsa_DomainInfo(struct ndr_pull *ndr, int ndr_flags, struct lsa_DomainInfo *r) { uint32 _ptr_sid; - NDR_CHECK(ndr_pull_align(ndr, 4)); if (!(ndr_flags & NDR_SCALARS)) goto buffers; + NDR_CHECK(ndr_pull_align(ndr, 4)); NDR_CHECK(ndr_pull_lsa_Name(ndr, NDR_SCALARS, &r->name)); NDR_CHECK(ndr_pull_uint32(ndr, &_ptr_sid)); if (_ptr_sid) { @@ -701,8 +701,8 @@ done: static NTSTATUS ndr_pull_lsa_PDAccountInfo(struct ndr_pull *ndr, int ndr_flags, struct lsa_PDAccountInfo *r) { - NDR_CHECK(ndr_pull_align(ndr, 4)); if (!(ndr_flags & NDR_SCALARS)) goto buffers; + NDR_CHECK(ndr_pull_align(ndr, 4)); NDR_CHECK(ndr_pull_lsa_Name(ndr, NDR_SCALARS, &r->name)); buffers: if (!(ndr_flags & NDR_BUFFERS)) goto done; @@ -713,8 +713,8 @@ done: static NTSTATUS ndr_pull_lsa_ServerRole(struct ndr_pull *ndr, int ndr_flags, struct lsa_ServerRole *r) { - NDR_CHECK(ndr_pull_align(ndr, 4)); if (!(ndr_flags & NDR_SCALARS)) goto buffers; + NDR_CHECK(ndr_pull_align(ndr, 4)); NDR_CHECK(ndr_pull_uint16(ndr, &r->role)); buffers: if (!(ndr_flags & NDR_BUFFERS)) goto done; @@ -724,8 +724,8 @@ done: static NTSTATUS ndr_pull_lsa_ReplicaSourceInfo(struct ndr_pull *ndr, int ndr_flags, struct lsa_ReplicaSourceInfo *r) { - NDR_CHECK(ndr_pull_align(ndr, 4)); if (!(ndr_flags & NDR_SCALARS)) goto buffers; + NDR_CHECK(ndr_pull_align(ndr, 4)); NDR_CHECK(ndr_pull_lsa_Name(ndr, NDR_SCALARS, &r->source)); NDR_CHECK(ndr_pull_lsa_Name(ndr, NDR_SCALARS, &r->account)); buffers: @@ -738,8 +738,8 @@ done: static NTSTATUS ndr_pull_lsa_DefaultQuotaInfo(struct ndr_pull *ndr, int ndr_flags, struct lsa_DefaultQuotaInfo *r) { - NDR_CHECK(ndr_pull_align(ndr, 8)); if (!(ndr_flags & NDR_SCALARS)) goto buffers; + NDR_CHECK(ndr_pull_align(ndr, 8)); NDR_CHECK(ndr_pull_uint32(ndr, &r->paged_pool)); NDR_CHECK(ndr_pull_uint32(ndr, &r->non_paged_pool)); NDR_CHECK(ndr_pull_uint32(ndr, &r->min_wss)); @@ -754,8 +754,8 @@ done: static NTSTATUS ndr_pull_lsa_ModificationInfo(struct ndr_pull *ndr, int ndr_flags, struct lsa_ModificationInfo *r) { - NDR_CHECK(ndr_pull_align(ndr, 8)); if (!(ndr_flags & NDR_SCALARS)) goto buffers; + NDR_CHECK(ndr_pull_align(ndr, 8)); NDR_CHECK(ndr_pull_HYPER_T(ndr, &r->modified_id)); NDR_CHECK(ndr_pull_NTTIME(ndr, &r->db_create_time)); buffers: @@ -766,8 +766,8 @@ done: static NTSTATUS ndr_pull_lsa_AuditFullSetInfo(struct ndr_pull *ndr, int ndr_flags, struct lsa_AuditFullSetInfo *r) { - NDR_CHECK(ndr_pull_align(ndr, 4)); if (!(ndr_flags & NDR_SCALARS)) goto buffers; + NDR_CHECK(ndr_pull_align(ndr, 4)); NDR_CHECK(ndr_pull_uint32(ndr, &r->shutdown_on_full)); buffers: if (!(ndr_flags & NDR_BUFFERS)) goto done; @@ -777,8 +777,8 @@ done: static NTSTATUS ndr_pull_lsa_AuditFullQueryInfo(struct ndr_pull *ndr, int ndr_flags, struct lsa_AuditFullQueryInfo *r) { - NDR_CHECK(ndr_pull_align(ndr, 4)); if (!(ndr_flags & NDR_SCALARS)) goto buffers; + NDR_CHECK(ndr_pull_align(ndr, 4)); NDR_CHECK(ndr_pull_uint32(ndr, &r->shutdown_on_full)); NDR_CHECK(ndr_pull_uint32(ndr, &r->log_is_full)); buffers: @@ -790,8 +790,8 @@ done: static NTSTATUS ndr_pull_lsa_DnsDomainInfo(struct ndr_pull *ndr, int ndr_flags, struct lsa_DnsDomainInfo *r) { uint32 _ptr_sid; - NDR_CHECK(ndr_pull_align(ndr, 4)); if (!(ndr_flags & NDR_SCALARS)) goto buffers; + NDR_CHECK(ndr_pull_align(ndr, 4)); NDR_CHECK(ndr_pull_lsa_Name(ndr, NDR_SCALARS, &r->name)); NDR_CHECK(ndr_pull_lsa_Name(ndr, NDR_SCALARS, &r->dns_domain)); NDR_CHECK(ndr_pull_lsa_Name(ndr, NDR_SCALARS, &r->dns_forest)); @@ -973,8 +973,8 @@ NTSTATUS ndr_pull_lsa_CreateAccount(struct ndr_pull *ndr, struct lsa_CreateAccou static NTSTATUS ndr_pull_lsa_SidPtr(struct ndr_pull *ndr, int ndr_flags, struct lsa_SidPtr *r) { uint32 _ptr_sid; - NDR_CHECK(ndr_pull_align(ndr, 4)); if (!(ndr_flags & NDR_SCALARS)) goto buffers; + NDR_CHECK(ndr_pull_align(ndr, 4)); NDR_CHECK(ndr_pull_uint32(ndr, &_ptr_sid)); if (_ptr_sid) { NDR_ALLOC(ndr, r->sid); @@ -993,8 +993,8 @@ done: static NTSTATUS ndr_pull_lsa_SidArray(struct ndr_pull *ndr, int ndr_flags, struct lsa_SidArray *r) { uint32 _ptr_sids; - NDR_CHECK(ndr_pull_align(ndr, 4)); if (!(ndr_flags & NDR_SCALARS)) goto buffers; + NDR_CHECK(ndr_pull_align(ndr, 4)); NDR_CHECK(ndr_pull_uint32(ndr, &r->num_sids)); NDR_CHECK(ndr_pull_uint32(ndr, &_ptr_sids)); if (_ptr_sids) { @@ -1038,8 +1038,8 @@ NTSTATUS ndr_pull_lsa_CreateTrustDom(struct ndr_pull *ndr, struct lsa_CreateTrus static NTSTATUS ndr_pull_lsa_DomainInformation(struct ndr_pull *ndr, int ndr_flags, struct lsa_DomainInformation *r) { uint32 _ptr_sid; - NDR_CHECK(ndr_pull_align(ndr, 4)); if (!(ndr_flags & NDR_SCALARS)) goto buffers; + NDR_CHECK(ndr_pull_align(ndr, 4)); NDR_CHECK(ndr_pull_lsa_Name(ndr, NDR_SCALARS, &r->name)); NDR_CHECK(ndr_pull_uint32(ndr, &_ptr_sid)); if (_ptr_sid) { @@ -1060,8 +1060,8 @@ done: static NTSTATUS ndr_pull_lsa_DomainList(struct ndr_pull *ndr, int ndr_flags, struct lsa_DomainList *r) { uint32 _ptr_domains; - NDR_CHECK(ndr_pull_align(ndr, 4)); if (!(ndr_flags & NDR_SCALARS)) goto buffers; + NDR_CHECK(ndr_pull_align(ndr, 4)); NDR_CHECK(ndr_pull_uint32(ndr, &r->count)); NDR_CHECK(ndr_pull_uint32(ndr, &_ptr_domains)); if (_ptr_domains) { @@ -1097,8 +1097,8 @@ NTSTATUS ndr_pull_lsa_EnumTrustDom(struct ndr_pull *ndr, struct lsa_EnumTrustDom static NTSTATUS ndr_pull_lsa_TranslatedSid(struct ndr_pull *ndr, int ndr_flags, struct lsa_TranslatedSid *r) { - NDR_CHECK(ndr_pull_align(ndr, 4)); if (!(ndr_flags & NDR_SCALARS)) goto buffers; + NDR_CHECK(ndr_pull_align(ndr, 4)); NDR_CHECK(ndr_pull_uint16(ndr, &r->sid_type)); NDR_CHECK(ndr_pull_uint32(ndr, &r->rid)); NDR_CHECK(ndr_pull_uint32(ndr, &r->sid_index)); @@ -1111,8 +1111,8 @@ done: static NTSTATUS ndr_pull_lsa_TransSidArray(struct ndr_pull *ndr, int ndr_flags, struct lsa_TransSidArray *r) { uint32 _ptr_sids; - NDR_CHECK(ndr_pull_align(ndr, 4)); if (!(ndr_flags & NDR_SCALARS)) goto buffers; + NDR_CHECK(ndr_pull_align(ndr, 4)); NDR_CHECK(ndr_pull_uint32(ndr, &r->count)); NDR_CHECK(ndr_pull_uint32(ndr, &_ptr_sids)); if (_ptr_sids) { @@ -1140,8 +1140,8 @@ done: static NTSTATUS ndr_pull_lsa_TrustInformation(struct ndr_pull *ndr, int ndr_flags, struct lsa_TrustInformation *r) { uint32 _ptr_sid; - NDR_CHECK(ndr_pull_align(ndr, 4)); if (!(ndr_flags & NDR_SCALARS)) goto buffers; + NDR_CHECK(ndr_pull_align(ndr, 4)); NDR_CHECK(ndr_pull_lsa_Name(ndr, NDR_SCALARS, &r->name)); NDR_CHECK(ndr_pull_uint32(ndr, &_ptr_sid)); if (_ptr_sid) { @@ -1162,8 +1162,8 @@ done: static NTSTATUS ndr_pull_lsa_RefDomainList(struct ndr_pull *ndr, int ndr_flags, struct lsa_RefDomainList *r) { uint32 _ptr_domains; - NDR_CHECK(ndr_pull_align(ndr, 4)); if (!(ndr_flags & NDR_SCALARS)) goto buffers; + NDR_CHECK(ndr_pull_align(ndr, 4)); NDR_CHECK(ndr_pull_uint32(ndr, &r->count)); NDR_CHECK(ndr_pull_uint32(ndr, &_ptr_domains)); if (_ptr_domains) { @@ -1210,8 +1210,8 @@ NTSTATUS ndr_pull_lsa_LookupNames(struct ndr_pull *ndr, struct lsa_LookupNames * static NTSTATUS ndr_pull_lsa_TranslatedName(struct ndr_pull *ndr, int ndr_flags, struct lsa_TranslatedName *r) { - NDR_CHECK(ndr_pull_align(ndr, 4)); if (!(ndr_flags & NDR_SCALARS)) goto buffers; + NDR_CHECK(ndr_pull_align(ndr, 4)); NDR_CHECK(ndr_pull_uint16(ndr, &r->sid_type)); NDR_CHECK(ndr_pull_lsa_Name(ndr, NDR_SCALARS, &r->name)); NDR_CHECK(ndr_pull_uint32(ndr, &r->sid_index)); @@ -1225,8 +1225,8 @@ done: static NTSTATUS ndr_pull_lsa_TransNameArray(struct ndr_pull *ndr, int ndr_flags, struct lsa_TransNameArray *r) { uint32 _ptr_names; - NDR_CHECK(ndr_pull_align(ndr, 4)); if (!(ndr_flags & NDR_SCALARS)) goto buffers; + NDR_CHECK(ndr_pull_align(ndr, 4)); NDR_CHECK(ndr_pull_uint32(ndr, &r->count)); NDR_CHECK(ndr_pull_uint32(ndr, &_ptr_names)); if (_ptr_names) { @@ -1287,8 +1287,8 @@ NTSTATUS ndr_pull_lsa_OpenAccount(struct ndr_pull *ndr, struct lsa_OpenAccount * static NTSTATUS ndr_pull_lsa_LUID(struct ndr_pull *ndr, int ndr_flags, struct lsa_LUID *r) { - NDR_CHECK(ndr_pull_align(ndr, 4)); if (!(ndr_flags & NDR_SCALARS)) goto buffers; + NDR_CHECK(ndr_pull_align(ndr, 4)); NDR_CHECK(ndr_pull_uint32(ndr, &r->low)); NDR_CHECK(ndr_pull_uint32(ndr, &r->high)); buffers: @@ -1299,8 +1299,8 @@ done: static NTSTATUS ndr_pull_lsa_LUIDAttribute(struct ndr_pull *ndr, int ndr_flags, struct lsa_LUIDAttribute *r) { - NDR_CHECK(ndr_pull_align(ndr, 4)); if (!(ndr_flags & NDR_SCALARS)) goto buffers; + NDR_CHECK(ndr_pull_align(ndr, 4)); NDR_CHECK(ndr_pull_lsa_LUID(ndr, NDR_SCALARS, &r->luid)); NDR_CHECK(ndr_pull_uint32(ndr, &r->attribute)); buffers: @@ -1314,8 +1314,8 @@ static NTSTATUS ndr_pull_lsa_PrivilegeSet(struct ndr_pull *ndr, int ndr_flags, s { uint32 _conformant_size; NDR_CHECK(ndr_pull_uint32(ndr, &_conformant_size)); - NDR_CHECK(ndr_pull_align(ndr, 4)); if (!(ndr_flags & NDR_SCALARS)) goto buffers; + NDR_CHECK(ndr_pull_align(ndr, 4)); NDR_CHECK(ndr_pull_uint32(ndr, &r->count)); NDR_CHECK(ndr_pull_uint32(ndr, &r->unknown)); buffers: @@ -1478,8 +1478,8 @@ NTSTATUS ndr_pull_ENUMACCTWITHRIGHT(struct ndr_pull *ndr, struct ENUMACCTWITHRIG static NTSTATUS ndr_pull_lsa_RightSet(struct ndr_pull *ndr, int ndr_flags, struct lsa_RightSet *r) { uint32 _ptr_names; - NDR_CHECK(ndr_pull_align(ndr, 4)); if (!(ndr_flags & NDR_SCALARS)) goto buffers; + NDR_CHECK(ndr_pull_align(ndr, 4)); NDR_CHECK(ndr_pull_uint32(ndr, &r->count)); NDR_CHECK(ndr_pull_uint32(ndr, &_ptr_names)); if (_ptr_names) { diff --git a/source4/librpc/ndr/ndr_samr.c b/source4/librpc/ndr/ndr_samr.c index 10f30afa2cf..fb6f19d3e67 100644 --- a/source4/librpc/ndr/ndr_samr.c +++ b/source4/librpc/ndr/ndr_samr.c @@ -39,8 +39,8 @@ NTSTATUS ndr_push_samr_Shutdown(struct ndr_push *ndr, struct samr_Shutdown *r) static NTSTATUS ndr_push_samr_Name(struct ndr_push *ndr, int ndr_flags, struct samr_Name *r) { - NDR_CHECK(ndr_push_align(ndr, 4)); if (!(ndr_flags & NDR_SCALARS)) goto buffers; + NDR_CHECK(ndr_push_align(ndr, 4)); NDR_CHECK(ndr_push_uint16(ndr, 2*strlen_m(r->name))); NDR_CHECK(ndr_push_uint16(ndr, 2*strlen_m(r->name))); NDR_CHECK(ndr_push_ptr(ndr, r->name)); @@ -486,8 +486,8 @@ NTSTATUS ndr_pull_samr_Shutdown(struct ndr_pull *ndr, struct samr_Shutdown *r) static NTSTATUS ndr_pull_samr_Name(struct ndr_pull *ndr, int ndr_flags, struct samr_Name *r) { uint32 _ptr_name; - NDR_CHECK(ndr_pull_align(ndr, 4)); if (!(ndr_flags & NDR_SCALARS)) goto buffers; + NDR_CHECK(ndr_pull_align(ndr, 4)); NDR_CHECK(ndr_pull_uint16(ndr, &r->name_len)); NDR_CHECK(ndr_pull_uint16(ndr, &r->name_size)); NDR_CHECK(ndr_pull_uint32(ndr, &_ptr_name)); @@ -524,8 +524,8 @@ NTSTATUS ndr_pull_samr_LookupDomain(struct ndr_pull *ndr, struct samr_LookupDoma static NTSTATUS ndr_pull_samr_SamEntry(struct ndr_pull *ndr, int ndr_flags, struct samr_SamEntry *r) { - NDR_CHECK(ndr_pull_align(ndr, 4)); if (!(ndr_flags & NDR_SCALARS)) goto buffers; + NDR_CHECK(ndr_pull_align(ndr, 4)); NDR_CHECK(ndr_pull_uint32(ndr, &r->idx)); NDR_CHECK(ndr_pull_samr_Name(ndr, NDR_SCALARS, &r->name)); buffers: @@ -538,8 +538,8 @@ done: static NTSTATUS ndr_pull_samr_SamArray(struct ndr_pull *ndr, int ndr_flags, struct samr_SamArray *r) { uint32 _ptr_entries; - NDR_CHECK(ndr_pull_align(ndr, 4)); if (!(ndr_flags & NDR_SCALARS)) goto buffers; + NDR_CHECK(ndr_pull_align(ndr, 4)); NDR_CHECK(ndr_pull_uint32(ndr, &r->count)); NDR_CHECK(ndr_pull_uint32(ndr, &_ptr_entries)); if (_ptr_entries) { @@ -593,8 +593,8 @@ NTSTATUS ndr_pull_samr_OpenDomain(struct ndr_pull *ndr, struct samr_OpenDomain * static NTSTATUS ndr_pull_samr_DomInfo1(struct ndr_pull *ndr, int ndr_flags, struct samr_DomInfo1 *r) { - NDR_CHECK(ndr_pull_align(ndr, 4)); if (!(ndr_flags & NDR_SCALARS)) goto buffers; + NDR_CHECK(ndr_pull_align(ndr, 4)); NDR_CHECK(ndr_pull_uint16(ndr, &r->min_length_password)); NDR_CHECK(ndr_pull_uint16(ndr, &r->password_history)); NDR_CHECK(ndr_pull_uint32(ndr, &r->flag)); @@ -606,6 +606,165 @@ done: return NT_STATUS_OK; } +static NTSTATUS ndr_pull_samr_DomInfo2(struct ndr_pull *ndr, int ndr_flags, struct samr_DomInfo2 *r) +{ + if (!(ndr_flags & NDR_SCALARS)) goto buffers; + NDR_CHECK(ndr_pull_align(ndr, 8)); + NDR_CHECK(ndr_pull_HYPER_T(ndr, &r->force_logoff_time)); + NDR_CHECK(ndr_pull_samr_Name(ndr, NDR_SCALARS, &r->unknown_name)); + NDR_CHECK(ndr_pull_samr_Name(ndr, NDR_SCALARS, &r->domain)); + NDR_CHECK(ndr_pull_samr_Name(ndr, NDR_SCALARS, &r->primary)); + NDR_CHECK(ndr_pull_HYPER_T(ndr, &r->sequence_num)); + NDR_CHECK(ndr_pull_uint32(ndr, &r->unknown_2)); + NDR_CHECK(ndr_pull_uint32(ndr, &r->role)); + NDR_CHECK(ndr_pull_uint32(ndr, &r->unknown_3)); + NDR_CHECK(ndr_pull_uint32(ndr, &r->num_users)); + NDR_CHECK(ndr_pull_uint32(ndr, &r->num_groups)); + NDR_CHECK(ndr_pull_uint32(ndr, &r->num_aliases)); +buffers: + if (!(ndr_flags & NDR_BUFFERS)) goto done; + NDR_CHECK(ndr_pull_samr_Name(ndr, NDR_BUFFERS, &r->unknown_name)); + NDR_CHECK(ndr_pull_samr_Name(ndr, NDR_BUFFERS, &r->domain)); + NDR_CHECK(ndr_pull_samr_Name(ndr, NDR_BUFFERS, &r->primary)); +done: + return NT_STATUS_OK; +} + +static NTSTATUS ndr_pull_samr_DomInfo3(struct ndr_pull *ndr, int ndr_flags, struct samr_DomInfo3 *r) +{ + if (!(ndr_flags & NDR_SCALARS)) goto buffers; + NDR_CHECK(ndr_pull_align(ndr, 8)); + NDR_CHECK(ndr_pull_HYPER_T(ndr, &r->force_logoff_time)); +buffers: + if (!(ndr_flags & NDR_BUFFERS)) goto done; +done: + return NT_STATUS_OK; +} + +static NTSTATUS ndr_pull_samr_DomInfo4(struct ndr_pull *ndr, int ndr_flags, struct samr_DomInfo4 *r) +{ + if (!(ndr_flags & NDR_SCALARS)) goto buffers; + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_samr_Name(ndr, NDR_SCALARS, &r->unknown_name)); +buffers: + if (!(ndr_flags & NDR_BUFFERS)) goto done; + NDR_CHECK(ndr_pull_samr_Name(ndr, NDR_BUFFERS, &r->unknown_name)); +done: + return NT_STATUS_OK; +} + +static NTSTATUS ndr_pull_samr_DomInfo5(struct ndr_pull *ndr, int ndr_flags, struct samr_DomInfo5 *r) +{ + if (!(ndr_flags & NDR_SCALARS)) goto buffers; + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_samr_Name(ndr, NDR_SCALARS, &r->domain)); +buffers: + if (!(ndr_flags & NDR_BUFFERS)) goto done; + NDR_CHECK(ndr_pull_samr_Name(ndr, NDR_BUFFERS, &r->domain)); +done: + return NT_STATUS_OK; +} + +static NTSTATUS ndr_pull_samr_DomInfo6(struct ndr_pull *ndr, int ndr_flags, struct samr_DomInfo6 *r) +{ + if (!(ndr_flags & NDR_SCALARS)) goto buffers; + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_samr_Name(ndr, NDR_SCALARS, &r->primary)); +buffers: + if (!(ndr_flags & NDR_BUFFERS)) goto done; + NDR_CHECK(ndr_pull_samr_Name(ndr, NDR_BUFFERS, &r->primary)); +done: + return NT_STATUS_OK; +} + +static NTSTATUS ndr_pull_samr_DomInfo7(struct ndr_pull *ndr, int ndr_flags, struct samr_DomInfo7 *r) +{ + if (!(ndr_flags & NDR_SCALARS)) goto buffers; + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, &r->role)); +buffers: + if (!(ndr_flags & NDR_BUFFERS)) goto done; +done: + return NT_STATUS_OK; +} + +static NTSTATUS ndr_pull_samr_DomInfo8(struct ndr_pull *ndr, int ndr_flags, struct samr_DomInfo8 *r) +{ + if (!(ndr_flags & NDR_SCALARS)) goto buffers; + NDR_CHECK(ndr_pull_align(ndr, 8)); + NDR_CHECK(ndr_pull_HYPER_T(ndr, &r->sequence_num)); + NDR_CHECK(ndr_pull_NTTIME(ndr, &r->last_modify_time)); +buffers: + if (!(ndr_flags & NDR_BUFFERS)) goto done; +done: + return NT_STATUS_OK; +} + +static NTSTATUS ndr_pull_samr_DomInfo9(struct ndr_pull *ndr, int ndr_flags, struct samr_DomInfo9 *r) +{ + if (!(ndr_flags & NDR_SCALARS)) goto buffers; + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, &r->unknown)); +buffers: + if (!(ndr_flags & NDR_BUFFERS)) goto done; +done: + return NT_STATUS_OK; +} + +static NTSTATUS ndr_pull_samr_DomInfo11(struct ndr_pull *ndr, int ndr_flags, struct samr_DomInfo11 *r) +{ + if (!(ndr_flags & NDR_SCALARS)) goto buffers; + NDR_CHECK(ndr_pull_align(ndr, 8)); + NDR_CHECK(ndr_pull_HYPER_T(ndr, &r->force_logoff_time)); + NDR_CHECK(ndr_pull_samr_Name(ndr, NDR_SCALARS, &r->unknown_name)); + NDR_CHECK(ndr_pull_samr_Name(ndr, NDR_SCALARS, &r->domain)); + NDR_CHECK(ndr_pull_samr_Name(ndr, NDR_SCALARS, &r->primary)); + NDR_CHECK(ndr_pull_HYPER_T(ndr, &r->sequence_num)); + NDR_CHECK(ndr_pull_uint32(ndr, &r->unknown_2)); + NDR_CHECK(ndr_pull_uint32(ndr, &r->role)); + NDR_CHECK(ndr_pull_uint32(ndr, &r->unknown_3)); + NDR_CHECK(ndr_pull_uint32(ndr, &r->num_users)); + NDR_CHECK(ndr_pull_uint32(ndr, &r->num_groups)); + NDR_CHECK(ndr_pull_uint32(ndr, &r->num_aliases)); + NDR_CHECK(ndr_pull_HYPER_T(ndr, &r->lockout_duration)); + NDR_CHECK(ndr_pull_HYPER_T(ndr, &r->lockout_window)); + NDR_CHECK(ndr_pull_uint16(ndr, &r->lockout_threshold)); +buffers: + if (!(ndr_flags & NDR_BUFFERS)) goto done; + NDR_CHECK(ndr_pull_samr_Name(ndr, NDR_BUFFERS, &r->unknown_name)); + NDR_CHECK(ndr_pull_samr_Name(ndr, NDR_BUFFERS, &r->domain)); + NDR_CHECK(ndr_pull_samr_Name(ndr, NDR_BUFFERS, &r->primary)); +done: + return NT_STATUS_OK; +} + +static NTSTATUS ndr_pull_samr_DomInfo12(struct ndr_pull *ndr, int ndr_flags, struct samr_DomInfo12 *r) +{ + if (!(ndr_flags & NDR_SCALARS)) goto buffers; + NDR_CHECK(ndr_pull_align(ndr, 8)); + NDR_CHECK(ndr_pull_HYPER_T(ndr, &r->lockout_duration)); + NDR_CHECK(ndr_pull_HYPER_T(ndr, &r->lockout_window)); + NDR_CHECK(ndr_pull_uint16(ndr, &r->lockout_threshold)); +buffers: + if (!(ndr_flags & NDR_BUFFERS)) goto done; +done: + return NT_STATUS_OK; +} + +static NTSTATUS ndr_pull_samr_DomInfo13(struct ndr_pull *ndr, int ndr_flags, struct samr_DomInfo13 *r) +{ + if (!(ndr_flags & NDR_SCALARS)) goto buffers; + NDR_CHECK(ndr_pull_align(ndr, 8)); + NDR_CHECK(ndr_pull_HYPER_T(ndr, &r->sequence_num)); + NDR_CHECK(ndr_pull_NTTIME(ndr, &r->last_modify_time)); + NDR_CHECK(ndr_pull_uint32(ndr, &r->foo7)); + NDR_CHECK(ndr_pull_uint32(ndr, &r->foo8)); +buffers: + if (!(ndr_flags & NDR_BUFFERS)) goto done; +done: + return NT_STATUS_OK; +} + static NTSTATUS ndr_pull_samr_DomainInfo(struct ndr_pull *ndr, int ndr_flags, uint16 *level, union samr_DomainInfo *r) { if (!(ndr_flags & NDR_SCALARS)) goto buffers; @@ -615,6 +774,54 @@ static NTSTATUS ndr_pull_samr_DomainInfo(struct ndr_pull *ndr, int ndr_flags, ui NDR_CHECK(ndr_pull_samr_DomInfo1(ndr, NDR_SCALARS, &r->info1)); break; } + case 2: { + NDR_CHECK(ndr_pull_samr_DomInfo2(ndr, NDR_SCALARS, &r->info2)); + break; } + + case 3: { + NDR_CHECK(ndr_pull_samr_DomInfo3(ndr, NDR_SCALARS, &r->info3)); + break; } + + case 4: { + NDR_CHECK(ndr_pull_samr_DomInfo4(ndr, NDR_SCALARS, &r->info4)); + break; } + + case 5: { + NDR_CHECK(ndr_pull_samr_DomInfo5(ndr, NDR_SCALARS, &r->info5)); + break; } + + case 6: { + NDR_CHECK(ndr_pull_samr_DomInfo6(ndr, NDR_SCALARS, &r->info6)); + break; } + + case 7: { + NDR_CHECK(ndr_pull_samr_DomInfo7(ndr, NDR_SCALARS, &r->info7)); + break; } + + case 8: { + NDR_CHECK(ndr_pull_samr_DomInfo8(ndr, NDR_SCALARS, &r->info8)); + break; } + + case 9: { + NDR_CHECK(ndr_pull_samr_DomInfo9(ndr, NDR_SCALARS, &r->info9)); + break; } + + case 10: { + NDR_CHECK(ndr_pull_samr_DomInfo1(ndr, NDR_SCALARS, &r->info10)); + break; } + + case 11: { + NDR_CHECK(ndr_pull_samr_DomInfo11(ndr, NDR_SCALARS, &r->info11)); + break; } + + case 12: { + NDR_CHECK(ndr_pull_samr_DomInfo12(ndr, NDR_SCALARS, &r->info12)); + break; } + + case 13: { + NDR_CHECK(ndr_pull_samr_DomInfo13(ndr, NDR_SCALARS, &r->info13)); + break; } + default: return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", *level); } @@ -625,6 +832,54 @@ buffers: NDR_CHECK(ndr_pull_samr_DomInfo1(ndr, NDR_BUFFERS, &r->info1)); break; + case 2: + NDR_CHECK(ndr_pull_samr_DomInfo2(ndr, NDR_BUFFERS, &r->info2)); + break; + + case 3: + NDR_CHECK(ndr_pull_samr_DomInfo3(ndr, NDR_BUFFERS, &r->info3)); + break; + + case 4: + NDR_CHECK(ndr_pull_samr_DomInfo4(ndr, NDR_BUFFERS, &r->info4)); + break; + + case 5: + NDR_CHECK(ndr_pull_samr_DomInfo5(ndr, NDR_BUFFERS, &r->info5)); + break; + + case 6: + NDR_CHECK(ndr_pull_samr_DomInfo6(ndr, NDR_BUFFERS, &r->info6)); + break; + + case 7: + NDR_CHECK(ndr_pull_samr_DomInfo7(ndr, NDR_BUFFERS, &r->info7)); + break; + + case 8: + NDR_CHECK(ndr_pull_samr_DomInfo8(ndr, NDR_BUFFERS, &r->info8)); + break; + + case 9: + NDR_CHECK(ndr_pull_samr_DomInfo9(ndr, NDR_BUFFERS, &r->info9)); + break; + + case 10: + NDR_CHECK(ndr_pull_samr_DomInfo1(ndr, NDR_BUFFERS, &r->info10)); + break; + + case 11: + NDR_CHECK(ndr_pull_samr_DomInfo11(ndr, NDR_BUFFERS, &r->info11)); + break; + + case 12: + NDR_CHECK(ndr_pull_samr_DomInfo12(ndr, NDR_BUFFERS, &r->info12)); + break; + + case 13: + NDR_CHECK(ndr_pull_samr_DomInfo13(ndr, NDR_BUFFERS, &r->info13)); + break; + default: return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", *level); } @@ -1116,6 +1371,123 @@ void ndr_print_samr_DomInfo1(struct ndr_print *ndr, const char *name, struct sam ndr->depth--; } +void ndr_print_samr_DomInfo2(struct ndr_print *ndr, const char *name, struct samr_DomInfo2 *r) +{ + ndr_print_struct(ndr, name, "samr_DomInfo2"); + ndr->depth++; + ndr_print_HYPER_T(ndr, "force_logoff_time", r->force_logoff_time); + ndr_print_samr_Name(ndr, "unknown_name", &r->unknown_name); + ndr_print_samr_Name(ndr, "domain", &r->domain); + ndr_print_samr_Name(ndr, "primary", &r->primary); + ndr_print_HYPER_T(ndr, "sequence_num", r->sequence_num); + ndr_print_uint32(ndr, "unknown_2", r->unknown_2); + ndr_print_uint32(ndr, "role", r->role); + ndr_print_uint32(ndr, "unknown_3", r->unknown_3); + ndr_print_uint32(ndr, "num_users", r->num_users); + ndr_print_uint32(ndr, "num_groups", r->num_groups); + ndr_print_uint32(ndr, "num_aliases", r->num_aliases); + ndr->depth--; +} + +void ndr_print_samr_DomInfo3(struct ndr_print *ndr, const char *name, struct samr_DomInfo3 *r) +{ + ndr_print_struct(ndr, name, "samr_DomInfo3"); + ndr->depth++; + ndr_print_HYPER_T(ndr, "force_logoff_time", r->force_logoff_time); + ndr->depth--; +} + +void ndr_print_samr_DomInfo4(struct ndr_print *ndr, const char *name, struct samr_DomInfo4 *r) +{ + ndr_print_struct(ndr, name, "samr_DomInfo4"); + ndr->depth++; + ndr_print_samr_Name(ndr, "unknown_name", &r->unknown_name); + ndr->depth--; +} + +void ndr_print_samr_DomInfo5(struct ndr_print *ndr, const char *name, struct samr_DomInfo5 *r) +{ + ndr_print_struct(ndr, name, "samr_DomInfo5"); + ndr->depth++; + ndr_print_samr_Name(ndr, "domain", &r->domain); + ndr->depth--; +} + +void ndr_print_samr_DomInfo6(struct ndr_print *ndr, const char *name, struct samr_DomInfo6 *r) +{ + ndr_print_struct(ndr, name, "samr_DomInfo6"); + ndr->depth++; + ndr_print_samr_Name(ndr, "primary", &r->primary); + ndr->depth--; +} + +void ndr_print_samr_DomInfo7(struct ndr_print *ndr, const char *name, struct samr_DomInfo7 *r) +{ + ndr_print_struct(ndr, name, "samr_DomInfo7"); + ndr->depth++; + ndr_print_uint32(ndr, "role", r->role); + ndr->depth--; +} + +void ndr_print_samr_DomInfo8(struct ndr_print *ndr, const char *name, struct samr_DomInfo8 *r) +{ + ndr_print_struct(ndr, name, "samr_DomInfo8"); + ndr->depth++; + ndr_print_HYPER_T(ndr, "sequence_num", r->sequence_num); + ndr_print_NTTIME(ndr, "last_modify_time", r->last_modify_time); + ndr->depth--; +} + +void ndr_print_samr_DomInfo9(struct ndr_print *ndr, const char *name, struct samr_DomInfo9 *r) +{ + ndr_print_struct(ndr, name, "samr_DomInfo9"); + ndr->depth++; + ndr_print_uint32(ndr, "unknown", r->unknown); + ndr->depth--; +} + +void ndr_print_samr_DomInfo11(struct ndr_print *ndr, const char *name, struct samr_DomInfo11 *r) +{ + ndr_print_struct(ndr, name, "samr_DomInfo11"); + ndr->depth++; + ndr_print_HYPER_T(ndr, "force_logoff_time", r->force_logoff_time); + ndr_print_samr_Name(ndr, "unknown_name", &r->unknown_name); + ndr_print_samr_Name(ndr, "domain", &r->domain); + ndr_print_samr_Name(ndr, "primary", &r->primary); + ndr_print_HYPER_T(ndr, "sequence_num", r->sequence_num); + ndr_print_uint32(ndr, "unknown_2", r->unknown_2); + ndr_print_uint32(ndr, "role", r->role); + ndr_print_uint32(ndr, "unknown_3", r->unknown_3); + ndr_print_uint32(ndr, "num_users", r->num_users); + ndr_print_uint32(ndr, "num_groups", r->num_groups); + ndr_print_uint32(ndr, "num_aliases", r->num_aliases); + ndr_print_HYPER_T(ndr, "lockout_duration", r->lockout_duration); + ndr_print_HYPER_T(ndr, "lockout_window", r->lockout_window); + ndr_print_uint16(ndr, "lockout_threshold", r->lockout_threshold); + ndr->depth--; +} + +void ndr_print_samr_DomInfo12(struct ndr_print *ndr, const char *name, struct samr_DomInfo12 *r) +{ + ndr_print_struct(ndr, name, "samr_DomInfo12"); + ndr->depth++; + ndr_print_HYPER_T(ndr, "lockout_duration", r->lockout_duration); + ndr_print_HYPER_T(ndr, "lockout_window", r->lockout_window); + ndr_print_uint16(ndr, "lockout_threshold", r->lockout_threshold); + ndr->depth--; +} + +void ndr_print_samr_DomInfo13(struct ndr_print *ndr, const char *name, struct samr_DomInfo13 *r) +{ + ndr_print_struct(ndr, name, "samr_DomInfo13"); + ndr->depth++; + ndr_print_HYPER_T(ndr, "sequence_num", r->sequence_num); + ndr_print_NTTIME(ndr, "last_modify_time", r->last_modify_time); + ndr_print_uint32(ndr, "foo7", r->foo7); + ndr_print_uint32(ndr, "foo8", r->foo8); + ndr->depth--; +} + void ndr_print_samr_DomainInfo(struct ndr_print *ndr, const char *name, uint16 level, union samr_DomainInfo *r) { ndr_print_union(ndr, name, level, "samr_DomainInfo"); @@ -1124,6 +1496,54 @@ void ndr_print_samr_DomainInfo(struct ndr_print *ndr, const char *name, uint16 l ndr_print_samr_DomInfo1(ndr, "info1", &r->info1); break; + case 2: + ndr_print_samr_DomInfo2(ndr, "info2", &r->info2); + break; + + case 3: + ndr_print_samr_DomInfo3(ndr, "info3", &r->info3); + break; + + case 4: + ndr_print_samr_DomInfo4(ndr, "info4", &r->info4); + break; + + case 5: + ndr_print_samr_DomInfo5(ndr, "info5", &r->info5); + break; + + case 6: + ndr_print_samr_DomInfo6(ndr, "info6", &r->info6); + break; + + case 7: + ndr_print_samr_DomInfo7(ndr, "info7", &r->info7); + break; + + case 8: + ndr_print_samr_DomInfo8(ndr, "info8", &r->info8); + break; + + case 9: + ndr_print_samr_DomInfo9(ndr, "info9", &r->info9); + break; + + case 10: + ndr_print_samr_DomInfo1(ndr, "info10", &r->info10); + break; + + case 11: + ndr_print_samr_DomInfo11(ndr, "info11", &r->info11); + break; + + case 12: + ndr_print_samr_DomInfo12(ndr, "info12", &r->info12); + break; + + case 13: + ndr_print_samr_DomInfo13(ndr, "info13", &r->info13); + break; + default: ndr_print_bad_level(ndr, name, level); } diff --git a/source4/librpc/ndr/ndr_samr.h b/source4/librpc/ndr/ndr_samr.h index 9bf46825631..8b68da5caa4 100644 --- a/source4/librpc/ndr/ndr_samr.h +++ b/source4/librpc/ndr/ndr_samr.h @@ -120,8 +120,93 @@ struct samr_DomInfo1 { NTTIME min_passwordage; }; +struct samr_DomInfo2 { + HYPER_T force_logoff_time; + struct samr_Name unknown_name; + struct samr_Name domain; + struct samr_Name primary; + HYPER_T sequence_num; + uint32 unknown_2; + uint32 role; + uint32 unknown_3; + uint32 num_users; + uint32 num_groups; + uint32 num_aliases; +}; + +struct samr_DomInfo3 { + HYPER_T force_logoff_time; +}; + +struct samr_DomInfo4 { + struct samr_Name unknown_name; +}; + +struct samr_DomInfo5 { + struct samr_Name domain; +}; + +struct samr_DomInfo6 { + struct samr_Name primary; +}; + +struct samr_DomInfo7 { + uint32 role; +}; + +struct samr_DomInfo8 { + HYPER_T sequence_num; + NTTIME last_modify_time; +}; + +struct samr_DomInfo9 { + uint32 unknown; +}; + +struct samr_DomInfo11 { + HYPER_T force_logoff_time; + struct samr_Name unknown_name; + struct samr_Name domain; + struct samr_Name primary; + HYPER_T sequence_num; + uint32 unknown_2; + uint32 role; + uint32 unknown_3; + uint32 num_users; + uint32 num_groups; + uint32 num_aliases; + HYPER_T lockout_duration; + HYPER_T lockout_window; + uint16 lockout_threshold; +}; + +struct samr_DomInfo12 { + HYPER_T lockout_duration; + HYPER_T lockout_window; + uint16 lockout_threshold; +}; + +struct samr_DomInfo13 { + HYPER_T sequence_num; + NTTIME last_modify_time; + uint32 foo7; + uint32 foo8; +}; + union samr_DomainInfo { /* [case(1)] */ struct samr_DomInfo1 info1; +/* [case(2)] */ struct samr_DomInfo2 info2; +/* [case(3)] */ struct samr_DomInfo3 info3; +/* [case(4)] */ struct samr_DomInfo4 info4; +/* [case(5)] */ struct samr_DomInfo5 info5; +/* [case(6)] */ struct samr_DomInfo6 info6; +/* [case(7)] */ struct samr_DomInfo7 info7; +/* [case(8)] */ struct samr_DomInfo8 info8; +/* [case(9)] */ struct samr_DomInfo9 info9; +/* [case(10)] */ struct samr_DomInfo1 info10; +/* [case(11)] */ struct samr_DomInfo11 info11; +/* [case(12)] */ struct samr_DomInfo12 info12; +/* [case(13)] */ struct samr_DomInfo13 info13; }; struct samr_QueryDomainInfo { diff --git a/source4/librpc/ndr/ndr_spoolss.c b/source4/librpc/ndr/ndr_spoolss.c index 33e550d05d0..d346ebd9b25 100644 --- a/source4/librpc/ndr/ndr_spoolss.c +++ b/source4/librpc/ndr/ndr_spoolss.c @@ -418,8 +418,8 @@ NTSTATUS ndr_push_spoolss_44(struct ndr_push *ndr, struct spoolss_44 *r) static NTSTATUS ndr_push_spoolss_Devmode(struct ndr_push *ndr, int ndr_flags, struct spoolss_Devmode *r) { - NDR_CHECK(ndr_push_align(ndr, 4)); if (!(ndr_flags & NDR_SCALARS)) goto buffers; + NDR_CHECK(ndr_push_align(ndr, 4)); NDR_CHECK(ndr_push_uint32(ndr, r->foo)); buffers: if (!(ndr_flags & NDR_BUFFERS)) goto done; @@ -429,8 +429,8 @@ done: static NTSTATUS ndr_push_spoolss_DevmodeContainer(struct ndr_push *ndr, int ndr_flags, struct spoolss_DevmodeContainer *r) { - NDR_CHECK(ndr_push_align(ndr, 4)); if (!(ndr_flags & NDR_SCALARS)) goto buffers; + NDR_CHECK(ndr_push_align(ndr, 4)); NDR_CHECK(ndr_push_uint32(ndr, r->size)); NDR_CHECK(ndr_push_ptr(ndr, r->devmode)); buffers: @@ -444,8 +444,8 @@ done: static NTSTATUS ndr_push_spoolss_UserLevel1(struct ndr_push *ndr, int ndr_flags, struct spoolss_UserLevel1 *r) { - NDR_CHECK(ndr_push_align(ndr, 4)); if (!(ndr_flags & NDR_SCALARS)) goto buffers; + NDR_CHECK(ndr_push_align(ndr, 4)); NDR_CHECK(ndr_push_uint32(ndr, r->size)); NDR_CHECK(ndr_push_ptr(ndr, r->client)); NDR_CHECK(ndr_push_ptr(ndr, r->user)); diff --git a/source4/torture/rpc/samr.c b/source4/torture/rpc/samr.c index 431372323e4..b66e86815ac 100644 --- a/source4/torture/rpc/samr.c +++ b/source4/torture/rpc/samr.c @@ -26,19 +26,26 @@ static BOOL test_QueryDomainInfo(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, { NTSTATUS status; struct samr_QueryDomainInfo r; + uint16 levels[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 12, 13}; + int i; + BOOL ret = True; - printf("Testing QueryDomainInfo\n"); + for (i=0;i<ARRAY_SIZE(levels);i++) { + printf("Testing QueryDomainInfo level %u\n", levels[i]); - r.in.handle = handle; - r.in.level = 1; + r.in.handle = handle; + r.in.level = levels[i]; - status = dcerpc_samr_QueryDomainInfo(p, mem_ctx, &r); - if (!NT_STATUS_IS_OK(status)) { - printf("QueryDomainInfo failed - %s\n", nt_errstr(status)); - return False; - } + status = dcerpc_samr_QueryDomainInfo(p, mem_ctx, &r); + if (!NT_STATUS_IS_OK(status)) { + printf("QueryDomainInfo level %u failed - %s\n", + r.in.level, nt_errstr(status)); + ret = False; + continue; + } - NDR_PRINT_UNION_DEBUG(samr_DomainInfo, r.in.level, r.out.info); + NDR_PRINT_UNION_DEBUG(samr_DomainInfo, r.in.level, r.out.info); + } return True; } |