}
}
+#####################################################################
+# print an array
+sub ParseArrayPrint($$)
+{
+ my $e = shift;
+ my $var_prefix = shift;
+ my $size = find_size_var($e, util::array_size($e));
+
+ if (util::is_scalar_type($e->{TYPE})) {
+ $res .= "\t\tndr_print_array_$e->{TYPE}(ndr, \"$e->{NAME}\", $var_prefix$e->{NAME}, $size);\n";
+ } else {
+ $res .= "\t\tndr_print_array(ndr, \"$e->{NAME}\", $var_prefix$e->{NAME}, sizeof($var_prefix$e->{NAME}\[0]), $size, (ndr_print_fn_t)ndr_print_$e->{TYPE});\n";
+ }
+}
+
#####################################################################
# parse an array - pull side
sub ParseArrayPull($$)
}
}
+#####################################################################
+# print scalars in a structure element
+sub ParseElementPrintScalar($$)
+{
+ my($e) = shift;
+ my($var_prefix) = shift;
+ my $cprefix = util::c_push_prefix($e);
+
+ if (util::has_property($e, "struct_len")) {
+ return;
+ }
+
+ if (defined $e->{VALUE}) {
+ $res .= "\tndr_print_$e->{TYPE}(ndr, \"$e->{NAME}\", $e->{VALUE});\n";
+ } elsif (util::need_wire_pointer($e)) {
+ $res .= "\tndr_print_ptr(ndr, \"$e->{NAME}\", $var_prefix$e->{NAME});\n";
+ $res .= "\tndr->depth++;\n";
+ ParseElementPrintBuffer($e, "r->");
+ $res .= "\tndr->depth--;\n";
+ } else {
+ $res .= "\tndr_print_$e->{TYPE}(ndr, \"$e->{NAME}\", $cprefix$var_prefix$e->{NAME});\n";
+ }
+}
+
#####################################################################
# parse scalars in a structure element - pull size
sub ParseElementPullSwitch($$$$)
}
}
+#####################################################################
+# print buffers in a structure element
+sub ParseElementPrintBuffer($$)
+{
+ my($e) = shift;
+ my($var_prefix) = shift;
+ my $cprefix = util::c_push_prefix($e);
+
+ if (util::is_pure_scalar($e)) {
+ return;
+ }
+
+ if (util::need_wire_pointer($e)) {
+ $res .= "\tif ($var_prefix$e->{NAME}) {\n";
+ }
+
+ if (util::array_size($e)) {
+ ParseArrayPrint($e, "r->");
+ } else {
+ $res .= "\t\tndr_print_$e->{TYPE}(ndr, \"$e->{NAME}\", $cprefix$var_prefix$e->{NAME});\n";
+ }
+
+ if (util::need_wire_pointer($e)) {
+ $res .= "\t}\n";
+ }
+}
+
#####################################################################
# parse buffers in a structure element - pull side
$res .= "done:\n";
}
+#####################################################################
+# generate a struct print function
+sub ParseStructPrint($)
+{
+ my($struct) = shift;
+
+ $res .= "\tndr_print_struct(ndr, name);\n";
+
+ if (! defined $struct->{ELEMENTS}) {
+ return;
+ }
+
+ $res .= "\tndr->depth++;\n";
+ foreach my $e (@{$struct->{ELEMENTS}}) {
+ ParseElementPrintScalar($e, "r->");
+ }
+ $res .= "\tndr->depth--;\n";
+}
+
#####################################################################
# parse a struct - pull side
sub ParseStructPull($)
print "WARNING! union push not done\n";
}
+#####################################################################
+# print a union
+sub ParseUnionPrint($)
+{
+ my $e = shift;
+ print "WARNING! union print not done\n";
+}
+
#####################################################################
# parse a union - pull side
sub ParseUnionPull($)
}
}
+#####################################################################
+# generate a print function for a type
+sub ParseTypePrint($)
+{
+ my($data) = shift;
+
+ if (ref($data) eq "HASH") {
+ ($data->{TYPE} eq "STRUCT") &&
+ ParseStructPrint($data);
+ ($data->{TYPE} eq "UNION") &&
+ ParseUnionPrint($data);
+ }
+}
+
#####################################################################
# parse a type
sub ParseTypePull($)
}
+#####################################################################
+# parse a typedef - push side
+sub ParseTypedefPrint($)
+{
+ my($e) = shift;
+
+ if ($e->{DATA}->{TYPE} eq "STRUCT") {
+ $res .= "void ndr_print_$e->{NAME}(struct ndr_print *ndr, const char *name, struct $e->{NAME} *r)";
+ $res .= "\n{\n";
+ ParseTypePrint($e->{DATA});
+ $res .= "}\n\n";
+ }
+
+ if ($e->{DATA}->{TYPE} eq "UNION") {
+ $res .= "void ndr_print_$e->{NAME}(struct ndr_print *ndr, const char *name, uint16 level, union $e->{NAME} *r)";
+ $res .= "\n{\n";
+ ParseTypePrint($e->{DATA});
+ $res .= "}\n\n";
+ }
+}
#####################################################################
my($e) = shift;
ParseTypedefPush($e);
ParseTypedefPull($e);
+ ParseTypedefPrint($e);
}
#####################################################################
return NT_STATUS_OK;
}
+void ndr_print_lsa_Name(struct ndr_print *ndr, const char *name, struct lsa_Name *r)
+{
+ ndr_print_struct(ndr, name);
+ ndr->depth++;
+ ndr_print_uint16(ndr, "name_len", r->name_len);
+ ndr_print_uint16(ndr, "name_size", r->name_size);
+ ndr_print_ptr(ndr, "name", r->name);
+ ndr->depth++;
+ if (r->name) {
+ ndr_print_unistr_noterm(ndr, "name", r->name);
+ }
+ ndr->depth--;
+ ndr->depth--;
+}
+
static NTSTATUS ndr_pull_lsa_PrivEntry(struct ndr_pull *ndr, int ndr_flags, struct lsa_PrivEntry *r)
{
if (!(ndr_flags & NDR_SCALARS)) goto buffers;
return NT_STATUS_OK;
}
+void ndr_print_lsa_PrivEntry(struct ndr_print *ndr, const char *name, struct lsa_PrivEntry *r)
+{
+ ndr_print_struct(ndr, name);
+ ndr->depth++;
+ ndr_print_lsa_Name(ndr, "name", &r->name);
+ ndr_print_uint32(ndr, "luid_low", r->luid_low);
+ ndr_print_uint32(ndr, "luid_high", r->luid_high);
+ ndr->depth--;
+}
+
static NTSTATUS ndr_pull_lsa_PrivArray(struct ndr_pull *ndr, int ndr_flags, struct lsa_PrivArray *r)
{
uint32 _ptr_privs;
return NT_STATUS_OK;
}
+void ndr_print_lsa_PrivArray(struct ndr_print *ndr, const char *name, struct lsa_PrivArray *r)
+{
+ ndr_print_struct(ndr, name);
+ ndr->depth++;
+ ndr_print_uint32(ndr, "count", r->count);
+ ndr_print_ptr(ndr, "privs", r->privs);
+ ndr->depth++;
+ if (r->privs) {
+ ndr_print_array(ndr, "privs", r->privs, sizeof(r->privs[0]), r->count, (ndr_print_fn_t)ndr_print_lsa_PrivEntry);
+ }
+ ndr->depth--;
+ ndr->depth--;
+}
+
NTSTATUS ndr_push_lsa_EnumPrivs(struct ndr_push *ndr, struct lsa_EnumPrivs *r)
{
NDR_CHECK(ndr_push_policy_handle(ndr, r->in.handle));
return NT_STATUS_OK;
}
+void ndr_print_lsa_QosInfo(struct ndr_print *ndr, const char *name, struct lsa_QosInfo *r)
+{
+ ndr_print_struct(ndr, name);
+ ndr->depth++;
+ ndr_print_uint16(ndr, "impersonation_level", r->impersonation_level);
+ ndr_print_uint8(ndr, "context_mode", r->context_mode);
+ ndr_print_uint8(ndr, "effective_only", r->effective_only);
+ ndr->depth--;
+}
+
static NTSTATUS ndr_push_lsa_ObjectAttribute(struct ndr_push *ndr, int ndr_flags, struct lsa_ObjectAttribute *r)
{
struct ndr_push_save _save1, _save2, _save3;
return NT_STATUS_OK;
}
+void ndr_print_lsa_ObjectAttribute(struct ndr_print *ndr, const char *name, struct lsa_ObjectAttribute *r)
+{
+ ndr_print_struct(ndr, name);
+ ndr->depth++;
+ ndr_print_ptr(ndr, "root_dir", r->root_dir);
+ ndr->depth++;
+ if (r->root_dir) {
+ ndr_print_uint8(ndr, "root_dir", *r->root_dir);
+ }
+ ndr->depth--;
+ ndr_print_ptr(ndr, "object_name", r->object_name);
+ ndr->depth++;
+ if (r->object_name) {
+ ndr_print_unistr(ndr, "object_name", r->object_name);
+ }
+ ndr->depth--;
+ ndr_print_uint32(ndr, "attributes", r->attributes);
+ ndr_print_ptr(ndr, "sec_desc", r->sec_desc);
+ ndr->depth++;
+ if (r->sec_desc) {
+ ndr_print_security_descriptor(ndr, "sec_desc", r->sec_desc);
+ }
+ ndr->depth--;
+ ndr_print_ptr(ndr, "sec_qos", r->sec_qos);
+ ndr->depth++;
+ if (r->sec_qos) {
+ ndr_print_lsa_QosInfo(ndr, "sec_qos", r->sec_qos);
+ }
+ ndr->depth--;
+ ndr->depth--;
+}
+
NTSTATUS ndr_push_lsa_OpenPolicy(struct ndr_push *ndr, struct lsa_OpenPolicy *r)
{
NDR_CHECK(ndr_push_ptr(ndr, r->in.system_name));
return NT_STATUS_OK;
}
+void ndr_print_lsa_AuditLogInfo(struct ndr_print *ndr, const char *name, struct lsa_AuditLogInfo *r)
+{
+ ndr_print_struct(ndr, name);
+ ndr->depth++;
+ ndr_print_uint32(ndr, "percent_full", r->percent_full);
+ ndr_print_uint32(ndr, "log_size", r->log_size);
+ ndr_print_NTTIME(ndr, "retention_time", r->retention_time);
+ ndr_print_uint8(ndr, "shutdown_in_progress", r->shutdown_in_progress);
+ ndr_print_NTTIME(ndr, "time_to_shutdown", r->time_to_shutdown);
+ ndr_print_uint32(ndr, "next_audit_record", r->next_audit_record);
+ ndr_print_uint32(ndr, "unknown", r->unknown);
+ ndr->depth--;
+}
+
static NTSTATUS ndr_pull_lsa_AuditEventsInfo(struct ndr_pull *ndr, int ndr_flags, struct lsa_AuditEventsInfo *r)
{
if (!(ndr_flags & NDR_SCALARS)) goto buffers;
return NT_STATUS_OK;
}
+void ndr_print_lsa_AuditEventsInfo(struct ndr_print *ndr, const char *name, struct lsa_AuditEventsInfo *r)
+{
+ ndr_print_struct(ndr, name);
+ ndr->depth++;
+ ndr_print_uint32(ndr, "auditing_mode", r->auditing_mode);
+ ndr->depth--;
+}
+
static NTSTATUS ndr_pull_lsa_PolicyInformation(struct ndr_pull *ndr, int ndr_flags, uint16 *level, union lsa_PolicyInformation *r)
{
NDR_CHECK(ndr_pull_uint16(ndr, level));
return NT_STATUS_OK;
}
+void ndr_print_lsa_PolicyInformation(struct ndr_print *ndr, const char *name, uint16 level, union lsa_PolicyInformation *r)
+{
+}
+
NTSTATUS ndr_push_lsa_QueryInfoPolicy(struct ndr_push *ndr, struct lsa_QueryInfoPolicy *r)
{
NDR_CHECK(ndr_push_policy_handle(ndr, r->in.handle));
return NT_STATUS_OK;
}
+void ndr_print_lsa_SidPtr(struct ndr_print *ndr, const char *name, struct lsa_SidPtr *r)
+{
+ ndr_print_struct(ndr, name);
+ ndr->depth++;
+ ndr_print_ptr(ndr, "sid", r->sid);
+ ndr->depth++;
+ if (r->sid) {
+ ndr_print_dom_sid2(ndr, "sid", r->sid);
+ }
+ ndr->depth--;
+ ndr->depth--;
+}
+
static NTSTATUS ndr_push_lsa_SidArray(struct ndr_push *ndr, int ndr_flags, struct lsa_SidArray *r)
{
if (!(ndr_flags & NDR_SCALARS)) goto buffers;
return NT_STATUS_OK;
}
+void ndr_print_lsa_SidArray(struct ndr_print *ndr, const char *name, struct lsa_SidArray *r)
+{
+ ndr_print_struct(ndr, name);
+ ndr->depth++;
+ ndr_print_uint32(ndr, "num_sids", r->num_sids);
+ ndr_print_ptr(ndr, "sids", r->sids);
+ ndr->depth++;
+ if (r->sids) {
+ ndr_print_array(ndr, "sids", r->sids, sizeof(r->sids[0]), r->num_sids, (ndr_print_fn_t)ndr_print_lsa_SidPtr);
+ }
+ ndr->depth--;
+ ndr->depth--;
+}
+
NTSTATUS ndr_push_lsa_EnumAccounts(struct ndr_push *ndr, struct lsa_EnumAccounts *r)
{
NDR_CHECK(ndr_push_policy_handle(ndr, r->in.handle));
return NT_STATUS_OK;
}
+void ndr_print_lsa_DomainInformation(struct ndr_print *ndr, const char *name, struct lsa_DomainInformation *r)
+{
+ ndr_print_struct(ndr, name);
+ ndr->depth++;
+ ndr_print_lsa_Name(ndr, "name", &r->name);
+ ndr_print_ptr(ndr, "sid", r->sid);
+ ndr->depth++;
+ if (r->sid) {
+ ndr_print_dom_sid2(ndr, "sid", r->sid);
+ }
+ ndr->depth--;
+ ndr->depth--;
+}
+
static NTSTATUS ndr_pull_lsa_DomainList(struct ndr_pull *ndr, int ndr_flags, struct lsa_DomainList *r)
{
uint32 _ptr_domains;
return NT_STATUS_OK;
}
+void ndr_print_lsa_DomainList(struct ndr_print *ndr, const char *name, struct lsa_DomainList *r)
+{
+ ndr_print_struct(ndr, name);
+ ndr->depth++;
+ ndr_print_uint32(ndr, "count", r->count);
+ ndr_print_ptr(ndr, "domains", r->domains);
+ ndr->depth++;
+ if (r->domains) {
+ ndr_print_array(ndr, "domains", r->domains, sizeof(r->domains[0]), r->count, (ndr_print_fn_t)ndr_print_lsa_DomainInformation);
+ }
+ ndr->depth--;
+ ndr->depth--;
+}
+
NTSTATUS ndr_push_lsa_EnumTrustDom(struct ndr_push *ndr, struct lsa_EnumTrustDom *r)
{
NDR_CHECK(ndr_push_policy_handle(ndr, r->in.handle));
return NT_STATUS_OK;
}
+void ndr_print_lsa_TranslatedSid(struct ndr_print *ndr, const char *name, struct lsa_TranslatedSid *r)
+{
+ ndr_print_struct(ndr, name);
+ ndr->depth++;
+ ndr_print_uint16(ndr, "sid_type", r->sid_type);
+ ndr_print_uint32(ndr, "rid", r->rid);
+ ndr_print_uint32(ndr, "sid_index", r->sid_index);
+ ndr->depth--;
+}
+
static NTSTATUS ndr_push_lsa_TransSidArray(struct ndr_push *ndr, int ndr_flags, struct lsa_TransSidArray *r)
{
if (!(ndr_flags & NDR_SCALARS)) goto buffers;
return NT_STATUS_OK;
}
+void ndr_print_lsa_TransSidArray(struct ndr_print *ndr, const char *name, struct lsa_TransSidArray *r)
+{
+ ndr_print_struct(ndr, name);
+ ndr->depth++;
+ ndr_print_uint32(ndr, "count", r->count);
+ ndr_print_ptr(ndr, "sids", r->sids);
+ ndr->depth++;
+ if (r->sids) {
+ ndr_print_array(ndr, "sids", r->sids, sizeof(r->sids[0]), r->count, (ndr_print_fn_t)ndr_print_lsa_TranslatedSid);
+ }
+ ndr->depth--;
+ ndr->depth--;
+}
+
static NTSTATUS ndr_pull_lsa_TrustInformation(struct ndr_pull *ndr, int ndr_flags, struct lsa_TrustInformation *r)
{
uint32 _ptr_sid;
return NT_STATUS_OK;
}
+void ndr_print_lsa_TrustInformation(struct ndr_print *ndr, const char *name, struct lsa_TrustInformation *r)
+{
+ ndr_print_struct(ndr, name);
+ ndr->depth++;
+ ndr_print_lsa_Name(ndr, "name", &r->name);
+ ndr_print_ptr(ndr, "sid", r->sid);
+ ndr->depth++;
+ if (r->sid) {
+ ndr_print_dom_sid2(ndr, "sid", r->sid);
+ }
+ ndr->depth--;
+ ndr->depth--;
+}
+
static NTSTATUS ndr_pull_lsa_RefDomainList(struct ndr_pull *ndr, int ndr_flags, struct lsa_RefDomainList *r)
{
uint32 _ptr_domains;
return NT_STATUS_OK;
}
+void ndr_print_lsa_RefDomainList(struct ndr_print *ndr, const char *name, struct lsa_RefDomainList *r)
+{
+ ndr_print_struct(ndr, name);
+ ndr->depth++;
+ ndr_print_uint32(ndr, "count", r->count);
+ ndr_print_ptr(ndr, "domains", r->domains);
+ ndr->depth++;
+ if (r->domains) {
+ ndr_print_array(ndr, "domains", r->domains, sizeof(r->domains[0]), r->count, (ndr_print_fn_t)ndr_print_lsa_TrustInformation);
+ }
+ ndr->depth--;
+ ndr_print_uint32(ndr, "max_count", r->max_count);
+ ndr->depth--;
+}
+
NTSTATUS ndr_push_lsa_LookupNames(struct ndr_push *ndr, struct lsa_LookupNames *r)
{
NDR_CHECK(ndr_push_policy_handle(ndr, r->in.handle));
return NT_STATUS_OK;
}
+void ndr_print_lsa_TranslatedName(struct ndr_print *ndr, const char *name, struct lsa_TranslatedName *r)
+{
+ ndr_print_struct(ndr, name);
+ ndr->depth++;
+ ndr_print_uint16(ndr, "sid_type", r->sid_type);
+ ndr_print_lsa_Name(ndr, "name", &r->name);
+ ndr_print_uint32(ndr, "sid_index", r->sid_index);
+ ndr->depth--;
+}
+
static NTSTATUS ndr_push_lsa_TransNameArray(struct ndr_push *ndr, int ndr_flags, struct lsa_TransNameArray *r)
{
if (!(ndr_flags & NDR_SCALARS)) goto buffers;
return NT_STATUS_OK;
}
+void ndr_print_lsa_TransNameArray(struct ndr_print *ndr, const char *name, struct lsa_TransNameArray *r)
+{
+ ndr_print_struct(ndr, name);
+ ndr->depth++;
+ ndr_print_uint32(ndr, "count", r->count);
+ ndr_print_ptr(ndr, "names", r->names);
+ ndr->depth++;
+ if (r->names) {
+ ndr_print_array(ndr, "names", r->names, sizeof(r->names[0]), r->count, (ndr_print_fn_t)ndr_print_lsa_TranslatedName);
+ }
+ ndr->depth--;
+ ndr->depth--;
+}
+
NTSTATUS ndr_push_lsa_LookupSids(struct ndr_push *ndr, struct lsa_LookupSids *r)
{
NDR_CHECK(ndr_push_policy_handle(ndr, r->in.handle));
return NT_STATUS_OK;
}
+void ndr_print_lsa_LUID(struct ndr_print *ndr, const char *name, struct lsa_LUID *r)
+{
+ ndr_print_struct(ndr, name);
+ ndr->depth++;
+ ndr_print_uint32(ndr, "low", r->low);
+ ndr_print_uint32(ndr, "high", r->high);
+ ndr->depth--;
+}
+
static NTSTATUS ndr_pull_lsa_LUIDAttribute(struct ndr_pull *ndr, int ndr_flags, struct lsa_LUIDAttribute *r)
{
if (!(ndr_flags & NDR_SCALARS)) goto buffers;
return NT_STATUS_OK;
}
+void ndr_print_lsa_LUIDAttribute(struct ndr_print *ndr, const char *name, struct lsa_LUIDAttribute *r)
+{
+ ndr_print_struct(ndr, name);
+ ndr->depth++;
+ ndr_print_lsa_LUID(ndr, "luid", &r->luid);
+ ndr_print_uint32(ndr, "attribute", r->attribute);
+ ndr->depth--;
+}
+
static NTSTATUS ndr_pull_lsa_PrivilegeSet(struct ndr_pull *ndr, int ndr_flags, struct lsa_PrivilegeSet *r)
{
if (!(ndr_flags & NDR_SCALARS)) goto buffers;
return NT_STATUS_OK;
}
+void ndr_print_lsa_PrivilegeSet(struct ndr_print *ndr, const char *name, struct lsa_PrivilegeSet *r)
+{
+ ndr_print_struct(ndr, name);
+ ndr->depth++;
+ ndr_print_uint32(ndr, "count", r->count);
+ ndr_print_lsa_LUIDAttribute(ndr, "set", r->set);
+ ndr->depth--;
+}
+
NTSTATUS ndr_push_lsa_EnumPrivsAccount(struct ndr_push *ndr, struct lsa_EnumPrivsAccount *r)
{
NDR_CHECK(ndr_push_policy_handle(ndr, r->in.handle));
return NT_STATUS_OK;
}
+void ndr_print_lsa_RightAttribute(struct ndr_print *ndr, const char *name, struct lsa_RightAttribute *r)
+{
+ ndr_print_struct(ndr, name);
+ ndr->depth++;
+ ndr_print_ptr(ndr, "name", r->name);
+ ndr->depth++;
+ if (r->name) {
+ ndr_print_unistr(ndr, "name", r->name);
+ }
+ ndr->depth--;
+ ndr->depth--;
+}
+
static NTSTATUS ndr_pull_lsa_RightSet(struct ndr_pull *ndr, int ndr_flags, struct lsa_RightSet *r)
{
uint32 _ptr_names;
return NT_STATUS_OK;
}
+void ndr_print_lsa_RightSet(struct ndr_print *ndr, const char *name, struct lsa_RightSet *r)
+{
+ ndr_print_struct(ndr, name);
+ ndr->depth++;
+ ndr_print_uint32(ndr, "count", r->count);
+ ndr_print_ptr(ndr, "names", r->names);
+ ndr->depth++;
+ if (r->names) {
+ ndr_print_array(ndr, "names", r->names, sizeof(r->names[0]), r->count, (ndr_print_fn_t)ndr_print_lsa_Name);
+ }
+ ndr->depth--;
+ ndr->depth--;
+}
+
NTSTATUS ndr_push_lsa_EnumAccountRights(struct ndr_push *ndr, struct lsa_EnumAccountRights *r)
{
NDR_CHECK(ndr_push_policy_handle(ndr, r->in.handle));
#include "includes.h"
+
/*
these really shouldn't be here ....
*/
}
if (r.out.domains) {
- printf("lookup gave %d domains (max_count=%d)\n",
- r.out.domains->count,
- r.out.domains->max_count);
- for (i=0;i<r.out.domains->count;i++) {
- printf("name='%s' sid=%s\n",
- r.out.domains->domains[i].name.name,
- lsa_sid_string_talloc(mem_ctx, r.out.domains->domains[i].sid));
- }
+ NDR_PRINT_DEBUG(lsa_RefDomainList, r.out.domains);
}
printf("lookup gave %d sids (sids.count=%d)\n", count, sids.count);
- for (i=0;i<sids.count;i++) {
- printf("sid_type=%d rid=%d sid_index=%d\n",
- sids.sids[i].sid_type,
- sids.sids[i].rid,
- sids.sids[i].sid_index);
- }
+
+ NDR_PRINT_DEBUG(lsa_TransSidArray, r.out.sids);
printf("\n");
}
if (r.out.domains) {
- printf("lookup gave %d domains (max_count=%d)\n",
- r.out.domains->count,
- r.out.domains->max_count);
- for (i=0;i<r.out.domains->count;i++) {
- printf("name='%s' sid=%s\n",
- r.out.domains->domains[i].name.name,
- lsa_sid_string_talloc(mem_ctx, r.out.domains->domains[i].sid));
- }
+ NDR_PRINT_DEBUG(lsa_RefDomainList, r.out.domains);
}
- printf("lookup gave %d names (names.count=%d)\n", count, names.count);
- for (i=0;i<names.count;i++) {
- printf("type=%d sid_index=%d name='%s'\n",
- names.names[i].sid_type,
- names.names[i].sid_index,
- names.names[i].name.name);
- }
+ NDR_PRINT_DEBUG(lsa_TransNameArray, r.out.names);
printf("\n");
return False;
}
- printf(" '%s'\n", r.out.name->name);
+ NDR_PRINT_DEBUG(lsa_Name, r.out.name);
return True;
}
r.out.privs?r.out.privs->count:0, r.out.unknown);
if (r.out.privs) {
- struct lsa_PrivilegeSet *privs = r.out.privs;
int i;
- for (i=0;i<privs->count;i++) {
- printf("luid=%08x-%08x attribute=0x%08x ",
- privs->set[i].luid.low,
- privs->set[i].luid.high,
- privs->set[i].attribute);
+ NDR_PRINT_DEBUG(lsa_PrivilegeSet, r.out.privs);
+ for (i=0;i<r.out.privs->count;i++) {
test_LookupPrivName(p, mem_ctx, handle,
- &privs->set[i].luid);
+ &r.out.privs->set[i].luid);
}
}
return False;
}
- printf("received %d rights\n", rights.count);
- for (i=0;i<rights.count;i++) {
- printf("\t'%s'\n", rights.names[i].name);
- }
+ NDR_PRINT_DEBUG(lsa_RightSet, r.out.rights);
return True;
}
printf("Got %d sids resume_handle=%u\n", sids1.num_sids, resume_handle);
- for (i=0;i<sids1.num_sids;i++) {
- printf("%s\n", lsa_sid_string_talloc(mem_ctx, sids1.sids[i].sid));
- }
+ NDR_PRINT_DEBUG(lsa_SidArray, r.out.sids);
if (!test_LookupSids(p, mem_ctx, handle, &sids1)) {
return False;
return False;
}
+ NDR_PRINT_DEBUG(lsa_SidArray, r.out.sids);
+
if (sids2.num_sids != 1) {
printf("Returned wrong number of entries (%d)\n", sids2.num_sids);
return False;
printf("Got %d privs resume_handle=%u\n", privs1.count, resume_handle);
- for (i=0;i<privs1.count;i++) {
- printf("luid=%08x-%08x '%s'\n",
- privs1.privs[i].luid_low,
- privs1.privs[i].luid_high,
- privs1.privs[i].name.name);
- }
+ NDR_PRINT_DEBUG(lsa_PrivArray, r.out.privs);
return True;
}
}
printf("lookup gave %d domains\n", domains.count);
- for (i=0;i<r.out.domains->count;i++) {
- printf("name='%s' sid=%s\n",
- domains.domains[i].name.name,
- lsa_sid_string_talloc(mem_ctx, domains.domains[i].sid));
- }
+
+ NDR_PRINT_DEBUG(lsa_DomainList, r.out.domains);
return True;
}
return False;
}
- {
- struct lsa_AuditLogInfo *u = &r.out.info->audit_log;
- printf("percent_full=%d log_size=%d retention_time=%s\n",
- u->percent_full, u->log_size,
- nt_time_string(mem_ctx, &u->retention_time));
- printf("shutdown_in_progress=%d time_to_shutdown=%s next_audit_record=%d unknown=0x%x\n",
- u->shutdown_in_progress, nt_time_string(mem_ctx, &u->time_to_shutdown),
- u->next_audit_record, u->unknown);
- }
+ NDR_PRINT_DEBUG(lsa_AuditLogInfo, &r.out.info->audit_log);
return True;
}