diff options
Diffstat (limited to 'source4/librpc/ndr')
-rw-r--r-- | source4/librpc/ndr/ndr_lsa.c | 4 | ||||
-rw-r--r-- | source4/librpc/ndr/ndr_samr.c | 50 | ||||
-rw-r--r-- | source4/librpc/ndr/ndr_samr.h | 19 |
3 files changed, 52 insertions, 21 deletions
diff --git a/source4/librpc/ndr/ndr_lsa.c b/source4/librpc/ndr/ndr_lsa.c index 587093ed69..db17c1e63d 100644 --- a/source4/librpc/ndr/ndr_lsa.c +++ b/source4/librpc/ndr/ndr_lsa.c @@ -20,8 +20,8 @@ static NTSTATUS ndr_push_lsa_Name(struct ndr_push *ndr, int ndr_flags, struct ls { NDR_CHECK(ndr_push_align(ndr, 4)); if (!(ndr_flags & NDR_SCALARS)) goto buffers; - NDR_CHECK(ndr_push_uint16(ndr, r->name_len)); - NDR_CHECK(ndr_push_uint16(ndr, r->name_size)); + 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)); buffers: if (!(ndr_flags & NDR_BUFFERS)) goto done; diff --git a/source4/librpc/ndr/ndr_samr.c b/source4/librpc/ndr/ndr_samr.c index 8258fe6bdf..8a972b426f 100644 --- a/source4/librpc/ndr/ndr_samr.c +++ b/source4/librpc/ndr/ndr_samr.c @@ -37,8 +37,26 @@ NTSTATUS ndr_push_samr_Shutdown(struct ndr_push *ndr, struct samr_Shutdown *r) return NT_STATUS_OK; } +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_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)); +buffers: + if (!(ndr_flags & NDR_BUFFERS)) goto done; + if (r->name) { + NDR_CHECK(ndr_push_unistr_noterm(ndr, r->name)); + } +done: + return NT_STATUS_OK; +} + NTSTATUS ndr_push_samr_LookupDomain(struct ndr_push *ndr, struct samr_LookupDomain *r) { + NDR_CHECK(ndr_push_policy_handle(ndr, r->in.handle)); + NDR_CHECK(ndr_push_samr_Name(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.domain)); return NT_STATUS_OK; } @@ -382,7 +400,7 @@ NTSTATUS ndr_push_samr_CONNECT3(struct ndr_push *ndr, struct samr_CONNECT3 *r) return NT_STATUS_OK; } -NTSTATUS ndr_push_samr_CONNECT4(struct ndr_push *ndr, struct samr_CONNECT4 *r) +NTSTATUS ndr_push_samr_Connect4(struct ndr_push *ndr, struct samr_Connect4 *r) { NDR_CHECK(ndr_push_ptr(ndr, r->in.system_name)); if (r->in.system_name) { @@ -460,13 +478,6 @@ NTSTATUS ndr_pull_samr_Shutdown(struct ndr_pull *ndr, struct samr_Shutdown *r) return NT_STATUS_OK; } -NTSTATUS ndr_pull_samr_LookupDomain(struct ndr_pull *ndr, struct samr_LookupDomain *r) -{ - NDR_CHECK(ndr_pull_NTSTATUS(ndr, &r->out.result)); - - return NT_STATUS_OK; -} - static NTSTATUS ndr_pull_samr_Name(struct ndr_pull *ndr, int ndr_flags, struct samr_Name *r) { uint32 _ptr_name; @@ -489,11 +500,28 @@ done: return NT_STATUS_OK; } +NTSTATUS ndr_pull_samr_LookupDomain(struct ndr_pull *ndr, struct samr_LookupDomain *r) +{ + uint32 _ptr_sid; + NDR_CHECK(ndr_pull_uint32(ndr, &_ptr_sid)); + if (_ptr_sid) { + NDR_ALLOC(ndr, r->out.sid); + } else { + r->out.sid = NULL; + } + if (r->out.sid) { + NDR_CHECK(ndr_pull_dom_sid2(ndr, r->out.sid)); + } + NDR_CHECK(ndr_pull_NTSTATUS(ndr, &r->out.result)); + + return NT_STATUS_OK; +} + 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_uint32(ndr, &r->rid)); + NDR_CHECK(ndr_pull_uint32(ndr, &r->idx)); NDR_CHECK(ndr_pull_samr_Name(ndr, NDR_SCALARS, &r->name)); buffers: if (!(ndr_flags & NDR_BUFFERS)) goto done; @@ -935,7 +963,7 @@ NTSTATUS ndr_pull_samr_CONNECT3(struct ndr_pull *ndr, struct samr_CONNECT3 *r) return NT_STATUS_OK; } -NTSTATUS ndr_pull_samr_CONNECT4(struct ndr_pull *ndr, struct samr_CONNECT4 *r) +NTSTATUS ndr_pull_samr_Connect4(struct ndr_pull *ndr, struct samr_Connect4 *r) { NDR_CHECK(ndr_pull_policy_handle(ndr, r->out.handle)); NDR_CHECK(ndr_pull_NTSTATUS(ndr, &r->out.result)); @@ -997,7 +1025,7 @@ void ndr_print_samr_SamEntry(struct ndr_print *ndr, const char *name, struct sam { ndr_print_struct(ndr, name, "samr_SamEntry"); ndr->depth++; - ndr_print_uint32(ndr, "rid", r->rid); + ndr_print_uint32(ndr, "idx", r->idx); ndr_print_samr_Name(ndr, "name", &r->name); ndr->depth--; } diff --git a/source4/librpc/ndr/ndr_samr.h b/source4/librpc/ndr/ndr_samr.h index 20b58685de..f24dde1ec5 100644 --- a/source4/librpc/ndr/ndr_samr.h +++ b/source4/librpc/ndr/ndr_samr.h @@ -53,24 +53,27 @@ struct samr_Shutdown { }; +struct samr_Name { + uint16 name_len; + uint16 name_size; + const char *name; +}; + struct samr_LookupDomain { struct { + struct policy_handle *handle; + struct samr_Name *domain; } in; struct { + struct dom_sid2 *sid; NTSTATUS result; } out; }; -struct samr_Name { - uint16 name_len; - uint16 name_size; - const char *name; -}; - struct samr_SamEntry { - uint32 rid; + uint32 idx; struct samr_Name name; }; @@ -645,7 +648,7 @@ struct samr_CONNECT3 { }; -struct samr_CONNECT4 { +struct samr_Connect4 { struct { const char *system_name; uint32 unknown; |