diff options
Diffstat (limited to 'source4/librpc')
-rw-r--r-- | source4/librpc/idl/dfs.idl | 100 | ||||
-rw-r--r-- | source4/librpc/ndr/ndr_dfs.c | 855 | ||||
-rw-r--r-- | source4/librpc/ndr/ndr_dfs.h | 101 | ||||
-rw-r--r-- | source4/librpc/ndr/ndr_echo.c | 4 | ||||
-rw-r--r-- | source4/librpc/ndr/ndr_lsa.c | 32 | ||||
-rw-r--r-- | source4/librpc/rpc/rpc_dfs.c | 8 |
6 files changed, 736 insertions, 364 deletions
diff --git a/source4/librpc/idl/dfs.idl b/source4/librpc/idl/dfs.idl index 95349b9000..107a7d7a53 100644 --- a/source4/librpc/idl/dfs.idl +++ b/source4/librpc/idl/dfs.idl @@ -17,11 +17,11 @@ /******************/ /* Function: 0x01 */ NTSTATUS dfs_Add ( - [in] unistr *path, - [in] unistr *server, - [in] unistr *share, - [in] unistr *comment, - [in] uint32 flags + [in,ref] unistr *path, + [in,ref] unistr *server, + [in] unistr *share, + [in] unistr *comment, + [in] uint32 flags ); /******************/ @@ -38,26 +38,12 @@ /******************/ /* Function: 0x04 */ - NTSTATUS dfs_Info ( - [in,ref] unistr_noterm *path, - [in] unistr *server, - [in] unistr *share, - [in] uint16 level - ); - - /******************/ - /* Function: 0x05 */ typedef struct { unistr *path; } dfs_Info1; typedef struct { - uint32 count; - [size_is(count)] dfs_Info1 *s; - } dfs_EnumArray1; - - typedef struct { unistr *path; unistr *comment; uint32 state; @@ -65,11 +51,6 @@ } dfs_Info2; typedef struct { - uint32 count; - [size_is(count)] dfs_Info2 *s; - } dfs_EnumArray2; - - typedef struct { uint32 state; unistr *server; unistr *share; @@ -84,11 +65,6 @@ } dfs_Info3; typedef struct { - uint32 count; - [size_is(count)] dfs_Info3 *s; - } dfs_EnumArray3; - - typedef struct { unistr *path; unistr *comment; uint32 state; @@ -99,24 +75,74 @@ } dfs_Info4; typedef struct { - uint32 count; - [size_is(count)] dfs_Info4 *s; - } dfs_EnumArray4; + unistr *comment; + } dfs_Info100; typedef struct { - unistr *dom_root; - } dfs_Info200; + uint32 state; + } dfs_Info101; typedef struct { - uint32 count; - [size_is(count)] dfs_Info200 *s; - } dfs_EnumArray200; + uint32 timeout; + } dfs_Info102; + + typedef struct { + unistr *dom_root; + } dfs_Info200; typedef struct { uint32 flags; unistr *dom_root; } dfs_Info300; + typedef union { + case(1) dfs_Info1 *info1; + case(2) dfs_Info2 *info2; + case(3) dfs_Info3 *info3; + case(4) dfs_Info4 *info4; + case(100) dfs_Info100 *info100; + case(101) dfs_Info101 *info101; + case(102) dfs_Info102 *info102; + case(200) dfs_Info200 *info200; + case(300) dfs_Info300 *info300; + } dfs_Info; + + NTSTATUS dfs_GetInfo ( + [in,ref] unistr *path, + [in] unistr *server, + [in] unistr *share, + [in] uint32 level, + [out,switch_is(level)] dfs_Info info + ); + + /******************/ + /* Function: 0x05 */ + + typedef struct { + uint32 count; + [size_is(count)] dfs_Info1 *s; + } dfs_EnumArray1; + + typedef struct { + uint32 count; + [size_is(count)] dfs_Info2 *s; + } dfs_EnumArray2; + + typedef struct { + uint32 count; + [size_is(count)] dfs_Info3 *s; + } dfs_EnumArray3; + + typedef struct { + uint32 count; + [size_is(count)] dfs_Info4 *s; + } dfs_EnumArray4; + + typedef struct { + uint32 count; + [size_is(count)] dfs_Info200 *s; + } dfs_EnumArray200; + typedef struct { uint32 count; [size_is(count)] dfs_Info300 *s; diff --git a/source4/librpc/ndr/ndr_dfs.c b/source4/librpc/ndr/ndr_dfs.c index c032908547..60a1252720 100644 --- a/source4/librpc/ndr/ndr_dfs.c +++ b/source4/librpc/ndr/ndr_dfs.c @@ -10,14 +10,8 @@ NTSTATUS ndr_push_dfs_Exist(struct ndr_push *ndr, struct dfs_Exist *r) NTSTATUS ndr_push_dfs_Add(struct ndr_push *ndr, struct dfs_Add *r) { - NDR_CHECK(ndr_push_ptr(ndr, r->in.path)); - if (r->in.path) { - NDR_CHECK(ndr_push_unistr(ndr, r->in.path)); - } - NDR_CHECK(ndr_push_ptr(ndr, r->in.server)); - if (r->in.server) { - NDR_CHECK(ndr_push_unistr(ndr, r->in.server)); - } + NDR_CHECK(ndr_push_unistr(ndr, r->in.path)); + NDR_CHECK(ndr_push_unistr(ndr, r->in.server)); NDR_CHECK(ndr_push_ptr(ndr, r->in.share)); if (r->in.share) { NDR_CHECK(ndr_push_unistr(ndr, r->in.share)); @@ -52,22 +46,6 @@ NTSTATUS ndr_push_dfs_UNKNOWN3(struct ndr_push *ndr, struct dfs_UNKNOWN3 *r) return NT_STATUS_OK; } -NTSTATUS ndr_push_dfs_Info(struct ndr_push *ndr, struct dfs_Info *r) -{ - NDR_CHECK(ndr_push_unistr_noterm(ndr, r->in.path)); - NDR_CHECK(ndr_push_ptr(ndr, r->in.server)); - if (r->in.server) { - NDR_CHECK(ndr_push_unistr(ndr, r->in.server)); - } - NDR_CHECK(ndr_push_ptr(ndr, r->in.share)); - if (r->in.share) { - NDR_CHECK(ndr_push_unistr(ndr, r->in.share)); - } - NDR_CHECK(ndr_push_uint16(ndr, r->in.level)); - - return NT_STATUS_OK; -} - static NTSTATUS ndr_push_dfs_Info1(struct ndr_push *ndr, int ndr_flags, struct dfs_Info1 *r) { NDR_CHECK(ndr_push_align(ndr, 4)); @@ -82,22 +60,6 @@ done: return NT_STATUS_OK; } -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_uint32(ndr, r->count)); - NDR_CHECK(ndr_push_ptr(ndr, r->s)); -buffers: - if (!(ndr_flags & NDR_BUFFERS)) goto done; - if (r->s) { - NDR_CHECK(ndr_push_uint32(ndr, r->count)); - NDR_CHECK(ndr_push_array(ndr, ndr_flags, r->s, sizeof(r->s[0]), r->count, (ndr_push_flags_fn_t)ndr_push_dfs_Info1)); - } -done: - return NT_STATUS_OK; -} - static NTSTATUS ndr_push_dfs_Info2(struct ndr_push *ndr, int ndr_flags, struct dfs_Info2 *r) { NDR_CHECK(ndr_push_align(ndr, 4)); @@ -118,22 +80,6 @@ done: return NT_STATUS_OK; } -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_uint32(ndr, r->count)); - NDR_CHECK(ndr_push_ptr(ndr, r->s)); -buffers: - if (!(ndr_flags & NDR_BUFFERS)) goto done; - if (r->s) { - NDR_CHECK(ndr_push_uint32(ndr, r->count)); - NDR_CHECK(ndr_push_array(ndr, ndr_flags, r->s, sizeof(r->s[0]), r->count, (ndr_push_flags_fn_t)ndr_push_dfs_Info2)); - } -done: - return NT_STATUS_OK; -} - static NTSTATUS ndr_push_dfs_StorageInfo(struct ndr_push *ndr, int ndr_flags, struct dfs_StorageInfo *r) { NDR_CHECK(ndr_push_align(ndr, 4)); @@ -178,22 +124,6 @@ done: return NT_STATUS_OK; } -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_uint32(ndr, r->count)); - NDR_CHECK(ndr_push_ptr(ndr, r->s)); -buffers: - if (!(ndr_flags & NDR_BUFFERS)) goto done; - if (r->s) { - NDR_CHECK(ndr_push_uint32(ndr, r->count)); - NDR_CHECK(ndr_push_array(ndr, ndr_flags, r->s, sizeof(r->s[0]), r->count, (ndr_push_flags_fn_t)ndr_push_dfs_Info3)); - } -done: - return NT_STATUS_OK; -} - static NTSTATUS ndr_push_dfs_Info4(struct ndr_push *ndr, int ndr_flags, struct dfs_Info4 *r) { NDR_CHECK(ndr_push_align(ndr, 4)); @@ -213,7 +143,7 @@ buffers: if (r->comment) { NDR_CHECK(ndr_push_unistr(ndr, r->comment)); } - NDR_CHECK(ndr_push_GUID(ndr, ndr_flags, &r->guid)); + NDR_CHECK(ndr_push_GUID(ndr, NDR_BUFFERS, &r->guid)); if (r->stores) { NDR_CHECK(ndr_push_uint32(ndr, r->num_stores)); NDR_CHECK(ndr_push_array(ndr, ndr_flags, r->stores, sizeof(r->stores[0]), r->num_stores, (ndr_push_flags_fn_t)ndr_push_dfs_StorageInfo)); @@ -222,7 +152,52 @@ done: return NT_STATUS_OK; } -static NTSTATUS ndr_push_dfs_EnumArray4(struct ndr_push *ndr, int ndr_flags, struct dfs_EnumArray4 *r) +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_ptr(ndr, r->dom_root)); +buffers: + if (!(ndr_flags & NDR_BUFFERS)) goto done; + if (r->dom_root) { + NDR_CHECK(ndr_push_unistr(ndr, r->dom_root)); + } +done: + return NT_STATUS_OK; +} + +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_uint32(ndr, r->flags)); + NDR_CHECK(ndr_push_ptr(ndr, r->dom_root)); +buffers: + if (!(ndr_flags & NDR_BUFFERS)) goto done; + if (r->dom_root) { + NDR_CHECK(ndr_push_unistr(ndr, r->dom_root)); + } +done: + return NT_STATUS_OK; +} + +NTSTATUS ndr_push_dfs_GetInfo(struct ndr_push *ndr, struct dfs_GetInfo *r) +{ + NDR_CHECK(ndr_push_unistr(ndr, r->in.path)); + NDR_CHECK(ndr_push_ptr(ndr, r->in.server)); + if (r->in.server) { + NDR_CHECK(ndr_push_unistr(ndr, r->in.server)); + } + NDR_CHECK(ndr_push_ptr(ndr, r->in.share)); + if (r->in.share) { + NDR_CHECK(ndr_push_unistr(ndr, r->in.share)); + } + NDR_CHECK(ndr_push_uint32(ndr, r->in.level)); + + return NT_STATUS_OK; +} + +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; @@ -232,27 +207,29 @@ buffers: if (!(ndr_flags & NDR_BUFFERS)) goto done; if (r->s) { NDR_CHECK(ndr_push_uint32(ndr, r->count)); - NDR_CHECK(ndr_push_array(ndr, ndr_flags, r->s, sizeof(r->s[0]), r->count, (ndr_push_flags_fn_t)ndr_push_dfs_Info4)); + NDR_CHECK(ndr_push_array(ndr, ndr_flags, r->s, sizeof(r->s[0]), r->count, (ndr_push_flags_fn_t)ndr_push_dfs_Info1)); } done: return NT_STATUS_OK; } -static NTSTATUS ndr_push_dfs_Info200(struct ndr_push *ndr, int ndr_flags, struct dfs_Info200 *r) +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_ptr(ndr, r->dom_root)); + NDR_CHECK(ndr_push_uint32(ndr, r->count)); + NDR_CHECK(ndr_push_ptr(ndr, r->s)); buffers: if (!(ndr_flags & NDR_BUFFERS)) goto done; - if (r->dom_root) { - NDR_CHECK(ndr_push_unistr(ndr, r->dom_root)); + if (r->s) { + NDR_CHECK(ndr_push_uint32(ndr, r->count)); + NDR_CHECK(ndr_push_array(ndr, ndr_flags, r->s, sizeof(r->s[0]), r->count, (ndr_push_flags_fn_t)ndr_push_dfs_Info2)); } done: return NT_STATUS_OK; } -static NTSTATUS ndr_push_dfs_EnumArray200(struct ndr_push *ndr, int ndr_flags, struct dfs_EnumArray200 *r) +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; @@ -262,22 +239,39 @@ buffers: if (!(ndr_flags & NDR_BUFFERS)) goto done; if (r->s) { NDR_CHECK(ndr_push_uint32(ndr, r->count)); - NDR_CHECK(ndr_push_array(ndr, ndr_flags, r->s, sizeof(r->s[0]), r->count, (ndr_push_flags_fn_t)ndr_push_dfs_Info200)); + NDR_CHECK(ndr_push_array(ndr, ndr_flags, r->s, sizeof(r->s[0]), r->count, (ndr_push_flags_fn_t)ndr_push_dfs_Info3)); } done: return NT_STATUS_OK; } -static NTSTATUS ndr_push_dfs_Info300(struct ndr_push *ndr, int ndr_flags, struct dfs_Info300 *r) +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_uint32(ndr, r->flags)); - NDR_CHECK(ndr_push_ptr(ndr, r->dom_root)); + NDR_CHECK(ndr_push_uint32(ndr, r->count)); + NDR_CHECK(ndr_push_ptr(ndr, r->s)); buffers: if (!(ndr_flags & NDR_BUFFERS)) goto done; - if (r->dom_root) { - NDR_CHECK(ndr_push_unistr(ndr, r->dom_root)); + if (r->s) { + NDR_CHECK(ndr_push_uint32(ndr, r->count)); + NDR_CHECK(ndr_push_array(ndr, ndr_flags, r->s, sizeof(r->s[0]), r->count, (ndr_push_flags_fn_t)ndr_push_dfs_Info4)); + } +done: + return NT_STATUS_OK; +} + +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_uint32(ndr, r->count)); + NDR_CHECK(ndr_push_ptr(ndr, r->s)); +buffers: + if (!(ndr_flags & NDR_BUFFERS)) goto done; + if (r->s) { + NDR_CHECK(ndr_push_uint32(ndr, r->count)); + NDR_CHECK(ndr_push_array(ndr, ndr_flags, r->s, sizeof(r->s[0]), r->count, (ndr_push_flags_fn_t)ndr_push_dfs_Info200)); } done: return NT_STATUS_OK; @@ -336,37 +330,37 @@ buffers: switch (level) { case 1: if (r->info1) { - NDR_CHECK(ndr_push_dfs_EnumArray1(ndr, ndr_flags, r->info1)); + NDR_CHECK(ndr_push_dfs_EnumArray1(ndr, NDR_SCALARS|NDR_BUFFERS, r->info1)); } break; case 2: if (r->info2) { - NDR_CHECK(ndr_push_dfs_EnumArray2(ndr, ndr_flags, r->info2)); + NDR_CHECK(ndr_push_dfs_EnumArray2(ndr, NDR_SCALARS|NDR_BUFFERS, r->info2)); } break; case 3: if (r->info3) { - NDR_CHECK(ndr_push_dfs_EnumArray3(ndr, ndr_flags, r->info3)); + NDR_CHECK(ndr_push_dfs_EnumArray3(ndr, NDR_SCALARS|NDR_BUFFERS, r->info3)); } break; case 4: if (r->info4) { - NDR_CHECK(ndr_push_dfs_EnumArray4(ndr, ndr_flags, r->info4)); + NDR_CHECK(ndr_push_dfs_EnumArray4(ndr, NDR_SCALARS|NDR_BUFFERS, r->info4)); } break; case 200: if (r->info200) { - NDR_CHECK(ndr_push_dfs_EnumArray200(ndr, ndr_flags, r->info200)); + NDR_CHECK(ndr_push_dfs_EnumArray200(ndr, NDR_SCALARS|NDR_BUFFERS, r->info200)); } break; case 300: if (r->info300) { - NDR_CHECK(ndr_push_dfs_EnumArray300(ndr, ndr_flags, r->info300)); + NDR_CHECK(ndr_push_dfs_EnumArray300(ndr, NDR_SCALARS|NDR_BUFFERS, r->info300)); } break; @@ -438,13 +432,6 @@ NTSTATUS ndr_pull_dfs_UNKNOWN3(struct ndr_pull *ndr, struct dfs_UNKNOWN3 *r) return NT_STATUS_OK; } -NTSTATUS ndr_pull_dfs_Info(struct ndr_pull *ndr, struct dfs_Info *r) -{ - NDR_CHECK(ndr_pull_NTSTATUS(ndr, &r->out.result)); - - return NT_STATUS_OK; -} - static NTSTATUS ndr_pull_dfs_Info1(struct ndr_pull *ndr, int ndr_flags, struct dfs_Info1 *r) { uint32 _ptr_path; @@ -465,35 +452,6 @@ done: return NT_STATUS_OK; } -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_uint32(ndr, &r->count)); - NDR_CHECK(ndr_pull_uint32(ndr, &_ptr_s)); - if (_ptr_s) { - NDR_ALLOC(ndr, r->s); - } else { - r->s = NULL; - } -buffers: - if (!(ndr_flags & NDR_BUFFERS)) goto done; - if (r->s) { - { - uint32 _array_size; - NDR_CHECK(ndr_pull_uint32(ndr, &_array_size)); - if (r->count > _array_size) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should be %u", _array_size, r->count); - } - } - NDR_ALLOC_N_SIZE(ndr, r->s, r->count, sizeof(r->s[0])); - NDR_CHECK(ndr_pull_array(ndr, NDR_SCALARS|NDR_BUFFERS, (void **)r->s, sizeof(r->s[0]), r->count, (ndr_pull_flags_fn_t)ndr_pull_dfs_Info1)); - } -done: - return NT_STATUS_OK; -} - static NTSTATUS ndr_pull_dfs_Info2(struct ndr_pull *ndr, int ndr_flags, struct dfs_Info2 *r) { uint32 _ptr_path; @@ -526,35 +484,6 @@ done: return NT_STATUS_OK; } -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_uint32(ndr, &r->count)); - NDR_CHECK(ndr_pull_uint32(ndr, &_ptr_s)); - if (_ptr_s) { - NDR_ALLOC(ndr, r->s); - } else { - r->s = NULL; - } -buffers: - if (!(ndr_flags & NDR_BUFFERS)) goto done; - if (r->s) { - { - uint32 _array_size; - NDR_CHECK(ndr_pull_uint32(ndr, &_array_size)); - if (r->count > _array_size) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should be %u", _array_size, r->count); - } - } - NDR_ALLOC_N_SIZE(ndr, r->s, r->count, sizeof(r->s[0])); - NDR_CHECK(ndr_pull_array(ndr, NDR_SCALARS|NDR_BUFFERS, (void **)r->s, sizeof(r->s[0]), r->count, (ndr_pull_flags_fn_t)ndr_pull_dfs_Info2)); - } -done: - return NT_STATUS_OK; -} - static NTSTATUS ndr_pull_dfs_StorageInfo(struct ndr_pull *ndr, int ndr_flags, struct dfs_StorageInfo *r) { uint32 _ptr_server; @@ -636,35 +565,6 @@ done: return NT_STATUS_OK; } -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_uint32(ndr, &r->count)); - NDR_CHECK(ndr_pull_uint32(ndr, &_ptr_s)); - if (_ptr_s) { - NDR_ALLOC(ndr, r->s); - } else { - r->s = NULL; - } -buffers: - if (!(ndr_flags & NDR_BUFFERS)) goto done; - if (r->s) { - { - uint32 _array_size; - NDR_CHECK(ndr_pull_uint32(ndr, &_array_size)); - if (r->count > _array_size) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should be %u", _array_size, r->count); - } - } - NDR_ALLOC_N_SIZE(ndr, r->s, r->count, sizeof(r->s[0])); - NDR_CHECK(ndr_pull_array(ndr, NDR_SCALARS|NDR_BUFFERS, (void **)r->s, sizeof(r->s[0]), r->count, (ndr_pull_flags_fn_t)ndr_pull_dfs_Info3)); - } -done: - return NT_STATUS_OK; -} - static NTSTATUS ndr_pull_dfs_Info4(struct ndr_pull *ndr, int ndr_flags, struct dfs_Info4 *r) { uint32 _ptr_path; @@ -702,7 +602,7 @@ buffers: if (r->comment) { NDR_CHECK(ndr_pull_unistr(ndr, &r->comment)); } - NDR_CHECK(ndr_pull_GUID(ndr, ndr_flags, &r->guid)); + NDR_CHECK(ndr_pull_GUID(ndr, NDR_BUFFERS, &r->guid)); if (r->stores) { { uint32 _array_size; @@ -718,7 +618,263 @@ done: return NT_STATUS_OK; } -static NTSTATUS ndr_pull_dfs_EnumArray4(struct ndr_pull *ndr, int ndr_flags, struct dfs_EnumArray4 *r) +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_uint32(ndr, &_ptr_comment)); + if (_ptr_comment) { + NDR_ALLOC(ndr, r->comment); + } else { + r->comment = NULL; + } +buffers: + if (!(ndr_flags & NDR_BUFFERS)) goto done; + if (r->comment) { + NDR_CHECK(ndr_pull_unistr(ndr, &r->comment)); + } +done: + return NT_STATUS_OK; +} + +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_uint32(ndr, &r->state)); +buffers: + if (!(ndr_flags & NDR_BUFFERS)) goto done; +done: + return NT_STATUS_OK; +} + +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_uint32(ndr, &r->timeout)); +buffers: + if (!(ndr_flags & NDR_BUFFERS)) goto done; +done: + return NT_STATUS_OK; +} + +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_uint32(ndr, &_ptr_dom_root)); + if (_ptr_dom_root) { + NDR_ALLOC(ndr, r->dom_root); + } else { + r->dom_root = NULL; + } +buffers: + if (!(ndr_flags & NDR_BUFFERS)) goto done; + if (r->dom_root) { + NDR_CHECK(ndr_pull_unistr(ndr, &r->dom_root)); + } +done: + return NT_STATUS_OK; +} + +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_uint32(ndr, &r->flags)); + NDR_CHECK(ndr_pull_uint32(ndr, &_ptr_dom_root)); + if (_ptr_dom_root) { + NDR_ALLOC(ndr, r->dom_root); + } else { + r->dom_root = NULL; + } +buffers: + if (!(ndr_flags & NDR_BUFFERS)) goto done; + if (r->dom_root) { + NDR_CHECK(ndr_pull_unistr(ndr, &r->dom_root)); + } +done: + return NT_STATUS_OK; +} + +static NTSTATUS ndr_pull_dfs_Info(struct ndr_pull *ndr, int ndr_flags, uint16 *level, union dfs_Info *r) +{ + if (!(ndr_flags & NDR_SCALARS)) goto buffers; + NDR_CHECK(ndr_pull_uint16(ndr, level)); + switch (*level) { + case 1: { + uint32 _ptr_info1; + NDR_CHECK(ndr_pull_uint32(ndr, &_ptr_info1)); + if (_ptr_info1) { + NDR_ALLOC(ndr, r->info1); + } else { + r->info1 = NULL; + } + break; } + + case 2: { + uint32 _ptr_info2; + NDR_CHECK(ndr_pull_uint32(ndr, &_ptr_info2)); + if (_ptr_info2) { + NDR_ALLOC(ndr, r->info2); + } else { + r->info2 = NULL; + } + break; } + + case 3: { + uint32 _ptr_info3; + NDR_CHECK(ndr_pull_uint32(ndr, &_ptr_info3)); + if (_ptr_info3) { + NDR_ALLOC(ndr, r->info3); + } else { + r->info3 = NULL; + } + break; } + + case 4: { + uint32 _ptr_info4; + NDR_CHECK(ndr_pull_uint32(ndr, &_ptr_info4)); + if (_ptr_info4) { + NDR_ALLOC(ndr, r->info4); + } else { + r->info4 = NULL; + } + break; } + + case 100: { + uint32 _ptr_info100; + NDR_CHECK(ndr_pull_uint32(ndr, &_ptr_info100)); + if (_ptr_info100) { + NDR_ALLOC(ndr, r->info100); + } else { + r->info100 = NULL; + } + break; } + + case 101: { + uint32 _ptr_info101; + NDR_CHECK(ndr_pull_uint32(ndr, &_ptr_info101)); + if (_ptr_info101) { + NDR_ALLOC(ndr, r->info101); + } else { + r->info101 = NULL; + } + break; } + + case 102: { + uint32 _ptr_info102; + NDR_CHECK(ndr_pull_uint32(ndr, &_ptr_info102)); + if (_ptr_info102) { + NDR_ALLOC(ndr, r->info102); + } else { + r->info102 = NULL; + } + break; } + + case 200: { + uint32 _ptr_info200; + NDR_CHECK(ndr_pull_uint32(ndr, &_ptr_info200)); + if (_ptr_info200) { + NDR_ALLOC(ndr, r->info200); + } else { + r->info200 = NULL; + } + break; } + + case 300: { + uint32 _ptr_info300; + NDR_CHECK(ndr_pull_uint32(ndr, &_ptr_info300)); + if (_ptr_info300) { + NDR_ALLOC(ndr, r->info300); + } else { + r->info300 = NULL; + } + break; } + + default: + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", *level); + } +buffers: + if (!(ndr_flags & NDR_BUFFERS)) goto done; + switch (*level) { + case 1: + if (r->info1) { + NDR_CHECK(ndr_pull_dfs_Info1(ndr, NDR_SCALARS|NDR_BUFFERS, r->info1)); + } + break; + + case 2: + if (r->info2) { + NDR_CHECK(ndr_pull_dfs_Info2(ndr, NDR_SCALARS|NDR_BUFFERS, r->info2)); + } + break; + + case 3: + if (r->info3) { + NDR_CHECK(ndr_pull_dfs_Info3(ndr, NDR_SCALARS|NDR_BUFFERS, r->info3)); + } + break; + + case 4: + if (r->info4) { + NDR_CHECK(ndr_pull_dfs_Info4(ndr, NDR_SCALARS|NDR_BUFFERS, r->info4)); + } + break; + + case 100: + if (r->info100) { + NDR_CHECK(ndr_pull_dfs_Info100(ndr, NDR_SCALARS|NDR_BUFFERS, r->info100)); + } + break; + + case 101: + if (r->info101) { + NDR_CHECK(ndr_pull_dfs_Info101(ndr, NDR_SCALARS|NDR_BUFFERS, r->info101)); + } + break; + + case 102: + if (r->info102) { + NDR_CHECK(ndr_pull_dfs_Info102(ndr, NDR_SCALARS|NDR_BUFFERS, r->info102)); + } + break; + + case 200: + if (r->info200) { + NDR_CHECK(ndr_pull_dfs_Info200(ndr, NDR_SCALARS|NDR_BUFFERS, r->info200)); + } + break; + + case 300: + if (r->info300) { + NDR_CHECK(ndr_pull_dfs_Info300(ndr, NDR_SCALARS|NDR_BUFFERS, r->info300)); + } + break; + + default: + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", *level); + } +done: + return NT_STATUS_OK; +} + +NTSTATUS ndr_pull_dfs_GetInfo(struct ndr_pull *ndr, struct dfs_GetInfo *r) +{ + { uint16 _level; + NDR_CHECK(ndr_pull_dfs_Info(ndr, NDR_SCALARS|NDR_BUFFERS, &_level, &r->out.info)); + if (((NDR_SCALARS|NDR_BUFFERS) & NDR_SCALARS) && (_level != r->in.level)) return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u in info"); + } + NDR_CHECK(ndr_pull_NTSTATUS(ndr, &r->out.result)); + + return NT_STATUS_OK; +} + +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)); @@ -741,33 +897,42 @@ buffers: } } NDR_ALLOC_N_SIZE(ndr, r->s, r->count, sizeof(r->s[0])); - NDR_CHECK(ndr_pull_array(ndr, NDR_SCALARS|NDR_BUFFERS, (void **)r->s, sizeof(r->s[0]), r->count, (ndr_pull_flags_fn_t)ndr_pull_dfs_Info4)); + NDR_CHECK(ndr_pull_array(ndr, NDR_SCALARS|NDR_BUFFERS, (void **)r->s, sizeof(r->s[0]), r->count, (ndr_pull_flags_fn_t)ndr_pull_dfs_Info1)); } done: return NT_STATUS_OK; } -static NTSTATUS ndr_pull_dfs_Info200(struct ndr_pull *ndr, int ndr_flags, struct dfs_Info200 *r) +static NTSTATUS ndr_pull_dfs_EnumArray2(struct ndr_pull *ndr, int ndr_flags, struct dfs_EnumArray2 *r) { - uint32 _ptr_dom_root; + uint32 _ptr_s; NDR_CHECK(ndr_pull_align(ndr, 4)); if (!(ndr_flags & NDR_SCALARS)) goto buffers; - NDR_CHECK(ndr_pull_uint32(ndr, &_ptr_dom_root)); - if (_ptr_dom_root) { - NDR_ALLOC(ndr, r->dom_root); + NDR_CHECK(ndr_pull_uint32(ndr, &r->count)); + NDR_CHECK(ndr_pull_uint32(ndr, &_ptr_s)); + if (_ptr_s) { + NDR_ALLOC(ndr, r->s); } else { - r->dom_root = NULL; + r->s = NULL; } buffers: if (!(ndr_flags & NDR_BUFFERS)) goto done; - if (r->dom_root) { - NDR_CHECK(ndr_pull_unistr(ndr, &r->dom_root)); + if (r->s) { + { + uint32 _array_size; + NDR_CHECK(ndr_pull_uint32(ndr, &_array_size)); + if (r->count > _array_size) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should be %u", _array_size, r->count); + } + } + NDR_ALLOC_N_SIZE(ndr, r->s, r->count, sizeof(r->s[0])); + NDR_CHECK(ndr_pull_array(ndr, NDR_SCALARS|NDR_BUFFERS, (void **)r->s, sizeof(r->s[0]), r->count, (ndr_pull_flags_fn_t)ndr_pull_dfs_Info2)); } done: return NT_STATUS_OK; } -static NTSTATUS ndr_pull_dfs_EnumArray200(struct ndr_pull *ndr, int ndr_flags, struct dfs_EnumArray200 *r) +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)); @@ -790,28 +955,65 @@ buffers: } } NDR_ALLOC_N_SIZE(ndr, r->s, r->count, sizeof(r->s[0])); - NDR_CHECK(ndr_pull_array(ndr, NDR_SCALARS|NDR_BUFFERS, (void **)r->s, sizeof(r->s[0]), r->count, (ndr_pull_flags_fn_t)ndr_pull_dfs_Info200)); + NDR_CHECK(ndr_pull_array(ndr, NDR_SCALARS|NDR_BUFFERS, (void **)r->s, sizeof(r->s[0]), r->count, (ndr_pull_flags_fn_t)ndr_pull_dfs_Info3)); } done: return NT_STATUS_OK; } -static NTSTATUS ndr_pull_dfs_Info300(struct ndr_pull *ndr, int ndr_flags, struct dfs_Info300 *r) +static NTSTATUS ndr_pull_dfs_EnumArray4(struct ndr_pull *ndr, int ndr_flags, struct dfs_EnumArray4 *r) { - uint32 _ptr_dom_root; + uint32 _ptr_s; NDR_CHECK(ndr_pull_align(ndr, 4)); if (!(ndr_flags & NDR_SCALARS)) goto buffers; - NDR_CHECK(ndr_pull_uint32(ndr, &r->flags)); - NDR_CHECK(ndr_pull_uint32(ndr, &_ptr_dom_root)); - if (_ptr_dom_root) { - NDR_ALLOC(ndr, r->dom_root); + NDR_CHECK(ndr_pull_uint32(ndr, &r->count)); + NDR_CHECK(ndr_pull_uint32(ndr, &_ptr_s)); + if (_ptr_s) { + NDR_ALLOC(ndr, r->s); } else { - r->dom_root = NULL; + r->s = NULL; } buffers: if (!(ndr_flags & NDR_BUFFERS)) goto done; - if (r->dom_root) { - NDR_CHECK(ndr_pull_unistr(ndr, &r->dom_root)); + if (r->s) { + { + uint32 _array_size; + NDR_CHECK(ndr_pull_uint32(ndr, &_array_size)); + if (r->count > _array_size) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should be %u", _array_size, r->count); + } + } + NDR_ALLOC_N_SIZE(ndr, r->s, r->count, sizeof(r->s[0])); + NDR_CHECK(ndr_pull_array(ndr, NDR_SCALARS|NDR_BUFFERS, (void **)r->s, sizeof(r->s[0]), r->count, (ndr_pull_flags_fn_t)ndr_pull_dfs_Info4)); + } +done: + return NT_STATUS_OK; +} + +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_uint32(ndr, &r->count)); + NDR_CHECK(ndr_pull_uint32(ndr, &_ptr_s)); + if (_ptr_s) { + NDR_ALLOC(ndr, r->s); + } else { + r->s = NULL; + } +buffers: + if (!(ndr_flags & NDR_BUFFERS)) goto done; + if (r->s) { + { + uint32 _array_size; + NDR_CHECK(ndr_pull_uint32(ndr, &_array_size)); + if (r->count > _array_size) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should be %u", _array_size, r->count); + } + } + NDR_ALLOC_N_SIZE(ndr, r->s, r->count, sizeof(r->s[0])); + NDR_CHECK(ndr_pull_array(ndr, NDR_SCALARS|NDR_BUFFERS, (void **)r->s, sizeof(r->s[0]), r->count, (ndr_pull_flags_fn_t)ndr_pull_dfs_Info200)); } done: return NT_STATUS_OK; @@ -967,13 +1169,13 @@ static NTSTATUS ndr_pull_dfs_EnumStruct(struct ndr_pull *ndr, int ndr_flags, str NDR_CHECK(ndr_pull_uint32(ndr, &r->level)); { uint16 _level; NDR_CHECK(ndr_pull_dfs_EnumInfo(ndr, NDR_SCALARS, &_level, &r->e)); - if (_level != r->level) return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u in e"); + if (((NDR_SCALARS) & NDR_SCALARS) && (_level != r->level)) return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u in e"); } buffers: if (!(ndr_flags & NDR_BUFFERS)) goto done; { uint16 _level; NDR_CHECK(ndr_pull_dfs_EnumInfo(ndr, NDR_BUFFERS, &_level, &r->e)); - if (_level != r->level) return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u in e"); + if (((NDR_BUFFERS) & NDR_SCALARS) && (_level != r->level)) return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u in e"); } done: return NT_STATUS_OK; @@ -1019,20 +1221,6 @@ void ndr_print_dfs_Info1(struct ndr_print *ndr, const char *name, struct dfs_Inf ndr->depth--; } -void ndr_print_dfs_EnumArray1(struct ndr_print *ndr, const char *name, struct dfs_EnumArray1 *r) -{ - ndr_print_struct(ndr, name, "dfs_EnumArray1"); - ndr->depth++; - ndr_print_uint32(ndr, "count", r->count); - ndr_print_ptr(ndr, "s", r->s); - ndr->depth++; - if (r->s) { - ndr_print_array(ndr, "s", r->s, sizeof(r->s[0]), r->count, (ndr_print_fn_t)ndr_print_dfs_Info1); - } - ndr->depth--; - ndr->depth--; -} - void ndr_print_dfs_Info2(struct ndr_print *ndr, const char *name, struct dfs_Info2 *r) { ndr_print_struct(ndr, name, "dfs_Info2"); @@ -1054,20 +1242,6 @@ void ndr_print_dfs_Info2(struct ndr_print *ndr, const char *name, struct dfs_Inf ndr->depth--; } -void ndr_print_dfs_EnumArray2(struct ndr_print *ndr, const char *name, struct dfs_EnumArray2 *r) -{ - ndr_print_struct(ndr, name, "dfs_EnumArray2"); - ndr->depth++; - ndr_print_uint32(ndr, "count", r->count); - ndr_print_ptr(ndr, "s", r->s); - ndr->depth++; - if (r->s) { - ndr_print_array(ndr, "s", r->s, sizeof(r->s[0]), r->count, (ndr_print_fn_t)ndr_print_dfs_Info2); - } - ndr->depth--; - ndr->depth--; -} - void ndr_print_dfs_StorageInfo(struct ndr_print *ndr, const char *name, struct dfs_StorageInfo *r) { ndr_print_struct(ndr, name, "dfs_StorageInfo"); @@ -1115,20 +1289,6 @@ void ndr_print_dfs_Info3(struct ndr_print *ndr, const char *name, struct dfs_Inf ndr->depth--; } -void ndr_print_dfs_EnumArray3(struct ndr_print *ndr, const char *name, struct dfs_EnumArray3 *r) -{ - ndr_print_struct(ndr, name, "dfs_EnumArray3"); - ndr->depth++; - ndr_print_uint32(ndr, "count", r->count); - ndr_print_ptr(ndr, "s", r->s); - ndr->depth++; - if (r->s) { - ndr_print_array(ndr, "s", r->s, sizeof(r->s[0]), r->count, (ndr_print_fn_t)ndr_print_dfs_Info3); - } - ndr->depth--; - ndr->depth--; -} - void ndr_print_dfs_Info4(struct ndr_print *ndr, const char *name, struct dfs_Info4 *r) { ndr_print_struct(ndr, name, "dfs_Info4"); @@ -1158,20 +1318,35 @@ void ndr_print_dfs_Info4(struct ndr_print *ndr, const char *name, struct dfs_Inf ndr->depth--; } -void ndr_print_dfs_EnumArray4(struct ndr_print *ndr, const char *name, struct dfs_EnumArray4 *r) +void ndr_print_dfs_Info100(struct ndr_print *ndr, const char *name, struct dfs_Info100 *r) { - ndr_print_struct(ndr, name, "dfs_EnumArray4"); + ndr_print_struct(ndr, name, "dfs_Info100"); ndr->depth++; - ndr_print_uint32(ndr, "count", r->count); - ndr_print_ptr(ndr, "s", r->s); + ndr_print_ptr(ndr, "comment", r->comment); ndr->depth++; - if (r->s) { - ndr_print_array(ndr, "s", r->s, sizeof(r->s[0]), r->count, (ndr_print_fn_t)ndr_print_dfs_Info4); + if (r->comment) { + ndr_print_unistr(ndr, "comment", r->comment); } ndr->depth--; ndr->depth--; } +void ndr_print_dfs_Info101(struct ndr_print *ndr, const char *name, struct dfs_Info101 *r) +{ + ndr_print_struct(ndr, name, "dfs_Info101"); + ndr->depth++; + ndr_print_uint32(ndr, "state", r->state); + ndr->depth--; +} + +void ndr_print_dfs_Info102(struct ndr_print *ndr, const char *name, struct dfs_Info102 *r) +{ + ndr_print_struct(ndr, name, "dfs_Info102"); + ndr->depth++; + ndr_print_uint32(ndr, "timeout", r->timeout); + ndr->depth--; +} + void ndr_print_dfs_Info200(struct ndr_print *ndr, const char *name, struct dfs_Info200 *r) { ndr_print_struct(ndr, name, "dfs_Info200"); @@ -1185,29 +1360,175 @@ void ndr_print_dfs_Info200(struct ndr_print *ndr, const char *name, struct dfs_I ndr->depth--; } -void ndr_print_dfs_EnumArray200(struct ndr_print *ndr, const char *name, struct dfs_EnumArray200 *r) +void ndr_print_dfs_Info300(struct ndr_print *ndr, const char *name, struct dfs_Info300 *r) { - ndr_print_struct(ndr, name, "dfs_EnumArray200"); + ndr_print_struct(ndr, name, "dfs_Info300"); + ndr->depth++; + ndr_print_uint32(ndr, "flags", r->flags); + ndr_print_ptr(ndr, "dom_root", r->dom_root); + ndr->depth++; + if (r->dom_root) { + ndr_print_unistr(ndr, "dom_root", r->dom_root); + } + ndr->depth--; + ndr->depth--; +} + +void ndr_print_dfs_Info(struct ndr_print *ndr, const char *name, uint16 level, union dfs_Info *r) +{ + ndr_print_union(ndr, name, level, "dfs_Info"); + switch (level) { + case 1: + ndr_print_ptr(ndr, "info1", r->info1); + ndr->depth++; + if (r->info1) { + ndr_print_dfs_Info1(ndr, "info1", r->info1); + } + ndr->depth--; + break; + + case 2: + ndr_print_ptr(ndr, "info2", r->info2); + ndr->depth++; + if (r->info2) { + ndr_print_dfs_Info2(ndr, "info2", r->info2); + } + ndr->depth--; + break; + + case 3: + ndr_print_ptr(ndr, "info3", r->info3); + ndr->depth++; + if (r->info3) { + ndr_print_dfs_Info3(ndr, "info3", r->info3); + } + ndr->depth--; + break; + + case 4: + ndr_print_ptr(ndr, "info4", r->info4); + ndr->depth++; + if (r->info4) { + ndr_print_dfs_Info4(ndr, "info4", r->info4); + } + ndr->depth--; + break; + + case 100: + ndr_print_ptr(ndr, "info100", r->info100); + ndr->depth++; + if (r->info100) { + ndr_print_dfs_Info100(ndr, "info100", r->info100); + } + ndr->depth--; + break; + + case 101: + ndr_print_ptr(ndr, "info101", r->info101); + ndr->depth++; + if (r->info101) { + ndr_print_dfs_Info101(ndr, "info101", r->info101); + } + ndr->depth--; + break; + + case 102: + ndr_print_ptr(ndr, "info102", r->info102); + ndr->depth++; + if (r->info102) { + ndr_print_dfs_Info102(ndr, "info102", r->info102); + } + ndr->depth--; + break; + + case 200: + ndr_print_ptr(ndr, "info200", r->info200); + ndr->depth++; + if (r->info200) { + ndr_print_dfs_Info200(ndr, "info200", r->info200); + } + ndr->depth--; + break; + + case 300: + ndr_print_ptr(ndr, "info300", r->info300); + ndr->depth++; + if (r->info300) { + ndr_print_dfs_Info300(ndr, "info300", r->info300); + } + ndr->depth--; + break; + + default: + ndr_print_bad_level(ndr, name, level); + } +} + +void ndr_print_dfs_EnumArray1(struct ndr_print *ndr, const char *name, struct dfs_EnumArray1 *r) +{ + ndr_print_struct(ndr, name, "dfs_EnumArray1"); ndr->depth++; ndr_print_uint32(ndr, "count", r->count); ndr_print_ptr(ndr, "s", r->s); ndr->depth++; if (r->s) { - ndr_print_array(ndr, "s", r->s, sizeof(r->s[0]), r->count, (ndr_print_fn_t)ndr_print_dfs_Info200); + ndr_print_array(ndr, "s", r->s, sizeof(r->s[0]), r->count, (ndr_print_fn_t)ndr_print_dfs_Info1); } ndr->depth--; ndr->depth--; } -void ndr_print_dfs_Info300(struct ndr_print *ndr, const char *name, struct dfs_Info300 *r) +void ndr_print_dfs_EnumArray2(struct ndr_print *ndr, const char *name, struct dfs_EnumArray2 *r) { - ndr_print_struct(ndr, name, "dfs_Info300"); + ndr_print_struct(ndr, name, "dfs_EnumArray2"); ndr->depth++; - ndr_print_uint32(ndr, "flags", r->flags); - ndr_print_ptr(ndr, "dom_root", r->dom_root); + ndr_print_uint32(ndr, "count", r->count); + ndr_print_ptr(ndr, "s", r->s); ndr->depth++; - if (r->dom_root) { - ndr_print_unistr(ndr, "dom_root", r->dom_root); + if (r->s) { + ndr_print_array(ndr, "s", r->s, sizeof(r->s[0]), r->count, (ndr_print_fn_t)ndr_print_dfs_Info2); + } + ndr->depth--; + ndr->depth--; +} + +void ndr_print_dfs_EnumArray3(struct ndr_print *ndr, const char *name, struct dfs_EnumArray3 *r) +{ + ndr_print_struct(ndr, name, "dfs_EnumArray3"); + ndr->depth++; + ndr_print_uint32(ndr, "count", r->count); + ndr_print_ptr(ndr, "s", r->s); + ndr->depth++; + if (r->s) { + ndr_print_array(ndr, "s", r->s, sizeof(r->s[0]), r->count, (ndr_print_fn_t)ndr_print_dfs_Info3); + } + ndr->depth--; + ndr->depth--; +} + +void ndr_print_dfs_EnumArray4(struct ndr_print *ndr, const char *name, struct dfs_EnumArray4 *r) +{ + ndr_print_struct(ndr, name, "dfs_EnumArray4"); + ndr->depth++; + ndr_print_uint32(ndr, "count", r->count); + ndr_print_ptr(ndr, "s", r->s); + ndr->depth++; + if (r->s) { + ndr_print_array(ndr, "s", r->s, sizeof(r->s[0]), r->count, (ndr_print_fn_t)ndr_print_dfs_Info4); + } + ndr->depth--; + ndr->depth--; +} + +void ndr_print_dfs_EnumArray200(struct ndr_print *ndr, const char *name, struct dfs_EnumArray200 *r) +{ + ndr_print_struct(ndr, name, "dfs_EnumArray200"); + ndr->depth++; + ndr_print_uint32(ndr, "count", r->count); + ndr_print_ptr(ndr, "s", r->s); + ndr->depth++; + if (r->s) { + ndr_print_array(ndr, "s", r->s, sizeof(r->s[0]), r->count, (ndr_print_fn_t)ndr_print_dfs_Info200); } ndr->depth--; ndr->depth--; diff --git a/source4/librpc/ndr/ndr_dfs.h b/source4/librpc/ndr/ndr_dfs.h index 23c84e5b53..c36477cd20 100644 --- a/source4/librpc/ndr/ndr_dfs.h +++ b/source4/librpc/ndr/ndr_dfs.h @@ -48,29 +48,10 @@ struct dfs_UNKNOWN3 { }; -struct dfs_Info { - struct { - const char *path; - const char *server; - const char *share; - uint16 level; - } in; - - struct { - NTSTATUS result; - } out; - -}; - struct dfs_Info1 { const char *path; }; -struct dfs_EnumArray1 { - uint32 count; - struct dfs_Info1 *s; -}; - struct dfs_Info2 { const char *path; const char *comment; @@ -78,11 +59,6 @@ struct dfs_Info2 { uint32 num_stores; }; -struct dfs_EnumArray2 { - uint32 count; - struct dfs_Info2 *s; -}; - struct dfs_StorageInfo { uint32 state; const char *server; @@ -97,11 +73,6 @@ struct dfs_Info3 { struct dfs_StorageInfo *stores; }; -struct dfs_EnumArray3 { - uint32 count; - struct dfs_Info3 *s; -}; - struct dfs_Info4 { const char *path; const char *comment; @@ -112,18 +83,20 @@ struct dfs_Info4 { struct dfs_StorageInfo *stores; }; -struct dfs_EnumArray4 { - uint32 count; - struct dfs_Info4 *s; +struct dfs_Info100 { + const char *comment; }; -struct dfs_Info200 { - const char *dom_root; +struct dfs_Info101 { + uint32 state; }; -struct dfs_EnumArray200 { - uint32 count; - struct dfs_Info200 *s; +struct dfs_Info102 { + uint32 timeout; +}; + +struct dfs_Info200 { + const char *dom_root; }; struct dfs_Info300 { @@ -131,6 +104,58 @@ struct dfs_Info300 { const char *dom_root; }; +union dfs_Info { +/* [case(1)] */ struct dfs_Info1 *info1; +/* [case(2)] */ struct dfs_Info2 *info2; +/* [case(3)] */ struct dfs_Info3 *info3; +/* [case(4)] */ struct dfs_Info4 *info4; +/* [case(100)] */ struct dfs_Info100 *info100; +/* [case(101)] */ struct dfs_Info101 *info101; +/* [case(102)] */ struct dfs_Info102 *info102; +/* [case(200)] */ struct dfs_Info200 *info200; +/* [case(300)] */ struct dfs_Info300 *info300; +}; + +struct dfs_GetInfo { + struct { + const char *path; + const char *server; + const char *share; + uint32 level; + } in; + + struct { + union dfs_Info info; + NTSTATUS result; + } out; + +}; + +struct dfs_EnumArray1 { + uint32 count; + struct dfs_Info1 *s; +}; + +struct dfs_EnumArray2 { + uint32 count; + struct dfs_Info2 *s; +}; + +struct dfs_EnumArray3 { + uint32 count; + struct dfs_Info3 *s; +}; + +struct dfs_EnumArray4 { + uint32 count; + struct dfs_Info4 *s; +}; + +struct dfs_EnumArray200 { + uint32 count; + struct dfs_Info200 *s; +}; + struct dfs_EnumArray300 { uint32 count; struct dfs_Info300 *s; @@ -171,5 +196,5 @@ struct dfs_Enum { #define DCERPC_DFS_ADD 1 #define DCERPC_DFS_REMOVE 2 #define DCERPC_DFS_UNKNOWN3 3 -#define DCERPC_DFS_INFO 4 +#define DCERPC_DFS_GETINFO 4 #define DCERPC_DFS_ENUM 5 diff --git a/source4/librpc/ndr/ndr_echo.c b/source4/librpc/ndr/ndr_echo.c index 49f93dcdea..909c06cd18 100644 --- a/source4/librpc/ndr/ndr_echo.c +++ b/source4/librpc/ndr/ndr_echo.c @@ -171,13 +171,13 @@ static NTSTATUS ndr_pull_Struct1(struct ndr_pull *ndr, int ndr_flags, struct Str NDR_CHECK(ndr_pull_uint32(ndr, &r->level)); { uint16 _level; NDR_CHECK(ndr_pull_echo_EnumInfo(ndr, NDR_SCALARS, &_level, &r->e)); - if (_level != r->level) return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u in e"); + if (((NDR_SCALARS) & NDR_SCALARS) && (_level != r->level)) return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u in e"); } buffers: if (!(ndr_flags & NDR_BUFFERS)) goto done; { uint16 _level; NDR_CHECK(ndr_pull_echo_EnumInfo(ndr, NDR_BUFFERS, &_level, &r->e)); - if (_level != r->level) return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u in e"); + if (((NDR_BUFFERS) & NDR_SCALARS) && (_level != r->level)) return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u in e"); } done: return NT_STATUS_OK; diff --git a/source4/librpc/ndr/ndr_lsa.c b/source4/librpc/ndr/ndr_lsa.c index 9fb8e3d833..713e87cbbc 100644 --- a/source4/librpc/ndr/ndr_lsa.c +++ b/source4/librpc/ndr/ndr_lsa.c @@ -107,7 +107,7 @@ buffers: NDR_CHECK(ndr_push_security_descriptor(ndr, r->sec_desc)); } if (r->sec_qos) { - NDR_CHECK(ndr_push_lsa_QosInfo(ndr, ndr_flags, r->sec_qos)); + NDR_CHECK(ndr_push_lsa_QosInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->sec_qos)); } ndr_push_save(ndr, &_save3); ndr_push_restore(ndr, &_save2); @@ -263,7 +263,7 @@ static NTSTATUS ndr_push_lsa_TranslatedName(struct ndr_push *ndr, int ndr_flags, NDR_CHECK(ndr_push_uint32(ndr, r->sid_index)); buffers: if (!(ndr_flags & NDR_BUFFERS)) goto done; - NDR_CHECK(ndr_push_lsa_Name(ndr, ndr_flags, &r->name)); + NDR_CHECK(ndr_push_lsa_Name(ndr, NDR_BUFFERS, &r->name)); done: return NT_STATUS_OK; } @@ -553,7 +553,7 @@ static NTSTATUS ndr_pull_lsa_PrivEntry(struct ndr_pull *ndr, int ndr_flags, stru 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)); + NDR_CHECK(ndr_pull_lsa_Name(ndr, NDR_BUFFERS, &r->name)); done: return NT_STATUS_OK; } @@ -695,7 +695,7 @@ static NTSTATUS ndr_pull_lsa_DomainInfo(struct ndr_pull *ndr, int ndr_flags, str } buffers: if (!(ndr_flags & NDR_BUFFERS)) goto done; - NDR_CHECK(ndr_pull_lsa_Name(ndr, ndr_flags, &r->name)); + NDR_CHECK(ndr_pull_lsa_Name(ndr, NDR_BUFFERS, &r->name)); if (r->sid) { NDR_CHECK(ndr_pull_dom_sid2(ndr, r->sid)); } @@ -710,7 +710,7 @@ static NTSTATUS ndr_pull_lsa_PDAccountInfo(struct ndr_pull *ndr, int ndr_flags, NDR_CHECK(ndr_pull_lsa_Name(ndr, NDR_SCALARS, &r->name)); buffers: if (!(ndr_flags & NDR_BUFFERS)) goto done; - NDR_CHECK(ndr_pull_lsa_Name(ndr, ndr_flags, &r->name)); + NDR_CHECK(ndr_pull_lsa_Name(ndr, NDR_BUFFERS, &r->name)); done: return NT_STATUS_OK; } @@ -734,8 +734,8 @@ static NTSTATUS ndr_pull_lsa_ReplicaSourceInfo(struct ndr_pull *ndr, int ndr_fla NDR_CHECK(ndr_pull_lsa_Name(ndr, NDR_SCALARS, &r->account)); buffers: if (!(ndr_flags & NDR_BUFFERS)) goto done; - NDR_CHECK(ndr_pull_lsa_Name(ndr, ndr_flags, &r->source)); - NDR_CHECK(ndr_pull_lsa_Name(ndr, ndr_flags, &r->account)); + NDR_CHECK(ndr_pull_lsa_Name(ndr, NDR_BUFFERS, &r->source)); + NDR_CHECK(ndr_pull_lsa_Name(ndr, NDR_BUFFERS, &r->account)); done: return NT_STATUS_OK; } @@ -808,10 +808,10 @@ static NTSTATUS ndr_pull_lsa_DnsDomainInfo(struct ndr_pull *ndr, int ndr_flags, } buffers: if (!(ndr_flags & NDR_BUFFERS)) goto done; - NDR_CHECK(ndr_pull_lsa_Name(ndr, ndr_flags, &r->name)); - NDR_CHECK(ndr_pull_lsa_Name(ndr, ndr_flags, &r->dns_domain)); - NDR_CHECK(ndr_pull_lsa_Name(ndr, ndr_flags, &r->dns_forest)); - NDR_CHECK(ndr_pull_GUID(ndr, ndr_flags, &r->domain_guid)); + NDR_CHECK(ndr_pull_lsa_Name(ndr, NDR_BUFFERS, &r->name)); + NDR_CHECK(ndr_pull_lsa_Name(ndr, NDR_BUFFERS, &r->dns_domain)); + NDR_CHECK(ndr_pull_lsa_Name(ndr, NDR_BUFFERS, &r->dns_forest)); + NDR_CHECK(ndr_pull_GUID(ndr, NDR_BUFFERS, &r->domain_guid)); if (r->sid) { NDR_CHECK(ndr_pull_dom_sid2(ndr, r->sid)); } @@ -945,7 +945,7 @@ NTSTATUS ndr_pull_lsa_QueryInfoPolicy(struct ndr_pull *ndr, struct lsa_QueryInfo if (r->out.info) { { uint16 _level; NDR_CHECK(ndr_pull_lsa_PolicyInformation(ndr, NDR_SCALARS|NDR_BUFFERS, &_level, r->out.info)); - if (_level != r->in.level) return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u in info"); + if (((NDR_SCALARS|NDR_BUFFERS) & NDR_SCALARS) && (_level != r->in.level)) return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u in info"); } } NDR_CHECK(ndr_pull_NTSTATUS(ndr, &r->out.result)); @@ -1053,7 +1053,7 @@ static NTSTATUS ndr_pull_lsa_DomainInformation(struct ndr_pull *ndr, int ndr_fla } buffers: if (!(ndr_flags & NDR_BUFFERS)) goto done; - NDR_CHECK(ndr_pull_lsa_Name(ndr, ndr_flags, &r->name)); + NDR_CHECK(ndr_pull_lsa_Name(ndr, NDR_BUFFERS, &r->name)); if (r->sid) { NDR_CHECK(ndr_pull_dom_sid2(ndr, r->sid)); } @@ -1155,7 +1155,7 @@ static NTSTATUS ndr_pull_lsa_TrustInformation(struct ndr_pull *ndr, int ndr_flag } buffers: if (!(ndr_flags & NDR_BUFFERS)) goto done; - NDR_CHECK(ndr_pull_lsa_Name(ndr, ndr_flags, &r->name)); + NDR_CHECK(ndr_pull_lsa_Name(ndr, NDR_BUFFERS, &r->name)); if (r->sid) { NDR_CHECK(ndr_pull_dom_sid2(ndr, r->sid)); } @@ -1221,7 +1221,7 @@ static NTSTATUS ndr_pull_lsa_TranslatedName(struct ndr_pull *ndr, int ndr_flags, NDR_CHECK(ndr_pull_uint32(ndr, &r->sid_index)); buffers: if (!(ndr_flags & NDR_BUFFERS)) goto done; - NDR_CHECK(ndr_pull_lsa_Name(ndr, ndr_flags, &r->name)); + NDR_CHECK(ndr_pull_lsa_Name(ndr, NDR_BUFFERS, &r->name)); done: return NT_STATUS_OK; } @@ -1309,7 +1309,7 @@ static NTSTATUS ndr_pull_lsa_LUIDAttribute(struct ndr_pull *ndr, int ndr_flags, NDR_CHECK(ndr_pull_uint32(ndr, &r->attribute)); buffers: if (!(ndr_flags & NDR_BUFFERS)) goto done; - NDR_CHECK(ndr_pull_lsa_LUID(ndr, ndr_flags, &r->luid)); + NDR_CHECK(ndr_pull_lsa_LUID(ndr, NDR_BUFFERS, &r->luid)); done: return NT_STATUS_OK; } diff --git a/source4/librpc/rpc/rpc_dfs.c b/source4/librpc/rpc/rpc_dfs.c index 1e827bda07..c722530eeb 100644 --- a/source4/librpc/rpc/rpc_dfs.c +++ b/source4/librpc/rpc/rpc_dfs.c @@ -53,12 +53,12 @@ NTSTATUS dcerpc_dfs_UNKNOWN3(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, struct return r->out.result; } -NTSTATUS dcerpc_dfs_Info(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, struct dfs_Info *r) +NTSTATUS dcerpc_dfs_GetInfo(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, struct dfs_GetInfo *r) { NTSTATUS status; - status = dcerpc_ndr_request(p, DCERPC_DFS_INFO, mem_ctx, - (ndr_push_fn_t) ndr_push_dfs_Info, - (ndr_pull_fn_t) ndr_pull_dfs_Info, + status = dcerpc_ndr_request(p, DCERPC_DFS_GETINFO, mem_ctx, + (ndr_push_fn_t) ndr_push_dfs_GetInfo, + (ndr_pull_fn_t) ndr_pull_dfs_GetInfo, r); if (!NT_STATUS_IS_OK(status)) { return status; |