summaryrefslogtreecommitdiff
path: root/source4/librpc/ndr/ndr_echo.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2003-11-17 02:18:11 +0000
committerAndrew Tridgell <tridge@samba.org>2003-11-17 02:18:11 +0000
commit657b4d2abdad5691fc37bafe819f75cc440354b9 (patch)
treea66c51ef8e39efa62e5b7a5f9e2e227bd3138935 /source4/librpc/ndr/ndr_echo.c
parentcc5f231e95b2a322a1f1f118b8a3a363a0e4d0cc (diff)
downloadsamba-657b4d2abdad5691fc37bafe819f75cc440354b9.tar.gz
samba-657b4d2abdad5691fc37bafe819f75cc440354b9.tar.bz2
samba-657b4d2abdad5691fc37bafe819f75cc440354b9.zip
nicer method of handling spoolss EnumPrinters
this also handles the return of several printers (an array of relative subcontexts) (This used to be commit 060421c7dc9aa611fe4160843a4f76498ab16bf4)
Diffstat (limited to 'source4/librpc/ndr/ndr_echo.c')
-rw-r--r--source4/librpc/ndr/ndr_echo.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/source4/librpc/ndr/ndr_echo.c b/source4/librpc/ndr/ndr_echo.c
index d7f131f784..74e55c7c19 100644
--- a/source4/librpc/ndr/ndr_echo.c
+++ b/source4/librpc/ndr/ndr_echo.c
@@ -93,6 +93,7 @@ NTSTATUS ndr_pull_echo_SourceData(struct ndr_pull *ndr, struct echo_SourceData *
NTSTATUS ndr_pull_echo_Enum1(struct ndr_pull *ndr, int ndr_flags, struct echo_Enum1 *r)
{
uint32 _ptr_count;
+ 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_count));
@@ -101,6 +102,7 @@ NTSTATUS ndr_pull_echo_Enum1(struct ndr_pull *ndr, int ndr_flags, struct echo_En
} else {
r->count = NULL;
}
+ ndr_pull_struct_end(ndr);
buffers:
if (!(ndr_flags & NDR_BUFFERS)) goto done;
if (r->count) {
@@ -113,6 +115,7 @@ done:
NTSTATUS ndr_pull_echo_Enum3(struct ndr_pull *ndr, int ndr_flags, struct echo_Enum3 *r)
{
uint32 _ptr_count;
+ 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_count));
@@ -121,6 +124,7 @@ NTSTATUS ndr_pull_echo_Enum3(struct ndr_pull *ndr, int ndr_flags, struct echo_En
} else {
r->count = NULL;
}
+ ndr_pull_struct_end(ndr);
buffers:
if (!(ndr_flags & NDR_BUFFERS)) goto done;
if (r->count) {
@@ -133,6 +137,7 @@ done:
NTSTATUS ndr_pull_echo_EnumInfo(struct ndr_pull *ndr, int ndr_flags, uint16 *level, union echo_EnumInfo *r)
{
if (!(ndr_flags & NDR_SCALARS)) goto buffers;
+ NDR_CHECK(ndr_pull_struct_start(ndr));
NDR_CHECK(ndr_pull_uint16(ndr, level));
switch (*level) {
case 1: {
@@ -146,6 +151,7 @@ NTSTATUS ndr_pull_echo_EnumInfo(struct ndr_pull *ndr, int ndr_flags, uint16 *lev
default:
return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", *level);
}
+ ndr_pull_struct_end(ndr);
buffers:
if (!(ndr_flags & NDR_BUFFERS)) goto done;
switch (*level) {
@@ -166,6 +172,7 @@ done:
NTSTATUS ndr_pull_Struct1(struct ndr_pull *ndr, int ndr_flags, struct Struct1 *r)
{
+ 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->level));
@@ -173,6 +180,7 @@ NTSTATUS ndr_pull_Struct1(struct ndr_pull *ndr, int ndr_flags, struct Struct1 *r
NDR_CHECK(ndr_pull_echo_EnumInfo(ndr, NDR_SCALARS, &_level, &r->e));
if (((NDR_SCALARS) & NDR_SCALARS) && (_level != r->level)) return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u in e");
}
+ ndr_pull_struct_end(ndr);
buffers:
if (!(ndr_flags & NDR_BUFFERS)) goto done;
{ uint16 _level = r->level;