1
0
mirror of https://github.com/samba-team/samba.git synced 2025-03-29 02:50:28 +03:00

* add another WERR err code

* use the top-level function argument printing to show more detail in
   RPC-* tests
(This used to be commit 33bb8785625b1845750f28f2d810e7096afe9f8e)
This commit is contained in:
Andrew Tridgell 2003-11-17 11:55:56 +00:00
parent fb53302c8e
commit d285c6f14f
16 changed files with 4658 additions and 45 deletions

View File

@ -170,6 +170,7 @@
#define WERR_NOMEM W_ERROR(8)
#define WERR_GENERAL_FAILURE W_ERROR(31)
#define WERR_NOT_SUPPORTED W_ERROR(50)
#define WERR_BAD_NETPATH W_ERROR(53)
#define WERR_PRINTQ_FULL W_ERROR(61)
#define WERR_NO_SPOOL_SPACE W_ERROR(62)
#define WERR_NO_SUCH_SHARE W_ERROR(67)

View File

@ -35,6 +35,7 @@ werror_code_struct dos_errs[] =
{ "WERR_ACCESS_DENIED", WERR_ACCESS_DENIED },
{ "WERR_BADFID", WERR_BADFID },
{ "WERR_BADFUNC", WERR_BADFUNC },
{ "WERR_BAD_NETPATH", WERR_BAD_NETPATH },
{ "WERR_INSUFFICIENT_BUFFER", WERR_INSUFFICIENT_BUFFER },
{ "WERR_NO_SUCH_SHARE", WERR_NO_SUCH_SHARE },
{ "WERR_ALREADY_EXISTS", WERR_ALREADY_EXISTS },

View File

@ -98,6 +98,10 @@
uint32 transmission_retry_timeout;
} spoolss_PrinterInfo5;
typedef struct {
uint32 unknown;
} spoolss_PrinterInfo6;
typedef struct {
[relative] nstring guid; /* text form of printer guid */
uint32 action;
@ -109,6 +113,7 @@
case(3) spoolss_PrinterInfo3 info3;
case(4) spoolss_PrinterInfo4 info4;
case(5) spoolss_PrinterInfo5 info5;
case(6) spoolss_PrinterInfo6 info6;
case(7) spoolss_PrinterInfo7 info7;
} spoolss_PrinterInfo;

View File

