1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-25 23:21:54 +03:00

Add a 1004 level for srvsvc.

(This used to be commit 9810e6f180)
This commit is contained in:
Richard Sharpe 2003-11-20 04:45:16 +00:00
parent b2fd4284b6
commit 4730469cd8
4 changed files with 170 additions and 1 deletions

View File

@ -310,12 +310,22 @@
[size_is(count)] srvsvc_NetShare502 *array;
} srvsvc_NetShareCtr502;
typedef struct {
unistr *comment;
} srvsvc_NetShare1004;
typedef struct {
uint32 count;
[size_is(count)] srvsvc_NetShare1004 *array;
} srvsvc_NetShareCtr1004;
typedef union {
[case(0)] srvsvc_NetShareCtr0 *ctr0;
[case(1)] srvsvc_NetShareCtr1 *ctr1;
[case(2)] srvsvc_NetShareCtr2 *ctr2;
[case(501)] srvsvc_NetShareCtr501 *ctr501;
[case(502)] srvsvc_NetShareCtr502 *ctr502;
[case(1004)] srvsvc_NetShareCtr1004 *ctr1004;
[default] ;
} srvsvc_NetShareCtr;

View File

@ -877,6 +877,40 @@ done:
return NT_STATUS_OK;
}
NTSTATUS ndr_push_srvsvc_NetShare1004(struct ndr_push *ndr, int ndr_flags, struct srvsvc_NetShare1004 *r)
{
if (!(ndr_flags & NDR_SCALARS)) goto buffers;
NDR_CHECK(ndr_push_struct_start(ndr));
NDR_CHECK(ndr_push_align(ndr, 4));
NDR_CHECK(ndr_push_ptr(ndr, r->comment));
ndr_push_struct_end(ndr);
buffers:
if (!(ndr_flags & NDR_BUFFERS)) goto done;
if (r->comment) {
NDR_CHECK(ndr_push_unistr(ndr, r->comment));
}
done:
return NT_STATUS_OK;
}
NTSTATUS ndr_push_srvsvc_NetShareCtr1004(struct ndr_push *ndr, int ndr_flags, struct srvsvc_NetShareCtr1004 *r)
{
if (!(ndr_flags & NDR_SCALARS)) goto buffers;
NDR_CHECK(ndr_push_struct_start(ndr));
NDR_CHECK(ndr_push_align(ndr, 4));
NDR_CHECK(ndr_push_uint32(ndr, r->count));
NDR_CHECK(ndr_push_ptr(ndr, r->array));
ndr_push_struct_end(ndr);
buffers:
if (!(ndr_flags & NDR_BUFFERS)) goto done;
if (r->array) {
NDR_CHECK(ndr_push_uint32(ndr, r->count));
NDR_CHECK(ndr_push_array(ndr, NDR_SCALARS|NDR_BUFFERS, r->array, sizeof(r->array[0]), r->count, (ndr_push_flags_fn_t)ndr_push_srvsvc_NetShare1004));
}
done:
return NT_STATUS_OK;
}
NTSTATUS ndr_push_srvsvc_NetShareCtr(struct ndr_push *ndr, int ndr_flags, uint16 level, union srvsvc_NetShareCtr *r)
{
if (!(ndr_flags & NDR_SCALARS)) goto buffers;
@ -902,6 +936,10 @@ NTSTATUS ndr_push_srvsvc_NetShareCtr(struct ndr_push *ndr, int ndr_flags, uint16
NDR_CHECK(ndr_push_ptr(ndr, r->ctr502));
break;
case 1004:
NDR_CHECK(ndr_push_ptr(ndr, r->ctr1004));
break;
default:
break;
@ -940,6 +978,12 @@ buffers:
}
break;
case 1004:
if (r->ctr1004) {
NDR_CHECK(ndr_push_srvsvc_NetShareCtr1004(ndr, NDR_SCALARS|NDR_BUFFERS, r->ctr1004));
}
break;
default:
break;
@ -2646,6 +2690,59 @@ done:
return NT_STATUS_OK;
}
NTSTATUS ndr_pull_srvsvc_NetShare1004(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetShare1004 *r)
{
uint32 _ptr_comment;
NDR_CHECK(ndr_pull_struct_start(ndr));
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);
} else {
r->comment = NULL;
}
ndr_pull_struct_end(ndr);
buffers:
if (!(ndr_flags & NDR_BUFFERS)) goto done;
if (r->comment) {
NDR_CHECK(ndr_pull_unistr(ndr, &r->comment));
}
done:
return NT_STATUS_OK;
}
NTSTATUS ndr_pull_srvsvc_NetShareCtr1004(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetShareCtr1004 *r)
{
uint32 _ptr_array;
NDR_CHECK(ndr_pull_struct_start(ndr));
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_array));
if (_ptr_array) {
NDR_ALLOC(ndr, r->array);
} else {
r->array = NULL;
}
ndr_pull_struct_end(ndr);
buffers:
if (!(ndr_flags & NDR_BUFFERS)) goto done;
if (r->array) {
{
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->array, r->count, sizeof(r->array[0]));
NDR_CHECK(ndr_pull_array(ndr, NDR_SCALARS|NDR_BUFFERS, (void **)r->array, sizeof(r->array[0]), r->count, (ndr_pull_flags_fn_t)ndr_pull_srvsvc_NetShare1004));
}
done:
return NT_STATUS_OK;
}
NTSTATUS ndr_pull_srvsvc_NetShareCtr(struct ndr_pull *ndr, int ndr_flags, uint16 level, union srvsvc_NetShareCtr *r)
{
if (!(ndr_flags & NDR_SCALARS)) goto buffers;
@ -2701,6 +2798,16 @@ NTSTATUS ndr_pull_srvsvc_NetShareCtr(struct ndr_pull *ndr, int ndr_flags, uint16
}
break; }
case 1004: {
uint32 _ptr_ctr1004;
NDR_CHECK(ndr_pull_uint32(ndr, &_ptr_ctr1004));
if (_ptr_ctr1004) {
NDR_ALLOC(ndr, r->ctr1004);
} else {
r->ctr1004 = NULL;
}
break; }
default: {
break; }
@ -2739,6 +2846,12 @@ buffers:
}
break;
case 1004:
if (r->ctr1004) {
NDR_CHECK(ndr_pull_srvsvc_NetShareCtr1004(ndr, NDR_SCALARS|NDR_BUFFERS, r->ctr1004));
}
break;
default:
break;
@ -4378,6 +4491,33 @@ void ndr_print_srvsvc_NetShareCtr502(struct ndr_print *ndr, const char *name, st
ndr->depth--;
}
void ndr_print_srvsvc_NetShare1004(struct ndr_print *ndr, const char *name, struct srvsvc_NetShare1004 *r)
{
ndr_print_struct(ndr, name, "srvsvc_NetShare1004");
ndr->depth++;
ndr_print_ptr(ndr, "comment", r->comment);
ndr->depth++;
if (r->comment) {
ndr_print_unistr(ndr, "comment", r->comment);
}
ndr->depth--;
ndr->depth--;
}
void ndr_print_srvsvc_NetShareCtr1004(struct ndr_print *ndr, const char *name, struct srvsvc_NetShareCtr1004 *r)
{
ndr_print_struct(ndr, name, "srvsvc_NetShareCtr1004");
ndr->depth++;
ndr_print_uint32(ndr, "count", r->count);
ndr_print_ptr(ndr, "array", r->array);
ndr->depth++;
if (r->array) {
ndr_print_array(ndr, "array", r->array, sizeof(r->array[0]), r->count, (ndr_print_fn_t)ndr_print_srvsvc_NetShare1004);
}
ndr->depth--;
ndr->depth--;
}
void ndr_print_srvsvc_NetShareCtr(struct ndr_print *ndr, const char *name, uint16 level, union srvsvc_NetShareCtr *r)
{
ndr_print_union(ndr, name, level, "srvsvc_NetShareCtr");
@ -4427,6 +4567,15 @@ void ndr_print_srvsvc_NetShareCtr(struct ndr_print *ndr, const char *name, uint1
ndr->depth--;
break;
case 1004:
ndr_print_ptr(ndr, "ctr1004", r->ctr1004);
ndr->depth++;
if (r->ctr1004) {
ndr_print_srvsvc_NetShareCtr1004(ndr, "ctr1004", r->ctr1004);
}
ndr->depth--;
break;
default:
break;

View File

@ -425,12 +425,22 @@ struct srvsvc_NetShareCtr502 {
struct srvsvc_NetShare502 *array;
};
struct srvsvc_NetShare1004 {
const char *comment;
};
struct srvsvc_NetShareCtr1004 {
uint32 count;
struct srvsvc_NetShare1004 *array;
};
union srvsvc_NetShareCtr {
/* [case(0)] */ struct srvsvc_NetShareCtr0 *ctr0;
/* [case(1)] */ struct srvsvc_NetShareCtr1 *ctr1;
/* [case(2)] */ struct srvsvc_NetShareCtr2 *ctr2;
/* [case(501)] */ struct srvsvc_NetShareCtr501 *ctr501;
/* [case(502)] */ struct srvsvc_NetShareCtr502 *ctr502;
/* [case(1004)] */ struct srvsvc_NetShareCtr1004 *ctr1004;
/* [case(default)] */ };
struct srvsvc_NetShareEnumAll {

View File

@ -123,7 +123,7 @@ static BOOL test_NetShareEnumAll(struct dcerpc_pipe *p,
NTSTATUS status;
struct srvsvc_NetShareEnumAll r;
struct srvsvc_NetShareCtr0 c0;
uint32 levels[] = {0, 1, 2, 501, 502};
uint32 levels[] = {0, 1, 2, 501, 502, 1004};
int i;
BOOL ret = True;