summaryrefslogtreecommitdiff
path: root/source4/librpc/ndr
diff options
context:
space:
mode:
Diffstat (limited to 'source4/librpc/ndr')
-rw-r--r--source4/librpc/ndr/ndr_lsa.c139
-rw-r--r--source4/librpc/ndr/ndr_lsa.h29
2 files changed, 126 insertions, 42 deletions
diff --git a/source4/librpc/ndr/ndr_lsa.c b/source4/librpc/ndr/ndr_lsa.c
index 54c81d2b49..b0ce82885d 100644
--- a/source4/librpc/ndr/ndr_lsa.c
+++ b/source4/librpc/ndr/ndr_lsa.c
@@ -18,6 +18,7 @@ NTSTATUS ndr_pull_lsa_Close(struct ndr_pull *ndr, struct lsa_Close *r)
NTSTATUS ndr_push_lsa_Delete(struct ndr_push *ndr, struct lsa_Delete *r)
{
+ NDR_CHECK(ndr_push_policy_handle(ndr, r->in.handle));
return NT_STATUS_OK;
}
@@ -29,14 +30,116 @@ NTSTATUS ndr_pull_lsa_Delete(struct ndr_pull *ndr, struct lsa_Delete *r)
return NT_STATUS_OK;
}
+static NTSTATUS ndr_push_lsa_Name(struct ndr_push *ndr, int ndr_flags, struct lsa_Name *r)
+{
+ 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_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;
+}
+
+static NTSTATUS ndr_pull_lsa_Name(struct ndr_pull *ndr, int ndr_flags, struct lsa_Name *r)
+{
+ uint32 _ptr_name;
+ if (!(ndr_flags & NDR_SCALARS)) goto buffers;
+ 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));
+ if (_ptr_name) {
+ NDR_ALLOC(ndr, r->name);
+ } else {
+ r->name = NULL;
+ }
+buffers:
+ if (!(ndr_flags & NDR_BUFFERS)) goto done;
+ if (r->name) {
+ NDR_CHECK(ndr_pull_unistr_noterm(ndr, &r->name));
+ }
+done:
+ return NT_STATUS_OK;
+}
+
+static NTSTATUS ndr_push_lsa_PrivEntry(struct ndr_push *ndr, int ndr_flags, struct lsa_PrivEntry *r)
+{
+ if (!(ndr_flags & NDR_SCALARS)) goto buffers;
+ NDR_CHECK(ndr_push_lsa_Name(ndr, NDR_SCALARS, &r->name));
+ NDR_CHECK(ndr_push_uint32(ndr, r->luid_low));
+ NDR_CHECK(ndr_push_uint32(ndr, r->luid_high));
+buffers:
+ if (!(ndr_flags & NDR_BUFFERS)) goto done;
+ NDR_CHECK(ndr_push_lsa_Name(ndr, ndr_flags, &r->name));
+done:
+ return NT_STATUS_OK;
+}
+
+static NTSTATUS ndr_pull_lsa_PrivEntry(struct ndr_pull *ndr, int ndr_flags, struct lsa_PrivEntry *r)
+{
+ if (!(ndr_flags & NDR_SCALARS)) goto buffers;
+ 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));
+buffers:
+ if (!(ndr_flags & NDR_BUFFERS)) goto done;
+ NDR_CHECK(ndr_pull_lsa_Name(ndr, ndr_flags, &r->name));
+done:
+ return NT_STATUS_OK;
+}
+
+static NTSTATUS ndr_push_lsa_PrivArray(struct ndr_push *ndr, int ndr_flags, struct lsa_PrivArray *r)
+{
+ if (!(ndr_flags & NDR_SCALARS)) goto buffers;
+ NDR_CHECK(ndr_push_uint32(ndr, r->count));
+ NDR_CHECK(ndr_push_ptr(ndr, r->privs));
+buffers:
+ if (!(ndr_flags & NDR_BUFFERS)) goto done;
+ if (r->privs) {
+ NDR_CHECK(ndr_push_array(ndr, ndr_flags, r->privs, sizeof(r->privs[0]), r->count, (ndr_push_flags_fn_t)ndr_push_lsa_PrivEntry));
+ }
+done:
+ return NT_STATUS_OK;
+}
+
+static NTSTATUS ndr_pull_lsa_PrivArray(struct ndr_pull *ndr, int ndr_flags, struct lsa_PrivArray *r)
+{
+ uint32 _ptr_privs;
+ if (!(ndr_flags & NDR_SCALARS)) goto buffers;
+ NDR_CHECK(ndr_pull_uint32(ndr, &r->count));
+ NDR_CHECK(ndr_pull_uint32(ndr, &_ptr_privs));
+ if (_ptr_privs) {
+ NDR_ALLOC(ndr, r->privs);
+ } else {
+ r->privs = NULL;
+ }
+buffers:
+ if (!(ndr_flags & NDR_BUFFERS)) goto done;
+ if (r->privs) {
+ NDR_ALLOC_N_SIZE(ndr, r->privs, r->count, sizeof(r->privs[0]));
+ NDR_CHECK(ndr_pull_array(ndr, ndr_flags, (void **)r->privs, sizeof(r->privs[0]), r->count, (ndr_pull_flags_fn_t)ndr_pull_lsa_PrivEntry));
+ }
+done:
+ return NT_STATUS_OK;
+}
+
NTSTATUS ndr_push_lsa_EnumPrivs(struct ndr_push *ndr, struct lsa_EnumPrivs *r)
{
+ NDR_CHECK(ndr_push_policy_handle(ndr, r->in.handle));
+ NDR_CHECK(ndr_push_uint32(ndr, *r->in.resume_handle));
+ NDR_CHECK(ndr_push_uint32(ndr, r->in.max_count));
return NT_STATUS_OK;
}
NTSTATUS ndr_pull_lsa_EnumPrivs(struct ndr_pull *ndr, struct lsa_EnumPrivs *r)
{
+ NDR_CHECK(ndr_pull_uint32(ndr, r->out.resume_handle));
+ NDR_CHECK(ndr_pull_lsa_PrivArray(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.privs));
NDR_CHECK(ndr_pull_NTSTATUS(ndr, &r->out.result));
return NT_STATUS_OK;
@@ -396,42 +499,6 @@ NTSTATUS ndr_pull_lsa_EnumTrustDom(struct ndr_pull *ndr, struct lsa_EnumTrustDom
return NT_STATUS_OK;
}
-static NTSTATUS ndr_push_lsa_Name(struct ndr_push *ndr, int ndr_flags, struct lsa_Name *r)
-{
- 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_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;
-}
-
-static NTSTATUS ndr_pull_lsa_Name(struct ndr_pull *ndr, int ndr_flags, struct lsa_Name *r)
-{
- uint32 _ptr_name;
- if (!(ndr_flags & NDR_SCALARS)) goto buffers;
- 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));
- if (_ptr_name) {
- NDR_ALLOC(ndr, r->name);
- } else {
- r->name = NULL;
- }
-buffers:
- if (!(ndr_flags & NDR_BUFFERS)) goto done;
- if (r->name) {
- NDR_CHECK(ndr_pull_unistr_noterm(ndr, &r->name));
- }
-done:
- return NT_STATUS_OK;
-}
-
static NTSTATUS ndr_push_lsa_TranslatedSid(struct ndr_push *ndr, int ndr_flags, struct lsa_TranslatedSid *r)
{
if (!(ndr_flags & NDR_SCALARS)) goto buffers;
diff --git a/source4/librpc/ndr/ndr_lsa.h b/source4/librpc/ndr/ndr_lsa.h
index 92f596b692..1436c8cfab 100644
--- a/source4/librpc/ndr/ndr_lsa.h
+++ b/source4/librpc/ndr/ndr_lsa.h
@@ -13,6 +13,7 @@ struct lsa_Close {
struct lsa_Delete {
struct {
+ struct policy_handle *handle;
} in;
struct {
@@ -21,11 +22,33 @@ struct lsa_Delete {
};
+struct lsa_Name {
+ uint16 name_len;
+ uint16 name_size;
+ const char *name;
+};
+
+struct lsa_PrivEntry {
+ struct lsa_Name name;
+ uint32 luid_low;
+ uint32 luid_high;
+};
+
+struct lsa_PrivArray {
+ uint32 count;
+ struct lsa_PrivEntry *privs;
+};
+
struct lsa_EnumPrivs {
struct {
+ struct policy_handle *handle;
+ uint32 *resume_handle;
+ uint32 max_count;
} in;
struct {
+ uint32 *resume_handle;
+ struct lsa_PrivArray *privs;
NTSTATUS result;
} out;
@@ -173,12 +196,6 @@ struct lsa_EnumTrustDom {
};
-struct lsa_Name {
- uint16 name_len;
- uint16 name_size;
- const char *name;
-};
-
struct lsa_TranslatedSid {
uint16 sid_type;
uint32 rid;