@ -94,6 +94,10 @@ struct ndr_print {
/* useful macro for debugging */
#define NDR_PRINT_DEBUG(type, p) ndr_print_debug((ndr_print_fn_t)ndr_print_ ##type, #p, p)
#define NDR_PRINT_UNION_DEBUG(type, level, p) ndr_print_union_debug((ndr_print_union_fn_t)ndr_print_ ##type, #p, level, p)
#define NDR_PRINT_FUNCTION_DEBUG(type, flags, p) ndr_print_function_debug((ndr_print_function_t)ndr_print_ ##type, #type, flags, p)
#define NDR_PRINT_BOTH_DEBUG(type, p) NDR_PRINT_FUNCTION_DEBUG(type, NDR_BOTH, p)
#define NDR_PRINT_OUT_DEBUG(type, p) NDR_PRINT_FUNCTION_DEBUG(type, NDR_OUT, p)
#define NDR_PRINT_IN_DEBUG(type, p) NDR_PRINT_FUNCTION_DEBUG(type, NDR_IN, p)
enum ndr_err_code {
@ -112,6 +116,13 @@ enum ndr_err_code {
#define NDR_SCALARS 1
#define NDR_BUFFERS 2
/*
flags passed to ndr_print_*()
*/
#define NDR_IN 1
#define NDR_OUT 2
#define NDR_BOTH 3
#define NDR_PULL_NEED_BYTES(ndr, n) do { \
if ((n) > ndr->data_size || ndr->offset + (n) > ndr->data_size) { \
return NT_STATUS_BUFFER_TOO_SMALL; \
@ -171,6 +182,7 @@ typedef NTSTATUS (*ndr_pull_flags_fn_t)(struct ndr_pull *, int ndr_flags, void *
typedef NTSTATUS (*ndr_push_union_fn_t)(struct ndr_push *, int ndr_flags, uint16, void *);
typedef NTSTATUS (*ndr_pull_union_fn_t)(struct ndr_pull *, int ndr_flags, uint16 *, void *);
typedef void (*ndr_print_fn_t)(struct ndr_print *, const char *, void *);
typedef void (*ndr_print_function_t)(struct ndr_print *, const char *, int, void *);
typedef void (*ndr_print_union_fn_t)(struct ndr_print *, const char *, uint16, void *);
/* now pull in the individual parsers */

View File

@ -325,7 +325,7 @@ void ndr_print_union_debug(void (*fn)(struct ndr_print *, const char *, uint16,
{
struct ndr_print ndr;
ndr.mem_ctx = talloc_init("ndr_print_debug");
ndr.mem_ctx = talloc_init("ndr_print_union");
if (!ndr.mem_ctx) return;
ndr.print = ndr_print_debug_helper;
ndr.depth = 1;
@ -333,6 +333,24 @@ void ndr_print_union_debug(void (*fn)(struct ndr_print *, const char *, uint16,
talloc_destroy(ndr.mem_ctx);
}
/*
a useful helper function for printing idl function calls via DEBUG()
*/
void ndr_print_function_debug(void (*fn)(struct ndr_print *, const char *, int , void *),
const char *name,
int flags,
void *ptr)
{
struct ndr_print ndr;
ndr.mem_ctx = talloc_init("ndr_print_function");
if (!ndr.mem_ctx) return;
ndr.print = ndr_print_debug_helper;
ndr.depth = 1;
fn(&ndr, name, flags, ptr);
talloc_destroy(ndr.mem_ctx);
}
/*
return and possibly log an NDR error
*/

View File

@ -591,6 +591,11 @@ void ndr_print_nstring(struct ndr_print *ndr, const char *name, const char **s)
ndr_print_unistr(ndr, name, *s);
}
void ndr_print_DATA_BLOB(struct ndr_print *ndr, const char *name, DATA_BLOB r)
{
ndr->print(ndr, "%-25s: DATA_BLOB length=%u", name, r.length);
}
/*
push a DATA_BLOB onto the wire.
@ -635,3 +640,14 @@ NTSTATUS ndr_push_policy_handle(struct ndr_push *ndr,
NDR_CHECK(ndr_push_bytes(ndr, r->data, 20));
return NT_STATUS_OK;
}
void ndr_print_policy_handle(struct ndr_print *ndr, const char *name, struct policy_handle *r)
{
ndr->print(ndr, "%-25s: policy_handle %02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x",
name,
r->data[0], r->data[1], r->data[2], r->data[3], r->data[4],
r->data[5], r->data[6], r->data[7], r->data[8], r->data[9],
r->data[10], r->data[11], r->data[12], r->data[13], r->data[14],
r->data[15], r->data[16], r->data[17], r->data[18], r->data[19]);
}

View File

@ -1276,6 +1276,115 @@ NTSTATUS ndr_pull_dfs_Enum(struct ndr_pull *ndr, struct dfs_Enum *r)
return NT_STATUS_OK;
}
void ndr_print_dfs_Exist(struct ndr_print *ndr, const char *name, int flags, struct dfs_Exist *r)
{
ndr_print_struct(ndr, name, "dfs_Exist");
ndr->depth++;
if (flags & NDR_IN) {
ndr_print_struct(ndr, "in", "dfs_Exist");
ndr->depth++;
ndr->depth--;
}
if (flags & NDR_OUT) {
ndr_print_struct(ndr, "out", "dfs_Exist");
ndr->depth++;
ndr_print_ptr(ndr, "exist_flag", r->out.exist_flag);
ndr->depth++;
ndr_print_uint32(ndr, "exist_flag", *r->out.exist_flag);
ndr->depth--;
ndr->depth--;
}
ndr->depth--;
}
void ndr_print_dfs_Add(struct ndr_print *ndr, const char *name, int flags, struct dfs_Add *r)
{
ndr_print_struct(ndr, name, "dfs_Add");
ndr->depth++;
if (flags & NDR_IN) {
ndr_print_struct(ndr, "in", "dfs_Add");
ndr->depth++;
ndr_print_ptr(ndr, "path", r->in.path);
ndr->depth++;
ndr_print_unistr(ndr, "path", r->in.path);
ndr->depth--;
ndr_print_ptr(ndr, "server", r->in.server);
ndr->depth++;
ndr_print_unistr(ndr, "server", r->in.server);
ndr->depth--;
ndr_print_ptr(ndr, "share", r->in.share);
ndr->depth++;
if (r->in.share) {
ndr_print_unistr(ndr, "share", r->in.share);
}
ndr->depth--;
ndr_print_ptr(ndr, "comment", r->in.comment);
ndr->depth++;
if (r->in.comment) {
ndr_print_unistr(ndr, "comment", r->in.comment);
}
ndr->depth--;
ndr_print_uint32(ndr, "flags", r->in.flags);
ndr->depth--;
}
if (flags & NDR_OUT) {
ndr_print_struct(ndr, "out", "dfs_Add");
ndr->depth++;
ndr->depth--;
}
ndr->depth--;
}
void ndr_print_dfs_Remove(struct ndr_print *ndr, const char *name, int flags, struct dfs_Remove *r)
{
ndr_print_struct(ndr, name, "dfs_Remove");
ndr->depth++;
if (flags & NDR_IN) {
ndr_print_struct(ndr, "in", "dfs_Remove");
ndr->depth++;
ndr_print_ptr(ndr, "path", r->in.path);
ndr->depth++;
ndr_print_unistr(ndr, "path", r->in.path);
ndr->depth--;
ndr_print_ptr(ndr, "server", r->in.server);
ndr->depth++;
if (r->in.server) {
ndr_print_unistr(ndr, "server", r->in.server);
}
ndr->depth--;
ndr_print_ptr(ndr, "share", r->in.share);
ndr->depth++;
if (r->in.share) {
ndr_print_unistr(ndr, "share", r->in.share);
}
ndr->depth--;
ndr->depth--;
}
if (flags & NDR_OUT) {
ndr_print_struct(ndr, "out", "dfs_Remove");
ndr->depth++;
ndr->depth--;
}
ndr->depth--;
}
void ndr_print_dfs_SetInfo(struct ndr_print *ndr, const char *name, int flags, struct dfs_SetInfo *r)
{
ndr_print_struct(ndr, name, "dfs_SetInfo");
ndr->depth++;
if (flags & NDR_IN) {
ndr_print_struct(ndr, "in", "dfs_SetInfo");
ndr->depth++;
ndr->depth--;
}
if (flags & NDR_OUT) {
ndr_print_struct(ndr, "out", "dfs_SetInfo");
ndr->depth++;
ndr->depth--;
}
ndr->depth--;
}
void ndr_print_dfs_Info1(struct ndr_print *ndr, const char *name, struct dfs_Info1 *r)
{
ndr_print_struct(ndr, name, "dfs_Info1");
@ -1532,6 +1641,41 @@ void ndr_print_dfs_Info(struct ndr_print *ndr, const char *name, uint16 level, u
}
}
void ndr_print_dfs_GetInfo(struct ndr_print *ndr, const char *name, int flags, struct dfs_GetInfo *r)
{
ndr_print_struct(ndr, name, "dfs_GetInfo");
ndr->depth++;
if (flags & NDR_IN) {
ndr_print_struct(ndr, "in", "dfs_GetInfo");
ndr->depth++;
ndr_print_ptr(ndr, "path", r->in.path);
ndr->depth++;
ndr_print_unistr(ndr, "path", r->in.path);
ndr->depth--;
ndr_print_ptr(ndr, "server", r->in.server);
ndr->depth++;
if (r->in.server) {
ndr_print_unistr(ndr, "server", r->in.server);
}
ndr->depth--;
ndr_print_ptr(ndr, "share", r->in.share);
ndr->depth++;
if (r->in.share) {
ndr_print_unistr(ndr, "share", r->in.share);
}
ndr->depth--;
ndr_print_uint32(ndr, "level", r->in.level);
ndr->depth--;
}
if (flags & NDR_OUT) {
ndr_print_struct(ndr, "out", "dfs_GetInfo");
ndr->depth++;
ndr_print_dfs_Info(ndr, "info", r->in.level, &r->out.info);
ndr->depth--;
}
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");
@ -1688,3 +1832,52 @@ void ndr_print_dfs_EnumStruct(struct ndr_print *ndr, const char *name, struct df
ndr->depth--;
}
void ndr_print_dfs_Enum(struct ndr_print *ndr, const char *name, int flags, struct dfs_Enum *r)
{
ndr_print_struct(ndr, name, "dfs_Enum");
ndr->depth++;
if (flags & NDR_IN) {
ndr_print_struct(ndr, "in", "dfs_Enum");
ndr->depth++;
ndr_print_uint32(ndr, "level", r->in.level);
ndr_print_uint32(ndr, "bufsize", r->in.bufsize);
ndr_print_ptr(ndr, "info", r->in.info);
ndr->depth++;
if (r->in.info) {
ndr_print_dfs_EnumStruct(ndr, "info", r->in.info);
}
ndr->depth--;
ndr_print_ptr(ndr, "unknown", r->in.unknown);
ndr->depth++;
if (r->in.unknown) {
ndr_print_uint32(ndr, "unknown", *r->in.unknown);
}
ndr->depth--;
ndr_print_ptr(ndr, "total", r->in.total);
ndr->depth++;
if (r->in.total) {
ndr_print_uint32(ndr, "total", *r->in.total);
}
ndr->depth--;
ndr->depth--;
}
if (flags & NDR_OUT) {
ndr_print_struct(ndr, "out", "dfs_Enum");
ndr->depth++;
ndr_print_ptr(ndr, "info", r->out.info);
ndr->depth++;
if (r->out.info) {
ndr_print_dfs_EnumStruct(ndr, "info", r->out.info);
}
ndr->depth--;
ndr_print_ptr(ndr, "total", r->out.total);
ndr->depth++;
if (r->out.total) {
ndr_print_uint32(ndr, "total", *r->out.total);
}
ndr->depth--;
ndr->depth--;
}
ndr->depth--;
}

View File

@ -100,3 +100,121 @@ NTSTATUS ndr_pull_TestCall(struct ndr_pull *ndr, struct TestCall *r)
return NT_STATUS_OK;
}
void ndr_print_echo_AddOne(struct ndr_print *ndr, const char *name, int flags, struct echo_AddOne *r)
{
ndr_print_struct(ndr, name, "echo_AddOne");
ndr->depth++;
if (flags & NDR_IN) {
ndr_print_struct(ndr, "in", "echo_AddOne");
ndr->depth++;
ndr_print_ptr(ndr, "v", r->in.v);
ndr->depth++;
ndr_print_uint32(ndr, "v", *r->in.v);
ndr->depth--;
ndr->depth--;
}
if (flags & NDR_OUT) {
ndr_print_struct(ndr, "out", "echo_AddOne");
ndr->depth++;
ndr_print_ptr(ndr, "v", r->out.v);
ndr->depth++;
ndr_print_uint32(ndr, "v", *r->out.v);
ndr->depth--;
ndr->depth--;
}
ndr->depth--;
}
void ndr_print_echo_EchoData(struct ndr_print *ndr, const char *name, int flags, struct echo_EchoData *r)
{
ndr_print_struct(ndr, name, "echo_EchoData");
ndr->depth++;
if (flags & NDR_IN) {
ndr_print_struct(ndr, "in", "echo_EchoData");
ndr->depth++;
ndr_print_uint32(ndr, "len", r->in.len);
ndr_print_ptr(ndr, "in_data", r->in.in_data);
ndr->depth++;
ndr_print_array_uint8(ndr, "in_data", r->in.in_data, r->in.len);
ndr->depth--;
ndr->depth--;
}
if (flags & NDR_OUT) {
ndr_print_struct(ndr, "out", "echo_EchoData");
ndr->depth++;
ndr_print_ptr(ndr, "out_data", r->out.out_data);
ndr->depth++;
ndr_print_array_uint8(ndr, "out_data", r->out.out_data, r->in.len);
ndr->depth--;
ndr->depth--;
}
ndr->depth--;
}
void ndr_print_echo_SinkData(struct ndr_print *ndr, const char *name, int flags, struct echo_SinkData *r)
{
ndr_print_struct(ndr, name, "echo_SinkData");
ndr->depth++;
if (flags & NDR_IN) {
ndr_print_struct(ndr, "in", "echo_SinkData");
ndr->depth++;
ndr_print_uint32(ndr, "len", r->in.len);
ndr_print_ptr(ndr, "data", r->in.data);
ndr->depth++;
ndr_print_array_uint8(ndr, "data", r->in.data, r->in.len);
ndr->depth--;
ndr->depth--;
}
if (flags & NDR_OUT) {
ndr_print_struct(ndr, "out", "echo_SinkData");
ndr->depth++;
ndr->depth--;
}
ndr->depth--;
}
void ndr_print_echo_SourceData(struct ndr_print *ndr, const char *name, int flags, struct echo_SourceData *r)
{
ndr_print_struct(ndr, name, "echo_SourceData");
ndr->depth++;
if (flags & NDR_IN) {
ndr_print_struct(ndr, "in", "echo_SourceData");
ndr->depth++;
ndr_print_uint32(ndr, "len", r->in.len);
ndr->depth--;
}
if (flags & NDR_OUT) {
ndr_print_struct(ndr, "out", "echo_SourceData");
ndr->depth++;
ndr_print_ptr(ndr, "data", r->out.data);
ndr->depth++;
ndr_print_array_uint8(ndr, "data", r->out.data, r->in.len);
ndr->depth--;
ndr->depth--;
}
ndr->depth--;
}
void ndr_print_TestCall(struct ndr_print *ndr, const char *name, int flags, struct TestCall *r)
{
ndr_print_struct(ndr, name, "TestCall");
ndr->depth++;
if (flags & NDR_IN) {
ndr_print_struct(ndr, "in", "TestCall");
ndr->depth++;
ndr_print_ptr(ndr, "s", r->in.s);
ndr->depth++;
if (r->in.s) {
ndr_print_unistr(ndr, "s", r->in.s);
}
ndr->depth--;
ndr->depth--;
}
if (flags & NDR_OUT) {
ndr_print_struct(ndr, "out", "TestCall");
ndr->depth++;
ndr->depth--;
}
ndr->depth--;
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -88,6 +88,10 @@ struct spoolss_PrinterInfo5 {
uint32 transmission_retry_timeout;
};
struct spoolss_PrinterInfo6 {
uint32 unknown;
};
struct spoolss_PrinterInfo7 {
const char * guid;
uint32 action;
@ -99,6 +103,7 @@ union spoolss_PrinterInfo {
/* [case(3)] */ struct spoolss_PrinterInfo3 info3;
/* [case(4)] */ struct spoolss_PrinterInfo4 info4;
/* [case(5)] */ struct spoolss_PrinterInfo5 info5;
/* [case(6)] */ struct spoolss_PrinterInfo6 info6;
/* [case(7)] */ struct spoolss_PrinterInfo7 info7;
};

View File

@ -36,7 +36,7 @@ static BOOL test_Exist(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx)
return False;
}
printf("exist=%d\n", exist);
NDR_PRINT_BOTH_DEBUG(dfs_Exist, &r);
return True;
}
@ -60,7 +60,7 @@ static BOOL test_InfoLevel(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, uint16 le
return False;
}
NDR_PRINT_UNION_DEBUG(dfs_Info, r.in.level, &r.out.info);
NDR_PRINT_BOTH_DEBUG(dfs_GetInfo, &r);
return True;
}
@ -106,9 +106,7 @@ static BOOL test_EnumLevel(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, uint16 le
return False;
}
printf("Received %d records\n", r.out.total?*r.out.total:-1);
NDR_PRINT_DEBUG(dfs_EnumStruct, r.out.info);
NDR_PRINT_BOTH_DEBUG(dfs_Enum, &r);
if (level == 1 && r.out.total) {
int i;

View File

@ -134,13 +134,7 @@ static BOOL test_LookupNames(struct dcerpc_pipe *p,
return False;
}
if (r.out.domains) {
NDR_PRINT_DEBUG(lsa_RefDomainList, r.out.domains);
}
printf("lookup gave %d sids (sids.count=%d)\n", count, sids.count);
NDR_PRINT_DEBUG(lsa_TransSidArray, r.out.sids);
NDR_PRINT_BOTH_DEBUG(lsa_LookupNames, &r);
printf("\n");
@ -177,11 +171,7 @@ static BOOL test_LookupSids(struct dcerpc_pipe *p,
return False;
}
if (r.out.domains) {
NDR_PRINT_DEBUG(lsa_RefDomainList, r.out.domains);
}
NDR_PRINT_DEBUG(lsa_TransNameArray, r.out.names);
NDR_PRINT_BOTH_DEBUG(lsa_LookupSids, &r);
printf("\n");
@ -209,7 +199,7 @@ static BOOL test_LookupPrivName(struct dcerpc_pipe *p,
return False;
}
NDR_PRINT_DEBUG(lsa_Name, r.out.name);
NDR_PRINT_BOTH_DEBUG(lsa_LookupPrivName, &r);
return True;
}
@ -232,12 +222,10 @@ static BOOL test_EnumPrivsAccount(struct dcerpc_pipe *p,
return False;
}
printf("received %d privileges\n",
r.out.privs?r.out.privs->count:0);
NDR_PRINT_BOTH_DEBUG(lsa_EnumPrivsAccount, &r);
if (r.out.privs) {
int i;
NDR_PRINT_DEBUG(lsa_PrivilegeSet, r.out.privs);
for (i=0;i<r.out.privs->count;i++) {
test_LookupPrivName(p, mem_ctx, handle,
&r.out.privs->set[i].luid);
@ -268,7 +256,7 @@ static BOOL test_EnumAccountRights(struct dcerpc_pipe *p,
return False;
}
NDR_PRINT_DEBUG(lsa_RightSet, r.out.rights);
NDR_PRINT_BOTH_DEBUG(lsa_EnumAccountRights, &r);
return True;
}
@ -293,7 +281,7 @@ static BOOL test_QuerySecObj(struct dcerpc_pipe *p,
return False;
}
NDR_PRINT_DEBUG(sec_desc_buf, r.out.sd);
NDR_PRINT_BOTH_DEBUG(lsa_QuerySecObj, &r);
return True;
}
@ -356,9 +344,7 @@ static BOOL test_EnumAccounts(struct dcerpc_pipe *p,
return False;
}
printf("Got %d sids resume_handle=%u\n", sids1.num_sids, resume_handle);
NDR_PRINT_DEBUG(lsa_SidArray, r.out.sids);
NDR_PRINT_BOTH_DEBUG(lsa_EnumAccounts, &r);
if (!test_LookupSids(p, mem_ctx, handle, &sids1)) {
return False;
@ -386,7 +372,7 @@ static BOOL test_EnumAccounts(struct dcerpc_pipe *p,
return False;
}
NDR_PRINT_DEBUG(lsa_SidArray, r.out.sids);
NDR_PRINT_BOTH_DEBUG(lsa_EnumAccounts, &r);
if (sids2.num_sids != 1) {
printf("Returned wrong number of entries (%d)\n", sids2.num_sids);
@ -421,9 +407,7 @@ static BOOL test_EnumPrivs(struct dcerpc_pipe *p,
return False;
}
printf("Got %d privs resume_handle=%u\n", privs1.count, resume_handle);
NDR_PRINT_DEBUG(lsa_PrivArray, r.out.privs);
NDR_PRINT_BOTH_DEBUG(lsa_EnumPrivs, &r);
return True;
}
@ -452,9 +436,7 @@ static BOOL test_EnumTrustDom(struct dcerpc_pipe *p,
return False;
}
printf("lookup gave %d domains\n", domains.count);
NDR_PRINT_DEBUG(lsa_DomainList, r.out.domains);
NDR_PRINT_BOTH_DEBUG(lsa_EnumTrustDom, &r);
return True;
}
@ -483,7 +465,7 @@ static BOOL test_QueryInfoPolicy(struct dcerpc_pipe *p,
continue;
}
NDR_PRINT_UNION_DEBUG(lsa_PolicyInformation, r.in.level, r.out.info);
NDR_PRINT_BOTH_DEBUG(lsa_QueryInfoPolicy, &r);
}
return ret;

View File

@ -30,12 +30,16 @@ static BOOL test_Close(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
r.in.handle = handle;
r.out.handle = handle;
NDR_PRINT_IN_DEBUG(samr_Close, &r);
status = dcerpc_samr_Close(p, mem_ctx, &r);
if (!NT_STATUS_IS_OK(status)) {
printf("Close handle failed - %s\n", nt_errstr(status));
return False;
}
NDR_PRINT_OUT_DEBUG(samr_Close, &r);
return True;
}
@ -63,7 +67,7 @@ static BOOL test_QueryAliasInfo(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
ret = False;
}
NDR_PRINT_UNION_DEBUG(samr_AliasInfo, r.in.level, r.out.info);
NDR_PRINT_BOTH_DEBUG(samr_QueryAliasInfo, &r);
}
return ret;
@ -91,7 +95,7 @@ static BOOL test_QueryGroupInfo(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
ret = False;
}
NDR_PRINT_UNION_DEBUG(samr_GroupInfo, r.in.level, r.out.info);
NDR_PRINT_BOTH_DEBUG(samr_QueryGroupInfo, &r);
}
return ret;
@ -120,7 +124,7 @@ static BOOL test_QueryUserInfo(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
ret = False;
}
NDR_PRINT_UNION_DEBUG(samr_UserInfo, r.in.level, r.out.info);
NDR_PRINT_BOTH_DEBUG(samr_QueryUserInfo, &r);
}
return ret;
@ -245,7 +249,7 @@ static BOOL test_EnumDomainUsers(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
return False;
}
NDR_PRINT_DEBUG(samr_SamArray, r.out.sam);
NDR_PRINT_BOTH_DEBUG(samr_EnumDomainUsers, &r);
if (!r.out.sam) {
return False;
@ -282,7 +286,7 @@ static BOOL test_EnumDomainGroups(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
return False;
}
NDR_PRINT_DEBUG(samr_SamArray, r.out.sam);
NDR_PRINT_BOTH_DEBUG(samr_EnumDomainGroups, &r);
if (!r.out.sam) {
return False;
@ -319,7 +323,7 @@ static BOOL test_EnumDomainAliases(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
return False;
}
NDR_PRINT_DEBUG(samr_SamArray, r.out.sam);
NDR_PRINT_BOTH_DEBUG(samr_EnumDomainAliases, &r);
if (!r.out.sam) {
return False;
@ -357,7 +361,7 @@ static BOOL test_QueryDomainInfo(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
continue;
}
NDR_PRINT_UNION_DEBUG(samr_DomainInfo, r.in.level, r.out.info);
NDR_PRINT_BOTH_DEBUG(samr_QueryDomainInfo, &r);
}
return True;
@ -424,7 +428,7 @@ static BOOL test_LookupDomain(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
return False;
}
NDR_PRINT_DEBUG(dom_sid2, r.out.sid);
NDR_PRINT_BOTH_DEBUG(samr_LookupDomain, &r);
if (!test_OpenDomain(p, mem_ctx, handle, r.out.sid)) {
return False;
@ -456,7 +460,7 @@ static BOOL test_EnumDomains(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
return False;
}
NDR_PRINT_DEBUG(samr_SamArray, r.out.sam);
NDR_PRINT_BOTH_DEBUG(samr_EnumDomains, &r);
if (!r.out.sam) {
return False;

View File

@ -62,7 +62,7 @@ BOOL test_GetPrinter(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
continue;
}
NDR_PRINT_UNION_DEBUG(spoolss_PrinterInfo, r.in.level, r.out.info);
NDR_PRINT_FUNCTION_DEBUG(spoolss_GetPrinter, NDR_BOTH, &r);
}
return ret;