diff options
Diffstat (limited to 'source3/librpc')
-rw-r--r-- | source3/librpc/gen_ndr/cli_samr.c | 3030 | ||||
-rw-r--r-- | source3/librpc/gen_ndr/cli_samr.h | 389 | ||||
-rw-r--r-- | source3/librpc/gen_ndr/ndr_samr.c | 12290 | ||||
-rw-r--r-- | source3/librpc/gen_ndr/ndr_samr.h | 340 | ||||
-rw-r--r-- | source3/librpc/gen_ndr/samr.h | 1754 | ||||
-rw-r--r-- | source3/librpc/gen_ndr/srv_samr.c | 5482 | ||||
-rw-r--r-- | source3/librpc/gen_ndr/srv_samr.h | 74 |
7 files changed, 23359 insertions, 0 deletions
diff --git a/source3/librpc/gen_ndr/cli_samr.c b/source3/librpc/gen_ndr/cli_samr.c new file mode 100644 index 0000000000..99e7e45b02 --- /dev/null +++ b/source3/librpc/gen_ndr/cli_samr.c @@ -0,0 +1,3030 @@ +/* + * Unix SMB/CIFS implementation. + * client auto-generated by pidl. DO NOT MODIFY! + */ + +#include "includes.h" +#include "librpc/gen_ndr/cli_samr.h" + +NTSTATUS rpccli_samr_Connect(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + uint16_t *system_name, + uint32_t access_mask, + struct policy_handle *connect_handle) +{ + struct samr_Connect r; + NTSTATUS status; + + /* In parameters */ + r.in.system_name = system_name; + r.in.access_mask = access_mask; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_Connect, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + PI_SAMR, + &ndr_table_samr, + NDR_SAMR_CONNECT, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_Connect, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *connect_handle = *r.out.connect_handle; + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_samr_Close(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle) +{ + struct samr_Close r; + NTSTATUS status; + + /* In parameters */ + r.in.handle = handle; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_Close, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + PI_SAMR, + &ndr_table_samr, + NDR_SAMR_CLOSE, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_Close, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *handle = *r.out.handle; + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_samr_SetSecurity(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle, + uint32_t sec_info, + struct sec_desc_buf *sdbuf) +{ + struct samr_SetSecurity r; + NTSTATUS status; + + /* In parameters */ + r.in.handle = handle; + r.in.sec_info = sec_info; + r.in.sdbuf = sdbuf; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_SetSecurity, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + PI_SAMR, + &ndr_table_samr, + NDR_SAMR_SETSECURITY, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_SetSecurity, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_samr_QuerySecurity(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle, + uint32_t sec_info, + struct sec_desc_buf *sdbuf) +{ + struct samr_QuerySecurity r; + NTSTATUS status; + + /* In parameters */ + r.in.handle = handle; + r.in.sec_info = sec_info; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_QuerySecurity, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + PI_SAMR, + &ndr_table_samr, + NDR_SAMR_QUERYSECURITY, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_QuerySecurity, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *sdbuf = *r.out.sdbuf; + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_samr_Shutdown(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *connect_handle) +{ + struct samr_Shutdown r; + NTSTATUS status; + + /* In parameters */ + r.in.connect_handle = connect_handle; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_Shutdown, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + PI_SAMR, + &ndr_table_samr, + NDR_SAMR_SHUTDOWN, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_Shutdown, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_samr_LookupDomain(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *connect_handle, + struct lsa_String *domain_name, + struct dom_sid2 *sid) +{ + struct samr_LookupDomain r; + NTSTATUS status; + + /* In parameters */ + r.in.connect_handle = connect_handle; + r.in.domain_name = domain_name; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_LookupDomain, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + PI_SAMR, + &ndr_table_samr, + NDR_SAMR_LOOKUPDOMAIN, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_LookupDomain, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *sid = *r.out.sid; + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_samr_EnumDomains(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *connect_handle, + uint32_t *resume_handle, + uint32_t buf_size, + struct samr_SamArray *sam, + uint32_t *num_entries) +{ + struct samr_EnumDomains r; + NTSTATUS status; + + /* In parameters */ + r.in.connect_handle = connect_handle; + r.in.resume_handle = resume_handle; + r.in.buf_size = buf_size; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_EnumDomains, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + PI_SAMR, + &ndr_table_samr, + NDR_SAMR_ENUMDOMAINS, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_EnumDomains, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *resume_handle = *r.out.resume_handle; + *sam = *r.out.sam; + *num_entries = *r.out.num_entries; + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_samr_OpenDomain(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *connect_handle, + uint32_t access_mask, + struct dom_sid2 *sid, + struct policy_handle *domain_handle) +{ + struct samr_OpenDomain r; + NTSTATUS status; + + /* In parameters */ + r.in.connect_handle = connect_handle; + r.in.access_mask = access_mask; + r.in.sid = sid; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_OpenDomain, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + PI_SAMR, + &ndr_table_samr, + NDR_SAMR_OPENDOMAIN, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_OpenDomain, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *domain_handle = *r.out.domain_handle; + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_samr_QueryDomainInfo(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *domain_handle, + uint16_t level, + union samr_DomainInfo *info) +{ + struct samr_QueryDomainInfo r; + NTSTATUS status; + + /* In parameters */ + r.in.domain_handle = domain_handle; + r.in.level = level; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_QueryDomainInfo, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + PI_SAMR, + &ndr_table_samr, + NDR_SAMR_QUERYDOMAININFO, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_QueryDomainInfo, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *info = *r.out.info; + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_samr_SetDomainInfo(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *domain_handle, + uint16_t level, + union samr_DomainInfo *info) +{ + struct samr_SetDomainInfo r; + NTSTATUS status; + + /* In parameters */ + r.in.domain_handle = domain_handle; + r.in.level = level; + r.in.info = info; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_SetDomainInfo, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + PI_SAMR, + &ndr_table_samr, + NDR_SAMR_SETDOMAININFO, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_SetDomainInfo, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_samr_CreateDomainGroup(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *domain_handle, + struct lsa_String *name, + uint32_t access_mask, + struct policy_handle *group_handle, + uint32_t *rid) +{ + struct samr_CreateDomainGroup r; + NTSTATUS status; + + /* In parameters */ + r.in.domain_handle = domain_handle; + r.in.name = name; + r.in.access_mask = access_mask; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_CreateDomainGroup, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + PI_SAMR, + &ndr_table_samr, + NDR_SAMR_CREATEDOMAINGROUP, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_CreateDomainGroup, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *group_handle = *r.out.group_handle; + *rid = *r.out.rid; + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_samr_EnumDomainGroups(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *domain_handle, + uint32_t *resume_handle, + uint32_t max_size, + struct samr_SamArray *sam, + uint32_t *num_entries) +{ + struct samr_EnumDomainGroups r; + NTSTATUS status; + + /* In parameters */ + r.in.domain_handle = domain_handle; + r.in.resume_handle = resume_handle; + r.in.max_size = max_size; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_EnumDomainGroups, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + PI_SAMR, + &ndr_table_samr, + NDR_SAMR_ENUMDOMAINGROUPS, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_EnumDomainGroups, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *resume_handle = *r.out.resume_handle; + *sam = *r.out.sam; + *num_entries = *r.out.num_entries; + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_samr_CreateUser(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *domain_handle, + struct lsa_String *account_name, + uint32_t access_mask, + struct policy_handle *user_handle, + uint32_t *rid) +{ + struct samr_CreateUser r; + NTSTATUS status; + + /* In parameters */ + r.in.domain_handle = domain_handle; + r.in.account_name = account_name; + r.in.access_mask = access_mask; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_CreateUser, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + PI_SAMR, + &ndr_table_samr, + NDR_SAMR_CREATEUSER, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_CreateUser, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *user_handle = *r.out.user_handle; + *rid = *r.out.rid; + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_samr_EnumDomainUsers(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *domain_handle, + uint32_t *resume_handle, + uint32_t acct_flags, + uint32_t max_size, + struct samr_SamArray *sam, + uint32_t *num_entries) +{ + struct samr_EnumDomainUsers r; + NTSTATUS status; + + /* In parameters */ + r.in.domain_handle = domain_handle; + r.in.resume_handle = resume_handle; + r.in.acct_flags = acct_flags; + r.in.max_size = max_size; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_EnumDomainUsers, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + PI_SAMR, + &ndr_table_samr, + NDR_SAMR_ENUMDOMAINUSERS, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_EnumDomainUsers, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *resume_handle = *r.out.resume_handle; + *sam = *r.out.sam; + *num_entries = *r.out.num_entries; + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_samr_CreateDomAlias(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *domain_handle, + struct lsa_String *alias_name, + uint32_t access_mask, + struct policy_handle *alias_handle, + uint32_t *rid) +{ + struct samr_CreateDomAlias r; + NTSTATUS status; + + /* In parameters */ + r.in.domain_handle = domain_handle; + r.in.alias_name = alias_name; + r.in.access_mask = access_mask; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_CreateDomAlias, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + PI_SAMR, + &ndr_table_samr, + NDR_SAMR_CREATEDOMALIAS, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_CreateDomAlias, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *alias_handle = *r.out.alias_handle; + *rid = *r.out.rid; + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_samr_EnumDomainAliases(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *domain_handle, + uint32_t *resume_handle, + uint32_t acct_flags, + struct samr_SamArray *sam, + uint32_t *num_entries) +{ + struct samr_EnumDomainAliases r; + NTSTATUS status; + + /* In parameters */ + r.in.domain_handle = domain_handle; + r.in.resume_handle = resume_handle; + r.in.acct_flags = acct_flags; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_EnumDomainAliases, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + PI_SAMR, + &ndr_table_samr, + NDR_SAMR_ENUMDOMAINALIASES, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_EnumDomainAliases, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *resume_handle = *r.out.resume_handle; + *sam = *r.out.sam; + *num_entries = *r.out.num_entries; + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_samr_GetAliasMembership(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *domain_handle, + struct lsa_SidArray *sids, + struct samr_Ids *rids) +{ + struct samr_GetAliasMembership r; + NTSTATUS status; + + /* In parameters */ + r.in.domain_handle = domain_handle; + r.in.sids = sids; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_GetAliasMembership, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + PI_SAMR, + &ndr_table_samr, + NDR_SAMR_GETALIASMEMBERSHIP, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_GetAliasMembership, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *rids = *r.out.rids; + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_samr_LookupNames(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *domain_handle, + uint32_t num_names, + struct lsa_String *names, + struct samr_Ids *rids, + struct samr_Ids *types) +{ + struct samr_LookupNames r; + NTSTATUS status; + + /* In parameters */ + r.in.domain_handle = domain_handle; + r.in.num_names = num_names; + r.in.names = names; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_LookupNames, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + PI_SAMR, + &ndr_table_samr, + NDR_SAMR_LOOKUPNAMES, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_LookupNames, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *rids = *r.out.rids; + *types = *r.out.types; + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_samr_LookupRids(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *domain_handle, + uint32_t num_rids, + uint32_t *rids, + struct lsa_Strings *names, + struct samr_Ids *types) +{ + struct samr_LookupRids r; + NTSTATUS status; + + /* In parameters */ + r.in.domain_handle = domain_handle; + r.in.num_rids = num_rids; + r.in.rids = rids; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_LookupRids, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + PI_SAMR, + &ndr_table_samr, + NDR_SAMR_LOOKUPRIDS, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_LookupRids, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *names = *r.out.names; + *types = *r.out.types; + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_samr_OpenGroup(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *domain_handle, + uint32_t access_mask, + uint32_t rid, + struct policy_handle *group_handle) +{ + struct samr_OpenGroup r; + NTSTATUS status; + + /* In parameters */ + r.in.domain_handle = domain_handle; + r.in.access_mask = access_mask; + r.in.rid = rid; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_OpenGroup, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + PI_SAMR, + &ndr_table_samr, + NDR_SAMR_OPENGROUP, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_OpenGroup, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *group_handle = *r.out.group_handle; + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_samr_QueryGroupInfo(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *group_handle, + enum samr_GroupInfoEnum level, + union samr_GroupInfo *info) +{ + struct samr_QueryGroupInfo r; + NTSTATUS status; + + /* In parameters */ + r.in.group_handle = group_handle; + r.in.level = level; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_QueryGroupInfo, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + PI_SAMR, + &ndr_table_samr, + NDR_SAMR_QUERYGROUPINFO, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_QueryGroupInfo, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *info = *r.out.info; + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_samr_SetGroupInfo(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *group_handle, + enum samr_GroupInfoEnum level, + union samr_GroupInfo *info) +{ + struct samr_SetGroupInfo r; + NTSTATUS status; + + /* In parameters */ + r.in.group_handle = group_handle; + r.in.level = level; + r.in.info = info; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_SetGroupInfo, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + PI_SAMR, + &ndr_table_samr, + NDR_SAMR_SETGROUPINFO, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_SetGroupInfo, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_samr_AddGroupMember(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *group_handle, + uint32_t rid, + uint32_t flags) +{ + struct samr_AddGroupMember r; + NTSTATUS status; + + /* In parameters */ + r.in.group_handle = group_handle; + r.in.rid = rid; + r.in.flags = flags; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_AddGroupMember, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + PI_SAMR, + &ndr_table_samr, + NDR_SAMR_ADDGROUPMEMBER, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_AddGroupMember, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_samr_DeleteDomainGroup(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *group_handle) +{ + struct samr_DeleteDomainGroup r; + NTSTATUS status; + + /* In parameters */ + r.in.group_handle = group_handle; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_DeleteDomainGroup, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + PI_SAMR, + &ndr_table_samr, + NDR_SAMR_DELETEDOMAINGROUP, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_DeleteDomainGroup, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *group_handle = *r.out.group_handle; + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_samr_DeleteGroupMember(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *group_handle, + uint32_t rid) +{ + struct samr_DeleteGroupMember r; + NTSTATUS status; + + /* In parameters */ + r.in.group_handle = group_handle; + r.in.rid = rid; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_DeleteGroupMember, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + PI_SAMR, + &ndr_table_samr, + NDR_SAMR_DELETEGROUPMEMBER, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_DeleteGroupMember, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_samr_QueryGroupMember(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *group_handle, + struct samr_RidTypeArray *rids) +{ + struct samr_QueryGroupMember r; + NTSTATUS status; + + /* In parameters */ + r.in.group_handle = group_handle; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_QueryGroupMember, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + PI_SAMR, + &ndr_table_samr, + NDR_SAMR_QUERYGROUPMEMBER, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_QueryGroupMember, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *rids = *r.out.rids; + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_samr_SetMemberAttributesOfGroup(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *group_handle, + uint32_t unknown1, + uint32_t unknown2) +{ + struct samr_SetMemberAttributesOfGroup r; + NTSTATUS status; + + /* In parameters */ + r.in.group_handle = group_handle; + r.in.unknown1 = unknown1; + r.in.unknown2 = unknown2; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_SetMemberAttributesOfGroup, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + PI_SAMR, + &ndr_table_samr, + NDR_SAMR_SETMEMBERATTRIBUTESOFGROUP, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_SetMemberAttributesOfGroup, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_samr_OpenAlias(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *domain_handle, + uint32_t access_mask, + uint32_t rid, + struct policy_handle *alias_handle) +{ + struct samr_OpenAlias r; + NTSTATUS status; + + /* In parameters */ + r.in.domain_handle = domain_handle; + r.in.access_mask = access_mask; + r.in.rid = rid; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_OpenAlias, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + PI_SAMR, + &ndr_table_samr, + NDR_SAMR_OPENALIAS, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_OpenAlias, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *alias_handle = *r.out.alias_handle; + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_samr_QueryAliasInfo(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *alias_handle, + enum samr_AliasInfoEnum level, + union samr_AliasInfo *info) +{ + struct samr_QueryAliasInfo r; + NTSTATUS status; + + /* In parameters */ + r.in.alias_handle = alias_handle; + r.in.level = level; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_QueryAliasInfo, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + PI_SAMR, + &ndr_table_samr, + NDR_SAMR_QUERYALIASINFO, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_QueryAliasInfo, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *info = *r.out.info; + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_samr_SetAliasInfo(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *alias_handle, + enum samr_AliasInfoEnum level, + union samr_AliasInfo *info) +{ + struct samr_SetAliasInfo r; + NTSTATUS status; + + /* In parameters */ + r.in.alias_handle = alias_handle; + r.in.level = level; + r.in.info = info; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_SetAliasInfo, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + PI_SAMR, + &ndr_table_samr, + NDR_SAMR_SETALIASINFO, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_SetAliasInfo, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_samr_DeleteDomAlias(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *alias_handle) +{ + struct samr_DeleteDomAlias r; + NTSTATUS status; + + /* In parameters */ + r.in.alias_handle = alias_handle; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_DeleteDomAlias, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + PI_SAMR, + &ndr_table_samr, + NDR_SAMR_DELETEDOMALIAS, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_DeleteDomAlias, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *alias_handle = *r.out.alias_handle; + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_samr_AddAliasMember(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *alias_handle, + struct dom_sid2 *sid) +{ + struct samr_AddAliasMember r; + NTSTATUS status; + + /* In parameters */ + r.in.alias_handle = alias_handle; + r.in.sid = sid; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_AddAliasMember, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + PI_SAMR, + &ndr_table_samr, + NDR_SAMR_ADDALIASMEMBER, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_AddAliasMember, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_samr_DeleteAliasMember(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *alias_handle, + struct dom_sid2 *sid) +{ + struct samr_DeleteAliasMember r; + NTSTATUS status; + + /* In parameters */ + r.in.alias_handle = alias_handle; + r.in.sid = sid; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_DeleteAliasMember, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + PI_SAMR, + &ndr_table_samr, + NDR_SAMR_DELETEALIASMEMBER, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_DeleteAliasMember, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_samr_GetMembersInAlias(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *alias_handle, + struct lsa_SidArray *sids) +{ + struct samr_GetMembersInAlias r; + NTSTATUS status; + + /* In parameters */ + r.in.alias_handle = alias_handle; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_GetMembersInAlias, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + PI_SAMR, + &ndr_table_samr, + NDR_SAMR_GETMEMBERSINALIAS, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_GetMembersInAlias, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *sids = *r.out.sids; + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_samr_OpenUser(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *domain_handle, + uint32_t access_mask, + uint32_t rid, + struct policy_handle *user_handle) +{ + struct samr_OpenUser r; + NTSTATUS status; + + /* In parameters */ + r.in.domain_handle = domain_handle; + r.in.access_mask = access_mask; + r.in.rid = rid; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_OpenUser, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + PI_SAMR, + &ndr_table_samr, + NDR_SAMR_OPENUSER, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_OpenUser, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *user_handle = *r.out.user_handle; + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_samr_DeleteUser(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *user_handle) +{ + struct samr_DeleteUser r; + NTSTATUS status; + + /* In parameters */ + r.in.user_handle = user_handle; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_DeleteUser, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + PI_SAMR, + &ndr_table_samr, + NDR_SAMR_DELETEUSER, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_DeleteUser, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *user_handle = *r.out.user_handle; + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_samr_QueryUserInfo(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *user_handle, + uint16_t level, + union samr_UserInfo *info) +{ + struct samr_QueryUserInfo r; + NTSTATUS status; + + /* In parameters */ + r.in.user_handle = user_handle; + r.in.level = level; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_QueryUserInfo, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + PI_SAMR, + &ndr_table_samr, + NDR_SAMR_QUERYUSERINFO, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_QueryUserInfo, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *info = *r.out.info; + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_samr_SetUserInfo(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *user_handle, + uint16_t level, + union samr_UserInfo *info) +{ + struct samr_SetUserInfo r; + NTSTATUS status; + + /* In parameters */ + r.in.user_handle = user_handle; + r.in.level = level; + r.in.info = info; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_SetUserInfo, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + PI_SAMR, + &ndr_table_samr, + NDR_SAMR_SETUSERINFO, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_SetUserInfo, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_samr_ChangePasswordUser(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *user_handle, + uint8_t lm_present, + struct samr_Password *old_lm_crypted, + struct samr_Password *new_lm_crypted, + uint8_t nt_present, + struct samr_Password *old_nt_crypted, + struct samr_Password *new_nt_crypted, + uint8_t cross1_present, + struct samr_Password *nt_cross, + uint8_t cross2_present, + struct samr_Password *lm_cross) +{ + struct samr_ChangePasswordUser r; + NTSTATUS status; + + /* In parameters */ + r.in.user_handle = user_handle; + r.in.lm_present = lm_present; + r.in.old_lm_crypted = old_lm_crypted; + r.in.new_lm_crypted = new_lm_crypted; + r.in.nt_present = nt_present; + r.in.old_nt_crypted = old_nt_crypted; + r.in.new_nt_crypted = new_nt_crypted; + r.in.cross1_present = cross1_present; + r.in.nt_cross = nt_cross; + r.in.cross2_present = cross2_present; + r.in.lm_cross = lm_cross; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_ChangePasswordUser, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + PI_SAMR, + &ndr_table_samr, + NDR_SAMR_CHANGEPASSWORDUSER, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_ChangePasswordUser, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_samr_GetGroupsForUser(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *user_handle, + struct samr_RidWithAttributeArray *rids) +{ + struct samr_GetGroupsForUser r; + NTSTATUS status; + + /* In parameters */ + r.in.user_handle = user_handle; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_GetGroupsForUser, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + PI_SAMR, + &ndr_table_samr, + NDR_SAMR_GETGROUPSFORUSER, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_GetGroupsForUser, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *rids = *r.out.rids; + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_samr_QueryDisplayInfo(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *domain_handle, + uint16_t level, + uint32_t start_idx, + uint32_t max_entries, + uint32_t buf_size, + uint32_t *total_size, + uint32_t *returned_size, + union samr_DispInfo *info) +{ + struct samr_QueryDisplayInfo r; + NTSTATUS status; + + /* In parameters */ + r.in.domain_handle = domain_handle; + r.in.level = level; + r.in.start_idx = start_idx; + r.in.max_entries = max_entries; + r.in.buf_size = buf_size; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_QueryDisplayInfo, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + PI_SAMR, + &ndr_table_samr, + NDR_SAMR_QUERYDISPLAYINFO, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_QueryDisplayInfo, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *total_size = *r.out.total_size; + *returned_size = *r.out.returned_size; + *info = *r.out.info; + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_samr_GetDisplayEnumerationIndex(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *domain_handle, + uint16_t level, + struct lsa_String name, + uint32_t *idx) +{ + struct samr_GetDisplayEnumerationIndex r; + NTSTATUS status; + + /* In parameters */ + r.in.domain_handle = domain_handle; + r.in.level = level; + r.in.name = name; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_GetDisplayEnumerationIndex, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + PI_SAMR, + &ndr_table_samr, + NDR_SAMR_GETDISPLAYENUMERATIONINDEX, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_GetDisplayEnumerationIndex, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *idx = *r.out.idx; + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_samr_TestPrivateFunctionsDomain(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *domain_handle) +{ + struct samr_TestPrivateFunctionsDomain r; + NTSTATUS status; + + /* In parameters */ + r.in.domain_handle = domain_handle; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_TestPrivateFunctionsDomain, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + PI_SAMR, + &ndr_table_samr, + NDR_SAMR_TESTPRIVATEFUNCTIONSDOMAIN, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_TestPrivateFunctionsDomain, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_samr_TestPrivateFunctionsUser(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *user_handle) +{ + struct samr_TestPrivateFunctionsUser r; + NTSTATUS status; + + /* In parameters */ + r.in.user_handle = user_handle; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_TestPrivateFunctionsUser, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + PI_SAMR, + &ndr_table_samr, + NDR_SAMR_TESTPRIVATEFUNCTIONSUSER, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_TestPrivateFunctionsUser, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_samr_GetUserPwInfo(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *user_handle, + struct samr_PwInfo *info) +{ + struct samr_GetUserPwInfo r; + NTSTATUS status; + + /* In parameters */ + r.in.user_handle = user_handle; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_GetUserPwInfo, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + PI_SAMR, + &ndr_table_samr, + NDR_SAMR_GETUSERPWINFO, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_GetUserPwInfo, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *info = *r.out.info; + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_samr_RemoveMemberFromForeignDomain(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *domain_handle, + struct dom_sid2 *sid) +{ + struct samr_RemoveMemberFromForeignDomain r; + NTSTATUS status; + + /* In parameters */ + r.in.domain_handle = domain_handle; + r.in.sid = sid; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_RemoveMemberFromForeignDomain, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + PI_SAMR, + &ndr_table_samr, + NDR_SAMR_REMOVEMEMBERFROMFOREIGNDOMAIN, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_RemoveMemberFromForeignDomain, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_samr_QueryDomainInfo2(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *domain_handle, + uint16_t level, + union samr_DomainInfo *info) +{ + struct samr_QueryDomainInfo2 r; + NTSTATUS status; + + /* In parameters */ + r.in.domain_handle = domain_handle; + r.in.level = level; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_QueryDomainInfo2, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + PI_SAMR, + &ndr_table_samr, + NDR_SAMR_QUERYDOMAININFO2, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_QueryDomainInfo2, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *info = *r.out.info; + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_samr_QueryUserInfo2(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *user_handle, + uint16_t level, + union samr_UserInfo *info) +{ + struct samr_QueryUserInfo2 r; + NTSTATUS status; + + /* In parameters */ + r.in.user_handle = user_handle; + r.in.level = level; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_QueryUserInfo2, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + PI_SAMR, + &ndr_table_samr, + NDR_SAMR_QUERYUSERINFO2, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_QueryUserInfo2, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *info = *r.out.info; + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_samr_QueryDisplayInfo2(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *domain_handle, + uint16_t level, + uint32_t start_idx, + uint32_t max_entries, + uint32_t buf_size, + uint32_t *total_size, + uint32_t *returned_size, + union samr_DispInfo *info) +{ + struct samr_QueryDisplayInfo2 r; + NTSTATUS status; + + /* In parameters */ + r.in.domain_handle = domain_handle; + r.in.level = level; + r.in.start_idx = start_idx; + r.in.max_entries = max_entries; + r.in.buf_size = buf_size; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_QueryDisplayInfo2, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + PI_SAMR, + &ndr_table_samr, + NDR_SAMR_QUERYDISPLAYINFO2, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_QueryDisplayInfo2, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *total_size = *r.out.total_size; + *returned_size = *r.out.returned_size; + *info = *r.out.info; + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_samr_GetDisplayEnumerationIndex2(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *domain_handle, + uint16_t level, + struct lsa_String name, + uint32_t *idx) +{ + struct samr_GetDisplayEnumerationIndex2 r; + NTSTATUS status; + + /* In parameters */ + r.in.domain_handle = domain_handle; + r.in.level = level; + r.in.name = name; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_GetDisplayEnumerationIndex2, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + PI_SAMR, + &ndr_table_samr, + NDR_SAMR_GETDISPLAYENUMERATIONINDEX2, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_GetDisplayEnumerationIndex2, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *idx = *r.out.idx; + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_samr_CreateUser2(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *domain_handle, + struct lsa_String *account_name, + uint32_t acct_flags, + uint32_t access_mask, + struct policy_handle *user_handle, + uint32_t *access_granted, + uint32_t *rid) +{ + struct samr_CreateUser2 r; + NTSTATUS status; + + /* In parameters */ + r.in.domain_handle = domain_handle; + r.in.account_name = account_name; + r.in.acct_flags = acct_flags; + r.in.access_mask = access_mask; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_CreateUser2, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + PI_SAMR, + &ndr_table_samr, + NDR_SAMR_CREATEUSER2, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_CreateUser2, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *user_handle = *r.out.user_handle; + *access_granted = *r.out.access_granted; + *rid = *r.out.rid; + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_samr_QueryDisplayInfo3(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *domain_handle, + uint16_t level, + uint32_t start_idx, + uint32_t max_entries, + uint32_t buf_size, + uint32_t *total_size, + uint32_t *returned_size, + union samr_DispInfo *info) +{ + struct samr_QueryDisplayInfo3 r; + NTSTATUS status; + + /* In parameters */ + r.in.domain_handle = domain_handle; + r.in.level = level; + r.in.start_idx = start_idx; + r.in.max_entries = max_entries; + r.in.buf_size = buf_size; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_QueryDisplayInfo3, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + PI_SAMR, + &ndr_table_samr, + NDR_SAMR_QUERYDISPLAYINFO3, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_QueryDisplayInfo3, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *total_size = *r.out.total_size; + *returned_size = *r.out.returned_size; + *info = *r.out.info; + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_samr_AddMultipleMembersToAlias(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *alias_handle, + struct lsa_SidArray *sids) +{ + struct samr_AddMultipleMembersToAlias r; + NTSTATUS status; + + /* In parameters */ + r.in.alias_handle = alias_handle; + r.in.sids = sids; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_AddMultipleMembersToAlias, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + PI_SAMR, + &ndr_table_samr, + NDR_SAMR_ADDMULTIPLEMEMBERSTOALIAS, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_AddMultipleMembersToAlias, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_samr_RemoveMultipleMembersFromAlias(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *alias_handle, + struct lsa_SidArray *sids) +{ + struct samr_RemoveMultipleMembersFromAlias r; + NTSTATUS status; + + /* In parameters */ + r.in.alias_handle = alias_handle; + r.in.sids = sids; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_RemoveMultipleMembersFromAlias, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + PI_SAMR, + &ndr_table_samr, + NDR_SAMR_REMOVEMULTIPLEMEMBERSFROMALIAS, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_RemoveMultipleMembersFromAlias, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_samr_OemChangePasswordUser2(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct lsa_AsciiString *server, + struct lsa_AsciiString *account, + struct samr_CryptPassword *password, + struct samr_Password *hash) +{ + struct samr_OemChangePasswordUser2 r; + NTSTATUS status; + + /* In parameters */ + r.in.server = server; + r.in.account = account; + r.in.password = password; + r.in.hash = hash; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_OemChangePasswordUser2, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + PI_SAMR, + &ndr_table_samr, + NDR_SAMR_OEMCHANGEPASSWORDUSER2, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_OemChangePasswordUser2, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_samr_ChangePasswordUser2(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct lsa_String *server, + struct lsa_String *account, + struct samr_CryptPassword *nt_password, + struct samr_Password *nt_verifier, + uint8_t lm_change, + struct samr_CryptPassword *lm_password, + struct samr_Password *lm_verifier) +{ + struct samr_ChangePasswordUser2 r; + NTSTATUS status; + + /* In parameters */ + r.in.server = server; + r.in.account = account; + r.in.nt_password = nt_password; + r.in.nt_verifier = nt_verifier; + r.in.lm_change = lm_change; + r.in.lm_password = lm_password; + r.in.lm_verifier = lm_verifier; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_ChangePasswordUser2, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + PI_SAMR, + &ndr_table_samr, + NDR_SAMR_CHANGEPASSWORDUSER2, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_ChangePasswordUser2, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_samr_GetDomPwInfo(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct lsa_String *domain_name, + struct samr_PwInfo *info) +{ + struct samr_GetDomPwInfo r; + NTSTATUS status; + + /* In parameters */ + r.in.domain_name = domain_name; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_GetDomPwInfo, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + PI_SAMR, + &ndr_table_samr, + NDR_SAMR_GETDOMPWINFO, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_GetDomPwInfo, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *info = *r.out.info; + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_samr_Connect2(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *system_name, + uint32_t access_mask, + struct policy_handle *connect_handle) +{ + struct samr_Connect2 r; + NTSTATUS status; + + /* In parameters */ + r.in.system_name = system_name; + r.in.access_mask = access_mask; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_Connect2, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + PI_SAMR, + &ndr_table_samr, + NDR_SAMR_CONNECT2, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_Connect2, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *connect_handle = *r.out.connect_handle; + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_samr_SetUserInfo2(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *user_handle, + uint16_t level, + union samr_UserInfo *info) +{ + struct samr_SetUserInfo2 r; + NTSTATUS status; + + /* In parameters */ + r.in.user_handle = user_handle; + r.in.level = level; + r.in.info = info; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_SetUserInfo2, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + PI_SAMR, + &ndr_table_samr, + NDR_SAMR_SETUSERINFO2, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_SetUserInfo2, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_samr_SetBootKeyInformation(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *connect_handle, + uint32_t unknown1, + uint32_t unknown2, + uint32_t unknown3) +{ + struct samr_SetBootKeyInformation r; + NTSTATUS status; + + /* In parameters */ + r.in.connect_handle = connect_handle; + r.in.unknown1 = unknown1; + r.in.unknown2 = unknown2; + r.in.unknown3 = unknown3; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_SetBootKeyInformation, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + PI_SAMR, + &ndr_table_samr, + NDR_SAMR_SETBOOTKEYINFORMATION, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_SetBootKeyInformation, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_samr_GetBootKeyInformation(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *domain_handle, + uint32_t *unknown) +{ + struct samr_GetBootKeyInformation r; + NTSTATUS status; + + /* In parameters */ + r.in.domain_handle = domain_handle; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_GetBootKeyInformation, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + PI_SAMR, + &ndr_table_samr, + NDR_SAMR_GETBOOTKEYINFORMATION, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_GetBootKeyInformation, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *unknown = *r.out.unknown; + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_samr_Connect3(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *system_name, + uint32_t unknown, + uint32_t access_mask, + struct policy_handle *connect_handle) +{ + struct samr_Connect3 r; + NTSTATUS status; + + /* In parameters */ + r.in.system_name = system_name; + r.in.unknown = unknown; + r.in.access_mask = access_mask; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_Connect3, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + PI_SAMR, + &ndr_table_samr, + NDR_SAMR_CONNECT3, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_Connect3, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *connect_handle = *r.out.connect_handle; + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_samr_Connect4(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *system_name, + uint32_t unknown, + uint32_t access_mask, + struct policy_handle *connect_handle) +{ + struct samr_Connect4 r; + NTSTATUS status; + + /* In parameters */ + r.in.system_name = system_name; + r.in.unknown = unknown; + r.in.access_mask = access_mask; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_Connect4, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + PI_SAMR, + &ndr_table_samr, + NDR_SAMR_CONNECT4, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_Connect4, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *connect_handle = *r.out.connect_handle; + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_samr_ChangePasswordUser3(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct lsa_String *server, + struct lsa_String *account, + struct samr_CryptPassword *nt_password, + struct samr_Password *nt_verifier, + uint8_t lm_change, + struct samr_CryptPassword *lm_password, + struct samr_Password *lm_verifier, + struct samr_CryptPassword *password3, + struct samr_DomInfo1 *dominfo, + struct samr_ChangeReject *reject) +{ + struct samr_ChangePasswordUser3 r; + NTSTATUS status; + + /* In parameters */ + r.in.server = server; + r.in.account = account; + r.in.nt_password = nt_password; + r.in.nt_verifier = nt_verifier; + r.in.lm_change = lm_change; + r.in.lm_password = lm_password; + r.in.lm_verifier = lm_verifier; + r.in.password3 = password3; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_ChangePasswordUser3, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + PI_SAMR, + &ndr_table_samr, + NDR_SAMR_CHANGEPASSWORDUSER3, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_ChangePasswordUser3, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *dominfo = *r.out.dominfo; + *reject = *r.out.reject; + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_samr_Connect5(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *system_name, + uint32_t access_mask, + uint32_t level_in, + union samr_ConnectInfo *info_in, + uint32_t *level_out, + union samr_ConnectInfo *info_out, + struct policy_handle *connect_handle) +{ + struct samr_Connect5 r; + NTSTATUS status; + + /* In parameters */ + r.in.system_name = system_name; + r.in.access_mask = access_mask; + r.in.level_in = level_in; + r.in.info_in = info_in; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_Connect5, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + PI_SAMR, + &ndr_table_samr, + NDR_SAMR_CONNECT5, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_Connect5, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *level_out = *r.out.level_out; + *info_out = *r.out.info_out; + *connect_handle = *r.out.connect_handle; + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_samr_RidToSid(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *domain_handle, + uint32_t rid, + struct dom_sid2 *sid) +{ + struct samr_RidToSid r; + NTSTATUS status; + + /* In parameters */ + r.in.domain_handle = domain_handle; + r.in.rid = rid; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_RidToSid, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + PI_SAMR, + &ndr_table_samr, + NDR_SAMR_RIDTOSID, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_RidToSid, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *sid = *r.out.sid; + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_samr_SetDsrmPassword(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct lsa_String *name, + uint32_t unknown, + struct samr_Password *hash) +{ + struct samr_SetDsrmPassword r; + NTSTATUS status; + + /* In parameters */ + r.in.name = name; + r.in.unknown = unknown; + r.in.hash = hash; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_SetDsrmPassword, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + PI_SAMR, + &ndr_table_samr, + NDR_SAMR_SETDSRMPASSWORD, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_SetDsrmPassword, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + return r.out.result; +} + +NTSTATUS rpccli_samr_ValidatePassword(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + enum samr_ValidatePasswordLevel level, + union samr_ValidatePasswordReq req, + union samr_ValidatePasswordRep *rep) +{ + struct samr_ValidatePassword r; + NTSTATUS status; + + /* In parameters */ + r.in.level = level; + r.in.req = req; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_ValidatePassword, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + PI_SAMR, + &ndr_table_samr, + NDR_SAMR_VALIDATEPASSWORD, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_ValidatePassword, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *rep = *r.out.rep; + + /* Return result */ + return r.out.result; +} + diff --git a/source3/librpc/gen_ndr/cli_samr.h b/source3/librpc/gen_ndr/cli_samr.h new file mode 100644 index 0000000000..23f2d1f1b6 --- /dev/null +++ b/source3/librpc/gen_ndr/cli_samr.h @@ -0,0 +1,389 @@ +#include "librpc/gen_ndr/ndr_samr.h" +#ifndef __CLI_SAMR__ +#define __CLI_SAMR__ +NTSTATUS rpccli_samr_Connect(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + uint16_t *system_name, + uint32_t access_mask, + struct policy_handle *connect_handle); +NTSTATUS rpccli_samr_Close(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle); +NTSTATUS rpccli_samr_SetSecurity(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle, + uint32_t sec_info, + struct sec_desc_buf *sdbuf); +NTSTATUS rpccli_samr_QuerySecurity(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle, + uint32_t sec_info, + struct sec_desc_buf *sdbuf); +NTSTATUS rpccli_samr_Shutdown(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *connect_handle); +NTSTATUS rpccli_samr_LookupDomain(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *connect_handle, + struct lsa_String *domain_name, + struct dom_sid2 *sid); +NTSTATUS rpccli_samr_EnumDomains(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *connect_handle, + uint32_t *resume_handle, + uint32_t buf_size, + struct samr_SamArray *sam, + uint32_t *num_entries); +NTSTATUS rpccli_samr_OpenDomain(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *connect_handle, + uint32_t access_mask, + struct dom_sid2 *sid, + struct policy_handle *domain_handle); +NTSTATUS rpccli_samr_QueryDomainInfo(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *domain_handle, + uint16_t level, + union samr_DomainInfo *info); +NTSTATUS rpccli_samr_SetDomainInfo(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *domain_handle, + uint16_t level, + union samr_DomainInfo *info); +NTSTATUS rpccli_samr_CreateDomainGroup(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *domain_handle, + struct lsa_String *name, + uint32_t access_mask, + struct policy_handle *group_handle, + uint32_t *rid); +NTSTATUS rpccli_samr_EnumDomainGroups(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *domain_handle, + uint32_t *resume_handle, + uint32_t max_size, + struct samr_SamArray *sam, + uint32_t *num_entries); +NTSTATUS rpccli_samr_CreateUser(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *domain_handle, + struct lsa_String *account_name, + uint32_t access_mask, + struct policy_handle *user_handle, + uint32_t *rid); +NTSTATUS rpccli_samr_EnumDomainUsers(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *domain_handle, + uint32_t *resume_handle, + uint32_t acct_flags, + uint32_t max_size, + struct samr_SamArray *sam, + uint32_t *num_entries); +NTSTATUS rpccli_samr_CreateDomAlias(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *domain_handle, + struct lsa_String *alias_name, + uint32_t access_mask, + struct policy_handle *alias_handle, + uint32_t *rid); +NTSTATUS rpccli_samr_EnumDomainAliases(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *domain_handle, + uint32_t *resume_handle, + uint32_t acct_flags, + struct samr_SamArray *sam, + uint32_t *num_entries); +NTSTATUS rpccli_samr_GetAliasMembership(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *domain_handle, + struct lsa_SidArray *sids, + struct samr_Ids *rids); +NTSTATUS rpccli_samr_LookupNames(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *domain_handle, + uint32_t num_names, + struct lsa_String *names, + struct samr_Ids *rids, + struct samr_Ids *types); +NTSTATUS rpccli_samr_LookupRids(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *domain_handle, + uint32_t num_rids, + uint32_t *rids, + struct lsa_Strings *names, + struct samr_Ids *types); +NTSTATUS rpccli_samr_OpenGroup(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *domain_handle, + uint32_t access_mask, + uint32_t rid, + struct policy_handle *group_handle); +NTSTATUS rpccli_samr_QueryGroupInfo(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *group_handle, + enum samr_GroupInfoEnum level, + union samr_GroupInfo *info); +NTSTATUS rpccli_samr_SetGroupInfo(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *group_handle, + enum samr_GroupInfoEnum level, + union samr_GroupInfo *info); +NTSTATUS rpccli_samr_AddGroupMember(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *group_handle, + uint32_t rid, + uint32_t flags); +NTSTATUS rpccli_samr_DeleteDomainGroup(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *group_handle); +NTSTATUS rpccli_samr_DeleteGroupMember(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *group_handle, + uint32_t rid); +NTSTATUS rpccli_samr_QueryGroupMember(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *group_handle, + struct samr_RidTypeArray *rids); +NTSTATUS rpccli_samr_SetMemberAttributesOfGroup(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *group_handle, + uint32_t unknown1, + uint32_t unknown2); +NTSTATUS rpccli_samr_OpenAlias(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *domain_handle, + uint32_t access_mask, + uint32_t rid, + struct policy_handle *alias_handle); +NTSTATUS rpccli_samr_QueryAliasInfo(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *alias_handle, + enum samr_AliasInfoEnum level, + union samr_AliasInfo *info); +NTSTATUS rpccli_samr_SetAliasInfo(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *alias_handle, + enum samr_AliasInfoEnum level, + union samr_AliasInfo *info); +NTSTATUS rpccli_samr_DeleteDomAlias(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *alias_handle); +NTSTATUS rpccli_samr_AddAliasMember(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *alias_handle, + struct dom_sid2 *sid); +NTSTATUS rpccli_samr_DeleteAliasMember(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *alias_handle, + struct dom_sid2 *sid); +NTSTATUS rpccli_samr_GetMembersInAlias(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *alias_handle, + struct lsa_SidArray *sids); +NTSTATUS rpccli_samr_OpenUser(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *domain_handle, + uint32_t access_mask, + uint32_t rid, + struct policy_handle *user_handle); +NTSTATUS rpccli_samr_DeleteUser(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *user_handle); +NTSTATUS rpccli_samr_QueryUserInfo(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *user_handle, + uint16_t level, + union samr_UserInfo *info); +NTSTATUS rpccli_samr_SetUserInfo(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *user_handle, + uint16_t level, + union samr_UserInfo *info); +NTSTATUS rpccli_samr_ChangePasswordUser(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *user_handle, + uint8_t lm_present, + struct samr_Password *old_lm_crypted, + struct samr_Password *new_lm_crypted, + uint8_t nt_present, + struct samr_Password *old_nt_crypted, + struct samr_Password *new_nt_crypted, + uint8_t cross1_present, + struct samr_Password *nt_cross, + uint8_t cross2_present, + struct samr_Password *lm_cross); +NTSTATUS rpccli_samr_GetGroupsForUser(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *user_handle, + struct samr_RidWithAttributeArray *rids); +NTSTATUS rpccli_samr_QueryDisplayInfo(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *domain_handle, + uint16_t level, + uint32_t start_idx, + uint32_t max_entries, + uint32_t buf_size, + uint32_t *total_size, + uint32_t *returned_size, + union samr_DispInfo *info); +NTSTATUS rpccli_samr_GetDisplayEnumerationIndex(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *domain_handle, + uint16_t level, + struct lsa_String name, + uint32_t *idx); +NTSTATUS rpccli_samr_TestPrivateFunctionsDomain(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *domain_handle); +NTSTATUS rpccli_samr_TestPrivateFunctionsUser(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *user_handle); +NTSTATUS rpccli_samr_GetUserPwInfo(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *user_handle, + struct samr_PwInfo *info); +NTSTATUS rpccli_samr_RemoveMemberFromForeignDomain(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *domain_handle, + struct dom_sid2 *sid); +NTSTATUS rpccli_samr_QueryDomainInfo2(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *domain_handle, + uint16_t level, + union samr_DomainInfo *info); +NTSTATUS rpccli_samr_QueryUserInfo2(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *user_handle, + uint16_t level, + union samr_UserInfo *info); +NTSTATUS rpccli_samr_QueryDisplayInfo2(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *domain_handle, + uint16_t level, + uint32_t start_idx, + uint32_t max_entries, + uint32_t buf_size, + uint32_t *total_size, + uint32_t *returned_size, + union samr_DispInfo *info); +NTSTATUS rpccli_samr_GetDisplayEnumerationIndex2(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *domain_handle, + uint16_t level, + struct lsa_String name, + uint32_t *idx); +NTSTATUS rpccli_samr_CreateUser2(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *domain_handle, + struct lsa_String *account_name, + uint32_t acct_flags, + uint32_t access_mask, + struct policy_handle *user_handle, + uint32_t *access_granted, + uint32_t *rid); +NTSTATUS rpccli_samr_QueryDisplayInfo3(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *domain_handle, + uint16_t level, + uint32_t start_idx, + uint32_t max_entries, + uint32_t buf_size, + uint32_t *total_size, + uint32_t *returned_size, + union samr_DispInfo *info); +NTSTATUS rpccli_samr_AddMultipleMembersToAlias(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *alias_handle, + struct lsa_SidArray *sids); +NTSTATUS rpccli_samr_RemoveMultipleMembersFromAlias(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *alias_handle, + struct lsa_SidArray *sids); +NTSTATUS rpccli_samr_OemChangePasswordUser2(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct lsa_AsciiString *server, + struct lsa_AsciiString *account, + struct samr_CryptPassword *password, + struct samr_Password *hash); +NTSTATUS rpccli_samr_ChangePasswordUser2(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct lsa_String *server, + struct lsa_String *account, + struct samr_CryptPassword *nt_password, + struct samr_Password *nt_verifier, + uint8_t lm_change, + struct samr_CryptPassword *lm_password, + struct samr_Password *lm_verifier); +NTSTATUS rpccli_samr_GetDomPwInfo(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct lsa_String *domain_name, + struct samr_PwInfo *info); +NTSTATUS rpccli_samr_Connect2(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *system_name, + uint32_t access_mask, + struct policy_handle *connect_handle); +NTSTATUS rpccli_samr_SetUserInfo2(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *user_handle, + uint16_t level, + union samr_UserInfo *info); +NTSTATUS rpccli_samr_SetBootKeyInformation(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *connect_handle, + uint32_t unknown1, + uint32_t unknown2, + uint32_t unknown3); +NTSTATUS rpccli_samr_GetBootKeyInformation(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *domain_handle, + uint32_t *unknown); +NTSTATUS rpccli_samr_Connect3(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *system_name, + uint32_t unknown, + uint32_t access_mask, + struct policy_handle *connect_handle); +NTSTATUS rpccli_samr_Connect4(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *system_name, + uint32_t unknown, + uint32_t access_mask, + struct policy_handle *connect_handle); +NTSTATUS rpccli_samr_ChangePasswordUser3(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct lsa_String *server, + struct lsa_String *account, + struct samr_CryptPassword *nt_password, + struct samr_Password *nt_verifier, + uint8_t lm_change, + struct samr_CryptPassword *lm_password, + struct samr_Password *lm_verifier, + struct samr_CryptPassword *password3, + struct samr_DomInfo1 *dominfo, + struct samr_ChangeReject *reject); +NTSTATUS rpccli_samr_Connect5(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *system_name, + uint32_t access_mask, + uint32_t level_in, + union samr_ConnectInfo *info_in, + uint32_t *level_out, + union samr_ConnectInfo *info_out, + struct policy_handle *connect_handle); +NTSTATUS rpccli_samr_RidToSid(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *domain_handle, + uint32_t rid, + struct dom_sid2 *sid); +NTSTATUS rpccli_samr_SetDsrmPassword(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct lsa_String *name, + uint32_t unknown, + struct samr_Password *hash); +NTSTATUS rpccli_samr_ValidatePassword(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + enum samr_ValidatePasswordLevel level, + union samr_ValidatePasswordReq req, + union samr_ValidatePasswordRep *rep); +#endif /* __CLI_SAMR__ */ diff --git a/source3/librpc/gen_ndr/ndr_samr.c b/source3/librpc/gen_ndr/ndr_samr.c new file mode 100644 index 0000000000..f407fcf954 --- /dev/null +++ b/source3/librpc/gen_ndr/ndr_samr.c @@ -0,0 +1,12290 @@ +/* parser auto-generated by pidl */ + +#include "includes.h" +#include "librpc/gen_ndr/ndr_samr.h" + +#include "librpc/gen_ndr/ndr_misc.h" +#include "librpc/gen_ndr/ndr_lsa.h" +#include "librpc/gen_ndr/ndr_security.h" +_PUBLIC_ enum ndr_err_code ndr_push_samr_AcctFlags(struct ndr_push *ndr, int ndr_flags, uint32_t r) +{ + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_samr_AcctFlags(struct ndr_pull *ndr, int ndr_flags, uint32_t *r) +{ + uint32_t v; + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); + *r = v; + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_AcctFlags(struct ndr_print *ndr, const char *name, uint32_t r) +{ + ndr_print_uint32(ndr, name, r); + ndr->depth++; + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "ACB_DISABLED", ACB_DISABLED, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "ACB_HOMDIRREQ", ACB_HOMDIRREQ, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "ACB_PWNOTREQ", ACB_PWNOTREQ, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "ACB_TEMPDUP", ACB_TEMPDUP, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "ACB_NORMAL", ACB_NORMAL, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "ACB_MNS", ACB_MNS, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "ACB_DOMTRUST", ACB_DOMTRUST, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "ACB_WSTRUST", ACB_WSTRUST, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "ACB_SVRTRUST", ACB_SVRTRUST, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "ACB_PWNOEXP", ACB_PWNOEXP, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "ACB_AUTOLOCK", ACB_AUTOLOCK, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "ACB_ENC_TXT_PWD_ALLOWED", ACB_ENC_TXT_PWD_ALLOWED, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "ACB_SMARTCARD_REQUIRED", ACB_SMARTCARD_REQUIRED, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "ACB_TRUSTED_FOR_DELEGATION", ACB_TRUSTED_FOR_DELEGATION, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "ACB_NOT_DELEGATED", ACB_NOT_DELEGATED, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "ACB_USE_DES_KEY_ONLY", ACB_USE_DES_KEY_ONLY, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "ACB_DONT_REQUIRE_PREAUTH", ACB_DONT_REQUIRE_PREAUTH, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "ACB_PW_EXPIRED", ACB_PW_EXPIRED, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "ACB_NO_AUTH_DATA_REQD", ACB_NO_AUTH_DATA_REQD, r); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_ConnectAccessMask(struct ndr_push *ndr, int ndr_flags, uint32_t r) +{ + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_ConnectAccessMask(struct ndr_pull *ndr, int ndr_flags, uint32_t *r) +{ + uint32_t v; + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); + *r = v; + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_ConnectAccessMask(struct ndr_print *ndr, const char *name, uint32_t r) +{ + ndr_print_uint32(ndr, name, r); + ndr->depth++; + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_ACCESS_CONNECT_TO_SERVER", SAMR_ACCESS_CONNECT_TO_SERVER, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_ACCESS_SHUTDOWN_SERVER", SAMR_ACCESS_SHUTDOWN_SERVER, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_ACCESS_INITIALIZE_SERVER", SAMR_ACCESS_INITIALIZE_SERVER, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_ACCESS_CREATE_DOMAIN", SAMR_ACCESS_CREATE_DOMAIN, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_ACCESS_ENUM_DOMAINS", SAMR_ACCESS_ENUM_DOMAINS, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_ACCESS_OPEN_DOMAIN", SAMR_ACCESS_OPEN_DOMAIN, r); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_UserAccessMask(struct ndr_push *ndr, int ndr_flags, uint32_t r) +{ + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_UserAccessMask(struct ndr_pull *ndr, int ndr_flags, uint32_t *r) +{ + uint32_t v; + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); + *r = v; + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_UserAccessMask(struct ndr_print *ndr, const char *name, uint32_t r) +{ + ndr_print_uint32(ndr, name, r); + ndr->depth++; + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "USER_ACCESS_GET_NAME_ETC", USER_ACCESS_GET_NAME_ETC, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "USER_ACCESS_GET_LOCALE", USER_ACCESS_GET_LOCALE, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "USER_ACCESS_SET_LOC_COM", USER_ACCESS_SET_LOC_COM, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "USER_ACCESS_GET_LOGONINFO", USER_ACCESS_GET_LOGONINFO, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "USER_ACCESS_GET_ATTRIBUTES", USER_ACCESS_GET_ATTRIBUTES, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "USER_ACCESS_SET_ATTRIBUTES", USER_ACCESS_SET_ATTRIBUTES, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "USER_ACCESS_CHANGE_PASSWORD", USER_ACCESS_CHANGE_PASSWORD, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "USER_ACCESS_SET_PASSWORD", USER_ACCESS_SET_PASSWORD, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "USER_ACCESS_GET_GROUPS", USER_ACCESS_GET_GROUPS, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "USER_ACCESS_GET_GROUP_MEMBERSHIP", USER_ACCESS_GET_GROUP_MEMBERSHIP, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "USER_ACCESS_CHANGE_GROUP_MEMBERSHIP", USER_ACCESS_CHANGE_GROUP_MEMBERSHIP, r); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_DomainAccessMask(struct ndr_push *ndr, int ndr_flags, uint32_t r) +{ + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_DomainAccessMask(struct ndr_pull *ndr, int ndr_flags, uint32_t *r) +{ + uint32_t v; + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); + *r = v; + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_DomainAccessMask(struct ndr_print *ndr, const char *name, uint32_t r) +{ + ndr_print_uint32(ndr, name, r); + ndr->depth++; + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DOMAIN_ACCESS_LOOKUP_INFO_1", DOMAIN_ACCESS_LOOKUP_INFO_1, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DOMAIN_ACCESS_SET_INFO_1", DOMAIN_ACCESS_SET_INFO_1, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DOMAIN_ACCESS_LOOKUP_INFO_2", DOMAIN_ACCESS_LOOKUP_INFO_2, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DOMAIN_ACCESS_SET_INFO_2", DOMAIN_ACCESS_SET_INFO_2, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DOMAIN_ACCESS_CREATE_USER", DOMAIN_ACCESS_CREATE_USER, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DOMAIN_ACCESS_CREATE_GROUP", DOMAIN_ACCESS_CREATE_GROUP, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DOMAIN_ACCESS_CREATE_ALIAS", DOMAIN_ACCESS_CREATE_ALIAS, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DOMAIN_ACCESS_LOOKUP_ALIAS", DOMAIN_ACCESS_LOOKUP_ALIAS, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DOMAIN_ACCESS_ENUM_ACCOUNTS", DOMAIN_ACCESS_ENUM_ACCOUNTS, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DOMAIN_ACCESS_OPEN_ACCOUNT", DOMAIN_ACCESS_OPEN_ACCOUNT, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DOMAIN_ACCESS_SET_INFO_3", DOMAIN_ACCESS_SET_INFO_3, r); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_GroupAccessMask(struct ndr_push *ndr, int ndr_flags, uint32_t r) +{ + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_GroupAccessMask(struct ndr_pull *ndr, int ndr_flags, uint32_t *r) +{ + uint32_t v; + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); + *r = v; + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_GroupAccessMask(struct ndr_print *ndr, const char *name, uint32_t r) +{ + ndr_print_uint32(ndr, name, r); + ndr->depth++; + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "GROUP_ACCESS_LOOKUP_INFO", GROUP_ACCESS_LOOKUP_INFO, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "GROUP_ACCESS_SET_INFO", GROUP_ACCESS_SET_INFO, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "GROUP_ACCESS_ADD_MEMBER", GROUP_ACCESS_ADD_MEMBER, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "GROUP_ACCESS_REMOVE_MEMBER", GROUP_ACCESS_REMOVE_MEMBER, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "GROUP_ACCESS_GET_MEMBERS", GROUP_ACCESS_GET_MEMBERS, r); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_AliasAccessMask(struct ndr_push *ndr, int ndr_flags, uint32_t r) +{ + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_AliasAccessMask(struct ndr_pull *ndr, int ndr_flags, uint32_t *r) +{ + uint32_t v; + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); + *r = v; + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_AliasAccessMask(struct ndr_print *ndr, const char *name, uint32_t r) +{ + ndr_print_uint32(ndr, name, r); + ndr->depth++; + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "ALIAS_ACCESS_ADD_MEMBER", ALIAS_ACCESS_ADD_MEMBER, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "ALIAS_ACCESS_REMOVE_MEMBER", ALIAS_ACCESS_REMOVE_MEMBER, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "ALIAS_ACCESS_GET_MEMBERS", ALIAS_ACCESS_GET_MEMBERS, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "ALIAS_ACCESS_LOOKUP_INFO", ALIAS_ACCESS_LOOKUP_INFO, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "ALIAS_ACCESS_SET_INFO", ALIAS_ACCESS_SET_INFO, r); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_SamEntry(struct ndr_push *ndr, int ndr_flags, const struct samr_SamEntry *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->idx)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->name)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->name)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_SamEntry(struct ndr_pull *ndr, int ndr_flags, struct samr_SamEntry *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->idx)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->name)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->name)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_SamEntry(struct ndr_print *ndr, const char *name, const struct samr_SamEntry *r) +{ + ndr_print_struct(ndr, name, "samr_SamEntry"); + ndr->depth++; + ndr_print_uint32(ndr, "idx", r->idx); + ndr_print_lsa_String(ndr, "name", &r->name); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_SamArray(struct ndr_push *ndr, int ndr_flags, const struct samr_SamArray *r) +{ + uint32_t cntr_entries_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->entries)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->entries) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + for (cntr_entries_1 = 0; cntr_entries_1 < r->count; cntr_entries_1++) { + NDR_CHECK(ndr_push_samr_SamEntry(ndr, NDR_SCALARS, &r->entries[cntr_entries_1])); + } + for (cntr_entries_1 = 0; cntr_entries_1 < r->count; cntr_entries_1++) { + NDR_CHECK(ndr_push_samr_SamEntry(ndr, NDR_BUFFERS, &r->entries[cntr_entries_1])); + } + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_SamArray(struct ndr_pull *ndr, int ndr_flags, struct samr_SamArray *r) +{ + uint32_t _ptr_entries; + uint32_t cntr_entries_1; + TALLOC_CTX *_mem_save_entries_0; + TALLOC_CTX *_mem_save_entries_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_entries)); + if (_ptr_entries) { + NDR_PULL_ALLOC(ndr, r->entries); + } else { + r->entries = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->entries) { + _mem_save_entries_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->entries, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->entries)); + NDR_PULL_ALLOC_N(ndr, r->entries, ndr_get_array_size(ndr, &r->entries)); + _mem_save_entries_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->entries, 0); + for (cntr_entries_1 = 0; cntr_entries_1 < r->count; cntr_entries_1++) { + NDR_CHECK(ndr_pull_samr_SamEntry(ndr, NDR_SCALARS, &r->entries[cntr_entries_1])); + } + for (cntr_entries_1 = 0; cntr_entries_1 < r->count; cntr_entries_1++) { + NDR_CHECK(ndr_pull_samr_SamEntry(ndr, NDR_BUFFERS, &r->entries[cntr_entries_1])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_entries_1, 0); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_entries_0, 0); + } + if (r->entries) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->entries, r->count)); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_SamArray(struct ndr_print *ndr, const char *name, const struct samr_SamArray *r) +{ + uint32_t cntr_entries_1; + ndr_print_struct(ndr, name, "samr_SamArray"); + ndr->depth++; + ndr_print_uint32(ndr, "count", r->count); + ndr_print_ptr(ndr, "entries", r->entries); + ndr->depth++; + if (r->entries) { + ndr->print(ndr, "%s: ARRAY(%d)", "entries", r->count); + ndr->depth++; + for (cntr_entries_1=0;cntr_entries_1<r->count;cntr_entries_1++) { + char *idx_1=NULL; + asprintf(&idx_1, "[%d]", cntr_entries_1); + if (idx_1) { + ndr_print_samr_SamEntry(ndr, "entries", &r->entries[cntr_entries_1]); + free(idx_1); + } + } + ndr->depth--; + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_Role(struct ndr_push *ndr, int ndr_flags, enum samr_Role r) +{ + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_Role(struct ndr_pull *ndr, int ndr_flags, enum samr_Role *r) +{ + uint32_t v; + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); + *r = v; + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_Role(struct ndr_print *ndr, const char *name, enum samr_Role r) +{ + const char *val = NULL; + + switch (r) { + case SAMR_ROLE_STANDALONE: val = "SAMR_ROLE_STANDALONE"; break; + case SAMR_ROLE_DOMAIN_MEMBER: val = "SAMR_ROLE_DOMAIN_MEMBER"; break; + case SAMR_ROLE_DOMAIN_BDC: val = "SAMR_ROLE_DOMAIN_BDC"; break; + case SAMR_ROLE_DOMAIN_PDC: val = "SAMR_ROLE_DOMAIN_PDC"; break; + } + ndr_print_enum(ndr, name, "ENUM", val, r); +} + +_PUBLIC_ enum ndr_err_code ndr_push_samr_PasswordProperties(struct ndr_push *ndr, int ndr_flags, uint32_t r) +{ + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_samr_PasswordProperties(struct ndr_pull *ndr, int ndr_flags, uint32_t *r) +{ + uint32_t v; + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); + *r = v; + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_PasswordProperties(struct ndr_print *ndr, const char *name, uint32_t r) +{ + ndr_print_uint32(ndr, name, r); + ndr->depth++; + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DOMAIN_PASSWORD_COMPLEX", DOMAIN_PASSWORD_COMPLEX, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DOMAIN_PASSWORD_NO_ANON_CHANGE", DOMAIN_PASSWORD_NO_ANON_CHANGE, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DOMAIN_PASSWORD_NO_CLEAR_CHANGE", DOMAIN_PASSWORD_NO_CLEAR_CHANGE, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DOMAIN_PASSWORD_LOCKOUT_ADMINS", DOMAIN_PASSWORD_LOCKOUT_ADMINS, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DOMAIN_PASSWORD_STORE_CLEARTEXT", DOMAIN_PASSWORD_STORE_CLEARTEXT, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DOMAIN_REFUSE_PASSWORD_CHANGE", DOMAIN_REFUSE_PASSWORD_CHANGE, r); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_DomInfo1(struct ndr_push *ndr, int ndr_flags, const struct samr_DomInfo1 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->min_password_length)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->password_history_length)); + NDR_CHECK(ndr_push_samr_PasswordProperties(ndr, NDR_SCALARS, r->password_properties)); + NDR_CHECK(ndr_push_dlong(ndr, NDR_SCALARS, r->max_password_age)); + NDR_CHECK(ndr_push_dlong(ndr, NDR_SCALARS, r->min_password_age)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_DomInfo1(struct ndr_pull *ndr, int ndr_flags, struct samr_DomInfo1 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->min_password_length)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->password_history_length)); + NDR_CHECK(ndr_pull_samr_PasswordProperties(ndr, NDR_SCALARS, &r->password_properties)); + NDR_CHECK(ndr_pull_dlong(ndr, NDR_SCALARS, &r->max_password_age)); + NDR_CHECK(ndr_pull_dlong(ndr, NDR_SCALARS, &r->min_password_age)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_DomInfo1(struct ndr_print *ndr, const char *name, const struct samr_DomInfo1 *r) +{ + ndr_print_struct(ndr, name, "samr_DomInfo1"); + ndr->depth++; + ndr_print_uint16(ndr, "min_password_length", r->min_password_length); + ndr_print_uint16(ndr, "password_history_length", r->password_history_length); + ndr_print_samr_PasswordProperties(ndr, "password_properties", r->password_properties); + ndr_print_dlong(ndr, "max_password_age", r->max_password_age); + ndr_print_dlong(ndr, "min_password_age", r->min_password_age); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_DomInfo2(struct ndr_push *ndr, int ndr_flags, const struct samr_DomInfo2 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->force_logoff_time)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->comment)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->domain_name)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->primary)); + NDR_CHECK(ndr_push_udlong(ndr, NDR_SCALARS, r->sequence_num)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown2)); + NDR_CHECK(ndr_push_samr_Role(ndr, NDR_SCALARS, r->role)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown3)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_users)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_groups)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_aliases)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->comment)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->domain_name)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->primary)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_DomInfo2(struct ndr_pull *ndr, int ndr_flags, struct samr_DomInfo2 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->force_logoff_time)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->comment)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->domain_name)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->primary)); + NDR_CHECK(ndr_pull_udlong(ndr, NDR_SCALARS, &r->sequence_num)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown2)); + NDR_CHECK(ndr_pull_samr_Role(ndr, NDR_SCALARS, &r->role)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown3)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->num_users)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->num_groups)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->num_aliases)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->comment)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->domain_name)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->primary)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_DomInfo2(struct ndr_print *ndr, const char *name, const struct samr_DomInfo2 *r) +{ + ndr_print_struct(ndr, name, "samr_DomInfo2"); + ndr->depth++; + ndr_print_NTTIME(ndr, "force_logoff_time", r->force_logoff_time); + ndr_print_lsa_String(ndr, "comment", &r->comment); + ndr_print_lsa_String(ndr, "domain_name", &r->domain_name); + ndr_print_lsa_String(ndr, "primary", &r->primary); + ndr_print_udlong(ndr, "sequence_num", r->sequence_num); + ndr_print_uint32(ndr, "unknown2", r->unknown2); + ndr_print_samr_Role(ndr, "role", r->role); + ndr_print_uint32(ndr, "unknown3", r->unknown3); + ndr_print_uint32(ndr, "num_users", r->num_users); + ndr_print_uint32(ndr, "num_groups", r->num_groups); + ndr_print_uint32(ndr, "num_aliases", r->num_aliases); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_DomInfo3(struct ndr_push *ndr, int ndr_flags, const struct samr_DomInfo3 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->force_logoff_time)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_DomInfo3(struct ndr_pull *ndr, int ndr_flags, struct samr_DomInfo3 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->force_logoff_time)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_DomInfo3(struct ndr_print *ndr, const char *name, const struct samr_DomInfo3 *r) +{ + ndr_print_struct(ndr, name, "samr_DomInfo3"); + ndr->depth++; + ndr_print_NTTIME(ndr, "force_logoff_time", r->force_logoff_time); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_DomInfo4(struct ndr_push *ndr, int ndr_flags, const struct samr_DomInfo4 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->comment)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->comment)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_DomInfo4(struct ndr_pull *ndr, int ndr_flags, struct samr_DomInfo4 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->comment)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->comment)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_DomInfo4(struct ndr_print *ndr, const char *name, const struct samr_DomInfo4 *r) +{ + ndr_print_struct(ndr, name, "samr_DomInfo4"); + ndr->depth++; + ndr_print_lsa_String(ndr, "comment", &r->comment); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_DomInfo5(struct ndr_push *ndr, int ndr_flags, const struct samr_DomInfo5 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->domain_name)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->domain_name)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_DomInfo5(struct ndr_pull *ndr, int ndr_flags, struct samr_DomInfo5 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->domain_name)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->domain_name)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_DomInfo5(struct ndr_print *ndr, const char *name, const struct samr_DomInfo5 *r) +{ + ndr_print_struct(ndr, name, "samr_DomInfo5"); + ndr->depth++; + ndr_print_lsa_String(ndr, "domain_name", &r->domain_name); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_DomInfo6(struct ndr_push *ndr, int ndr_flags, const struct samr_DomInfo6 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->primary)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->primary)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_DomInfo6(struct ndr_pull *ndr, int ndr_flags, struct samr_DomInfo6 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->primary)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->primary)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_DomInfo6(struct ndr_print *ndr, const char *name, const struct samr_DomInfo6 *r) +{ + ndr_print_struct(ndr, name, "samr_DomInfo6"); + ndr->depth++; + ndr_print_lsa_String(ndr, "primary", &r->primary); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_DomInfo7(struct ndr_push *ndr, int ndr_flags, const struct samr_DomInfo7 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_samr_Role(ndr, NDR_SCALARS, r->role)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_DomInfo7(struct ndr_pull *ndr, int ndr_flags, struct samr_DomInfo7 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_samr_Role(ndr, NDR_SCALARS, &r->role)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_DomInfo7(struct ndr_print *ndr, const char *name, const struct samr_DomInfo7 *r) +{ + ndr_print_struct(ndr, name, "samr_DomInfo7"); + ndr->depth++; + ndr_print_samr_Role(ndr, "role", r->role); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_DomInfo8(struct ndr_push *ndr, int ndr_flags, const struct samr_DomInfo8 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 8)); + NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->sequence_num)); + NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->domain_create_time)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_DomInfo8(struct ndr_pull *ndr, int ndr_flags, struct samr_DomInfo8 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 8)); + NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->sequence_num)); + NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->domain_create_time)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_DomInfo8(struct ndr_print *ndr, const char *name, const struct samr_DomInfo8 *r) +{ + ndr_print_struct(ndr, name, "samr_DomInfo8"); + ndr->depth++; + ndr_print_hyper(ndr, "sequence_num", r->sequence_num); + ndr_print_NTTIME(ndr, "domain_create_time", r->domain_create_time); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_DomInfo9(struct ndr_push *ndr, int ndr_flags, const struct samr_DomInfo9 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_DomInfo9(struct ndr_pull *ndr, int ndr_flags, struct samr_DomInfo9 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_DomInfo9(struct ndr_print *ndr, const char *name, const struct samr_DomInfo9 *r) +{ + ndr_print_struct(ndr, name, "samr_DomInfo9"); + ndr->depth++; + ndr_print_uint32(ndr, "unknown", r->unknown); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_DomInfo11(struct ndr_push *ndr, int ndr_flags, const struct samr_DomInfo11 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 8)); + NDR_CHECK(ndr_push_samr_DomInfo2(ndr, NDR_SCALARS, &r->info2)); + NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->lockout_duration)); + NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->lockout_window)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->lockout_threshold)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_push_samr_DomInfo2(ndr, NDR_BUFFERS, &r->info2)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_DomInfo11(struct ndr_pull *ndr, int ndr_flags, struct samr_DomInfo11 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 8)); + NDR_CHECK(ndr_pull_samr_DomInfo2(ndr, NDR_SCALARS, &r->info2)); + NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->lockout_duration)); + NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->lockout_window)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->lockout_threshold)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_pull_samr_DomInfo2(ndr, NDR_BUFFERS, &r->info2)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_DomInfo11(struct ndr_print *ndr, const char *name, const struct samr_DomInfo11 *r) +{ + ndr_print_struct(ndr, name, "samr_DomInfo11"); + ndr->depth++; + ndr_print_samr_DomInfo2(ndr, "info2", &r->info2); + ndr_print_hyper(ndr, "lockout_duration", r->lockout_duration); + ndr_print_hyper(ndr, "lockout_window", r->lockout_window); + ndr_print_uint16(ndr, "lockout_threshold", r->lockout_threshold); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_DomInfo12(struct ndr_push *ndr, int ndr_flags, const struct samr_DomInfo12 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 8)); + NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->lockout_duration)); + NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->lockout_window)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->lockout_threshold)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_DomInfo12(struct ndr_pull *ndr, int ndr_flags, struct samr_DomInfo12 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 8)); + NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->lockout_duration)); + NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->lockout_window)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->lockout_threshold)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_DomInfo12(struct ndr_print *ndr, const char *name, const struct samr_DomInfo12 *r) +{ + ndr_print_struct(ndr, name, "samr_DomInfo12"); + ndr->depth++; + ndr_print_hyper(ndr, "lockout_duration", r->lockout_duration); + ndr_print_hyper(ndr, "lockout_window", r->lockout_window); + ndr_print_uint16(ndr, "lockout_threshold", r->lockout_threshold); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_DomInfo13(struct ndr_push *ndr, int ndr_flags, const struct samr_DomInfo13 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 8)); + NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->sequence_num)); + NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->domain_create_time)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown1)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown2)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_DomInfo13(struct ndr_pull *ndr, int ndr_flags, struct samr_DomInfo13 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 8)); + NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->sequence_num)); + NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->domain_create_time)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown1)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown2)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_DomInfo13(struct ndr_print *ndr, const char *name, const struct samr_DomInfo13 *r) +{ + ndr_print_struct(ndr, name, "samr_DomInfo13"); + ndr->depth++; + ndr_print_hyper(ndr, "sequence_num", r->sequence_num); + ndr_print_NTTIME(ndr, "domain_create_time", r->domain_create_time); + ndr_print_uint32(ndr, "unknown1", r->unknown1); + ndr_print_uint32(ndr, "unknown2", r->unknown2); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_DomainInfo(struct ndr_push *ndr, int ndr_flags, const union samr_DomainInfo *r) +{ + if (ndr_flags & NDR_SCALARS) { + int level = ndr_push_get_switch_value(ndr, r); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, level)); + switch (level) { + case 1: + NDR_CHECK(ndr_push_samr_DomInfo1(ndr, NDR_SCALARS, &r->info1)); + break; + + case 2: + NDR_CHECK(ndr_push_samr_DomInfo2(ndr, NDR_SCALARS, &r->info2)); + break; + + case 3: + NDR_CHECK(ndr_push_samr_DomInfo3(ndr, NDR_SCALARS, &r->info3)); + break; + + case 4: + NDR_CHECK(ndr_push_samr_DomInfo4(ndr, NDR_SCALARS, &r->info4)); + break; + + case 5: + NDR_CHECK(ndr_push_samr_DomInfo5(ndr, NDR_SCALARS, &r->info5)); + break; + + case 6: + NDR_CHECK(ndr_push_samr_DomInfo6(ndr, NDR_SCALARS, &r->info6)); + break; + + case 7: + NDR_CHECK(ndr_push_samr_DomInfo7(ndr, NDR_SCALARS, &r->info7)); + break; + + case 8: + NDR_CHECK(ndr_push_samr_DomInfo8(ndr, NDR_SCALARS, &r->info8)); + break; + + case 9: + NDR_CHECK(ndr_push_samr_DomInfo9(ndr, NDR_SCALARS, &r->info9)); + break; + + case 11: + NDR_CHECK(ndr_push_samr_DomInfo11(ndr, NDR_SCALARS, &r->info11)); + break; + + case 12: + NDR_CHECK(ndr_push_samr_DomInfo12(ndr, NDR_SCALARS, &r->info12)); + break; + + case 13: + NDR_CHECK(ndr_push_samr_DomInfo13(ndr, NDR_SCALARS, &r->info13)); + break; + + default: + return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + if (ndr_flags & NDR_BUFFERS) { + int level = ndr_push_get_switch_value(ndr, r); + switch (level) { + case 1: + break; + + case 2: + NDR_CHECK(ndr_push_samr_DomInfo2(ndr, NDR_BUFFERS, &r->info2)); + break; + + case 3: + break; + + case 4: + NDR_CHECK(ndr_push_samr_DomInfo4(ndr, NDR_BUFFERS, &r->info4)); + break; + + case 5: + NDR_CHECK(ndr_push_samr_DomInfo5(ndr, NDR_BUFFERS, &r->info5)); + break; + + case 6: + NDR_CHECK(ndr_push_samr_DomInfo6(ndr, NDR_BUFFERS, &r->info6)); + break; + + case 7: + break; + + case 8: + break; + + case 9: + break; + + case 11: + NDR_CHECK(ndr_push_samr_DomInfo11(ndr, NDR_BUFFERS, &r->info11)); + break; + + case 12: + break; + + case 13: + break; + + default: + return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_DomainInfo(struct ndr_pull *ndr, int ndr_flags, union samr_DomainInfo *r) +{ + int level; + uint16_t _level; + level = ndr_pull_get_switch_value(ndr, r); + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &_level)); + if (_level != level) { + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level); + } + switch (level) { + case 1: { + NDR_CHECK(ndr_pull_samr_DomInfo1(ndr, NDR_SCALARS, &r->info1)); + break; } + + case 2: { + NDR_CHECK(ndr_pull_samr_DomInfo2(ndr, NDR_SCALARS, &r->info2)); + break; } + + case 3: { + NDR_CHECK(ndr_pull_samr_DomInfo3(ndr, NDR_SCALARS, &r->info3)); + break; } + + case 4: { + NDR_CHECK(ndr_pull_samr_DomInfo4(ndr, NDR_SCALARS, &r->info4)); + break; } + + case 5: { + NDR_CHECK(ndr_pull_samr_DomInfo5(ndr, NDR_SCALARS, &r->info5)); + break; } + + case 6: { + NDR_CHECK(ndr_pull_samr_DomInfo6(ndr, NDR_SCALARS, &r->info6)); + break; } + + case 7: { + NDR_CHECK(ndr_pull_samr_DomInfo7(ndr, NDR_SCALARS, &r->info7)); + break; } + + case 8: { + NDR_CHECK(ndr_pull_samr_DomInfo8(ndr, NDR_SCALARS, &r->info8)); + break; } + + case 9: { + NDR_CHECK(ndr_pull_samr_DomInfo9(ndr, NDR_SCALARS, &r->info9)); + break; } + + case 11: { + NDR_CHECK(ndr_pull_samr_DomInfo11(ndr, NDR_SCALARS, &r->info11)); + break; } + + case 12: { + NDR_CHECK(ndr_pull_samr_DomInfo12(ndr, NDR_SCALARS, &r->info12)); + break; } + + case 13: { + NDR_CHECK(ndr_pull_samr_DomInfo13(ndr, NDR_SCALARS, &r->info13)); + break; } + + default: + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + if (ndr_flags & NDR_BUFFERS) { + switch (level) { + case 1: + break; + + case 2: + NDR_CHECK(ndr_pull_samr_DomInfo2(ndr, NDR_BUFFERS, &r->info2)); + break; + + case 3: + break; + + case 4: + NDR_CHECK(ndr_pull_samr_DomInfo4(ndr, NDR_BUFFERS, &r->info4)); + break; + + case 5: + NDR_CHECK(ndr_pull_samr_DomInfo5(ndr, NDR_BUFFERS, &r->info5)); + break; + + case 6: + NDR_CHECK(ndr_pull_samr_DomInfo6(ndr, NDR_BUFFERS, &r->info6)); + break; + + case 7: + break; + + case 8: + break; + + case 9: + break; + + case 11: + NDR_CHECK(ndr_pull_samr_DomInfo11(ndr, NDR_BUFFERS, &r->info11)); + break; + + case 12: + break; + + case 13: + break; + + default: + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_DomainInfo(struct ndr_print *ndr, const char *name, const union samr_DomainInfo *r) +{ + int level; + level = ndr_print_get_switch_value(ndr, r); + ndr_print_union(ndr, name, level, "samr_DomainInfo"); + switch (level) { + case 1: + ndr_print_samr_DomInfo1(ndr, "info1", &r->info1); + break; + + case 2: + ndr_print_samr_DomInfo2(ndr, "info2", &r->info2); + break; + + case 3: + ndr_print_samr_DomInfo3(ndr, "info3", &r->info3); + break; + + case 4: + ndr_print_samr_DomInfo4(ndr, "info4", &r->info4); + break; + + case 5: + ndr_print_samr_DomInfo5(ndr, "info5", &r->info5); + break; + + case 6: + ndr_print_samr_DomInfo6(ndr, "info6", &r->info6); + break; + + case 7: + ndr_print_samr_DomInfo7(ndr, "info7", &r->info7); + break; + + case 8: + ndr_print_samr_DomInfo8(ndr, "info8", &r->info8); + break; + + case 9: + ndr_print_samr_DomInfo9(ndr, "info9", &r->info9); + break; + + case 11: + ndr_print_samr_DomInfo11(ndr, "info11", &r->info11); + break; + + case 12: + ndr_print_samr_DomInfo12(ndr, "info12", &r->info12); + break; + + case 13: + ndr_print_samr_DomInfo13(ndr, "info13", &r->info13); + break; + + default: + ndr_print_bad_level(ndr, name, level); + } +} + +static enum ndr_err_code ndr_push_samr_Ids(struct ndr_push *ndr, int ndr_flags, const struct samr_Ids *r) +{ + uint32_t cntr_ids_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->ids)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->ids) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + for (cntr_ids_1 = 0; cntr_ids_1 < r->count; cntr_ids_1++) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->ids[cntr_ids_1])); + } + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_Ids(struct ndr_pull *ndr, int ndr_flags, struct samr_Ids *r) +{ + uint32_t _ptr_ids; + uint32_t cntr_ids_1; + TALLOC_CTX *_mem_save_ids_0; + TALLOC_CTX *_mem_save_ids_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); + if (r->count < 0 || r->count > 1024) { + return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range"); + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_ids)); + if (_ptr_ids) { + NDR_PULL_ALLOC(ndr, r->ids); + } else { + r->ids = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->ids) { + _mem_save_ids_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->ids, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->ids)); + NDR_PULL_ALLOC_N(ndr, r->ids, ndr_get_array_size(ndr, &r->ids)); + _mem_save_ids_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->ids, 0); + for (cntr_ids_1 = 0; cntr_ids_1 < r->count; cntr_ids_1++) { + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->ids[cntr_ids_1])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ids_1, 0); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ids_0, 0); + } + if (r->ids) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->ids, r->count)); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_Ids(struct ndr_print *ndr, const char *name, const struct samr_Ids *r) +{ + uint32_t cntr_ids_1; + ndr_print_struct(ndr, name, "samr_Ids"); + ndr->depth++; + ndr_print_uint32(ndr, "count", r->count); + ndr_print_ptr(ndr, "ids", r->ids); + ndr->depth++; + if (r->ids) { + ndr->print(ndr, "%s: ARRAY(%d)", "ids", r->count); + ndr->depth++; + for (cntr_ids_1=0;cntr_ids_1<r->count;cntr_ids_1++) { + char *idx_1=NULL; + asprintf(&idx_1, "[%d]", cntr_ids_1); + if (idx_1) { + ndr_print_uint32(ndr, "ids", r->ids[cntr_ids_1]); + free(idx_1); + } + } + ndr->depth--; + } + ndr->depth--; + ndr->depth--; +} + +_PUBLIC_ enum ndr_err_code ndr_push_samr_GroupAttrs(struct ndr_push *ndr, int ndr_flags, uint32_t r) +{ + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_samr_GroupAttrs(struct ndr_pull *ndr, int ndr_flags, uint32_t *r) +{ + uint32_t v; + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); + *r = v; + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_GroupAttrs(struct ndr_print *ndr, const char *name, uint32_t r) +{ + ndr_print_uint32(ndr, name, r); + ndr->depth++; + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SE_GROUP_MANDATORY", SE_GROUP_MANDATORY, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SE_GROUP_ENABLED_BY_DEFAULT", SE_GROUP_ENABLED_BY_DEFAULT, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SE_GROUP_ENABLED", SE_GROUP_ENABLED, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SE_GROUP_OWNER", SE_GROUP_OWNER, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SE_GROUP_USE_FOR_DENY_ONLY", SE_GROUP_USE_FOR_DENY_ONLY, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SE_GROUP_RESOURCE", SE_GROUP_RESOURCE, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SE_GROUP_LOGON_ID", SE_GROUP_LOGON_ID, r); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_GroupInfoAll(struct ndr_push *ndr, int ndr_flags, const struct samr_GroupInfoAll *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->name)); + NDR_CHECK(ndr_push_samr_GroupAttrs(ndr, NDR_SCALARS, r->attributes)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_members)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->description)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->name)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->description)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_GroupInfoAll(struct ndr_pull *ndr, int ndr_flags, struct samr_GroupInfoAll *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->name)); + NDR_CHECK(ndr_pull_samr_GroupAttrs(ndr, NDR_SCALARS, &r->attributes)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->num_members)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->description)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->name)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->description)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_GroupInfoAll(struct ndr_print *ndr, const char *name, const struct samr_GroupInfoAll *r) +{ + ndr_print_struct(ndr, name, "samr_GroupInfoAll"); + ndr->depth++; + ndr_print_lsa_String(ndr, "name", &r->name); + ndr_print_samr_GroupAttrs(ndr, "attributes", r->attributes); + ndr_print_uint32(ndr, "num_members", r->num_members); + ndr_print_lsa_String(ndr, "description", &r->description); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_GroupInfoAttributes(struct ndr_push *ndr, int ndr_flags, const struct samr_GroupInfoAttributes *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_samr_GroupAttrs(ndr, NDR_SCALARS, r->attributes)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_GroupInfoAttributes(struct ndr_pull *ndr, int ndr_flags, struct samr_GroupInfoAttributes *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_samr_GroupAttrs(ndr, NDR_SCALARS, &r->attributes)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_GroupInfoAttributes(struct ndr_print *ndr, const char *name, const struct samr_GroupInfoAttributes *r) +{ + ndr_print_struct(ndr, name, "samr_GroupInfoAttributes"); + ndr->depth++; + ndr_print_samr_GroupAttrs(ndr, "attributes", r->attributes); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_GroupInfoEnum(struct ndr_push *ndr, int ndr_flags, enum samr_GroupInfoEnum r) +{ + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r)); + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_GroupInfoEnum(struct ndr_pull *ndr, int ndr_flags, enum samr_GroupInfoEnum *r) +{ + uint16_t v; + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &v)); + *r = v; + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_GroupInfoEnum(struct ndr_print *ndr, const char *name, enum samr_GroupInfoEnum r) +{ + const char *val = NULL; + + switch (r) { + case GROUPINFOALL: val = "GROUPINFOALL"; break; + case GROUPINFONAME: val = "GROUPINFONAME"; break; + case GROUPINFOATTRIBUTES: val = "GROUPINFOATTRIBUTES"; break; + case GROUPINFODESCRIPTION: val = "GROUPINFODESCRIPTION"; break; + case GROUPINFOALL2: val = "GROUPINFOALL2"; break; + } + ndr_print_enum(ndr, name, "ENUM", val, r); +} + +static enum ndr_err_code ndr_push_samr_GroupInfo(struct ndr_push *ndr, int ndr_flags, const union samr_GroupInfo *r) +{ + if (ndr_flags & NDR_SCALARS) { + int level = ndr_push_get_switch_value(ndr, r); + NDR_CHECK(ndr_push_samr_GroupInfoEnum(ndr, NDR_SCALARS, level)); + switch (level) { + case GROUPINFOALL: + NDR_CHECK(ndr_push_samr_GroupInfoAll(ndr, NDR_SCALARS, &r->all)); + break; + + case GROUPINFONAME: + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->name)); + break; + + case GROUPINFOATTRIBUTES: + NDR_CHECK(ndr_push_samr_GroupInfoAttributes(ndr, NDR_SCALARS, &r->attributes)); + break; + + case GROUPINFODESCRIPTION: + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->description)); + break; + + case GROUPINFOALL2: + NDR_CHECK(ndr_push_samr_GroupInfoAll(ndr, NDR_SCALARS, &r->all2)); + break; + + default: + return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + if (ndr_flags & NDR_BUFFERS) { + int level = ndr_push_get_switch_value(ndr, r); + switch (level) { + case GROUPINFOALL: + NDR_CHECK(ndr_push_samr_GroupInfoAll(ndr, NDR_BUFFERS, &r->all)); + break; + + case GROUPINFONAME: + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->name)); + break; + + case GROUPINFOATTRIBUTES: + break; + + case GROUPINFODESCRIPTION: + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->description)); + break; + + case GROUPINFOALL2: + NDR_CHECK(ndr_push_samr_GroupInfoAll(ndr, NDR_BUFFERS, &r->all2)); + break; + + default: + return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_GroupInfo(struct ndr_pull *ndr, int ndr_flags, union samr_GroupInfo *r) +{ + int level; + uint16_t _level; + level = ndr_pull_get_switch_value(ndr, r); + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &_level)); + if (_level != level) { + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level); + } + switch (level) { + case GROUPINFOALL: { + NDR_CHECK(ndr_pull_samr_GroupInfoAll(ndr, NDR_SCALARS, &r->all)); + break; } + + case GROUPINFONAME: { + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->name)); + break; } + + case GROUPINFOATTRIBUTES: { + NDR_CHECK(ndr_pull_samr_GroupInfoAttributes(ndr, NDR_SCALARS, &r->attributes)); + break; } + + case GROUPINFODESCRIPTION: { + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->description)); + break; } + + case GROUPINFOALL2: { + NDR_CHECK(ndr_pull_samr_GroupInfoAll(ndr, NDR_SCALARS, &r->all2)); + break; } + + default: + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + if (ndr_flags & NDR_BUFFERS) { + switch (level) { + case GROUPINFOALL: + NDR_CHECK(ndr_pull_samr_GroupInfoAll(ndr, NDR_BUFFERS, &r->all)); + break; + + case GROUPINFONAME: + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->name)); + break; + + case GROUPINFOATTRIBUTES: + break; + + case GROUPINFODESCRIPTION: + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->description)); + break; + + case GROUPINFOALL2: + NDR_CHECK(ndr_pull_samr_GroupInfoAll(ndr, NDR_BUFFERS, &r->all2)); + break; + + default: + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_GroupInfo(struct ndr_print *ndr, const char *name, const union samr_GroupInfo *r) +{ + int level; + level = ndr_print_get_switch_value(ndr, r); + ndr_print_union(ndr, name, level, "samr_GroupInfo"); + switch (level) { + case GROUPINFOALL: + ndr_print_samr_GroupInfoAll(ndr, "all", &r->all); + break; + + case GROUPINFONAME: + ndr_print_lsa_String(ndr, "name", &r->name); + break; + + case GROUPINFOATTRIBUTES: + ndr_print_samr_GroupInfoAttributes(ndr, "attributes", &r->attributes); + break; + + case GROUPINFODESCRIPTION: + ndr_print_lsa_String(ndr, "description", &r->description); + break; + + case GROUPINFOALL2: + ndr_print_samr_GroupInfoAll(ndr, "all2", &r->all2); + break; + + default: + ndr_print_bad_level(ndr, name, level); + } +} + +static enum ndr_err_code ndr_push_samr_RidTypeArray(struct ndr_push *ndr, int ndr_flags, const struct samr_RidTypeArray *r) +{ + uint32_t cntr_rids_1; + uint32_t cntr_types_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->rids)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->types)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->rids) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + for (cntr_rids_1 = 0; cntr_rids_1 < r->count; cntr_rids_1++) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->rids[cntr_rids_1])); + } + } + if (r->types) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + for (cntr_types_1 = 0; cntr_types_1 < r->count; cntr_types_1++) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->types[cntr_types_1])); + } + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_RidTypeArray(struct ndr_pull *ndr, int ndr_flags, struct samr_RidTypeArray *r) +{ + uint32_t _ptr_rids; + uint32_t cntr_rids_1; + TALLOC_CTX *_mem_save_rids_0; + TALLOC_CTX *_mem_save_rids_1; + uint32_t _ptr_types; + uint32_t cntr_types_1; + TALLOC_CTX *_mem_save_types_0; + TALLOC_CTX *_mem_save_types_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_rids)); + if (_ptr_rids) { + NDR_PULL_ALLOC(ndr, r->rids); + } else { + r->rids = NULL; + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_types)); + if (_ptr_types) { + NDR_PULL_ALLOC(ndr, r->types); + } else { + r->types = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->rids) { + _mem_save_rids_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->rids, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->rids)); + NDR_PULL_ALLOC_N(ndr, r->rids, ndr_get_array_size(ndr, &r->rids)); + _mem_save_rids_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->rids, 0); + for (cntr_rids_1 = 0; cntr_rids_1 < r->count; cntr_rids_1++) { + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->rids[cntr_rids_1])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_rids_1, 0); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_rids_0, 0); + } + if (r->types) { + _mem_save_types_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->types, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->types)); + NDR_PULL_ALLOC_N(ndr, r->types, ndr_get_array_size(ndr, &r->types)); + _mem_save_types_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->types, 0); + for (cntr_types_1 = 0; cntr_types_1 < r->count; cntr_types_1++) { + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->types[cntr_types_1])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_types_1, 0); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_types_0, 0); + } + if (r->rids) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->rids, r->count)); + } + if (r->types) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->types, r->count)); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_RidTypeArray(struct ndr_print *ndr, const char *name, const struct samr_RidTypeArray *r) +{ + uint32_t cntr_rids_1; + uint32_t cntr_types_1; + ndr_print_struct(ndr, name, "samr_RidTypeArray"); + ndr->depth++; + ndr_print_uint32(ndr, "count", r->count); + ndr_print_ptr(ndr, "rids", r->rids); + ndr->depth++; + if (r->rids) { + ndr->print(ndr, "%s: ARRAY(%d)", "rids", r->count); + ndr->depth++; + for (cntr_rids_1=0;cntr_rids_1<r->count;cntr_rids_1++) { + char *idx_1=NULL; + asprintf(&idx_1, "[%d]", cntr_rids_1); + if (idx_1) { + ndr_print_uint32(ndr, "rids", r->rids[cntr_rids_1]); + free(idx_1); + } + } + ndr->depth--; + } + ndr->depth--; + ndr_print_ptr(ndr, "types", r->types); + ndr->depth++; + if (r->types) { + ndr->print(ndr, "%s: ARRAY(%d)", "types", r->count); + ndr->depth++; + for (cntr_types_1=0;cntr_types_1<r->count;cntr_types_1++) { + char *idx_1=NULL; + asprintf(&idx_1, "[%d]", cntr_types_1); + if (idx_1) { + ndr_print_uint32(ndr, "types", r->types[cntr_types_1]); + free(idx_1); + } + } + ndr->depth--; + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_AliasInfoAll(struct ndr_push *ndr, int ndr_flags, const struct samr_AliasInfoAll *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->name)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_members)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->description)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->name)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->description)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_AliasInfoAll(struct ndr_pull *ndr, int ndr_flags, struct samr_AliasInfoAll *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->name)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->num_members)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->description)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->name)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->description)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_AliasInfoAll(struct ndr_print *ndr, const char *name, const struct samr_AliasInfoAll *r) +{ + ndr_print_struct(ndr, name, "samr_AliasInfoAll"); + ndr->depth++; + ndr_print_lsa_String(ndr, "name", &r->name); + ndr_print_uint32(ndr, "num_members", r->num_members); + ndr_print_lsa_String(ndr, "description", &r->description); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_AliasInfoEnum(struct ndr_push *ndr, int ndr_flags, enum samr_AliasInfoEnum r) +{ + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r)); + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_AliasInfoEnum(struct ndr_pull *ndr, int ndr_flags, enum samr_AliasInfoEnum *r) +{ + uint16_t v; + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &v)); + *r = v; + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_AliasInfoEnum(struct ndr_print *ndr, const char *name, enum samr_AliasInfoEnum r) +{ + const char *val = NULL; + + switch (r) { + case ALIASINFOALL: val = "ALIASINFOALL"; break; + case ALIASINFONAME: val = "ALIASINFONAME"; break; + case ALIASINFODESCRIPTION: val = "ALIASINFODESCRIPTION"; break; + } + ndr_print_enum(ndr, name, "ENUM", val, r); +} + +static enum ndr_err_code ndr_push_samr_AliasInfo(struct ndr_push *ndr, int ndr_flags, const union samr_AliasInfo *r) +{ + if (ndr_flags & NDR_SCALARS) { + int level = ndr_push_get_switch_value(ndr, r); + NDR_CHECK(ndr_push_samr_AliasInfoEnum(ndr, NDR_SCALARS, level)); + switch (level) { + case ALIASINFOALL: + NDR_CHECK(ndr_push_samr_AliasInfoAll(ndr, NDR_SCALARS, &r->all)); + break; + + case ALIASINFONAME: + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->name)); + break; + + case ALIASINFODESCRIPTION: + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->description)); + break; + + default: + return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + if (ndr_flags & NDR_BUFFERS) { + int level = ndr_push_get_switch_value(ndr, r); + switch (level) { + case ALIASINFOALL: + NDR_CHECK(ndr_push_samr_AliasInfoAll(ndr, NDR_BUFFERS, &r->all)); + break; + + case ALIASINFONAME: + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->name)); + break; + + case ALIASINFODESCRIPTION: + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->description)); + break; + + default: + return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_AliasInfo(struct ndr_pull *ndr, int ndr_flags, union samr_AliasInfo *r) +{ + int level; + uint16_t _level; + level = ndr_pull_get_switch_value(ndr, r); + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &_level)); + if (_level != level) { + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level); + } + switch (level) { + case ALIASINFOALL: { + NDR_CHECK(ndr_pull_samr_AliasInfoAll(ndr, NDR_SCALARS, &r->all)); + break; } + + case ALIASINFONAME: { + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->name)); + break; } + + case ALIASINFODESCRIPTION: { + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->description)); + break; } + + default: + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + if (ndr_flags & NDR_BUFFERS) { + switch (level) { + case ALIASINFOALL: + NDR_CHECK(ndr_pull_samr_AliasInfoAll(ndr, NDR_BUFFERS, &r->all)); + break; + + case ALIASINFONAME: + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->name)); + break; + + case ALIASINFODESCRIPTION: + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->description)); + break; + + default: + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_AliasInfo(struct ndr_print *ndr, const char *name, const union samr_AliasInfo *r) +{ + int level; + level = ndr_print_get_switch_value(ndr, r); + ndr_print_union(ndr, name, level, "samr_AliasInfo"); + switch (level) { + case ALIASINFOALL: + ndr_print_samr_AliasInfoAll(ndr, "all", &r->all); + break; + + case ALIASINFONAME: + ndr_print_lsa_String(ndr, "name", &r->name); + break; + + case ALIASINFODESCRIPTION: + ndr_print_lsa_String(ndr, "description", &r->description); + break; + + default: + ndr_print_bad_level(ndr, name, level); + } +} + +static enum ndr_err_code ndr_push_samr_UserInfo1(struct ndr_push *ndr, int ndr_flags, const struct samr_UserInfo1 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->account_name)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->full_name)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->primary_gid)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->description)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->comment)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->account_name)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->full_name)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->description)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->comment)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_UserInfo1(struct ndr_pull *ndr, int ndr_flags, struct samr_UserInfo1 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->account_name)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->full_name)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->primary_gid)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->description)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->comment)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->account_name)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->full_name)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->description)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->comment)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_UserInfo1(struct ndr_print *ndr, const char *name, const struct samr_UserInfo1 *r) +{ + ndr_print_struct(ndr, name, "samr_UserInfo1"); + ndr->depth++; + ndr_print_lsa_String(ndr, "account_name", &r->account_name); + ndr_print_lsa_String(ndr, "full_name", &r->full_name); + ndr_print_uint32(ndr, "primary_gid", r->primary_gid); + ndr_print_lsa_String(ndr, "description", &r->description); + ndr_print_lsa_String(ndr, "comment", &r->comment); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_UserInfo2(struct ndr_push *ndr, int ndr_flags, const struct samr_UserInfo2 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->comment)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->country_code)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->code_page)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->comment)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_UserInfo2(struct ndr_pull *ndr, int ndr_flags, struct samr_UserInfo2 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->comment)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->country_code)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->code_page)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->comment)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_UserInfo2(struct ndr_print *ndr, const char *name, const struct samr_UserInfo2 *r) +{ + ndr_print_struct(ndr, name, "samr_UserInfo2"); + ndr->depth++; + ndr_print_lsa_String(ndr, "comment", &r->comment); + ndr_print_lsa_String(ndr, "unknown", &r->unknown); + ndr_print_uint16(ndr, "country_code", r->country_code); + ndr_print_uint16(ndr, "code_page", r->code_page); + ndr->depth--; +} + +_PUBLIC_ enum ndr_err_code ndr_push_samr_LogonHours(struct ndr_push *ndr, int ndr_flags, const struct samr_LogonHours *r) +{ + { + uint32_t _flags_save_STRUCT = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->units_per_week)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->bits)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->bits) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 1260)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->units_per_week / 8)); + NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->bits, r->units_per_week / 8)); + } + } + ndr->flags = _flags_save_STRUCT; + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_samr_LogonHours(struct ndr_pull *ndr, int ndr_flags, struct samr_LogonHours *r) +{ + uint32_t _ptr_bits; + TALLOC_CTX *_mem_save_bits_0; + { + uint32_t _flags_save_STRUCT = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->units_per_week)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_bits)); + if (_ptr_bits) { + NDR_PULL_ALLOC(ndr, r->bits); + } else { + r->bits = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->bits) { + _mem_save_bits_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->bits, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->bits)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->bits)); + if (ndr_get_array_length(ndr, &r->bits) > ndr_get_array_size(ndr, &r->bits)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->bits), ndr_get_array_length(ndr, &r->bits)); + } + NDR_PULL_ALLOC_N(ndr, r->bits, ndr_get_array_size(ndr, &r->bits)); + NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->bits, ndr_get_array_length(ndr, &r->bits))); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_bits_0, 0); + } + if (r->bits) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->bits, 1260)); + } + if (r->bits) { + NDR_CHECK(ndr_check_array_length(ndr, (void*)&r->bits, r->units_per_week / 8)); + } + } + ndr->flags = _flags_save_STRUCT; + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_LogonHours(struct ndr_print *ndr, const char *name, const struct samr_LogonHours *r) +{ + ndr_print_struct(ndr, name, "samr_LogonHours"); + { + uint32_t _flags_save_STRUCT = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); + ndr->depth++; + ndr_print_uint16(ndr, "units_per_week", r->units_per_week); + ndr_print_ptr(ndr, "bits", r->bits); + ndr->depth++; + if (r->bits) { + ndr_print_array_uint8(ndr, "bits", r->bits, r->units_per_week / 8); + } + ndr->depth--; + ndr->depth--; + ndr->flags = _flags_save_STRUCT; + } +} + +static enum ndr_err_code ndr_push_samr_UserInfo3(struct ndr_push *ndr, int ndr_flags, const struct samr_UserInfo3 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->account_name)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->full_name)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->rid)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->primary_gid)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->home_directory)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->home_drive)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->logon_script)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->profile_path)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->workstations)); + NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->last_logon)); + NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->last_logoff)); + NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->last_password_change)); + NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->allow_password_change)); + NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->force_password_change)); + NDR_CHECK(ndr_push_samr_LogonHours(ndr, NDR_SCALARS, &r->logon_hours)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->bad_password_count)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->logon_count)); + NDR_CHECK(ndr_push_samr_AcctFlags(ndr, NDR_SCALARS, r->acct_flags)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->account_name)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->full_name)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->home_directory)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->home_drive)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->logon_script)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->profile_path)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->workstations)); + NDR_CHECK(ndr_push_samr_LogonHours(ndr, NDR_BUFFERS, &r->logon_hours)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_UserInfo3(struct ndr_pull *ndr, int ndr_flags, struct samr_UserInfo3 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->account_name)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->full_name)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->rid)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->primary_gid)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->home_directory)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->home_drive)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->logon_script)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->profile_path)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->workstations)); + NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->last_logon)); + NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->last_logoff)); + NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->last_password_change)); + NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->allow_password_change)); + NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->force_password_change)); + NDR_CHECK(ndr_pull_samr_LogonHours(ndr, NDR_SCALARS, &r->logon_hours)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->bad_password_count)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->logon_count)); + NDR_CHECK(ndr_pull_samr_AcctFlags(ndr, NDR_SCALARS, &r->acct_flags)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->account_name)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->full_name)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->home_directory)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->home_drive)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->logon_script)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->profile_path)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->workstations)); + NDR_CHECK(ndr_pull_samr_LogonHours(ndr, NDR_BUFFERS, &r->logon_hours)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_UserInfo3(struct ndr_print *ndr, const char *name, const struct samr_UserInfo3 *r) +{ + ndr_print_struct(ndr, name, "samr_UserInfo3"); + ndr->depth++; + ndr_print_lsa_String(ndr, "account_name", &r->account_name); + ndr_print_lsa_String(ndr, "full_name", &r->full_name); + ndr_print_uint32(ndr, "rid", r->rid); + ndr_print_uint32(ndr, "primary_gid", r->primary_gid); + ndr_print_lsa_String(ndr, "home_directory", &r->home_directory); + ndr_print_lsa_String(ndr, "home_drive", &r->home_drive); + ndr_print_lsa_String(ndr, "logon_script", &r->logon_script); + ndr_print_lsa_String(ndr, "profile_path", &r->profile_path); + ndr_print_lsa_String(ndr, "workstations", &r->workstations); + ndr_print_NTTIME(ndr, "last_logon", r->last_logon); + ndr_print_NTTIME(ndr, "last_logoff", r->last_logoff); + ndr_print_NTTIME(ndr, "last_password_change", r->last_password_change); + ndr_print_NTTIME(ndr, "allow_password_change", r->allow_password_change); + ndr_print_NTTIME(ndr, "force_password_change", r->force_password_change); + ndr_print_samr_LogonHours(ndr, "logon_hours", &r->logon_hours); + ndr_print_uint16(ndr, "bad_password_count", r->bad_password_count); + ndr_print_uint16(ndr, "logon_count", r->logon_count); + ndr_print_samr_AcctFlags(ndr, "acct_flags", r->acct_flags); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_UserInfo4(struct ndr_push *ndr, int ndr_flags, const struct samr_UserInfo4 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_samr_LogonHours(ndr, NDR_SCALARS, &r->logon_hours)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_push_samr_LogonHours(ndr, NDR_BUFFERS, &r->logon_hours)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_UserInfo4(struct ndr_pull *ndr, int ndr_flags, struct samr_UserInfo4 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_samr_LogonHours(ndr, NDR_SCALARS, &r->logon_hours)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_pull_samr_LogonHours(ndr, NDR_BUFFERS, &r->logon_hours)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_UserInfo4(struct ndr_print *ndr, const char *name, const struct samr_UserInfo4 *r) +{ + ndr_print_struct(ndr, name, "samr_UserInfo4"); + ndr->depth++; + ndr_print_samr_LogonHours(ndr, "logon_hours", &r->logon_hours); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_UserInfo5(struct ndr_push *ndr, int ndr_flags, const struct samr_UserInfo5 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->account_name)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->full_name)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->rid)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->primary_gid)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->home_directory)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->home_drive)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->logon_script)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->profile_path)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->description)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->workstations)); + NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->last_logon)); + NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->last_logoff)); + NDR_CHECK(ndr_push_samr_LogonHours(ndr, NDR_SCALARS, &r->logon_hours)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->bad_password_count)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->logon_count)); + NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->last_password_change)); + NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->acct_expiry)); + NDR_CHECK(ndr_push_samr_AcctFlags(ndr, NDR_SCALARS, r->acct_flags)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->account_name)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->full_name)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->home_directory)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->home_drive)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->logon_script)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->profile_path)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->description)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->workstations)); + NDR_CHECK(ndr_push_samr_LogonHours(ndr, NDR_BUFFERS, &r->logon_hours)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_UserInfo5(struct ndr_pull *ndr, int ndr_flags, struct samr_UserInfo5 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->account_name)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->full_name)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->rid)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->primary_gid)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->home_directory)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->home_drive)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->logon_script)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->profile_path)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->description)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->workstations)); + NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->last_logon)); + NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->last_logoff)); + NDR_CHECK(ndr_pull_samr_LogonHours(ndr, NDR_SCALARS, &r->logon_hours)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->bad_password_count)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->logon_count)); + NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->last_password_change)); + NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->acct_expiry)); + NDR_CHECK(ndr_pull_samr_AcctFlags(ndr, NDR_SCALARS, &r->acct_flags)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->account_name)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->full_name)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->home_directory)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->home_drive)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->logon_script)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->profile_path)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->description)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->workstations)); + NDR_CHECK(ndr_pull_samr_LogonHours(ndr, NDR_BUFFERS, &r->logon_hours)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_UserInfo5(struct ndr_print *ndr, const char *name, const struct samr_UserInfo5 *r) +{ + ndr_print_struct(ndr, name, "samr_UserInfo5"); + ndr->depth++; + ndr_print_lsa_String(ndr, "account_name", &r->account_name); + ndr_print_lsa_String(ndr, "full_name", &r->full_name); + ndr_print_uint32(ndr, "rid", r->rid); + ndr_print_uint32(ndr, "primary_gid", r->primary_gid); + ndr_print_lsa_String(ndr, "home_directory", &r->home_directory); + ndr_print_lsa_String(ndr, "home_drive", &r->home_drive); + ndr_print_lsa_String(ndr, "logon_script", &r->logon_script); + ndr_print_lsa_String(ndr, "profile_path", &r->profile_path); + ndr_print_lsa_String(ndr, "description", &r->description); + ndr_print_lsa_String(ndr, "workstations", &r->workstations); + ndr_print_NTTIME(ndr, "last_logon", r->last_logon); + ndr_print_NTTIME(ndr, "last_logoff", r->last_logoff); + ndr_print_samr_LogonHours(ndr, "logon_hours", &r->logon_hours); + ndr_print_uint16(ndr, "bad_password_count", r->bad_password_count); + ndr_print_uint16(ndr, "logon_count", r->logon_count); + ndr_print_NTTIME(ndr, "last_password_change", r->last_password_change); + ndr_print_NTTIME(ndr, "acct_expiry", r->acct_expiry); + ndr_print_samr_AcctFlags(ndr, "acct_flags", r->acct_flags); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_UserInfo6(struct ndr_push *ndr, int ndr_flags, const struct samr_UserInfo6 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->account_name)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->full_name)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->account_name)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->full_name)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_UserInfo6(struct ndr_pull *ndr, int ndr_flags, struct samr_UserInfo6 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->account_name)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->full_name)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->account_name)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->full_name)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_UserInfo6(struct ndr_print *ndr, const char *name, const struct samr_UserInfo6 *r) +{ + ndr_print_struct(ndr, name, "samr_UserInfo6"); + ndr->depth++; + ndr_print_lsa_String(ndr, "account_name", &r->account_name); + ndr_print_lsa_String(ndr, "full_name", &r->full_name); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_UserInfo7(struct ndr_push *ndr, int ndr_flags, const struct samr_UserInfo7 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->account_name)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->account_name)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_UserInfo7(struct ndr_pull *ndr, int ndr_flags, struct samr_UserInfo7 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->account_name)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->account_name)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_UserInfo7(struct ndr_print *ndr, const char *name, const struct samr_UserInfo7 *r) +{ + ndr_print_struct(ndr, name, "samr_UserInfo7"); + ndr->depth++; + ndr_print_lsa_String(ndr, "account_name", &r->account_name); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_UserInfo8(struct ndr_push *ndr, int ndr_flags, const struct samr_UserInfo8 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->full_name)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->full_name)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_UserInfo8(struct ndr_pull *ndr, int ndr_flags, struct samr_UserInfo8 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->full_name)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->full_name)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_UserInfo8(struct ndr_print *ndr, const char *name, const struct samr_UserInfo8 *r) +{ + ndr_print_struct(ndr, name, "samr_UserInfo8"); + ndr->depth++; + ndr_print_lsa_String(ndr, "full_name", &r->full_name); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_UserInfo9(struct ndr_push *ndr, int ndr_flags, const struct samr_UserInfo9 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->primary_gid)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_UserInfo9(struct ndr_pull *ndr, int ndr_flags, struct samr_UserInfo9 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->primary_gid)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_UserInfo9(struct ndr_print *ndr, const char *name, const struct samr_UserInfo9 *r) +{ + ndr_print_struct(ndr, name, "samr_UserInfo9"); + ndr->depth++; + ndr_print_uint32(ndr, "primary_gid", r->primary_gid); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_UserInfo10(struct ndr_push *ndr, int ndr_flags, const struct samr_UserInfo10 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->home_directory)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->home_drive)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->home_directory)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->home_drive)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_UserInfo10(struct ndr_pull *ndr, int ndr_flags, struct samr_UserInfo10 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->home_directory)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->home_drive)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->home_directory)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->home_drive)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_UserInfo10(struct ndr_print *ndr, const char *name, const struct samr_UserInfo10 *r) +{ + ndr_print_struct(ndr, name, "samr_UserInfo10"); + ndr->depth++; + ndr_print_lsa_String(ndr, "home_directory", &r->home_directory); + ndr_print_lsa_String(ndr, "home_drive", &r->home_drive); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_UserInfo11(struct ndr_push *ndr, int ndr_flags, const struct samr_UserInfo11 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->logon_script)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->logon_script)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_UserInfo11(struct ndr_pull *ndr, int ndr_flags, struct samr_UserInfo11 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->logon_script)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->logon_script)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_UserInfo11(struct ndr_print *ndr, const char *name, const struct samr_UserInfo11 *r) +{ + ndr_print_struct(ndr, name, "samr_UserInfo11"); + ndr->depth++; + ndr_print_lsa_String(ndr, "logon_script", &r->logon_script); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_UserInfo12(struct ndr_push *ndr, int ndr_flags, const struct samr_UserInfo12 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->profile_path)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->profile_path)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_UserInfo12(struct ndr_pull *ndr, int ndr_flags, struct samr_UserInfo12 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->profile_path)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->profile_path)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_UserInfo12(struct ndr_print *ndr, const char *name, const struct samr_UserInfo12 *r) +{ + ndr_print_struct(ndr, name, "samr_UserInfo12"); + ndr->depth++; + ndr_print_lsa_String(ndr, "profile_path", &r->profile_path); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_UserInfo13(struct ndr_push *ndr, int ndr_flags, const struct samr_UserInfo13 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->description)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->description)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_UserInfo13(struct ndr_pull *ndr, int ndr_flags, struct samr_UserInfo13 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->description)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->description)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_UserInfo13(struct ndr_print *ndr, const char *name, const struct samr_UserInfo13 *r) +{ + ndr_print_struct(ndr, name, "samr_UserInfo13"); + ndr->depth++; + ndr_print_lsa_String(ndr, "description", &r->description); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_UserInfo14(struct ndr_push *ndr, int ndr_flags, const struct samr_UserInfo14 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->workstations)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->workstations)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_UserInfo14(struct ndr_pull *ndr, int ndr_flags, struct samr_UserInfo14 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->workstations)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->workstations)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_UserInfo14(struct ndr_print *ndr, const char *name, const struct samr_UserInfo14 *r) +{ + ndr_print_struct(ndr, name, "samr_UserInfo14"); + ndr->depth++; + ndr_print_lsa_String(ndr, "workstations", &r->workstations); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_UserInfo16(struct ndr_push *ndr, int ndr_flags, const struct samr_UserInfo16 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_samr_AcctFlags(ndr, NDR_SCALARS, r->acct_flags)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_UserInfo16(struct ndr_pull *ndr, int ndr_flags, struct samr_UserInfo16 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_samr_AcctFlags(ndr, NDR_SCALARS, &r->acct_flags)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_UserInfo16(struct ndr_print *ndr, const char *name, const struct samr_UserInfo16 *r) +{ + ndr_print_struct(ndr, name, "samr_UserInfo16"); + ndr->depth++; + ndr_print_samr_AcctFlags(ndr, "acct_flags", r->acct_flags); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_UserInfo17(struct ndr_push *ndr, int ndr_flags, const struct samr_UserInfo17 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->acct_expiry)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_UserInfo17(struct ndr_pull *ndr, int ndr_flags, struct samr_UserInfo17 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->acct_expiry)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_UserInfo17(struct ndr_print *ndr, const char *name, const struct samr_UserInfo17 *r) +{ + ndr_print_struct(ndr, name, "samr_UserInfo17"); + ndr->depth++; + ndr_print_NTTIME(ndr, "acct_expiry", r->acct_expiry); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_UserInfo20(struct ndr_push *ndr, int ndr_flags, const struct samr_UserInfo20 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->parameters)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->parameters)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_UserInfo20(struct ndr_pull *ndr, int ndr_flags, struct samr_UserInfo20 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->parameters)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->parameters)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_UserInfo20(struct ndr_print *ndr, const char *name, const struct samr_UserInfo20 *r) +{ + ndr_print_struct(ndr, name, "samr_UserInfo20"); + ndr->depth++; + ndr_print_lsa_String(ndr, "parameters", &r->parameters); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_FieldsPresent(struct ndr_push *ndr, int ndr_flags, uint32_t r) +{ + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_FieldsPresent(struct ndr_pull *ndr, int ndr_flags, uint32_t *r) +{ + uint32_t v; + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); + *r = v; + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_FieldsPresent(struct ndr_print *ndr, const char *name, uint32_t r) +{ + ndr_print_uint32(ndr, name, r); + ndr->depth++; + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_FIELD_ACCOUNT_NAME", SAMR_FIELD_ACCOUNT_NAME, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_FIELD_FULL_NAME", SAMR_FIELD_FULL_NAME, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_FIELD_RID", SAMR_FIELD_RID, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_FIELD_PRIMARY_GID", SAMR_FIELD_PRIMARY_GID, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_FIELD_DESCRIPTION", SAMR_FIELD_DESCRIPTION, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_FIELD_COMMENT", SAMR_FIELD_COMMENT, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_FIELD_HOME_DIRECTORY", SAMR_FIELD_HOME_DIRECTORY, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_FIELD_HOME_DRIVE", SAMR_FIELD_HOME_DRIVE, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_FIELD_LOGON_SCRIPT", SAMR_FIELD_LOGON_SCRIPT, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_FIELD_PROFILE_PATH", SAMR_FIELD_PROFILE_PATH, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_FIELD_WORKSTATIONS", SAMR_FIELD_WORKSTATIONS, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_FIELD_LAST_LOGON", SAMR_FIELD_LAST_LOGON, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_FIELD_LAST_LOGOFF", SAMR_FIELD_LAST_LOGOFF, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_FIELD_LOGON_HOURS", SAMR_FIELD_LOGON_HOURS, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_FIELD_BAD_PWD_COUNT", SAMR_FIELD_BAD_PWD_COUNT, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_FIELD_NUM_LOGONS", SAMR_FIELD_NUM_LOGONS, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_FIELD_ALLOW_PWD_CHANGE", SAMR_FIELD_ALLOW_PWD_CHANGE, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_FIELD_FORCE_PWD_CHANGE", SAMR_FIELD_FORCE_PWD_CHANGE, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_FIELD_LAST_PWD_CHANGE", SAMR_FIELD_LAST_PWD_CHANGE, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_FIELD_ACCT_EXPIRY", SAMR_FIELD_ACCT_EXPIRY, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_FIELD_ACCT_FLAGS", SAMR_FIELD_ACCT_FLAGS, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_FIELD_PARAMETERS", SAMR_FIELD_PARAMETERS, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_FIELD_COUNTRY_CODE", SAMR_FIELD_COUNTRY_CODE, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_FIELD_CODE_PAGE", SAMR_FIELD_CODE_PAGE, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_FIELD_PASSWORD", SAMR_FIELD_PASSWORD, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_FIELD_PASSWORD2", SAMR_FIELD_PASSWORD2, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_FIELD_PRIVATE_DATA", SAMR_FIELD_PRIVATE_DATA, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_FIELD_EXPIRED_FLAG", SAMR_FIELD_EXPIRED_FLAG, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_FIELD_SEC_DESC", SAMR_FIELD_SEC_DESC, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_FIELD_OWF_PWD", SAMR_FIELD_OWF_PWD, r); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_UserInfo21(struct ndr_push *ndr, int ndr_flags, const struct samr_UserInfo21 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->last_logon)); + NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->last_logoff)); + NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->last_password_change)); + NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->acct_expiry)); + NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->allow_password_change)); + NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->force_password_change)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->account_name)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->full_name)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->home_directory)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->home_drive)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->logon_script)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->profile_path)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->description)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->workstations)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->comment)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->parameters)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown1)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown2)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown3)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->buf_count)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->buffer)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->rid)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->primary_gid)); + NDR_CHECK(ndr_push_samr_AcctFlags(ndr, NDR_SCALARS, r->acct_flags)); + NDR_CHECK(ndr_push_samr_FieldsPresent(ndr, NDR_SCALARS, r->fields_present)); + NDR_CHECK(ndr_push_samr_LogonHours(ndr, NDR_SCALARS, &r->logon_hours)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->bad_password_count)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->logon_count)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->country_code)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->code_page)); + NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->nt_password_set)); + NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->lm_password_set)); + NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->password_expired)); + NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->unknown4)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->account_name)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->full_name)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->home_directory)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->home_drive)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->logon_script)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->profile_path)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->description)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->workstations)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->comment)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->parameters)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown1)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown2)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown3)); + if (r->buffer) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->buf_count)); + NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->buffer, r->buf_count)); + } + NDR_CHECK(ndr_push_samr_LogonHours(ndr, NDR_BUFFERS, &r->logon_hours)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_UserInfo21(struct ndr_pull *ndr, int ndr_flags, struct samr_UserInfo21 *r) +{ + uint32_t _ptr_buffer; + TALLOC_CTX *_mem_save_buffer_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->last_logon)); + NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->last_logoff)); + NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->last_password_change)); + NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->acct_expiry)); + NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->allow_password_change)); + NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->force_password_change)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->account_name)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->full_name)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->home_directory)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->home_drive)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->logon_script)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->profile_path)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->description)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->workstations)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->comment)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->parameters)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown1)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown2)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown3)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->buf_count)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_buffer)); + if (_ptr_buffer) { + NDR_PULL_ALLOC(ndr, r->buffer); + } else { + r->buffer = NULL; + } + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->rid)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->primary_gid)); + NDR_CHECK(ndr_pull_samr_AcctFlags(ndr, NDR_SCALARS, &r->acct_flags)); + NDR_CHECK(ndr_pull_samr_FieldsPresent(ndr, NDR_SCALARS, &r->fields_present)); + NDR_CHECK(ndr_pull_samr_LogonHours(ndr, NDR_SCALARS, &r->logon_hours)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->bad_password_count)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->logon_count)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->country_code)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->code_page)); + NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->nt_password_set)); + NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->lm_password_set)); + NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->password_expired)); + NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->unknown4)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->account_name)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->full_name)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->home_directory)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->home_drive)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->logon_script)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->profile_path)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->description)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->workstations)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->comment)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->parameters)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown1)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown2)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown3)); + if (r->buffer) { + _mem_save_buffer_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->buffer, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->buffer)); + NDR_PULL_ALLOC_N(ndr, r->buffer, ndr_get_array_size(ndr, &r->buffer)); + NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->buffer, ndr_get_array_size(ndr, &r->buffer))); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_buffer_0, 0); + } + NDR_CHECK(ndr_pull_samr_LogonHours(ndr, NDR_BUFFERS, &r->logon_hours)); + if (r->buffer) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->buffer, r->buf_count)); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_UserInfo21(struct ndr_print *ndr, const char *name, const struct samr_UserInfo21 *r) +{ + ndr_print_struct(ndr, name, "samr_UserInfo21"); + ndr->depth++; + ndr_print_NTTIME(ndr, "last_logon", r->last_logon); + ndr_print_NTTIME(ndr, "last_logoff", r->last_logoff); + ndr_print_NTTIME(ndr, "last_password_change", r->last_password_change); + ndr_print_NTTIME(ndr, "acct_expiry", r->acct_expiry); + ndr_print_NTTIME(ndr, "allow_password_change", r->allow_password_change); + ndr_print_NTTIME(ndr, "force_password_change", r->force_password_change); + ndr_print_lsa_String(ndr, "account_name", &r->account_name); + ndr_print_lsa_String(ndr, "full_name", &r->full_name); + ndr_print_lsa_String(ndr, "home_directory", &r->home_directory); + ndr_print_lsa_String(ndr, "home_drive", &r->home_drive); + ndr_print_lsa_String(ndr, "logon_script", &r->logon_script); + ndr_print_lsa_String(ndr, "profile_path", &r->profile_path); + ndr_print_lsa_String(ndr, "description", &r->description); + ndr_print_lsa_String(ndr, "workstations", &r->workstations); + ndr_print_lsa_String(ndr, "comment", &r->comment); + ndr_print_lsa_String(ndr, "parameters", &r->parameters); + ndr_print_lsa_String(ndr, "unknown1", &r->unknown1); + ndr_print_lsa_String(ndr, "unknown2", &r->unknown2); + ndr_print_lsa_String(ndr, "unknown3", &r->unknown3); + ndr_print_uint32(ndr, "buf_count", r->buf_count); + ndr_print_ptr(ndr, "buffer", r->buffer); + ndr->depth++; + if (r->buffer) { + ndr_print_array_uint8(ndr, "buffer", r->buffer, r->buf_count); + } + ndr->depth--; + ndr_print_uint32(ndr, "rid", r->rid); + ndr_print_uint32(ndr, "primary_gid", r->primary_gid); + ndr_print_samr_AcctFlags(ndr, "acct_flags", r->acct_flags); + ndr_print_samr_FieldsPresent(ndr, "fields_present", r->fields_present); + ndr_print_samr_LogonHours(ndr, "logon_hours", &r->logon_hours); + ndr_print_uint16(ndr, "bad_password_count", r->bad_password_count); + ndr_print_uint16(ndr, "logon_count", r->logon_count); + ndr_print_uint16(ndr, "country_code", r->country_code); + ndr_print_uint16(ndr, "code_page", r->code_page); + ndr_print_uint8(ndr, "nt_password_set", r->nt_password_set); + ndr_print_uint8(ndr, "lm_password_set", r->lm_password_set); + ndr_print_uint8(ndr, "password_expired", r->password_expired); + ndr_print_uint8(ndr, "unknown4", r->unknown4); + ndr->depth--; +} + +_PUBLIC_ enum ndr_err_code ndr_push_samr_CryptPassword(struct ndr_push *ndr, int ndr_flags, const struct samr_CryptPassword *r) +{ + { + uint32_t _flags_save_STRUCT = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 1)); + NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->data, 516)); + } + if (ndr_flags & NDR_BUFFERS) { + } + ndr->flags = _flags_save_STRUCT; + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_samr_CryptPassword(struct ndr_pull *ndr, int ndr_flags, struct samr_CryptPassword *r) +{ + { + uint32_t _flags_save_STRUCT = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 1)); + NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->data, 516)); + } + if (ndr_flags & NDR_BUFFERS) { + } + ndr->flags = _flags_save_STRUCT; + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_CryptPassword(struct ndr_print *ndr, const char *name, const struct samr_CryptPassword *r) +{ + ndr_print_struct(ndr, name, "samr_CryptPassword"); + { + uint32_t _flags_save_STRUCT = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); + ndr->depth++; + ndr_print_array_uint8(ndr, "data", r->data, 516); + ndr->depth--; + ndr->flags = _flags_save_STRUCT; + } +} + +static enum ndr_err_code ndr_push_samr_UserInfo23(struct ndr_push *ndr, int ndr_flags, const struct samr_UserInfo23 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_samr_UserInfo21(ndr, NDR_SCALARS, &r->info)); + NDR_CHECK(ndr_push_samr_CryptPassword(ndr, NDR_SCALARS, &r->password)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_push_samr_UserInfo21(ndr, NDR_BUFFERS, &r->info)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_UserInfo23(struct ndr_pull *ndr, int ndr_flags, struct samr_UserInfo23 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_samr_UserInfo21(ndr, NDR_SCALARS, &r->info)); + NDR_CHECK(ndr_pull_samr_CryptPassword(ndr, NDR_SCALARS, &r->password)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_pull_samr_UserInfo21(ndr, NDR_BUFFERS, &r->info)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_UserInfo23(struct ndr_print *ndr, const char *name, const struct samr_UserInfo23 *r) +{ + ndr_print_struct(ndr, name, "samr_UserInfo23"); + ndr->depth++; + ndr_print_samr_UserInfo21(ndr, "info", &r->info); + ndr_print_samr_CryptPassword(ndr, "password", &r->password); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_UserInfo24(struct ndr_push *ndr, int ndr_flags, const struct samr_UserInfo24 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 1)); + NDR_CHECK(ndr_push_samr_CryptPassword(ndr, NDR_SCALARS, &r->password)); + NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->pw_len)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_UserInfo24(struct ndr_pull *ndr, int ndr_flags, struct samr_UserInfo24 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 1)); + NDR_CHECK(ndr_pull_samr_CryptPassword(ndr, NDR_SCALARS, &r->password)); + NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->pw_len)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_UserInfo24(struct ndr_print *ndr, const char *name, const struct samr_UserInfo24 *r) +{ + ndr_print_struct(ndr, name, "samr_UserInfo24"); + ndr->depth++; + ndr_print_samr_CryptPassword(ndr, "password", &r->password); + ndr_print_uint8(ndr, "pw_len", r->pw_len); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_CryptPasswordEx(struct ndr_push *ndr, int ndr_flags, const struct samr_CryptPasswordEx *r) +{ + { + uint32_t _flags_save_STRUCT = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 1)); + NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->data, 532)); + } + if (ndr_flags & NDR_BUFFERS) { + } + ndr->flags = _flags_save_STRUCT; + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_CryptPasswordEx(struct ndr_pull *ndr, int ndr_flags, struct samr_CryptPasswordEx *r) +{ + { + uint32_t _flags_save_STRUCT = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 1)); + NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->data, 532)); + } + if (ndr_flags & NDR_BUFFERS) { + } + ndr->flags = _flags_save_STRUCT; + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_CryptPasswordEx(struct ndr_print *ndr, const char *name, const struct samr_CryptPasswordEx *r) +{ + ndr_print_struct(ndr, name, "samr_CryptPasswordEx"); + { + uint32_t _flags_save_STRUCT = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); + ndr->depth++; + ndr_print_array_uint8(ndr, "data", r->data, 532); + ndr->depth--; + ndr->flags = _flags_save_STRUCT; + } +} + +static enum ndr_err_code ndr_push_samr_UserInfo25(struct ndr_push *ndr, int ndr_flags, const struct samr_UserInfo25 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_samr_UserInfo21(ndr, NDR_SCALARS, &r->info)); + NDR_CHECK(ndr_push_samr_CryptPasswordEx(ndr, NDR_SCALARS, &r->password)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_push_samr_UserInfo21(ndr, NDR_BUFFERS, &r->info)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_UserInfo25(struct ndr_pull *ndr, int ndr_flags, struct samr_UserInfo25 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_samr_UserInfo21(ndr, NDR_SCALARS, &r->info)); + NDR_CHECK(ndr_pull_samr_CryptPasswordEx(ndr, NDR_SCALARS, &r->password)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_pull_samr_UserInfo21(ndr, NDR_BUFFERS, &r->info)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_UserInfo25(struct ndr_print *ndr, const char *name, const struct samr_UserInfo25 *r) +{ + ndr_print_struct(ndr, name, "samr_UserInfo25"); + ndr->depth++; + ndr_print_samr_UserInfo21(ndr, "info", &r->info); + ndr_print_samr_CryptPasswordEx(ndr, "password", &r->password); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_UserInfo26(struct ndr_push *ndr, int ndr_flags, const struct samr_UserInfo26 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 1)); + NDR_CHECK(ndr_push_samr_CryptPasswordEx(ndr, NDR_SCALARS, &r->password)); + NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->pw_len)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_UserInfo26(struct ndr_pull *ndr, int ndr_flags, struct samr_UserInfo26 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 1)); + NDR_CHECK(ndr_pull_samr_CryptPasswordEx(ndr, NDR_SCALARS, &r->password)); + NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->pw_len)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_UserInfo26(struct ndr_print *ndr, const char *name, const struct samr_UserInfo26 *r) +{ + ndr_print_struct(ndr, name, "samr_UserInfo26"); + ndr->depth++; + ndr_print_samr_CryptPasswordEx(ndr, "password", &r->password); + ndr_print_uint8(ndr, "pw_len", r->pw_len); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_UserInfo(struct ndr_push *ndr, int ndr_flags, const union samr_UserInfo *r) +{ + if (ndr_flags & NDR_SCALARS) { + int level = ndr_push_get_switch_value(ndr, r); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, level)); + switch (level) { + case 1: + NDR_CHECK(ndr_push_samr_UserInfo1(ndr, NDR_SCALARS, &r->info1)); + break; + + case 2: + NDR_CHECK(ndr_push_samr_UserInfo2(ndr, NDR_SCALARS, &r->info2)); + break; + + case 3: + NDR_CHECK(ndr_push_samr_UserInfo3(ndr, NDR_SCALARS, &r->info3)); + break; + + case 4: + NDR_CHECK(ndr_push_samr_UserInfo4(ndr, NDR_SCALARS, &r->info4)); + break; + + case 5: + NDR_CHECK(ndr_push_samr_UserInfo5(ndr, NDR_SCALARS, &r->info5)); + break; + + case 6: + NDR_CHECK(ndr_push_samr_UserInfo6(ndr, NDR_SCALARS, &r->info6)); + break; + + case 7: + NDR_CHECK(ndr_push_samr_UserInfo7(ndr, NDR_SCALARS, &r->info7)); + break; + + case 8: + NDR_CHECK(ndr_push_samr_UserInfo8(ndr, NDR_SCALARS, &r->info8)); + break; + + case 9: + NDR_CHECK(ndr_push_samr_UserInfo9(ndr, NDR_SCALARS, &r->info9)); + break; + + case 10: + NDR_CHECK(ndr_push_samr_UserInfo10(ndr, NDR_SCALARS, &r->info10)); + break; + + case 11: + NDR_CHECK(ndr_push_samr_UserInfo11(ndr, NDR_SCALARS, &r->info11)); + break; + + case 12: + NDR_CHECK(ndr_push_samr_UserInfo12(ndr, NDR_SCALARS, &r->info12)); + break; + + case 13: + NDR_CHECK(ndr_push_samr_UserInfo13(ndr, NDR_SCALARS, &r->info13)); + break; + + case 14: + NDR_CHECK(ndr_push_samr_UserInfo14(ndr, NDR_SCALARS, &r->info14)); + break; + + case 16: + NDR_CHECK(ndr_push_samr_UserInfo16(ndr, NDR_SCALARS, &r->info16)); + break; + + case 17: + NDR_CHECK(ndr_push_samr_UserInfo17(ndr, NDR_SCALARS, &r->info17)); + break; + + case 20: + NDR_CHECK(ndr_push_samr_UserInfo20(ndr, NDR_SCALARS, &r->info20)); + break; + + case 21: + NDR_CHECK(ndr_push_samr_UserInfo21(ndr, NDR_SCALARS, &r->info21)); + break; + + case 23: + NDR_CHECK(ndr_push_samr_UserInfo23(ndr, NDR_SCALARS, &r->info23)); + break; + + case 24: + NDR_CHECK(ndr_push_samr_UserInfo24(ndr, NDR_SCALARS, &r->info24)); + break; + + case 25: + NDR_CHECK(ndr_push_samr_UserInfo25(ndr, NDR_SCALARS, &r->info25)); + break; + + case 26: + NDR_CHECK(ndr_push_samr_UserInfo26(ndr, NDR_SCALARS, &r->info26)); + break; + + default: + return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + if (ndr_flags & NDR_BUFFERS) { + int level = ndr_push_get_switch_value(ndr, r); + switch (level) { + case 1: + NDR_CHECK(ndr_push_samr_UserInfo1(ndr, NDR_BUFFERS, &r->info1)); + break; + + case 2: + NDR_CHECK(ndr_push_samr_UserInfo2(ndr, NDR_BUFFERS, &r->info2)); + break; + + case 3: + NDR_CHECK(ndr_push_samr_UserInfo3(ndr, NDR_BUFFERS, &r->info3)); + break; + + case 4: + NDR_CHECK(ndr_push_samr_UserInfo4(ndr, NDR_BUFFERS, &r->info4)); + break; + + case 5: + NDR_CHECK(ndr_push_samr_UserInfo5(ndr, NDR_BUFFERS, &r->info5)); + break; + + case 6: + NDR_CHECK(ndr_push_samr_UserInfo6(ndr, NDR_BUFFERS, &r->info6)); + break; + + case 7: + NDR_CHECK(ndr_push_samr_UserInfo7(ndr, NDR_BUFFERS, &r->info7)); + break; + + case 8: + NDR_CHECK(ndr_push_samr_UserInfo8(ndr, NDR_BUFFERS, &r->info8)); + break; + + case 9: + break; + + case 10: + NDR_CHECK(ndr_push_samr_UserInfo10(ndr, NDR_BUFFERS, &r->info10)); + break; + + case 11: + NDR_CHECK(ndr_push_samr_UserInfo11(ndr, NDR_BUFFERS, &r->info11)); + break; + + case 12: + NDR_CHECK(ndr_push_samr_UserInfo12(ndr, NDR_BUFFERS, &r->info12)); + break; + + case 13: + NDR_CHECK(ndr_push_samr_UserInfo13(ndr, NDR_BUFFERS, &r->info13)); + break; + + case 14: + NDR_CHECK(ndr_push_samr_UserInfo14(ndr, NDR_BUFFERS, &r->info14)); + break; + + case 16: + break; + + case 17: + break; + + case 20: + NDR_CHECK(ndr_push_samr_UserInfo20(ndr, NDR_BUFFERS, &r->info20)); + break; + + case 21: + NDR_CHECK(ndr_push_samr_UserInfo21(ndr, NDR_BUFFERS, &r->info21)); + break; + + case 23: + NDR_CHECK(ndr_push_samr_UserInfo23(ndr, NDR_BUFFERS, &r->info23)); + break; + + case 24: + break; + + case 25: + NDR_CHECK(ndr_push_samr_UserInfo25(ndr, NDR_BUFFERS, &r->info25)); + break; + + case 26: + break; + + default: + return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_UserInfo(struct ndr_pull *ndr, int ndr_flags, union samr_UserInfo *r) +{ + int level; + uint16_t _level; + level = ndr_pull_get_switch_value(ndr, r); + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &_level)); + if (_level != level) { + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level); + } + switch (level) { + case 1: { + NDR_CHECK(ndr_pull_samr_UserInfo1(ndr, NDR_SCALARS, &r->info1)); + break; } + + case 2: { + NDR_CHECK(ndr_pull_samr_UserInfo2(ndr, NDR_SCALARS, &r->info2)); + break; } + + case 3: { + NDR_CHECK(ndr_pull_samr_UserInfo3(ndr, NDR_SCALARS, &r->info3)); + break; } + + case 4: { + NDR_CHECK(ndr_pull_samr_UserInfo4(ndr, NDR_SCALARS, &r->info4)); + break; } + + case 5: { + NDR_CHECK(ndr_pull_samr_UserInfo5(ndr, NDR_SCALARS, &r->info5)); + break; } + + case 6: { + NDR_CHECK(ndr_pull_samr_UserInfo6(ndr, NDR_SCALARS, &r->info6)); + break; } + + case 7: { + NDR_CHECK(ndr_pull_samr_UserInfo7(ndr, NDR_SCALARS, &r->info7)); + break; } + + case 8: { + NDR_CHECK(ndr_pull_samr_UserInfo8(ndr, NDR_SCALARS, &r->info8)); + break; } + + case 9: { + NDR_CHECK(ndr_pull_samr_UserInfo9(ndr, NDR_SCALARS, &r->info9)); + break; } + + case 10: { + NDR_CHECK(ndr_pull_samr_UserInfo10(ndr, NDR_SCALARS, &r->info10)); + break; } + + case 11: { + NDR_CHECK(ndr_pull_samr_UserInfo11(ndr, NDR_SCALARS, &r->info11)); + break; } + + case 12: { + NDR_CHECK(ndr_pull_samr_UserInfo12(ndr, NDR_SCALARS, &r->info12)); + break; } + + case 13: { + NDR_CHECK(ndr_pull_samr_UserInfo13(ndr, NDR_SCALARS, &r->info13)); + break; } + + case 14: { + NDR_CHECK(ndr_pull_samr_UserInfo14(ndr, NDR_SCALARS, &r->info14)); + break; } + + case 16: { + NDR_CHECK(ndr_pull_samr_UserInfo16(ndr, NDR_SCALARS, &r->info16)); + break; } + + case 17: { + NDR_CHECK(ndr_pull_samr_UserInfo17(ndr, NDR_SCALARS, &r->info17)); + break; } + + case 20: { + NDR_CHECK(ndr_pull_samr_UserInfo20(ndr, NDR_SCALARS, &r->info20)); + break; } + + case 21: { + NDR_CHECK(ndr_pull_samr_UserInfo21(ndr, NDR_SCALARS, &r->info21)); + break; } + + case 23: { + NDR_CHECK(ndr_pull_samr_UserInfo23(ndr, NDR_SCALARS, &r->info23)); + break; } + + case 24: { + NDR_CHECK(ndr_pull_samr_UserInfo24(ndr, NDR_SCALARS, &r->info24)); + break; } + + case 25: { + NDR_CHECK(ndr_pull_samr_UserInfo25(ndr, NDR_SCALARS, &r->info25)); + break; } + + case 26: { + NDR_CHECK(ndr_pull_samr_UserInfo26(ndr, NDR_SCALARS, &r->info26)); + break; } + + default: + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + if (ndr_flags & NDR_BUFFERS) { + switch (level) { + case 1: + NDR_CHECK(ndr_pull_samr_UserInfo1(ndr, NDR_BUFFERS, &r->info1)); + break; + + case 2: + NDR_CHECK(ndr_pull_samr_UserInfo2(ndr, NDR_BUFFERS, &r->info2)); + break; + + case 3: + NDR_CHECK(ndr_pull_samr_UserInfo3(ndr, NDR_BUFFERS, &r->info3)); + break; + + case 4: + NDR_CHECK(ndr_pull_samr_UserInfo4(ndr, NDR_BUFFERS, &r->info4)); + break; + + case 5: + NDR_CHECK(ndr_pull_samr_UserInfo5(ndr, NDR_BUFFERS, &r->info5)); + break; + + case 6: + NDR_CHECK(ndr_pull_samr_UserInfo6(ndr, NDR_BUFFERS, &r->info6)); + break; + + case 7: + NDR_CHECK(ndr_pull_samr_UserInfo7(ndr, NDR_BUFFERS, &r->info7)); + break; + + case 8: + NDR_CHECK(ndr_pull_samr_UserInfo8(ndr, NDR_BUFFERS, &r->info8)); + break; + + case 9: + break; + + case 10: + NDR_CHECK(ndr_pull_samr_UserInfo10(ndr, NDR_BUFFERS, &r->info10)); + break; + + case 11: + NDR_CHECK(ndr_pull_samr_UserInfo11(ndr, NDR_BUFFERS, &r->info11)); + break; + + case 12: + NDR_CHECK(ndr_pull_samr_UserInfo12(ndr, NDR_BUFFERS, &r->info12)); + break; + + case 13: + NDR_CHECK(ndr_pull_samr_UserInfo13(ndr, NDR_BUFFERS, &r->info13)); + break; + + case 14: + NDR_CHECK(ndr_pull_samr_UserInfo14(ndr, NDR_BUFFERS, &r->info14)); + break; + + case 16: + break; + + case 17: + break; + + case 20: + NDR_CHECK(ndr_pull_samr_UserInfo20(ndr, NDR_BUFFERS, &r->info20)); + break; + + case 21: + NDR_CHECK(ndr_pull_samr_UserInfo21(ndr, NDR_BUFFERS, &r->info21)); + break; + + case 23: + NDR_CHECK(ndr_pull_samr_UserInfo23(ndr, NDR_BUFFERS, &r->info23)); + break; + + case 24: + break; + + case 25: + NDR_CHECK(ndr_pull_samr_UserInfo25(ndr, NDR_BUFFERS, &r->info25)); + break; + + case 26: + break; + + default: + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_UserInfo(struct ndr_print *ndr, const char *name, const union samr_UserInfo *r) +{ + int level; + level = ndr_print_get_switch_value(ndr, r); + ndr_print_union(ndr, name, level, "samr_UserInfo"); + switch (level) { + case 1: + ndr_print_samr_UserInfo1(ndr, "info1", &r->info1); + break; + + case 2: + ndr_print_samr_UserInfo2(ndr, "info2", &r->info2); + break; + + case 3: + ndr_print_samr_UserInfo3(ndr, "info3", &r->info3); + break; + + case 4: + ndr_print_samr_UserInfo4(ndr, "info4", &r->info4); + break; + + case 5: + ndr_print_samr_UserInfo5(ndr, "info5", &r->info5); + break; + + case 6: + ndr_print_samr_UserInfo6(ndr, "info6", &r->info6); + break; + + case 7: + ndr_print_samr_UserInfo7(ndr, "info7", &r->info7); + break; + + case 8: + ndr_print_samr_UserInfo8(ndr, "info8", &r->info8); + break; + + case 9: + ndr_print_samr_UserInfo9(ndr, "info9", &r->info9); + break; + + case 10: + ndr_print_samr_UserInfo10(ndr, "info10", &r->info10); + break; + + case 11: + ndr_print_samr_UserInfo11(ndr, "info11", &r->info11); + break; + + case 12: + ndr_print_samr_UserInfo12(ndr, "info12", &r->info12); + break; + + case 13: + ndr_print_samr_UserInfo13(ndr, "info13", &r->info13); + break; + + case 14: + ndr_print_samr_UserInfo14(ndr, "info14", &r->info14); + break; + + case 16: + ndr_print_samr_UserInfo16(ndr, "info16", &r->info16); + break; + + case 17: + ndr_print_samr_UserInfo17(ndr, "info17", &r->info17); + break; + + case 20: + ndr_print_samr_UserInfo20(ndr, "info20", &r->info20); + break; + + case 21: + ndr_print_samr_UserInfo21(ndr, "info21", &r->info21); + break; + + case 23: + ndr_print_samr_UserInfo23(ndr, "info23", &r->info23); + break; + + case 24: + ndr_print_samr_UserInfo24(ndr, "info24", &r->info24); + break; + + case 25: + ndr_print_samr_UserInfo25(ndr, "info25", &r->info25); + break; + + case 26: + ndr_print_samr_UserInfo26(ndr, "info26", &r->info26); + break; + + default: + ndr_print_bad_level(ndr, name, level); + } +} + +_PUBLIC_ enum ndr_err_code ndr_push_samr_Password(struct ndr_push *ndr, int ndr_flags, const struct samr_Password *r) +{ + { + uint32_t _flags_save_STRUCT = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 1)); + NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->hash, 16)); + } + if (ndr_flags & NDR_BUFFERS) { + } + ndr->flags = _flags_save_STRUCT; + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_samr_Password(struct ndr_pull *ndr, int ndr_flags, struct samr_Password *r) +{ + { + uint32_t _flags_save_STRUCT = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 1)); + NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->hash, 16)); + } + if (ndr_flags & NDR_BUFFERS) { + } + ndr->flags = _flags_save_STRUCT; + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_Password(struct ndr_print *ndr, const char *name, const struct samr_Password *r) +{ + ndr_print_struct(ndr, name, "samr_Password"); + { + uint32_t _flags_save_STRUCT = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); + ndr->depth++; + ndr_print_array_uint8(ndr, "hash", r->hash, 16); + ndr->depth--; + ndr->flags = _flags_save_STRUCT; + } +} + +_PUBLIC_ enum ndr_err_code ndr_push_samr_RidWithAttribute(struct ndr_push *ndr, int ndr_flags, const struct samr_RidWithAttribute *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->rid)); + NDR_CHECK(ndr_push_samr_GroupAttrs(ndr, NDR_SCALARS, r->attributes)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_samr_RidWithAttribute(struct ndr_pull *ndr, int ndr_flags, struct samr_RidWithAttribute *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->rid)); + NDR_CHECK(ndr_pull_samr_GroupAttrs(ndr, NDR_SCALARS, &r->attributes)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_RidWithAttribute(struct ndr_print *ndr, const char *name, const struct samr_RidWithAttribute *r) +{ + ndr_print_struct(ndr, name, "samr_RidWithAttribute"); + ndr->depth++; + ndr_print_uint32(ndr, "rid", r->rid); + ndr_print_samr_GroupAttrs(ndr, "attributes", r->attributes); + ndr->depth--; +} + +_PUBLIC_ enum ndr_err_code ndr_push_samr_RidWithAttributeArray(struct ndr_push *ndr, int ndr_flags, const struct samr_RidWithAttributeArray *r) +{ + uint32_t cntr_rids_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->rids)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->rids) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + for (cntr_rids_1 = 0; cntr_rids_1 < r->count; cntr_rids_1++) { + NDR_CHECK(ndr_push_samr_RidWithAttribute(ndr, NDR_SCALARS, &r->rids[cntr_rids_1])); + } + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_samr_RidWithAttributeArray(struct ndr_pull *ndr, int ndr_flags, struct samr_RidWithAttributeArray *r) +{ + uint32_t _ptr_rids; + uint32_t cntr_rids_1; + TALLOC_CTX *_mem_save_rids_0; + TALLOC_CTX *_mem_save_rids_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_rids)); + if (_ptr_rids) { + NDR_PULL_ALLOC(ndr, r->rids); + } else { + r->rids = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->rids) { + _mem_save_rids_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->rids, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->rids)); + NDR_PULL_ALLOC_N(ndr, r->rids, ndr_get_array_size(ndr, &r->rids)); + _mem_save_rids_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->rids, 0); + for (cntr_rids_1 = 0; cntr_rids_1 < r->count; cntr_rids_1++) { + NDR_CHECK(ndr_pull_samr_RidWithAttribute(ndr, NDR_SCALARS, &r->rids[cntr_rids_1])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_rids_1, 0); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_rids_0, 0); + } + if (r->rids) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->rids, r->count)); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_RidWithAttributeArray(struct ndr_print *ndr, const char *name, const struct samr_RidWithAttributeArray *r) +{ + uint32_t cntr_rids_1; + ndr_print_struct(ndr, name, "samr_RidWithAttributeArray"); + ndr->depth++; + ndr_print_uint32(ndr, "count", r->count); + ndr_print_ptr(ndr, "rids", r->rids); + ndr->depth++; + if (r->rids) { + ndr->print(ndr, "%s: ARRAY(%d)", "rids", r->count); + ndr->depth++; + for (cntr_rids_1=0;cntr_rids_1<r->count;cntr_rids_1++) { + char *idx_1=NULL; + asprintf(&idx_1, "[%d]", cntr_rids_1); + if (idx_1) { + ndr_print_samr_RidWithAttribute(ndr, "rids", &r->rids[cntr_rids_1]); + free(idx_1); + } + } + ndr->depth--; + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_DispEntryGeneral(struct ndr_push *ndr, int ndr_flags, const struct samr_DispEntryGeneral *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->idx)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->rid)); + NDR_CHECK(ndr_push_samr_AcctFlags(ndr, NDR_SCALARS, r->acct_flags)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->account_name)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->description)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->full_name)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->account_name)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->description)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->full_name)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_DispEntryGeneral(struct ndr_pull *ndr, int ndr_flags, struct samr_DispEntryGeneral *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->idx)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->rid)); + NDR_CHECK(ndr_pull_samr_AcctFlags(ndr, NDR_SCALARS, &r->acct_flags)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->account_name)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->description)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->full_name)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->account_name)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->description)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->full_name)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_DispEntryGeneral(struct ndr_print *ndr, const char *name, const struct samr_DispEntryGeneral *r) +{ + ndr_print_struct(ndr, name, "samr_DispEntryGeneral"); + ndr->depth++; + ndr_print_uint32(ndr, "idx", r->idx); + ndr_print_uint32(ndr, "rid", r->rid); + ndr_print_samr_AcctFlags(ndr, "acct_flags", r->acct_flags); + ndr_print_lsa_String(ndr, "account_name", &r->account_name); + ndr_print_lsa_String(ndr, "description", &r->description); + ndr_print_lsa_String(ndr, "full_name", &r->full_name); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_DispInfoGeneral(struct ndr_push *ndr, int ndr_flags, const struct samr_DispInfoGeneral *r) +{ + uint32_t cntr_entries_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->entries)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->entries) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + for (cntr_entries_1 = 0; cntr_entries_1 < r->count; cntr_entries_1++) { + NDR_CHECK(ndr_push_samr_DispEntryGeneral(ndr, NDR_SCALARS, &r->entries[cntr_entries_1])); + } + for (cntr_entries_1 = 0; cntr_entries_1 < r->count; cntr_entries_1++) { + NDR_CHECK(ndr_push_samr_DispEntryGeneral(ndr, NDR_BUFFERS, &r->entries[cntr_entries_1])); + } + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_DispInfoGeneral(struct ndr_pull *ndr, int ndr_flags, struct samr_DispInfoGeneral *r) +{ + uint32_t _ptr_entries; + uint32_t cntr_entries_1; + TALLOC_CTX *_mem_save_entries_0; + TALLOC_CTX *_mem_save_entries_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_entries)); + if (_ptr_entries) { + NDR_PULL_ALLOC(ndr, r->entries); + } else { + r->entries = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->entries) { + _mem_save_entries_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->entries, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->entries)); + NDR_PULL_ALLOC_N(ndr, r->entries, ndr_get_array_size(ndr, &r->entries)); + _mem_save_entries_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->entries, 0); + for (cntr_entries_1 = 0; cntr_entries_1 < r->count; cntr_entries_1++) { + NDR_CHECK(ndr_pull_samr_DispEntryGeneral(ndr, NDR_SCALARS, &r->entries[cntr_entries_1])); + } + for (cntr_entries_1 = 0; cntr_entries_1 < r->count; cntr_entries_1++) { + NDR_CHECK(ndr_pull_samr_DispEntryGeneral(ndr, NDR_BUFFERS, &r->entries[cntr_entries_1])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_entries_1, 0); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_entries_0, 0); + } + if (r->entries) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->entries, r->count)); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_DispInfoGeneral(struct ndr_print *ndr, const char *name, const struct samr_DispInfoGeneral *r) +{ + uint32_t cntr_entries_1; + ndr_print_struct(ndr, name, "samr_DispInfoGeneral"); + ndr->depth++; + ndr_print_uint32(ndr, "count", r->count); + ndr_print_ptr(ndr, "entries", r->entries); + ndr->depth++; + if (r->entries) { + ndr->print(ndr, "%s: ARRAY(%d)", "entries", r->count); + ndr->depth++; + for (cntr_entries_1=0;cntr_entries_1<r->count;cntr_entries_1++) { + char *idx_1=NULL; + asprintf(&idx_1, "[%d]", cntr_entries_1); + if (idx_1) { + ndr_print_samr_DispEntryGeneral(ndr, "entries", &r->entries[cntr_entries_1]); + free(idx_1); + } + } + ndr->depth--; + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_DispEntryFull(struct ndr_push *ndr, int ndr_flags, const struct samr_DispEntryFull *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->idx)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->rid)); + NDR_CHECK(ndr_push_samr_AcctFlags(ndr, NDR_SCALARS, r->acct_flags)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->account_name)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->description)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->account_name)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->description)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_DispEntryFull(struct ndr_pull *ndr, int ndr_flags, struct samr_DispEntryFull *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->idx)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->rid)); + NDR_CHECK(ndr_pull_samr_AcctFlags(ndr, NDR_SCALARS, &r->acct_flags)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->account_name)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->description)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->account_name)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->description)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_DispEntryFull(struct ndr_print *ndr, const char *name, const struct samr_DispEntryFull *r) +{ + ndr_print_struct(ndr, name, "samr_DispEntryFull"); + ndr->depth++; + ndr_print_uint32(ndr, "idx", r->idx); + ndr_print_uint32(ndr, "rid", r->rid); + ndr_print_samr_AcctFlags(ndr, "acct_flags", r->acct_flags); + ndr_print_lsa_String(ndr, "account_name", &r->account_name); + ndr_print_lsa_String(ndr, "description", &r->description); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_DispInfoFull(struct ndr_push *ndr, int ndr_flags, const struct samr_DispInfoFull *r) +{ + uint32_t cntr_entries_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->entries)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->entries) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + for (cntr_entries_1 = 0; cntr_entries_1 < r->count; cntr_entries_1++) { + NDR_CHECK(ndr_push_samr_DispEntryFull(ndr, NDR_SCALARS, &r->entries[cntr_entries_1])); + } + for (cntr_entries_1 = 0; cntr_entries_1 < r->count; cntr_entries_1++) { + NDR_CHECK(ndr_push_samr_DispEntryFull(ndr, NDR_BUFFERS, &r->entries[cntr_entries_1])); + } + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_DispInfoFull(struct ndr_pull *ndr, int ndr_flags, struct samr_DispInfoFull *r) +{ + uint32_t _ptr_entries; + uint32_t cntr_entries_1; + TALLOC_CTX *_mem_save_entries_0; + TALLOC_CTX *_mem_save_entries_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_entries)); + if (_ptr_entries) { + NDR_PULL_ALLOC(ndr, r->entries); + } else { + r->entries = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->entries) { + _mem_save_entries_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->entries, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->entries)); + NDR_PULL_ALLOC_N(ndr, r->entries, ndr_get_array_size(ndr, &r->entries)); + _mem_save_entries_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->entries, 0); + for (cntr_entries_1 = 0; cntr_entries_1 < r->count; cntr_entries_1++) { + NDR_CHECK(ndr_pull_samr_DispEntryFull(ndr, NDR_SCALARS, &r->entries[cntr_entries_1])); + } + for (cntr_entries_1 = 0; cntr_entries_1 < r->count; cntr_entries_1++) { + NDR_CHECK(ndr_pull_samr_DispEntryFull(ndr, NDR_BUFFERS, &r->entries[cntr_entries_1])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_entries_1, 0); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_entries_0, 0); + } + if (r->entries) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->entries, r->count)); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_DispInfoFull(struct ndr_print *ndr, const char *name, const struct samr_DispInfoFull *r) +{ + uint32_t cntr_entries_1; + ndr_print_struct(ndr, name, "samr_DispInfoFull"); + ndr->depth++; + ndr_print_uint32(ndr, "count", r->count); + ndr_print_ptr(ndr, "entries", r->entries); + ndr->depth++; + if (r->entries) { + ndr->print(ndr, "%s: ARRAY(%d)", "entries", r->count); + ndr->depth++; + for (cntr_entries_1=0;cntr_entries_1<r->count;cntr_entries_1++) { + char *idx_1=NULL; + asprintf(&idx_1, "[%d]", cntr_entries_1); + if (idx_1) { + ndr_print_samr_DispEntryFull(ndr, "entries", &r->entries[cntr_entries_1]); + free(idx_1); + } + } + ndr->depth--; + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_DispEntryFullGroup(struct ndr_push *ndr, int ndr_flags, const struct samr_DispEntryFullGroup *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->idx)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->rid)); + NDR_CHECK(ndr_push_samr_GroupAttrs(ndr, NDR_SCALARS, r->acct_flags)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->account_name)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->description)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->account_name)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->description)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_DispEntryFullGroup(struct ndr_pull *ndr, int ndr_flags, struct samr_DispEntryFullGroup *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->idx)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->rid)); + NDR_CHECK(ndr_pull_samr_GroupAttrs(ndr, NDR_SCALARS, &r->acct_flags)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->account_name)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->description)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->account_name)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->description)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_DispEntryFullGroup(struct ndr_print *ndr, const char *name, const struct samr_DispEntryFullGroup *r) +{ + ndr_print_struct(ndr, name, "samr_DispEntryFullGroup"); + ndr->depth++; + ndr_print_uint32(ndr, "idx", r->idx); + ndr_print_uint32(ndr, "rid", r->rid); + ndr_print_samr_GroupAttrs(ndr, "acct_flags", r->acct_flags); + ndr_print_lsa_String(ndr, "account_name", &r->account_name); + ndr_print_lsa_String(ndr, "description", &r->description); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_DispInfoFullGroups(struct ndr_push *ndr, int ndr_flags, const struct samr_DispInfoFullGroups *r) +{ + uint32_t cntr_entries_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->entries)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->entries) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + for (cntr_entries_1 = 0; cntr_entries_1 < r->count; cntr_entries_1++) { + NDR_CHECK(ndr_push_samr_DispEntryFullGroup(ndr, NDR_SCALARS, &r->entries[cntr_entries_1])); + } + for (cntr_entries_1 = 0; cntr_entries_1 < r->count; cntr_entries_1++) { + NDR_CHECK(ndr_push_samr_DispEntryFullGroup(ndr, NDR_BUFFERS, &r->entries[cntr_entries_1])); + } + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_DispInfoFullGroups(struct ndr_pull *ndr, int ndr_flags, struct samr_DispInfoFullGroups *r) +{ + uint32_t _ptr_entries; + uint32_t cntr_entries_1; + TALLOC_CTX *_mem_save_entries_0; + TALLOC_CTX *_mem_save_entries_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_entries)); + if (_ptr_entries) { + NDR_PULL_ALLOC(ndr, r->entries); + } else { + r->entries = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->entries) { + _mem_save_entries_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->entries, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->entries)); + NDR_PULL_ALLOC_N(ndr, r->entries, ndr_get_array_size(ndr, &r->entries)); + _mem_save_entries_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->entries, 0); + for (cntr_entries_1 = 0; cntr_entries_1 < r->count; cntr_entries_1++) { + NDR_CHECK(ndr_pull_samr_DispEntryFullGroup(ndr, NDR_SCALARS, &r->entries[cntr_entries_1])); + } + for (cntr_entries_1 = 0; cntr_entries_1 < r->count; cntr_entries_1++) { + NDR_CHECK(ndr_pull_samr_DispEntryFullGroup(ndr, NDR_BUFFERS, &r->entries[cntr_entries_1])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_entries_1, 0); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_entries_0, 0); + } + if (r->entries) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->entries, r->count)); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_DispInfoFullGroups(struct ndr_print *ndr, const char *name, const struct samr_DispInfoFullGroups *r) +{ + uint32_t cntr_entries_1; + ndr_print_struct(ndr, name, "samr_DispInfoFullGroups"); + ndr->depth++; + ndr_print_uint32(ndr, "count", r->count); + ndr_print_ptr(ndr, "entries", r->entries); + ndr->depth++; + if (r->entries) { + ndr->print(ndr, "%s: ARRAY(%d)", "entries", r->count); + ndr->depth++; + for (cntr_entries_1=0;cntr_entries_1<r->count;cntr_entries_1++) { + char *idx_1=NULL; + asprintf(&idx_1, "[%d]", cntr_entries_1); + if (idx_1) { + ndr_print_samr_DispEntryFullGroup(ndr, "entries", &r->entries[cntr_entries_1]); + free(idx_1); + } + } + ndr->depth--; + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_DispEntryAscii(struct ndr_push *ndr, int ndr_flags, const struct samr_DispEntryAscii *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->idx)); + NDR_CHECK(ndr_push_lsa_AsciiString(ndr, NDR_SCALARS, &r->account_name)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_push_lsa_AsciiString(ndr, NDR_BUFFERS, &r->account_name)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_DispEntryAscii(struct ndr_pull *ndr, int ndr_flags, struct samr_DispEntryAscii *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->idx)); + NDR_CHECK(ndr_pull_lsa_AsciiString(ndr, NDR_SCALARS, &r->account_name)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_pull_lsa_AsciiString(ndr, NDR_BUFFERS, &r->account_name)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_DispEntryAscii(struct ndr_print *ndr, const char *name, const struct samr_DispEntryAscii *r) +{ + ndr_print_struct(ndr, name, "samr_DispEntryAscii"); + ndr->depth++; + ndr_print_uint32(ndr, "idx", r->idx); + ndr_print_lsa_AsciiString(ndr, "account_name", &r->account_name); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_DispInfoAscii(struct ndr_push *ndr, int ndr_flags, const struct samr_DispInfoAscii *r) +{ + uint32_t cntr_entries_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->entries)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->entries) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + for (cntr_entries_1 = 0; cntr_entries_1 < r->count; cntr_entries_1++) { + NDR_CHECK(ndr_push_samr_DispEntryAscii(ndr, NDR_SCALARS, &r->entries[cntr_entries_1])); + } + for (cntr_entries_1 = 0; cntr_entries_1 < r->count; cntr_entries_1++) { + NDR_CHECK(ndr_push_samr_DispEntryAscii(ndr, NDR_BUFFERS, &r->entries[cntr_entries_1])); + } + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_DispInfoAscii(struct ndr_pull *ndr, int ndr_flags, struct samr_DispInfoAscii *r) +{ + uint32_t _ptr_entries; + uint32_t cntr_entries_1; + TALLOC_CTX *_mem_save_entries_0; + TALLOC_CTX *_mem_save_entries_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_entries)); + if (_ptr_entries) { + NDR_PULL_ALLOC(ndr, r->entries); + } else { + r->entries = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->entries) { + _mem_save_entries_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->entries, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->entries)); + NDR_PULL_ALLOC_N(ndr, r->entries, ndr_get_array_size(ndr, &r->entries)); + _mem_save_entries_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->entries, 0); + for (cntr_entries_1 = 0; cntr_entries_1 < r->count; cntr_entries_1++) { + NDR_CHECK(ndr_pull_samr_DispEntryAscii(ndr, NDR_SCALARS, &r->entries[cntr_entries_1])); + } + for (cntr_entries_1 = 0; cntr_entries_1 < r->count; cntr_entries_1++) { + NDR_CHECK(ndr_pull_samr_DispEntryAscii(ndr, NDR_BUFFERS, &r->entries[cntr_entries_1])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_entries_1, 0); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_entries_0, 0); + } + if (r->entries) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->entries, r->count)); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_DispInfoAscii(struct ndr_print *ndr, const char *name, const struct samr_DispInfoAscii *r) +{ + uint32_t cntr_entries_1; + ndr_print_struct(ndr, name, "samr_DispInfoAscii"); + ndr->depth++; + ndr_print_uint32(ndr, "count", r->count); + ndr_print_ptr(ndr, "entries", r->entries); + ndr->depth++; + if (r->entries) { + ndr->print(ndr, "%s: ARRAY(%d)", "entries", r->count); + ndr->depth++; + for (cntr_entries_1=0;cntr_entries_1<r->count;cntr_entries_1++) { + char *idx_1=NULL; + asprintf(&idx_1, "[%d]", cntr_entries_1); + if (idx_1) { + ndr_print_samr_DispEntryAscii(ndr, "entries", &r->entries[cntr_entries_1]); + free(idx_1); + } + } + ndr->depth--; + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_DispInfo(struct ndr_push *ndr, int ndr_flags, const union samr_DispInfo *r) +{ + if (ndr_flags & NDR_SCALARS) { + int level = ndr_push_get_switch_value(ndr, r); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, level)); + switch (level) { + case 1: + NDR_CHECK(ndr_push_samr_DispInfoGeneral(ndr, NDR_SCALARS, &r->info1)); + break; + + case 2: + NDR_CHECK(ndr_push_samr_DispInfoFull(ndr, NDR_SCALARS, &r->info2)); + break; + + case 3: + NDR_CHECK(ndr_push_samr_DispInfoFullGroups(ndr, NDR_SCALARS, &r->info3)); + break; + + case 4: + NDR_CHECK(ndr_push_samr_DispInfoAscii(ndr, NDR_SCALARS, &r->info4)); + break; + + case 5: + NDR_CHECK(ndr_push_samr_DispInfoAscii(ndr, NDR_SCALARS, &r->info5)); + break; + + default: + return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + if (ndr_flags & NDR_BUFFERS) { + int level = ndr_push_get_switch_value(ndr, r); + switch (level) { + case 1: + NDR_CHECK(ndr_push_samr_DispInfoGeneral(ndr, NDR_BUFFERS, &r->info1)); + break; + + case 2: + NDR_CHECK(ndr_push_samr_DispInfoFull(ndr, NDR_BUFFERS, &r->info2)); + break; + + case 3: + NDR_CHECK(ndr_push_samr_DispInfoFullGroups(ndr, NDR_BUFFERS, &r->info3)); + break; + + case 4: + NDR_CHECK(ndr_push_samr_DispInfoAscii(ndr, NDR_BUFFERS, &r->info4)); + break; + + case 5: + NDR_CHECK(ndr_push_samr_DispInfoAscii(ndr, NDR_BUFFERS, &r->info5)); + break; + + default: + return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_DispInfo(struct ndr_pull *ndr, int ndr_flags, union samr_DispInfo *r) +{ + int level; + uint16_t _level; + level = ndr_pull_get_switch_value(ndr, r); + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &_level)); + if (_level != level) { + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level); + } + switch (level) { + case 1: { + NDR_CHECK(ndr_pull_samr_DispInfoGeneral(ndr, NDR_SCALARS, &r->info1)); + break; } + + case 2: { + NDR_CHECK(ndr_pull_samr_DispInfoFull(ndr, NDR_SCALARS, &r->info2)); + break; } + + case 3: { + NDR_CHECK(ndr_pull_samr_DispInfoFullGroups(ndr, NDR_SCALARS, &r->info3)); + break; } + + case 4: { + NDR_CHECK(ndr_pull_samr_DispInfoAscii(ndr, NDR_SCALARS, &r->info4)); + break; } + + case 5: { + NDR_CHECK(ndr_pull_samr_DispInfoAscii(ndr, NDR_SCALARS, &r->info5)); + break; } + + default: + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + if (ndr_flags & NDR_BUFFERS) { + switch (level) { + case 1: + NDR_CHECK(ndr_pull_samr_DispInfoGeneral(ndr, NDR_BUFFERS, &r->info1)); + break; + + case 2: + NDR_CHECK(ndr_pull_samr_DispInfoFull(ndr, NDR_BUFFERS, &r->info2)); + break; + + case 3: + NDR_CHECK(ndr_pull_samr_DispInfoFullGroups(ndr, NDR_BUFFERS, &r->info3)); + break; + + case 4: + NDR_CHECK(ndr_pull_samr_DispInfoAscii(ndr, NDR_BUFFERS, &r->info4)); + break; + + case 5: + NDR_CHECK(ndr_pull_samr_DispInfoAscii(ndr, NDR_BUFFERS, &r->info5)); + break; + + default: + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_DispInfo(struct ndr_print *ndr, const char *name, const union samr_DispInfo *r) +{ + int level; + level = ndr_print_get_switch_value(ndr, r); + ndr_print_union(ndr, name, level, "samr_DispInfo"); + switch (level) { + case 1: + ndr_print_samr_DispInfoGeneral(ndr, "info1", &r->info1); + break; + + case 2: + ndr_print_samr_DispInfoFull(ndr, "info2", &r->info2); + break; + + case 3: + ndr_print_samr_DispInfoFullGroups(ndr, "info3", &r->info3); + break; + + case 4: + ndr_print_samr_DispInfoAscii(ndr, "info4", &r->info4); + break; + + case 5: + ndr_print_samr_DispInfoAscii(ndr, "info5", &r->info5); + break; + + default: + ndr_print_bad_level(ndr, name, level); + } +} + +static enum ndr_err_code ndr_push_samr_PwInfo(struct ndr_push *ndr, int ndr_flags, const struct samr_PwInfo *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->min_password_length)); + NDR_CHECK(ndr_push_samr_PasswordProperties(ndr, NDR_SCALARS, r->password_properties)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_PwInfo(struct ndr_pull *ndr, int ndr_flags, struct samr_PwInfo *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->min_password_length)); + NDR_CHECK(ndr_pull_samr_PasswordProperties(ndr, NDR_SCALARS, &r->password_properties)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_PwInfo(struct ndr_print *ndr, const char *name, const struct samr_PwInfo *r) +{ + ndr_print_struct(ndr, name, "samr_PwInfo"); + ndr->depth++; + ndr_print_uint16(ndr, "min_password_length", r->min_password_length); + ndr_print_samr_PasswordProperties(ndr, "password_properties", r->password_properties); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_ChangeReject(struct ndr_push *ndr, int ndr_flags, const struct samr_ChangeReject *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_samr_RejectReason(ndr, NDR_SCALARS, r->reason)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown1)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown2)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_ChangeReject(struct ndr_pull *ndr, int ndr_flags, struct samr_ChangeReject *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_samr_RejectReason(ndr, NDR_SCALARS, &r->reason)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown1)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown2)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_ChangeReject(struct ndr_print *ndr, const char *name, const struct samr_ChangeReject *r) +{ + ndr_print_struct(ndr, name, "samr_ChangeReject"); + ndr->depth++; + ndr_print_samr_RejectReason(ndr, "reason", r->reason); + ndr_print_uint32(ndr, "unknown1", r->unknown1); + ndr_print_uint32(ndr, "unknown2", r->unknown2); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_ConnectInfo1(struct ndr_push *ndr, int ndr_flags, const struct samr_ConnectInfo1 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown1)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown2)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_ConnectInfo1(struct ndr_pull *ndr, int ndr_flags, struct samr_ConnectInfo1 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown1)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown2)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_ConnectInfo1(struct ndr_print *ndr, const char *name, const struct samr_ConnectInfo1 *r) +{ + ndr_print_struct(ndr, name, "samr_ConnectInfo1"); + ndr->depth++; + ndr_print_uint32(ndr, "unknown1", r->unknown1); + ndr_print_uint32(ndr, "unknown2", r->unknown2); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_ConnectInfo(struct ndr_push *ndr, int ndr_flags, const union samr_ConnectInfo *r) +{ + if (ndr_flags & NDR_SCALARS) { + int level = ndr_push_get_switch_value(ndr, r); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, level)); + switch (level) { + case 1: + NDR_CHECK(ndr_push_samr_ConnectInfo1(ndr, NDR_SCALARS, &r->info1)); + break; + + default: + return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + if (ndr_flags & NDR_BUFFERS) { + int level = ndr_push_get_switch_value(ndr, r); + switch (level) { + case 1: + break; + + default: + return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_ConnectInfo(struct ndr_pull *ndr, int ndr_flags, union samr_ConnectInfo *r) +{ + int level; + uint32_t _level; + level = ndr_pull_get_switch_value(ndr, r); + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &_level)); + if (_level != level) { + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level); + } + switch (level) { + case 1: { + NDR_CHECK(ndr_pull_samr_ConnectInfo1(ndr, NDR_SCALARS, &r->info1)); + break; } + + default: + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + if (ndr_flags & NDR_BUFFERS) { + switch (level) { + case 1: + break; + + default: + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_ConnectInfo(struct ndr_print *ndr, const char *name, const union samr_ConnectInfo *r) +{ + int level; + level = ndr_print_get_switch_value(ndr, r); + ndr_print_union(ndr, name, level, "samr_ConnectInfo"); + switch (level) { + case 1: + ndr_print_samr_ConnectInfo1(ndr, "info1", &r->info1); + break; + + default: + ndr_print_bad_level(ndr, name, level); + } +} + +static enum ndr_err_code ndr_push_samr_ValidateFieldsPresent(struct ndr_push *ndr, int ndr_flags, uint32_t r) +{ + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_ValidateFieldsPresent(struct ndr_pull *ndr, int ndr_flags, uint32_t *r) +{ + uint32_t v; + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); + *r = v; + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_ValidateFieldsPresent(struct ndr_print *ndr, const char *name, uint32_t r) +{ + ndr_print_uint32(ndr, name, r); + ndr->depth++; + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_VALIDATE_FIELD_PASSWORD_LAST_SET", SAMR_VALIDATE_FIELD_PASSWORD_LAST_SET, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_VALIDATE_FIELD_BAD_PASSWORD_TIME", SAMR_VALIDATE_FIELD_BAD_PASSWORD_TIME, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_VALIDATE_FIELD_LOCKOUT_TIME", SAMR_VALIDATE_FIELD_LOCKOUT_TIME, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_VALIDATE_FIELD_BAD_PASSWORD_COUNT", SAMR_VALIDATE_FIELD_BAD_PASSWORD_COUNT, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_VALIDATE_FIELD_PASSWORD_HISTORY_LENGTH", SAMR_VALIDATE_FIELD_PASSWORD_HISTORY_LENGTH, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_VALIDATE_FIELD_PASSWORD_HISTORY", SAMR_VALIDATE_FIELD_PASSWORD_HISTORY, r); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_ValidatePasswordLevel(struct ndr_push *ndr, int ndr_flags, enum samr_ValidatePasswordLevel r) +{ + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r)); + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_ValidatePasswordLevel(struct ndr_pull *ndr, int ndr_flags, enum samr_ValidatePasswordLevel *r) +{ + uint16_t v; + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &v)); + *r = v; + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_ValidatePasswordLevel(struct ndr_print *ndr, const char *name, enum samr_ValidatePasswordLevel r) +{ + const char *val = NULL; + + switch (r) { + case NetValidateAuthentication: val = "NetValidateAuthentication"; break; + case NetValidatePasswordChange: val = "NetValidatePasswordChange"; break; + case NetValidatePasswordReset: val = "NetValidatePasswordReset"; break; + } + ndr_print_enum(ndr, name, "ENUM", val, r); +} + +static enum ndr_err_code ndr_push_samr_ValidationStatus(struct ndr_push *ndr, int ndr_flags, enum samr_ValidationStatus r) +{ + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r)); + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_ValidationStatus(struct ndr_pull *ndr, int ndr_flags, enum samr_ValidationStatus *r) +{ + uint16_t v; + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &v)); + *r = v; + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_ValidationStatus(struct ndr_print *ndr, const char *name, enum samr_ValidationStatus r) +{ + const char *val = NULL; + + switch (r) { + case SAMR_VALIDATION_STATUS_SUCCESS: val = "SAMR_VALIDATION_STATUS_SUCCESS"; break; + case SAMR_VALIDATION_STATUS_PASSWORD_MUST_CHANGE: val = "SAMR_VALIDATION_STATUS_PASSWORD_MUST_CHANGE"; break; + case SAMR_VALIDATION_STATUS_ACCOUNT_LOCKED_OUT: val = "SAMR_VALIDATION_STATUS_ACCOUNT_LOCKED_OUT"; break; + case SAMR_VALIDATION_STATUS_BAD_PASSWORD: val = "SAMR_VALIDATION_STATUS_BAD_PASSWORD"; break; + case SAMR_VALIDATION_STATUS_PWD_HISTORY_CONFLICT: val = "SAMR_VALIDATION_STATUS_PWD_HISTORY_CONFLICT"; break; + case SAMR_VALIDATION_STATUS_PWD_TOO_SHORT: val = "SAMR_VALIDATION_STATUS_PWD_TOO_SHORT"; break; + case SAMR_VALIDATION_STATUS_PWD_TOO_LONG: val = "SAMR_VALIDATION_STATUS_PWD_TOO_LONG"; break; + case SAMR_VALIDATION_STATUS_NOT_COMPLEX_ENOUGH: val = "SAMR_VALIDATION_STATUS_NOT_COMPLEX_ENOUGH"; break; + case SAMR_VALIDATION_STATUS_PASSWORD_TOO_RECENT: val = "SAMR_VALIDATION_STATUS_PASSWORD_TOO_RECENT"; break; + } + ndr_print_enum(ndr, name, "ENUM", val, r); +} + +static enum ndr_err_code ndr_push_samr_ValidationBlob(struct ndr_push *ndr, int ndr_flags, const struct samr_ValidationBlob *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->length)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->data)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->data) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->length)); + NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->data, r->length)); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_ValidationBlob(struct ndr_pull *ndr, int ndr_flags, struct samr_ValidationBlob *r) +{ + uint32_t _ptr_data; + TALLOC_CTX *_mem_save_data_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->length)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_data)); + if (_ptr_data) { + NDR_PULL_ALLOC(ndr, r->data); + } else { + r->data = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->data) { + _mem_save_data_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->data, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->data)); + NDR_PULL_ALLOC_N(ndr, r->data, ndr_get_array_size(ndr, &r->data)); + NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->data, ndr_get_array_size(ndr, &r->data))); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_data_0, 0); + } + if (r->data) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->data, r->length)); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_ValidationBlob(struct ndr_print *ndr, const char *name, const struct samr_ValidationBlob *r) +{ + ndr_print_struct(ndr, name, "samr_ValidationBlob"); + ndr->depth++; + ndr_print_uint32(ndr, "length", r->length); + ndr_print_ptr(ndr, "data", r->data); + ndr->depth++; + if (r->data) { + ndr_print_array_uint8(ndr, "data", r->data, r->length); + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_ValidatePasswordInfo(struct ndr_push *ndr, int ndr_flags, const struct samr_ValidatePasswordInfo *r) +{ + uint32_t cntr_pwd_history_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 8)); + NDR_CHECK(ndr_push_samr_ValidateFieldsPresent(ndr, NDR_SCALARS, r->fields_present)); + NDR_CHECK(ndr_push_NTTIME_hyper(ndr, NDR_SCALARS, r->last_password_change)); + NDR_CHECK(ndr_push_NTTIME_hyper(ndr, NDR_SCALARS, r->bad_password_time)); + NDR_CHECK(ndr_push_NTTIME_hyper(ndr, NDR_SCALARS, r->lockout_time)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->bad_pwd_count)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->pwd_history_len)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->pwd_history)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->pwd_history) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->pwd_history_len)); + for (cntr_pwd_history_1 = 0; cntr_pwd_history_1 < r->pwd_history_len; cntr_pwd_history_1++) { + NDR_CHECK(ndr_push_samr_ValidationBlob(ndr, NDR_SCALARS, &r->pwd_history[cntr_pwd_history_1])); + } + for (cntr_pwd_history_1 = 0; cntr_pwd_history_1 < r->pwd_history_len; cntr_pwd_history_1++) { + NDR_CHECK(ndr_push_samr_ValidationBlob(ndr, NDR_BUFFERS, &r->pwd_history[cntr_pwd_history_1])); + } + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_ValidatePasswordInfo(struct ndr_pull *ndr, int ndr_flags, struct samr_ValidatePasswordInfo *r) +{ + uint32_t _ptr_pwd_history; + uint32_t cntr_pwd_history_1; + TALLOC_CTX *_mem_save_pwd_history_0; + TALLOC_CTX *_mem_save_pwd_history_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 8)); + NDR_CHECK(ndr_pull_samr_ValidateFieldsPresent(ndr, NDR_SCALARS, &r->fields_present)); + NDR_CHECK(ndr_pull_NTTIME_hyper(ndr, NDR_SCALARS, &r->last_password_change)); + NDR_CHECK(ndr_pull_NTTIME_hyper(ndr, NDR_SCALARS, &r->bad_password_time)); + NDR_CHECK(ndr_pull_NTTIME_hyper(ndr, NDR_SCALARS, &r->lockout_time)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->bad_pwd_count)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->pwd_history_len)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_pwd_history)); + if (_ptr_pwd_history) { + NDR_PULL_ALLOC(ndr, r->pwd_history); + } else { + r->pwd_history = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->pwd_history) { + _mem_save_pwd_history_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->pwd_history, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->pwd_history)); + NDR_PULL_ALLOC_N(ndr, r->pwd_history, ndr_get_array_size(ndr, &r->pwd_history)); + _mem_save_pwd_history_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->pwd_history, 0); + for (cntr_pwd_history_1 = 0; cntr_pwd_history_1 < r->pwd_history_len; cntr_pwd_history_1++) { + NDR_CHECK(ndr_pull_samr_ValidationBlob(ndr, NDR_SCALARS, &r->pwd_history[cntr_pwd_history_1])); + } + for (cntr_pwd_history_1 = 0; cntr_pwd_history_1 < r->pwd_history_len; cntr_pwd_history_1++) { + NDR_CHECK(ndr_pull_samr_ValidationBlob(ndr, NDR_BUFFERS, &r->pwd_history[cntr_pwd_history_1])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_pwd_history_1, 0); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_pwd_history_0, 0); + } + if (r->pwd_history) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->pwd_history, r->pwd_history_len)); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_ValidatePasswordInfo(struct ndr_print *ndr, const char *name, const struct samr_ValidatePasswordInfo *r) +{ + uint32_t cntr_pwd_history_1; + ndr_print_struct(ndr, name, "samr_ValidatePasswordInfo"); + ndr->depth++; + ndr_print_samr_ValidateFieldsPresent(ndr, "fields_present", r->fields_present); + ndr_print_NTTIME_hyper(ndr, "last_password_change", r->last_password_change); + ndr_print_NTTIME_hyper(ndr, "bad_password_time", r->bad_password_time); + ndr_print_NTTIME_hyper(ndr, "lockout_time", r->lockout_time); + ndr_print_uint32(ndr, "bad_pwd_count", r->bad_pwd_count); + ndr_print_uint32(ndr, "pwd_history_len", r->pwd_history_len); + ndr_print_ptr(ndr, "pwd_history", r->pwd_history); + ndr->depth++; + if (r->pwd_history) { + ndr->print(ndr, "%s: ARRAY(%d)", "pwd_history", r->pwd_history_len); + ndr->depth++; + for (cntr_pwd_history_1=0;cntr_pwd_history_1<r->pwd_history_len;cntr_pwd_history_1++) { + char *idx_1=NULL; + asprintf(&idx_1, "[%d]", cntr_pwd_history_1); + if (idx_1) { + ndr_print_samr_ValidationBlob(ndr, "pwd_history", &r->pwd_history[cntr_pwd_history_1]); + free(idx_1); + } + } + ndr->depth--; + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_ValidatePasswordRepCtr(struct ndr_push *ndr, int ndr_flags, const struct samr_ValidatePasswordRepCtr *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 8)); + NDR_CHECK(ndr_push_samr_ValidatePasswordInfo(ndr, NDR_SCALARS, &r->info)); + NDR_CHECK(ndr_push_samr_ValidationStatus(ndr, NDR_SCALARS, r->status)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_push_samr_ValidatePasswordInfo(ndr, NDR_BUFFERS, &r->info)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_ValidatePasswordRepCtr(struct ndr_pull *ndr, int ndr_flags, struct samr_ValidatePasswordRepCtr *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 8)); + NDR_CHECK(ndr_pull_samr_ValidatePasswordInfo(ndr, NDR_SCALARS, &r->info)); + NDR_CHECK(ndr_pull_samr_ValidationStatus(ndr, NDR_SCALARS, &r->status)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_pull_samr_ValidatePasswordInfo(ndr, NDR_BUFFERS, &r->info)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_ValidatePasswordRepCtr(struct ndr_print *ndr, const char *name, const struct samr_ValidatePasswordRepCtr *r) +{ + ndr_print_struct(ndr, name, "samr_ValidatePasswordRepCtr"); + ndr->depth++; + ndr_print_samr_ValidatePasswordInfo(ndr, "info", &r->info); + ndr_print_samr_ValidationStatus(ndr, "status", r->status); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_ValidatePasswordRep(struct ndr_push *ndr, int ndr_flags, const union samr_ValidatePasswordRep *r) +{ + if (ndr_flags & NDR_SCALARS) { + int level = ndr_push_get_switch_value(ndr, r); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, level)); + switch (level) { + case 1: + NDR_CHECK(ndr_push_samr_ValidatePasswordRepCtr(ndr, NDR_SCALARS, &r->ctr1)); + break; + + case 2: + NDR_CHECK(ndr_push_samr_ValidatePasswordRepCtr(ndr, NDR_SCALARS, &r->ctr2)); + break; + + case 3: + NDR_CHECK(ndr_push_samr_ValidatePasswordRepCtr(ndr, NDR_SCALARS, &r->ctr3)); + break; + + default: + return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + if (ndr_flags & NDR_BUFFERS) { + int level = ndr_push_get_switch_value(ndr, r); + switch (level) { + case 1: + NDR_CHECK(ndr_push_samr_ValidatePasswordRepCtr(ndr, NDR_BUFFERS, &r->ctr1)); + break; + + case 2: + NDR_CHECK(ndr_push_samr_ValidatePasswordRepCtr(ndr, NDR_BUFFERS, &r->ctr2)); + break; + + case 3: + NDR_CHECK(ndr_push_samr_ValidatePasswordRepCtr(ndr, NDR_BUFFERS, &r->ctr3)); + break; + + default: + return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_ValidatePasswordRep(struct ndr_pull *ndr, int ndr_flags, union samr_ValidatePasswordRep *r) +{ + int level; + uint16_t _level; + level = ndr_pull_get_switch_value(ndr, r); + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &_level)); + if (_level != level) { + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level); + } + switch (level) { + case 1: { + NDR_CHECK(ndr_pull_samr_ValidatePasswordRepCtr(ndr, NDR_SCALARS, &r->ctr1)); + break; } + + case 2: { + NDR_CHECK(ndr_pull_samr_ValidatePasswordRepCtr(ndr, NDR_SCALARS, &r->ctr2)); + break; } + + case 3: { + NDR_CHECK(ndr_pull_samr_ValidatePasswordRepCtr(ndr, NDR_SCALARS, &r->ctr3)); + break; } + + default: + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + if (ndr_flags & NDR_BUFFERS) { + switch (level) { + case 1: + NDR_CHECK(ndr_pull_samr_ValidatePasswordRepCtr(ndr, NDR_BUFFERS, &r->ctr1)); + break; + + case 2: + NDR_CHECK(ndr_pull_samr_ValidatePasswordRepCtr(ndr, NDR_BUFFERS, &r->ctr2)); + break; + + case 3: + NDR_CHECK(ndr_pull_samr_ValidatePasswordRepCtr(ndr, NDR_BUFFERS, &r->ctr3)); + break; + + default: + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_ValidatePasswordRep(struct ndr_print *ndr, const char *name, const union samr_ValidatePasswordRep *r) +{ + int level; + level = ndr_print_get_switch_value(ndr, r); + ndr_print_union(ndr, name, level, "samr_ValidatePasswordRep"); + switch (level) { + case 1: + ndr_print_samr_ValidatePasswordRepCtr(ndr, "ctr1", &r->ctr1); + break; + + case 2: + ndr_print_samr_ValidatePasswordRepCtr(ndr, "ctr2", &r->ctr2); + break; + + case 3: + ndr_print_samr_ValidatePasswordRepCtr(ndr, "ctr3", &r->ctr3); + break; + + default: + ndr_print_bad_level(ndr, name, level); + } +} + +static enum ndr_err_code ndr_push_samr_ValidatePasswordReq3(struct ndr_push *ndr, int ndr_flags, const struct samr_ValidatePasswordReq3 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 8)); + NDR_CHECK(ndr_push_samr_ValidatePasswordInfo(ndr, NDR_SCALARS, &r->info)); + NDR_CHECK(ndr_push_lsa_StringLarge(ndr, NDR_SCALARS, &r->password)); + NDR_CHECK(ndr_push_lsa_StringLarge(ndr, NDR_SCALARS, &r->account)); + NDR_CHECK(ndr_push_samr_ValidationBlob(ndr, NDR_SCALARS, &r->hash)); + NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->pwd_must_change_at_next_logon)); + NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->clear_lockout)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_push_samr_ValidatePasswordInfo(ndr, NDR_BUFFERS, &r->info)); + NDR_CHECK(ndr_push_lsa_StringLarge(ndr, NDR_BUFFERS, &r->password)); + NDR_CHECK(ndr_push_lsa_StringLarge(ndr, NDR_BUFFERS, &r->account)); + NDR_CHECK(ndr_push_samr_ValidationBlob(ndr, NDR_BUFFERS, &r->hash)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_ValidatePasswordReq3(struct ndr_pull *ndr, int ndr_flags, struct samr_ValidatePasswordReq3 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 8)); + NDR_CHECK(ndr_pull_samr_ValidatePasswordInfo(ndr, NDR_SCALARS, &r->info)); + NDR_CHECK(ndr_pull_lsa_StringLarge(ndr, NDR_SCALARS, &r->password)); + NDR_CHECK(ndr_pull_lsa_StringLarge(ndr, NDR_SCALARS, &r->account)); + NDR_CHECK(ndr_pull_samr_ValidationBlob(ndr, NDR_SCALARS, &r->hash)); + NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->pwd_must_change_at_next_logon)); + NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->clear_lockout)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_pull_samr_ValidatePasswordInfo(ndr, NDR_BUFFERS, &r->info)); + NDR_CHECK(ndr_pull_lsa_StringLarge(ndr, NDR_BUFFERS, &r->password)); + NDR_CHECK(ndr_pull_lsa_StringLarge(ndr, NDR_BUFFERS, &r->account)); + NDR_CHECK(ndr_pull_samr_ValidationBlob(ndr, NDR_BUFFERS, &r->hash)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_ValidatePasswordReq3(struct ndr_print *ndr, const char *name, const struct samr_ValidatePasswordReq3 *r) +{ + ndr_print_struct(ndr, name, "samr_ValidatePasswordReq3"); + ndr->depth++; + ndr_print_samr_ValidatePasswordInfo(ndr, "info", &r->info); + ndr_print_lsa_StringLarge(ndr, "password", &r->password); + ndr_print_lsa_StringLarge(ndr, "account", &r->account); + ndr_print_samr_ValidationBlob(ndr, "hash", &r->hash); + ndr_print_uint8(ndr, "pwd_must_change_at_next_logon", r->pwd_must_change_at_next_logon); + ndr_print_uint8(ndr, "clear_lockout", r->clear_lockout); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_ValidatePasswordReq2(struct ndr_push *ndr, int ndr_flags, const struct samr_ValidatePasswordReq2 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 8)); + NDR_CHECK(ndr_push_samr_ValidatePasswordInfo(ndr, NDR_SCALARS, &r->info)); + NDR_CHECK(ndr_push_lsa_StringLarge(ndr, NDR_SCALARS, &r->password)); + NDR_CHECK(ndr_push_lsa_StringLarge(ndr, NDR_SCALARS, &r->account)); + NDR_CHECK(ndr_push_samr_ValidationBlob(ndr, NDR_SCALARS, &r->hash)); + NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->password_matched)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_push_samr_ValidatePasswordInfo(ndr, NDR_BUFFERS, &r->info)); + NDR_CHECK(ndr_push_lsa_StringLarge(ndr, NDR_BUFFERS, &r->password)); + NDR_CHECK(ndr_push_lsa_StringLarge(ndr, NDR_BUFFERS, &r->account)); + NDR_CHECK(ndr_push_samr_ValidationBlob(ndr, NDR_BUFFERS, &r->hash)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_ValidatePasswordReq2(struct ndr_pull *ndr, int ndr_flags, struct samr_ValidatePasswordReq2 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 8)); + NDR_CHECK(ndr_pull_samr_ValidatePasswordInfo(ndr, NDR_SCALARS, &r->info)); + NDR_CHECK(ndr_pull_lsa_StringLarge(ndr, NDR_SCALARS, &r->password)); + NDR_CHECK(ndr_pull_lsa_StringLarge(ndr, NDR_SCALARS, &r->account)); + NDR_CHECK(ndr_pull_samr_ValidationBlob(ndr, NDR_SCALARS, &r->hash)); + NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->password_matched)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_pull_samr_ValidatePasswordInfo(ndr, NDR_BUFFERS, &r->info)); + NDR_CHECK(ndr_pull_lsa_StringLarge(ndr, NDR_BUFFERS, &r->password)); + NDR_CHECK(ndr_pull_lsa_StringLarge(ndr, NDR_BUFFERS, &r->account)); + NDR_CHECK(ndr_pull_samr_ValidationBlob(ndr, NDR_BUFFERS, &r->hash)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_ValidatePasswordReq2(struct ndr_print *ndr, const char *name, const struct samr_ValidatePasswordReq2 *r) +{ + ndr_print_struct(ndr, name, "samr_ValidatePasswordReq2"); + ndr->depth++; + ndr_print_samr_ValidatePasswordInfo(ndr, "info", &r->info); + ndr_print_lsa_StringLarge(ndr, "password", &r->password); + ndr_print_lsa_StringLarge(ndr, "account", &r->account); + ndr_print_samr_ValidationBlob(ndr, "hash", &r->hash); + ndr_print_uint8(ndr, "password_matched", r->password_matched); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_ValidatePasswordReq1(struct ndr_push *ndr, int ndr_flags, const struct samr_ValidatePasswordReq1 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 8)); + NDR_CHECK(ndr_push_samr_ValidatePasswordInfo(ndr, NDR_SCALARS, &r->info)); + NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->password_matched)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_push_samr_ValidatePasswordInfo(ndr, NDR_BUFFERS, &r->info)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_ValidatePasswordReq1(struct ndr_pull *ndr, int ndr_flags, struct samr_ValidatePasswordReq1 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 8)); + NDR_CHECK(ndr_pull_samr_ValidatePasswordInfo(ndr, NDR_SCALARS, &r->info)); + NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->password_matched)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_pull_samr_ValidatePasswordInfo(ndr, NDR_BUFFERS, &r->info)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_ValidatePasswordReq1(struct ndr_print *ndr, const char *name, const struct samr_ValidatePasswordReq1 *r) +{ + ndr_print_struct(ndr, name, "samr_ValidatePasswordReq1"); + ndr->depth++; + ndr_print_samr_ValidatePasswordInfo(ndr, "info", &r->info); + ndr_print_uint8(ndr, "password_matched", r->password_matched); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_ValidatePasswordReq(struct ndr_push *ndr, int ndr_flags, const union samr_ValidatePasswordReq *r) +{ + if (ndr_flags & NDR_SCALARS) { + int level = ndr_push_get_switch_value(ndr, r); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, level)); + switch (level) { + case 1: + NDR_CHECK(ndr_push_samr_ValidatePasswordReq1(ndr, NDR_SCALARS, &r->req1)); + break; + + case 2: + NDR_CHECK(ndr_push_samr_ValidatePasswordReq2(ndr, NDR_SCALARS, &r->req2)); + break; + + case 3: + NDR_CHECK(ndr_push_samr_ValidatePasswordReq3(ndr, NDR_SCALARS, &r->req3)); + break; + + default: + return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + if (ndr_flags & NDR_BUFFERS) { + int level = ndr_push_get_switch_value(ndr, r); + switch (level) { + case 1: + NDR_CHECK(ndr_push_samr_ValidatePasswordReq1(ndr, NDR_BUFFERS, &r->req1)); + break; + + case 2: + NDR_CHECK(ndr_push_samr_ValidatePasswordReq2(ndr, NDR_BUFFERS, &r->req2)); + break; + + case 3: + NDR_CHECK(ndr_push_samr_ValidatePasswordReq3(ndr, NDR_BUFFERS, &r->req3)); + break; + + default: + return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_ValidatePasswordReq(struct ndr_pull *ndr, int ndr_flags, union samr_ValidatePasswordReq *r) +{ + int level; + uint16_t _level; + level = ndr_pull_get_switch_value(ndr, r); + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &_level)); + if (_level != level) { + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level); + } + switch (level) { + case 1: { + NDR_CHECK(ndr_pull_samr_ValidatePasswordReq1(ndr, NDR_SCALARS, &r->req1)); + break; } + + case 2: { + NDR_CHECK(ndr_pull_samr_ValidatePasswordReq2(ndr, NDR_SCALARS, &r->req2)); + break; } + + case 3: { + NDR_CHECK(ndr_pull_samr_ValidatePasswordReq3(ndr, NDR_SCALARS, &r->req3)); + break; } + + default: + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + if (ndr_flags & NDR_BUFFERS) { + switch (level) { + case 1: + NDR_CHECK(ndr_pull_samr_ValidatePasswordReq1(ndr, NDR_BUFFERS, &r->req1)); + break; + + case 2: + NDR_CHECK(ndr_pull_samr_ValidatePasswordReq2(ndr, NDR_BUFFERS, &r->req2)); + break; + + case 3: + NDR_CHECK(ndr_pull_samr_ValidatePasswordReq3(ndr, NDR_BUFFERS, &r->req3)); + break; + + default: + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_ValidatePasswordReq(struct ndr_print *ndr, const char *name, const union samr_ValidatePasswordReq *r) +{ + int level; + level = ndr_print_get_switch_value(ndr, r); + ndr_print_union(ndr, name, level, "samr_ValidatePasswordReq"); + switch (level) { + case 1: + ndr_print_samr_ValidatePasswordReq1(ndr, "req1", &r->req1); + break; + + case 2: + ndr_print_samr_ValidatePasswordReq2(ndr, "req2", &r->req2); + break; + + case 3: + ndr_print_samr_ValidatePasswordReq3(ndr, "req3", &r->req3); + break; + + default: + ndr_print_bad_level(ndr, name, level); + } +} + +static enum ndr_err_code ndr_push_samr_Connect(struct ndr_push *ndr, int flags, const struct samr_Connect *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.system_name)); + if (r->in.system_name) { + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, *r->in.system_name)); + } + NDR_CHECK(ndr_push_samr_ConnectAccessMask(ndr, NDR_SCALARS, r->in.access_mask)); + } + if (flags & NDR_OUT) { + if (r->out.connect_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->out.connect_handle)); + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_Connect(struct ndr_pull *ndr, int flags, struct samr_Connect *r) +{ + uint32_t _ptr_system_name; + TALLOC_CTX *_mem_save_system_name_0; + TALLOC_CTX *_mem_save_connect_handle_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_system_name)); + if (_ptr_system_name) { + NDR_PULL_ALLOC(ndr, r->in.system_name); + } else { + r->in.system_name = NULL; + } + if (r->in.system_name) { + _mem_save_system_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.system_name, 0); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, r->in.system_name)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_system_name_0, 0); + } + NDR_CHECK(ndr_pull_samr_ConnectAccessMask(ndr, NDR_SCALARS, &r->in.access_mask)); + NDR_PULL_ALLOC(ndr, r->out.connect_handle); + ZERO_STRUCTP(r->out.connect_handle); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.connect_handle); + } + _mem_save_connect_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.connect_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->out.connect_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_connect_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_Connect(struct ndr_print *ndr, const char *name, int flags, const struct samr_Connect *r) +{ + ndr_print_struct(ndr, name, "samr_Connect"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "samr_Connect"); + ndr->depth++; + ndr_print_ptr(ndr, "system_name", r->in.system_name); + ndr->depth++; + if (r->in.system_name) { + ndr_print_uint16(ndr, "system_name", *r->in.system_name); + } + ndr->depth--; + ndr_print_samr_ConnectAccessMask(ndr, "access_mask", r->in.access_mask); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "samr_Connect"); + ndr->depth++; + ndr_print_ptr(ndr, "connect_handle", r->out.connect_handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "connect_handle", r->out.connect_handle); + ndr->depth--; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +_PUBLIC_ enum ndr_err_code ndr_push_samr_Close(struct ndr_push *ndr, int flags, const struct samr_Close *r) +{ + if (flags & NDR_IN) { + if (r->in.handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle)); + } + if (flags & NDR_OUT) { + if (r->out.handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->out.handle)); + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_samr_Close(struct ndr_pull *ndr, int flags, struct samr_Close *r) +{ + TALLOC_CTX *_mem_save_handle_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.handle); + } + _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_PULL_ALLOC(ndr, r->out.handle); + *r->out.handle = *r->in.handle; + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.handle); + } + _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->out.handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_Close(struct ndr_print *ndr, const char *name, int flags, const struct samr_Close *r) +{ + ndr_print_struct(ndr, name, "samr_Close"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "samr_Close"); + ndr->depth++; + ndr_print_ptr(ndr, "handle", r->in.handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "handle", r->in.handle); + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "samr_Close"); + ndr->depth++; + ndr_print_ptr(ndr, "handle", r->out.handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "handle", r->out.handle); + ndr->depth--; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_SetSecurity(struct ndr_push *ndr, int flags, const struct samr_SetSecurity *r) +{ + if (flags & NDR_IN) { + if (r->in.handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle)); + NDR_CHECK(ndr_push_security_secinfo(ndr, NDR_SCALARS, r->in.sec_info)); + if (r->in.sdbuf == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_sec_desc_buf(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.sdbuf)); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_SetSecurity(struct ndr_pull *ndr, int flags, struct samr_SetSecurity *r) +{ + TALLOC_CTX *_mem_save_handle_0; + TALLOC_CTX *_mem_save_sdbuf_0; + if (flags & NDR_IN) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.handle); + } + _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_security_secinfo(ndr, NDR_SCALARS, &r->in.sec_info)); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.sdbuf); + } + _mem_save_sdbuf_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.sdbuf, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_sec_desc_buf(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.sdbuf)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sdbuf_0, LIBNDR_FLAG_REF_ALLOC); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_SetSecurity(struct ndr_print *ndr, const char *name, int flags, const struct samr_SetSecurity *r) +{ + ndr_print_struct(ndr, name, "samr_SetSecurity"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "samr_SetSecurity"); + ndr->depth++; + ndr_print_ptr(ndr, "handle", r->in.handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "handle", r->in.handle); + ndr->depth--; + ndr_print_security_secinfo(ndr, "sec_info", r->in.sec_info); + ndr_print_ptr(ndr, "sdbuf", r->in.sdbuf); + ndr->depth++; + ndr_print_sec_desc_buf(ndr, "sdbuf", r->in.sdbuf); + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "samr_SetSecurity"); + ndr->depth++; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_QuerySecurity(struct ndr_push *ndr, int flags, const struct samr_QuerySecurity *r) +{ + if (flags & NDR_IN) { + if (r->in.handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle)); + NDR_CHECK(ndr_push_security_secinfo(ndr, NDR_SCALARS, r->in.sec_info)); + } + if (flags & NDR_OUT) { + if (r->out.sdbuf == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_sec_desc_buf(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.sdbuf)); + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_QuerySecurity(struct ndr_pull *ndr, int flags, struct samr_QuerySecurity *r) +{ + TALLOC_CTX *_mem_save_handle_0; + TALLOC_CTX *_mem_save_sdbuf_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.handle); + } + _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_security_secinfo(ndr, NDR_SCALARS, &r->in.sec_info)); + NDR_PULL_ALLOC(ndr, r->out.sdbuf); + ZERO_STRUCTP(r->out.sdbuf); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.sdbuf); + } + _mem_save_sdbuf_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.sdbuf, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_sec_desc_buf(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.sdbuf)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sdbuf_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_QuerySecurity(struct ndr_print *ndr, const char *name, int flags, const struct samr_QuerySecurity *r) +{ + ndr_print_struct(ndr, name, "samr_QuerySecurity"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "samr_QuerySecurity"); + ndr->depth++; + ndr_print_ptr(ndr, "handle", r->in.handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "handle", r->in.handle); + ndr->depth--; + ndr_print_security_secinfo(ndr, "sec_info", r->in.sec_info); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "samr_QuerySecurity"); + ndr->depth++; + ndr_print_ptr(ndr, "sdbuf", r->out.sdbuf); + ndr->depth++; + ndr_print_sec_desc_buf(ndr, "sdbuf", r->out.sdbuf); + ndr->depth--; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_Shutdown(struct ndr_push *ndr, int flags, const struct samr_Shutdown *r) +{ + if (flags & NDR_IN) { + if (r->in.connect_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.connect_handle)); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_Shutdown(struct ndr_pull *ndr, int flags, struct samr_Shutdown *r) +{ + TALLOC_CTX *_mem_save_connect_handle_0; + if (flags & NDR_IN) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.connect_handle); + } + _mem_save_connect_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.connect_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.connect_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_connect_handle_0, LIBNDR_FLAG_REF_ALLOC); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_Shutdown(struct ndr_print *ndr, const char *name, int flags, const struct samr_Shutdown *r) +{ + ndr_print_struct(ndr, name, "samr_Shutdown"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "samr_Shutdown"); + ndr->depth++; + ndr_print_ptr(ndr, "connect_handle", r->in.connect_handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "connect_handle", r->in.connect_handle); + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "samr_Shutdown"); + ndr->depth++; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_LookupDomain(struct ndr_push *ndr, int flags, const struct samr_LookupDomain *r) +{ + if (flags & NDR_IN) { + if (r->in.connect_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.connect_handle)); + if (r->in.domain_name == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.domain_name)); + } + if (flags & NDR_OUT) { + if (r->out.sid == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_dom_sid2(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.sid)); + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_LookupDomain(struct ndr_pull *ndr, int flags, struct samr_LookupDomain *r) +{ + TALLOC_CTX *_mem_save_connect_handle_0; + TALLOC_CTX *_mem_save_domain_name_0; + TALLOC_CTX *_mem_save_sid_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.connect_handle); + } + _mem_save_connect_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.connect_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.connect_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_connect_handle_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.domain_name); + } + _mem_save_domain_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.domain_name, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.domain_name)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_name_0, LIBNDR_FLAG_REF_ALLOC); + NDR_PULL_ALLOC(ndr, r->out.sid); + ZERO_STRUCTP(r->out.sid); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.sid); + } + _mem_save_sid_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.sid, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_dom_sid2(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.sid)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sid_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_LookupDomain(struct ndr_print *ndr, const char *name, int flags, const struct samr_LookupDomain *r) +{ + ndr_print_struct(ndr, name, "samr_LookupDomain"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "samr_LookupDomain"); + ndr->depth++; + ndr_print_ptr(ndr, "connect_handle", r->in.connect_handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "connect_handle", r->in.connect_handle); + ndr->depth--; + ndr_print_ptr(ndr, "domain_name", r->in.domain_name); + ndr->depth++; + ndr_print_lsa_String(ndr, "domain_name", r->in.domain_name); + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "samr_LookupDomain"); + ndr->depth++; + ndr_print_ptr(ndr, "sid", r->out.sid); + ndr->depth++; + ndr_print_dom_sid2(ndr, "sid", r->out.sid); + ndr->depth--; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_EnumDomains(struct ndr_push *ndr, int flags, const struct samr_EnumDomains *r) +{ + if (flags & NDR_IN) { + if (r->in.connect_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.connect_handle)); + if (r->in.resume_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.resume_handle)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.buf_size)); + } + if (flags & NDR_OUT) { + if (r->out.resume_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.resume_handle)); + if (r->out.sam == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_samr_SamArray(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.sam)); + if (r->out.num_entries == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.num_entries)); + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_EnumDomains(struct ndr_pull *ndr, int flags, struct samr_EnumDomains *r) +{ + TALLOC_CTX *_mem_save_connect_handle_0; + TALLOC_CTX *_mem_save_resume_handle_0; + TALLOC_CTX *_mem_save_sam_0; + TALLOC_CTX *_mem_save_num_entries_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.connect_handle); + } + _mem_save_connect_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.connect_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.connect_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_connect_handle_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.resume_handle); + } + _mem_save_resume_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.resume_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->in.resume_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_resume_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.buf_size)); + NDR_PULL_ALLOC(ndr, r->out.resume_handle); + *r->out.resume_handle = *r->in.resume_handle; + NDR_PULL_ALLOC(ndr, r->out.sam); + ZERO_STRUCTP(r->out.sam); + NDR_PULL_ALLOC(ndr, r->out.num_entries); + ZERO_STRUCTP(r->out.num_entries); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.resume_handle); + } + _mem_save_resume_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.resume_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.resume_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_resume_handle_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.sam); + } + _mem_save_sam_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.sam, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_samr_SamArray(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.sam)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sam_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.num_entries); + } + _mem_save_num_entries_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.num_entries, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.num_entries)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_num_entries_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_EnumDomains(struct ndr_print *ndr, const char *name, int flags, const struct samr_EnumDomains *r) +{ + ndr_print_struct(ndr, name, "samr_EnumDomains"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "samr_EnumDomains"); + ndr->depth++; + ndr_print_ptr(ndr, "connect_handle", r->in.connect_handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "connect_handle", r->in.connect_handle); + ndr->depth--; + ndr_print_ptr(ndr, "resume_handle", r->in.resume_handle); + ndr->depth++; + ndr_print_uint32(ndr, "resume_handle", *r->in.resume_handle); + ndr->depth--; + ndr_print_uint32(ndr, "buf_size", r->in.buf_size); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "samr_EnumDomains"); + ndr->depth++; + ndr_print_ptr(ndr, "resume_handle", r->out.resume_handle); + ndr->depth++; + ndr_print_uint32(ndr, "resume_handle", *r->out.resume_handle); + ndr->depth--; + ndr_print_ptr(ndr, "sam", r->out.sam); + ndr->depth++; + ndr_print_samr_SamArray(ndr, "sam", r->out.sam); + ndr->depth--; + ndr_print_ptr(ndr, "num_entries", r->out.num_entries); + ndr->depth++; + ndr_print_uint32(ndr, "num_entries", *r->out.num_entries); + ndr->depth--; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +_PUBLIC_ enum ndr_err_code ndr_push_samr_OpenDomain(struct ndr_push *ndr, int flags, const struct samr_OpenDomain *r) +{ + if (flags & NDR_IN) { + if (r->in.connect_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.connect_handle)); + NDR_CHECK(ndr_push_samr_DomainAccessMask(ndr, NDR_SCALARS, r->in.access_mask)); + if (r->in.sid == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_dom_sid2(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.sid)); + } + if (flags & NDR_OUT) { + if (r->out.domain_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->out.domain_handle)); + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_samr_OpenDomain(struct ndr_pull *ndr, int flags, struct samr_OpenDomain *r) +{ + TALLOC_CTX *_mem_save_connect_handle_0; + TALLOC_CTX *_mem_save_sid_0; + TALLOC_CTX *_mem_save_domain_handle_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.connect_handle); + } + _mem_save_connect_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.connect_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.connect_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_connect_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_samr_DomainAccessMask(ndr, NDR_SCALARS, &r->in.access_mask)); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.sid); + } + _mem_save_sid_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.sid, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_dom_sid2(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.sid)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sid_0, LIBNDR_FLAG_REF_ALLOC); + NDR_PULL_ALLOC(ndr, r->out.domain_handle); + ZERO_STRUCTP(r->out.domain_handle); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.domain_handle); + } + _mem_save_domain_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.domain_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->out.domain_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_OpenDomain(struct ndr_print *ndr, const char *name, int flags, const struct samr_OpenDomain *r) +{ + ndr_print_struct(ndr, name, "samr_OpenDomain"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "samr_OpenDomain"); + ndr->depth++; + ndr_print_ptr(ndr, "connect_handle", r->in.connect_handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "connect_handle", r->in.connect_handle); + ndr->depth--; + ndr_print_samr_DomainAccessMask(ndr, "access_mask", r->in.access_mask); + ndr_print_ptr(ndr, "sid", r->in.sid); + ndr->depth++; + ndr_print_dom_sid2(ndr, "sid", r->in.sid); + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "samr_OpenDomain"); + ndr->depth++; + ndr_print_ptr(ndr, "domain_handle", r->out.domain_handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "domain_handle", r->out.domain_handle); + ndr->depth--; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_QueryDomainInfo(struct ndr_push *ndr, int flags, const struct samr_QueryDomainInfo *r) +{ + if (flags & NDR_IN) { + if (r->in.domain_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.domain_handle)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->in.level)); + } + if (flags & NDR_OUT) { + if (r->out.info == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_set_switch_value(ndr, r->out.info, r->in.level)); + NDR_CHECK(ndr_push_samr_DomainInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.info)); + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_QueryDomainInfo(struct ndr_pull *ndr, int flags, struct samr_QueryDomainInfo *r) +{ + TALLOC_CTX *_mem_save_domain_handle_0; + TALLOC_CTX *_mem_save_info_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.domain_handle); + } + _mem_save_domain_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.domain_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.domain_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->in.level)); + NDR_PULL_ALLOC(ndr, r->out.info); + ZERO_STRUCTP(r->out.info); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.info); + } + _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.info, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_set_switch_value(ndr, r->out.info, r->in.level)); + NDR_CHECK(ndr_pull_samr_DomainInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.info)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_QueryDomainInfo(struct ndr_print *ndr, const char *name, int flags, const struct samr_QueryDomainInfo *r) +{ + ndr_print_struct(ndr, name, "samr_QueryDomainInfo"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "samr_QueryDomainInfo"); + ndr->depth++; + ndr_print_ptr(ndr, "domain_handle", r->in.domain_handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "domain_handle", r->in.domain_handle); + ndr->depth--; + ndr_print_uint16(ndr, "level", r->in.level); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "samr_QueryDomainInfo"); + ndr->depth++; + ndr_print_ptr(ndr, "info", r->out.info); + ndr->depth++; + ndr_print_set_switch_value(ndr, r->out.info, r->in.level); + ndr_print_samr_DomainInfo(ndr, "info", r->out.info); + ndr->depth--; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_SetDomainInfo(struct ndr_push *ndr, int flags, const struct samr_SetDomainInfo *r) +{ + if (flags & NDR_IN) { + if (r->in.domain_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.domain_handle)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->in.level)); + if (r->in.info == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_set_switch_value(ndr, r->in.info, r->in.level)); + NDR_CHECK(ndr_push_samr_DomainInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.info)); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_SetDomainInfo(struct ndr_pull *ndr, int flags, struct samr_SetDomainInfo *r) +{ + TALLOC_CTX *_mem_save_domain_handle_0; + TALLOC_CTX *_mem_save_info_0; + if (flags & NDR_IN) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.domain_handle); + } + _mem_save_domain_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.domain_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.domain_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->in.level)); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.info); + } + _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.info, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_set_switch_value(ndr, r->in.info, r->in.level)); + NDR_CHECK(ndr_pull_samr_DomainInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.info)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, LIBNDR_FLAG_REF_ALLOC); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_SetDomainInfo(struct ndr_print *ndr, const char *name, int flags, const struct samr_SetDomainInfo *r) +{ + ndr_print_struct(ndr, name, "samr_SetDomainInfo"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "samr_SetDomainInfo"); + ndr->depth++; + ndr_print_ptr(ndr, "domain_handle", r->in.domain_handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "domain_handle", r->in.domain_handle); + ndr->depth--; + ndr_print_uint16(ndr, "level", r->in.level); + ndr_print_ptr(ndr, "info", r->in.info); + ndr->depth++; + ndr_print_set_switch_value(ndr, r->in.info, r->in.level); + ndr_print_samr_DomainInfo(ndr, "info", r->in.info); + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "samr_SetDomainInfo"); + ndr->depth++; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_CreateDomainGroup(struct ndr_push *ndr, int flags, const struct samr_CreateDomainGroup *r) +{ + if (flags & NDR_IN) { + if (r->in.domain_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.domain_handle)); + if (r->in.name == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.name)); + NDR_CHECK(ndr_push_samr_GroupAccessMask(ndr, NDR_SCALARS, r->in.access_mask)); + } + if (flags & NDR_OUT) { + if (r->out.group_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->out.group_handle)); + if (r->out.rid == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.rid)); + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_CreateDomainGroup(struct ndr_pull *ndr, int flags, struct samr_CreateDomainGroup *r) +{ + TALLOC_CTX *_mem_save_domain_handle_0; + TALLOC_CTX *_mem_save_name_0; + TALLOC_CTX *_mem_save_group_handle_0; + TALLOC_CTX *_mem_save_rid_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.domain_handle); + } + _mem_save_domain_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.domain_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.domain_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_handle_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.name); + } + _mem_save_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.name, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.name)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_name_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_samr_GroupAccessMask(ndr, NDR_SCALARS, &r->in.access_mask)); + NDR_PULL_ALLOC(ndr, r->out.group_handle); + ZERO_STRUCTP(r->out.group_handle); + NDR_PULL_ALLOC(ndr, r->out.rid); + ZERO_STRUCTP(r->out.rid); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.group_handle); + } + _mem_save_group_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.group_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->out.group_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_group_handle_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.rid); + } + _mem_save_rid_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.rid, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.rid)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_rid_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_CreateDomainGroup(struct ndr_print *ndr, const char *name, int flags, const struct samr_CreateDomainGroup *r) +{ + ndr_print_struct(ndr, name, "samr_CreateDomainGroup"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "samr_CreateDomainGroup"); + ndr->depth++; + ndr_print_ptr(ndr, "domain_handle", r->in.domain_handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "domain_handle", r->in.domain_handle); + ndr->depth--; + ndr_print_ptr(ndr, "name", r->in.name); + ndr->depth++; + ndr_print_lsa_String(ndr, "name", r->in.name); + ndr->depth--; + ndr_print_samr_GroupAccessMask(ndr, "access_mask", r->in.access_mask); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "samr_CreateDomainGroup"); + ndr->depth++; + ndr_print_ptr(ndr, "group_handle", r->out.group_handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "group_handle", r->out.group_handle); + ndr->depth--; + ndr_print_ptr(ndr, "rid", r->out.rid); + ndr->depth++; + ndr_print_uint32(ndr, "rid", *r->out.rid); + ndr->depth--; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_EnumDomainGroups(struct ndr_push *ndr, int flags, const struct samr_EnumDomainGroups *r) +{ + if (flags & NDR_IN) { + if (r->in.domain_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.domain_handle)); + if (r->in.resume_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.resume_handle)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.max_size)); + } + if (flags & NDR_OUT) { + if (r->out.resume_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.resume_handle)); + if (r->out.sam == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_samr_SamArray(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.sam)); + if (r->out.num_entries == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.num_entries)); + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_EnumDomainGroups(struct ndr_pull *ndr, int flags, struct samr_EnumDomainGroups *r) +{ + TALLOC_CTX *_mem_save_domain_handle_0; + TALLOC_CTX *_mem_save_resume_handle_0; + TALLOC_CTX *_mem_save_sam_0; + TALLOC_CTX *_mem_save_num_entries_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.domain_handle); + } + _mem_save_domain_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.domain_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.domain_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_handle_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.resume_handle); + } + _mem_save_resume_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.resume_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->in.resume_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_resume_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.max_size)); + NDR_PULL_ALLOC(ndr, r->out.resume_handle); + *r->out.resume_handle = *r->in.resume_handle; + NDR_PULL_ALLOC(ndr, r->out.sam); + ZERO_STRUCTP(r->out.sam); + NDR_PULL_ALLOC(ndr, r->out.num_entries); + ZERO_STRUCTP(r->out.num_entries); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.resume_handle); + } + _mem_save_resume_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.resume_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.resume_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_resume_handle_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.sam); + } + _mem_save_sam_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.sam, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_samr_SamArray(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.sam)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sam_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.num_entries); + } + _mem_save_num_entries_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.num_entries, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.num_entries)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_num_entries_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_EnumDomainGroups(struct ndr_print *ndr, const char *name, int flags, const struct samr_EnumDomainGroups *r) +{ + ndr_print_struct(ndr, name, "samr_EnumDomainGroups"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "samr_EnumDomainGroups"); + ndr->depth++; + ndr_print_ptr(ndr, "domain_handle", r->in.domain_handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "domain_handle", r->in.domain_handle); + ndr->depth--; + ndr_print_ptr(ndr, "resume_handle", r->in.resume_handle); + ndr->depth++; + ndr_print_uint32(ndr, "resume_handle", *r->in.resume_handle); + ndr->depth--; + ndr_print_uint32(ndr, "max_size", r->in.max_size); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "samr_EnumDomainGroups"); + ndr->depth++; + ndr_print_ptr(ndr, "resume_handle", r->out.resume_handle); + ndr->depth++; + ndr_print_uint32(ndr, "resume_handle", *r->out.resume_handle); + ndr->depth--; + ndr_print_ptr(ndr, "sam", r->out.sam); + ndr->depth++; + ndr_print_samr_SamArray(ndr, "sam", r->out.sam); + ndr->depth--; + ndr_print_ptr(ndr, "num_entries", r->out.num_entries); + ndr->depth++; + ndr_print_uint32(ndr, "num_entries", *r->out.num_entries); + ndr->depth--; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_CreateUser(struct ndr_push *ndr, int flags, const struct samr_CreateUser *r) +{ + if (flags & NDR_IN) { + if (r->in.domain_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.domain_handle)); + if (r->in.account_name == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.account_name)); + NDR_CHECK(ndr_push_samr_UserAccessMask(ndr, NDR_SCALARS, r->in.access_mask)); + } + if (flags & NDR_OUT) { + if (r->out.user_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->out.user_handle)); + if (r->out.rid == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.rid)); + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_CreateUser(struct ndr_pull *ndr, int flags, struct samr_CreateUser *r) +{ + TALLOC_CTX *_mem_save_domain_handle_0; + TALLOC_CTX *_mem_save_account_name_0; + TALLOC_CTX *_mem_save_user_handle_0; + TALLOC_CTX *_mem_save_rid_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.domain_handle); + } + _mem_save_domain_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.domain_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.domain_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_handle_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.account_name); + } + _mem_save_account_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.account_name, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.account_name)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_account_name_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_samr_UserAccessMask(ndr, NDR_SCALARS, &r->in.access_mask)); + NDR_PULL_ALLOC(ndr, r->out.user_handle); + ZERO_STRUCTP(r->out.user_handle); + NDR_PULL_ALLOC(ndr, r->out.rid); + ZERO_STRUCTP(r->out.rid); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.user_handle); + } + _mem_save_user_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.user_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->out.user_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_user_handle_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.rid); + } + _mem_save_rid_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.rid, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.rid)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_rid_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_CreateUser(struct ndr_print *ndr, const char *name, int flags, const struct samr_CreateUser *r) +{ + ndr_print_struct(ndr, name, "samr_CreateUser"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "samr_CreateUser"); + ndr->depth++; + ndr_print_ptr(ndr, "domain_handle", r->in.domain_handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "domain_handle", r->in.domain_handle); + ndr->depth--; + ndr_print_ptr(ndr, "account_name", r->in.account_name); + ndr->depth++; + ndr_print_lsa_String(ndr, "account_name", r->in.account_name); + ndr->depth--; + ndr_print_samr_UserAccessMask(ndr, "access_mask", r->in.access_mask); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "samr_CreateUser"); + ndr->depth++; + ndr_print_ptr(ndr, "user_handle", r->out.user_handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "user_handle", r->out.user_handle); + ndr->depth--; + ndr_print_ptr(ndr, "rid", r->out.rid); + ndr->depth++; + ndr_print_uint32(ndr, "rid", *r->out.rid); + ndr->depth--; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_EnumDomainUsers(struct ndr_push *ndr, int flags, const struct samr_EnumDomainUsers *r) +{ + if (flags & NDR_IN) { + if (r->in.domain_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.domain_handle)); + if (r->in.resume_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.resume_handle)); + NDR_CHECK(ndr_push_samr_AcctFlags(ndr, NDR_SCALARS, r->in.acct_flags)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.max_size)); + } + if (flags & NDR_OUT) { + if (r->out.resume_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.resume_handle)); + if (r->out.sam == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_samr_SamArray(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.sam)); + if (r->out.num_entries == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.num_entries)); + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_EnumDomainUsers(struct ndr_pull *ndr, int flags, struct samr_EnumDomainUsers *r) +{ + TALLOC_CTX *_mem_save_domain_handle_0; + TALLOC_CTX *_mem_save_resume_handle_0; + TALLOC_CTX *_mem_save_sam_0; + TALLOC_CTX *_mem_save_num_entries_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.domain_handle); + } + _mem_save_domain_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.domain_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.domain_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_handle_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.resume_handle); + } + _mem_save_resume_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.resume_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->in.resume_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_resume_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_samr_AcctFlags(ndr, NDR_SCALARS, &r->in.acct_flags)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.max_size)); + NDR_PULL_ALLOC(ndr, r->out.resume_handle); + *r->out.resume_handle = *r->in.resume_handle; + NDR_PULL_ALLOC(ndr, r->out.sam); + ZERO_STRUCTP(r->out.sam); + NDR_PULL_ALLOC(ndr, r->out.num_entries); + ZERO_STRUCTP(r->out.num_entries); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.resume_handle); + } + _mem_save_resume_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.resume_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.resume_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_resume_handle_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.sam); + } + _mem_save_sam_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.sam, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_samr_SamArray(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.sam)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sam_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.num_entries); + } + _mem_save_num_entries_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.num_entries, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.num_entries)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_num_entries_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_EnumDomainUsers(struct ndr_print *ndr, const char *name, int flags, const struct samr_EnumDomainUsers *r) +{ + ndr_print_struct(ndr, name, "samr_EnumDomainUsers"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "samr_EnumDomainUsers"); + ndr->depth++; + ndr_print_ptr(ndr, "domain_handle", r->in.domain_handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "domain_handle", r->in.domain_handle); + ndr->depth--; + ndr_print_ptr(ndr, "resume_handle", r->in.resume_handle); + ndr->depth++; + ndr_print_uint32(ndr, "resume_handle", *r->in.resume_handle); + ndr->depth--; + ndr_print_samr_AcctFlags(ndr, "acct_flags", r->in.acct_flags); + ndr_print_uint32(ndr, "max_size", r->in.max_size); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "samr_EnumDomainUsers"); + ndr->depth++; + ndr_print_ptr(ndr, "resume_handle", r->out.resume_handle); + ndr->depth++; + ndr_print_uint32(ndr, "resume_handle", *r->out.resume_handle); + ndr->depth--; + ndr_print_ptr(ndr, "sam", r->out.sam); + ndr->depth++; + ndr_print_samr_SamArray(ndr, "sam", r->out.sam); + ndr->depth--; + ndr_print_ptr(ndr, "num_entries", r->out.num_entries); + ndr->depth++; + ndr_print_uint32(ndr, "num_entries", *r->out.num_entries); + ndr->depth--; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_CreateDomAlias(struct ndr_push *ndr, int flags, const struct samr_CreateDomAlias *r) +{ + if (flags & NDR_IN) { + if (r->in.domain_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.domain_handle)); + if (r->in.alias_name == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.alias_name)); + NDR_CHECK(ndr_push_samr_AliasAccessMask(ndr, NDR_SCALARS, r->in.access_mask)); + } + if (flags & NDR_OUT) { + if (r->out.alias_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->out.alias_handle)); + if (r->out.rid == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.rid)); + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_CreateDomAlias(struct ndr_pull *ndr, int flags, struct samr_CreateDomAlias *r) +{ + TALLOC_CTX *_mem_save_domain_handle_0; + TALLOC_CTX *_mem_save_alias_name_0; + TALLOC_CTX *_mem_save_alias_handle_0; + TALLOC_CTX *_mem_save_rid_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.domain_handle); + } + _mem_save_domain_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.domain_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.domain_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_handle_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.alias_name); + } + _mem_save_alias_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.alias_name, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.alias_name)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_alias_name_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_samr_AliasAccessMask(ndr, NDR_SCALARS, &r->in.access_mask)); + NDR_PULL_ALLOC(ndr, r->out.alias_handle); + ZERO_STRUCTP(r->out.alias_handle); + NDR_PULL_ALLOC(ndr, r->out.rid); + ZERO_STRUCTP(r->out.rid); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.alias_handle); + } + _mem_save_alias_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.alias_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->out.alias_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_alias_handle_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.rid); + } + _mem_save_rid_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.rid, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.rid)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_rid_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_CreateDomAlias(struct ndr_print *ndr, const char *name, int flags, const struct samr_CreateDomAlias *r) +{ + ndr_print_struct(ndr, name, "samr_CreateDomAlias"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "samr_CreateDomAlias"); + ndr->depth++; + ndr_print_ptr(ndr, "domain_handle", r->in.domain_handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "domain_handle", r->in.domain_handle); + ndr->depth--; + ndr_print_ptr(ndr, "alias_name", r->in.alias_name); + ndr->depth++; + ndr_print_lsa_String(ndr, "alias_name", r->in.alias_name); + ndr->depth--; + ndr_print_samr_AliasAccessMask(ndr, "access_mask", r->in.access_mask); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "samr_CreateDomAlias"); + ndr->depth++; + ndr_print_ptr(ndr, "alias_handle", r->out.alias_handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "alias_handle", r->out.alias_handle); + ndr->depth--; + ndr_print_ptr(ndr, "rid", r->out.rid); + ndr->depth++; + ndr_print_uint32(ndr, "rid", *r->out.rid); + ndr->depth--; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_EnumDomainAliases(struct ndr_push *ndr, int flags, const struct samr_EnumDomainAliases *r) +{ + if (flags & NDR_IN) { + if (r->in.domain_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.domain_handle)); + if (r->in.resume_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.resume_handle)); + NDR_CHECK(ndr_push_samr_AcctFlags(ndr, NDR_SCALARS, r->in.acct_flags)); + } + if (flags & NDR_OUT) { + if (r->out.resume_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.resume_handle)); + if (r->out.sam == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_samr_SamArray(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.sam)); + if (r->out.num_entries == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.num_entries)); + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_EnumDomainAliases(struct ndr_pull *ndr, int flags, struct samr_EnumDomainAliases *r) +{ + TALLOC_CTX *_mem_save_domain_handle_0; + TALLOC_CTX *_mem_save_resume_handle_0; + TALLOC_CTX *_mem_save_sam_0; + TALLOC_CTX *_mem_save_num_entries_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.domain_handle); + } + _mem_save_domain_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.domain_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.domain_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_handle_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.resume_handle); + } + _mem_save_resume_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.resume_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->in.resume_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_resume_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_samr_AcctFlags(ndr, NDR_SCALARS, &r->in.acct_flags)); + NDR_PULL_ALLOC(ndr, r->out.resume_handle); + *r->out.resume_handle = *r->in.resume_handle; + NDR_PULL_ALLOC(ndr, r->out.sam); + ZERO_STRUCTP(r->out.sam); + NDR_PULL_ALLOC(ndr, r->out.num_entries); + ZERO_STRUCTP(r->out.num_entries); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.resume_handle); + } + _mem_save_resume_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.resume_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.resume_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_resume_handle_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.sam); + } + _mem_save_sam_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.sam, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_samr_SamArray(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.sam)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sam_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.num_entries); + } + _mem_save_num_entries_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.num_entries, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.num_entries)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_num_entries_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_EnumDomainAliases(struct ndr_print *ndr, const char *name, int flags, const struct samr_EnumDomainAliases *r) +{ + ndr_print_struct(ndr, name, "samr_EnumDomainAliases"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "samr_EnumDomainAliases"); + ndr->depth++; + ndr_print_ptr(ndr, "domain_handle", r->in.domain_handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "domain_handle", r->in.domain_handle); + ndr->depth--; + ndr_print_ptr(ndr, "resume_handle", r->in.resume_handle); + ndr->depth++; + ndr_print_uint32(ndr, "resume_handle", *r->in.resume_handle); + ndr->depth--; + ndr_print_samr_AcctFlags(ndr, "acct_flags", r->in.acct_flags); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "samr_EnumDomainAliases"); + ndr->depth++; + ndr_print_ptr(ndr, "resume_handle", r->out.resume_handle); + ndr->depth++; + ndr_print_uint32(ndr, "resume_handle", *r->out.resume_handle); + ndr->depth--; + ndr_print_ptr(ndr, "sam", r->out.sam); + ndr->depth++; + ndr_print_samr_SamArray(ndr, "sam", r->out.sam); + ndr->depth--; + ndr_print_ptr(ndr, "num_entries", r->out.num_entries); + ndr->depth++; + ndr_print_uint32(ndr, "num_entries", *r->out.num_entries); + ndr->depth--; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_GetAliasMembership(struct ndr_push *ndr, int flags, const struct samr_GetAliasMembership *r) +{ + if (flags & NDR_IN) { + if (r->in.domain_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.domain_handle)); + if (r->in.sids == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_lsa_SidArray(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.sids)); + } + if (flags & NDR_OUT) { + if (r->out.rids == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_samr_Ids(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.rids)); + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_GetAliasMembership(struct ndr_pull *ndr, int flags, struct samr_GetAliasMembership *r) +{ + TALLOC_CTX *_mem_save_domain_handle_0; + TALLOC_CTX *_mem_save_sids_0; + TALLOC_CTX *_mem_save_rids_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.domain_handle); + } + _mem_save_domain_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.domain_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.domain_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_handle_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.sids); + } + _mem_save_sids_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.sids, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_lsa_SidArray(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.sids)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sids_0, LIBNDR_FLAG_REF_ALLOC); + NDR_PULL_ALLOC(ndr, r->out.rids); + ZERO_STRUCTP(r->out.rids); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.rids); + } + _mem_save_rids_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.rids, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_samr_Ids(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.rids)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_rids_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_GetAliasMembership(struct ndr_print *ndr, const char *name, int flags, const struct samr_GetAliasMembership *r) +{ + ndr_print_struct(ndr, name, "samr_GetAliasMembership"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "samr_GetAliasMembership"); + ndr->depth++; + ndr_print_ptr(ndr, "domain_handle", r->in.domain_handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "domain_handle", r->in.domain_handle); + ndr->depth--; + ndr_print_ptr(ndr, "sids", r->in.sids); + ndr->depth++; + ndr_print_lsa_SidArray(ndr, "sids", r->in.sids); + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "samr_GetAliasMembership"); + ndr->depth++; + ndr_print_ptr(ndr, "rids", r->out.rids); + ndr->depth++; + ndr_print_samr_Ids(ndr, "rids", r->out.rids); + ndr->depth--; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +_PUBLIC_ enum ndr_err_code ndr_push_samr_LookupNames(struct ndr_push *ndr, int flags, const struct samr_LookupNames *r) +{ + uint32_t cntr_names_0; + if (flags & NDR_IN) { + if (r->in.domain_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.domain_handle)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.num_names)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 1000)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.num_names)); + for (cntr_names_0 = 0; cntr_names_0 < r->in.num_names; cntr_names_0++) { + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->in.names[cntr_names_0])); + } + for (cntr_names_0 = 0; cntr_names_0 < r->in.num_names; cntr_names_0++) { + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->in.names[cntr_names_0])); + } + } + if (flags & NDR_OUT) { + if (r->out.rids == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_samr_Ids(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.rids)); + if (r->out.types == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_samr_Ids(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.types)); + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_samr_LookupNames(struct ndr_pull *ndr, int flags, struct samr_LookupNames *r) +{ + uint32_t cntr_names_0; + TALLOC_CTX *_mem_save_domain_handle_0; + TALLOC_CTX *_mem_save_names_0; + TALLOC_CTX *_mem_save_rids_0; + TALLOC_CTX *_mem_save_types_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.domain_handle); + } + _mem_save_domain_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.domain_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.domain_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.num_names)); + if (r->in.num_names < 0 || r->in.num_names > 1000) { + return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range"); + } + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.names)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.names)); + if (ndr_get_array_length(ndr, &r->in.names) > ndr_get_array_size(ndr, &r->in.names)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.names), ndr_get_array_length(ndr, &r->in.names)); + } + NDR_PULL_ALLOC_N(ndr, r->in.names, ndr_get_array_size(ndr, &r->in.names)); + _mem_save_names_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.names, 0); + for (cntr_names_0 = 0; cntr_names_0 < r->in.num_names; cntr_names_0++) { + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->in.names[cntr_names_0])); + } + for (cntr_names_0 = 0; cntr_names_0 < r->in.num_names; cntr_names_0++) { + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->in.names[cntr_names_0])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_names_0, 0); + NDR_PULL_ALLOC(ndr, r->out.rids); + ZERO_STRUCTP(r->out.rids); + NDR_PULL_ALLOC(ndr, r->out.types); + ZERO_STRUCTP(r->out.types); + if (r->in.names) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->in.names, 1000)); + } + if (r->in.names) { + NDR_CHECK(ndr_check_array_length(ndr, (void*)&r->in.names, r->in.num_names)); + } + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.rids); + } + _mem_save_rids_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.rids, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_samr_Ids(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.rids)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_rids_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.types); + } + _mem_save_types_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.types, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_samr_Ids(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.types)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_types_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_LookupNames(struct ndr_print *ndr, const char *name, int flags, const struct samr_LookupNames *r) +{ + uint32_t cntr_names_0; + ndr_print_struct(ndr, name, "samr_LookupNames"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "samr_LookupNames"); + ndr->depth++; + ndr_print_ptr(ndr, "domain_handle", r->in.domain_handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "domain_handle", r->in.domain_handle); + ndr->depth--; + ndr_print_uint32(ndr, "num_names", r->in.num_names); + ndr->print(ndr, "%s: ARRAY(%d)", "names", r->in.num_names); + ndr->depth++; + for (cntr_names_0=0;cntr_names_0<r->in.num_names;cntr_names_0++) { + char *idx_0=NULL; + asprintf(&idx_0, "[%d]", cntr_names_0); + if (idx_0) { + ndr_print_lsa_String(ndr, "names", &r->in.names[cntr_names_0]); + free(idx_0); + } + } + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "samr_LookupNames"); + ndr->depth++; + ndr_print_ptr(ndr, "rids", r->out.rids); + ndr->depth++; + ndr_print_samr_Ids(ndr, "rids", r->out.rids); + ndr->depth--; + ndr_print_ptr(ndr, "types", r->out.types); + ndr->depth++; + ndr_print_samr_Ids(ndr, "types", r->out.types); + ndr->depth--; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_LookupRids(struct ndr_push *ndr, int flags, const struct samr_LookupRids *r) +{ + uint32_t cntr_rids_0; + if (flags & NDR_IN) { + if (r->in.domain_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.domain_handle)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.num_rids)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 1000)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.num_rids)); + for (cntr_rids_0 = 0; cntr_rids_0 < r->in.num_rids; cntr_rids_0++) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.rids[cntr_rids_0])); + } + } + if (flags & NDR_OUT) { + if (r->out.names == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_lsa_Strings(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.names)); + if (r->out.types == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_samr_Ids(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.types)); + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_LookupRids(struct ndr_pull *ndr, int flags, struct samr_LookupRids *r) +{ + uint32_t cntr_rids_0; + TALLOC_CTX *_mem_save_domain_handle_0; + TALLOC_CTX *_mem_save_rids_0; + TALLOC_CTX *_mem_save_names_0; + TALLOC_CTX *_mem_save_types_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.domain_handle); + } + _mem_save_domain_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.domain_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.domain_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.num_rids)); + if (r->in.num_rids < 0 || r->in.num_rids > 1000) { + return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range"); + } + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.rids)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.rids)); + if (ndr_get_array_length(ndr, &r->in.rids) > ndr_get_array_size(ndr, &r->in.rids)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.rids), ndr_get_array_length(ndr, &r->in.rids)); + } + NDR_PULL_ALLOC_N(ndr, r->in.rids, ndr_get_array_size(ndr, &r->in.rids)); + _mem_save_rids_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.rids, 0); + for (cntr_rids_0 = 0; cntr_rids_0 < r->in.num_rids; cntr_rids_0++) { + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.rids[cntr_rids_0])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_rids_0, 0); + NDR_PULL_ALLOC(ndr, r->out.names); + ZERO_STRUCTP(r->out.names); + NDR_PULL_ALLOC(ndr, r->out.types); + ZERO_STRUCTP(r->out.types); + if (r->in.rids) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->in.rids, 1000)); + } + if (r->in.rids) { + NDR_CHECK(ndr_check_array_length(ndr, (void*)&r->in.rids, r->in.num_rids)); + } + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.names); + } + _mem_save_names_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.names, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_lsa_Strings(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.names)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_names_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.types); + } + _mem_save_types_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.types, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_samr_Ids(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.types)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_types_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_LookupRids(struct ndr_print *ndr, const char *name, int flags, const struct samr_LookupRids *r) +{ + uint32_t cntr_rids_0; + ndr_print_struct(ndr, name, "samr_LookupRids"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "samr_LookupRids"); + ndr->depth++; + ndr_print_ptr(ndr, "domain_handle", r->in.domain_handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "domain_handle", r->in.domain_handle); + ndr->depth--; + ndr_print_uint32(ndr, "num_rids", r->in.num_rids); + ndr->print(ndr, "%s: ARRAY(%d)", "rids", r->in.num_rids); + ndr->depth++; + for (cntr_rids_0=0;cntr_rids_0<r->in.num_rids;cntr_rids_0++) { + char *idx_0=NULL; + asprintf(&idx_0, "[%d]", cntr_rids_0); + if (idx_0) { + ndr_print_uint32(ndr, "rids", r->in.rids[cntr_rids_0]); + free(idx_0); + } + } + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "samr_LookupRids"); + ndr->depth++; + ndr_print_ptr(ndr, "names", r->out.names); + ndr->depth++; + ndr_print_lsa_Strings(ndr, "names", r->out.names); + ndr->depth--; + ndr_print_ptr(ndr, "types", r->out.types); + ndr->depth++; + ndr_print_samr_Ids(ndr, "types", r->out.types); + ndr->depth--; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_OpenGroup(struct ndr_push *ndr, int flags, const struct samr_OpenGroup *r) +{ + if (flags & NDR_IN) { + if (r->in.domain_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.domain_handle)); + NDR_CHECK(ndr_push_samr_GroupAccessMask(ndr, NDR_SCALARS, r->in.access_mask)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.rid)); + } + if (flags & NDR_OUT) { + if (r->out.group_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->out.group_handle)); + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_OpenGroup(struct ndr_pull *ndr, int flags, struct samr_OpenGroup *r) +{ + TALLOC_CTX *_mem_save_domain_handle_0; + TALLOC_CTX *_mem_save_group_handle_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.domain_handle); + } + _mem_save_domain_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.domain_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.domain_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_samr_GroupAccessMask(ndr, NDR_SCALARS, &r->in.access_mask)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.rid)); + NDR_PULL_ALLOC(ndr, r->out.group_handle); + ZERO_STRUCTP(r->out.group_handle); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.group_handle); + } + _mem_save_group_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.group_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->out.group_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_group_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_OpenGroup(struct ndr_print *ndr, const char *name, int flags, const struct samr_OpenGroup *r) +{ + ndr_print_struct(ndr, name, "samr_OpenGroup"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "samr_OpenGroup"); + ndr->depth++; + ndr_print_ptr(ndr, "domain_handle", r->in.domain_handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "domain_handle", r->in.domain_handle); + ndr->depth--; + ndr_print_samr_GroupAccessMask(ndr, "access_mask", r->in.access_mask); + ndr_print_uint32(ndr, "rid", r->in.rid); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "samr_OpenGroup"); + ndr->depth++; + ndr_print_ptr(ndr, "group_handle", r->out.group_handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "group_handle", r->out.group_handle); + ndr->depth--; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_QueryGroupInfo(struct ndr_push *ndr, int flags, const struct samr_QueryGroupInfo *r) +{ + if (flags & NDR_IN) { + if (r->in.group_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.group_handle)); + NDR_CHECK(ndr_push_samr_GroupInfoEnum(ndr, NDR_SCALARS, r->in.level)); + } + if (flags & NDR_OUT) { + if (r->out.info == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_set_switch_value(ndr, r->out.info, r->in.level)); + NDR_CHECK(ndr_push_samr_GroupInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.info)); + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_QueryGroupInfo(struct ndr_pull *ndr, int flags, struct samr_QueryGroupInfo *r) +{ + TALLOC_CTX *_mem_save_group_handle_0; + TALLOC_CTX *_mem_save_info_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.group_handle); + } + _mem_save_group_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.group_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.group_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_group_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_samr_GroupInfoEnum(ndr, NDR_SCALARS, &r->in.level)); + NDR_PULL_ALLOC(ndr, r->out.info); + ZERO_STRUCTP(r->out.info); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.info); + } + _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.info, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_set_switch_value(ndr, r->out.info, r->in.level)); + NDR_CHECK(ndr_pull_samr_GroupInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.info)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_QueryGroupInfo(struct ndr_print *ndr, const char *name, int flags, const struct samr_QueryGroupInfo *r) +{ + ndr_print_struct(ndr, name, "samr_QueryGroupInfo"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "samr_QueryGroupInfo"); + ndr->depth++; + ndr_print_ptr(ndr, "group_handle", r->in.group_handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "group_handle", r->in.group_handle); + ndr->depth--; + ndr_print_samr_GroupInfoEnum(ndr, "level", r->in.level); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "samr_QueryGroupInfo"); + ndr->depth++; + ndr_print_ptr(ndr, "info", r->out.info); + ndr->depth++; + ndr_print_set_switch_value(ndr, r->out.info, r->in.level); + ndr_print_samr_GroupInfo(ndr, "info", r->out.info); + ndr->depth--; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_SetGroupInfo(struct ndr_push *ndr, int flags, const struct samr_SetGroupInfo *r) +{ + if (flags & NDR_IN) { + if (r->in.group_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.group_handle)); + NDR_CHECK(ndr_push_samr_GroupInfoEnum(ndr, NDR_SCALARS, r->in.level)); + if (r->in.info == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_set_switch_value(ndr, r->in.info, r->in.level)); + NDR_CHECK(ndr_push_samr_GroupInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.info)); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_SetGroupInfo(struct ndr_pull *ndr, int flags, struct samr_SetGroupInfo *r) +{ + TALLOC_CTX *_mem_save_group_handle_0; + TALLOC_CTX *_mem_save_info_0; + if (flags & NDR_IN) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.group_handle); + } + _mem_save_group_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.group_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.group_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_group_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_samr_GroupInfoEnum(ndr, NDR_SCALARS, &r->in.level)); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.info); + } + _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.info, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_set_switch_value(ndr, r->in.info, r->in.level)); + NDR_CHECK(ndr_pull_samr_GroupInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.info)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, LIBNDR_FLAG_REF_ALLOC); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_SetGroupInfo(struct ndr_print *ndr, const char *name, int flags, const struct samr_SetGroupInfo *r) +{ + ndr_print_struct(ndr, name, "samr_SetGroupInfo"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "samr_SetGroupInfo"); + ndr->depth++; + ndr_print_ptr(ndr, "group_handle", r->in.group_handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "group_handle", r->in.group_handle); + ndr->depth--; + ndr_print_samr_GroupInfoEnum(ndr, "level", r->in.level); + ndr_print_ptr(ndr, "info", r->in.info); + ndr->depth++; + ndr_print_set_switch_value(ndr, r->in.info, r->in.level); + ndr_print_samr_GroupInfo(ndr, "info", r->in.info); + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "samr_SetGroupInfo"); + ndr->depth++; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_AddGroupMember(struct ndr_push *ndr, int flags, const struct samr_AddGroupMember *r) +{ + if (flags & NDR_IN) { + if (r->in.group_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.group_handle)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.rid)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.flags)); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_AddGroupMember(struct ndr_pull *ndr, int flags, struct samr_AddGroupMember *r) +{ + TALLOC_CTX *_mem_save_group_handle_0; + if (flags & NDR_IN) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.group_handle); + } + _mem_save_group_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.group_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.group_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_group_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.rid)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.flags)); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_AddGroupMember(struct ndr_print *ndr, const char *name, int flags, const struct samr_AddGroupMember *r) +{ + ndr_print_struct(ndr, name, "samr_AddGroupMember"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "samr_AddGroupMember"); + ndr->depth++; + ndr_print_ptr(ndr, "group_handle", r->in.group_handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "group_handle", r->in.group_handle); + ndr->depth--; + ndr_print_uint32(ndr, "rid", r->in.rid); + ndr_print_uint32(ndr, "flags", r->in.flags); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "samr_AddGroupMember"); + ndr->depth++; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_DeleteDomainGroup(struct ndr_push *ndr, int flags, const struct samr_DeleteDomainGroup *r) +{ + if (flags & NDR_IN) { + if (r->in.group_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.group_handle)); + } + if (flags & NDR_OUT) { + if (r->out.group_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->out.group_handle)); + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_DeleteDomainGroup(struct ndr_pull *ndr, int flags, struct samr_DeleteDomainGroup *r) +{ + TALLOC_CTX *_mem_save_group_handle_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.group_handle); + } + _mem_save_group_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.group_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.group_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_group_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_PULL_ALLOC(ndr, r->out.group_handle); + *r->out.group_handle = *r->in.group_handle; + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.group_handle); + } + _mem_save_group_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.group_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->out.group_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_group_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_DeleteDomainGroup(struct ndr_print *ndr, const char *name, int flags, const struct samr_DeleteDomainGroup *r) +{ + ndr_print_struct(ndr, name, "samr_DeleteDomainGroup"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "samr_DeleteDomainGroup"); + ndr->depth++; + ndr_print_ptr(ndr, "group_handle", r->in.group_handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "group_handle", r->in.group_handle); + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "samr_DeleteDomainGroup"); + ndr->depth++; + ndr_print_ptr(ndr, "group_handle", r->out.group_handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "group_handle", r->out.group_handle); + ndr->depth--; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_DeleteGroupMember(struct ndr_push *ndr, int flags, const struct samr_DeleteGroupMember *r) +{ + if (flags & NDR_IN) { + if (r->in.group_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.group_handle)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.rid)); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_DeleteGroupMember(struct ndr_pull *ndr, int flags, struct samr_DeleteGroupMember *r) +{ + TALLOC_CTX *_mem_save_group_handle_0; + if (flags & NDR_IN) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.group_handle); + } + _mem_save_group_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.group_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.group_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_group_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.rid)); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_DeleteGroupMember(struct ndr_print *ndr, const char *name, int flags, const struct samr_DeleteGroupMember *r) +{ + ndr_print_struct(ndr, name, "samr_DeleteGroupMember"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "samr_DeleteGroupMember"); + ndr->depth++; + ndr_print_ptr(ndr, "group_handle", r->in.group_handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "group_handle", r->in.group_handle); + ndr->depth--; + ndr_print_uint32(ndr, "rid", r->in.rid); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "samr_DeleteGroupMember"); + ndr->depth++; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_QueryGroupMember(struct ndr_push *ndr, int flags, const struct samr_QueryGroupMember *r) +{ + if (flags & NDR_IN) { + if (r->in.group_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.group_handle)); + } + if (flags & NDR_OUT) { + if (r->out.rids == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_samr_RidTypeArray(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.rids)); + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_QueryGroupMember(struct ndr_pull *ndr, int flags, struct samr_QueryGroupMember *r) +{ + TALLOC_CTX *_mem_save_group_handle_0; + TALLOC_CTX *_mem_save_rids_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.group_handle); + } + _mem_save_group_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.group_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.group_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_group_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_PULL_ALLOC(ndr, r->out.rids); + ZERO_STRUCTP(r->out.rids); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.rids); + } + _mem_save_rids_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.rids, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_samr_RidTypeArray(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.rids)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_rids_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_QueryGroupMember(struct ndr_print *ndr, const char *name, int flags, const struct samr_QueryGroupMember *r) +{ + ndr_print_struct(ndr, name, "samr_QueryGroupMember"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "samr_QueryGroupMember"); + ndr->depth++; + ndr_print_ptr(ndr, "group_handle", r->in.group_handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "group_handle", r->in.group_handle); + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "samr_QueryGroupMember"); + ndr->depth++; + ndr_print_ptr(ndr, "rids", r->out.rids); + ndr->depth++; + ndr_print_samr_RidTypeArray(ndr, "rids", r->out.rids); + ndr->depth--; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_SetMemberAttributesOfGroup(struct ndr_push *ndr, int flags, const struct samr_SetMemberAttributesOfGroup *r) +{ + if (flags & NDR_IN) { + if (r->in.group_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.group_handle)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.unknown1)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.unknown2)); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_SetMemberAttributesOfGroup(struct ndr_pull *ndr, int flags, struct samr_SetMemberAttributesOfGroup *r) +{ + TALLOC_CTX *_mem_save_group_handle_0; + if (flags & NDR_IN) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.group_handle); + } + _mem_save_group_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.group_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.group_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_group_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.unknown1)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.unknown2)); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_SetMemberAttributesOfGroup(struct ndr_print *ndr, const char *name, int flags, const struct samr_SetMemberAttributesOfGroup *r) +{ + ndr_print_struct(ndr, name, "samr_SetMemberAttributesOfGroup"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "samr_SetMemberAttributesOfGroup"); + ndr->depth++; + ndr_print_ptr(ndr, "group_handle", r->in.group_handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "group_handle", r->in.group_handle); + ndr->depth--; + ndr_print_uint32(ndr, "unknown1", r->in.unknown1); + ndr_print_uint32(ndr, "unknown2", r->in.unknown2); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "samr_SetMemberAttributesOfGroup"); + ndr->depth++; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_OpenAlias(struct ndr_push *ndr, int flags, const struct samr_OpenAlias *r) +{ + if (flags & NDR_IN) { + if (r->in.domain_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.domain_handle)); + NDR_CHECK(ndr_push_samr_AliasAccessMask(ndr, NDR_SCALARS, r->in.access_mask)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.rid)); + } + if (flags & NDR_OUT) { + if (r->out.alias_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->out.alias_handle)); + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_OpenAlias(struct ndr_pull *ndr, int flags, struct samr_OpenAlias *r) +{ + TALLOC_CTX *_mem_save_domain_handle_0; + TALLOC_CTX *_mem_save_alias_handle_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.domain_handle); + } + _mem_save_domain_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.domain_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.domain_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_samr_AliasAccessMask(ndr, NDR_SCALARS, &r->in.access_mask)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.rid)); + NDR_PULL_ALLOC(ndr, r->out.alias_handle); + ZERO_STRUCTP(r->out.alias_handle); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.alias_handle); + } + _mem_save_alias_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.alias_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->out.alias_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_alias_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_OpenAlias(struct ndr_print *ndr, const char *name, int flags, const struct samr_OpenAlias *r) +{ + ndr_print_struct(ndr, name, "samr_OpenAlias"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "samr_OpenAlias"); + ndr->depth++; + ndr_print_ptr(ndr, "domain_handle", r->in.domain_handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "domain_handle", r->in.domain_handle); + ndr->depth--; + ndr_print_samr_AliasAccessMask(ndr, "access_mask", r->in.access_mask); + ndr_print_uint32(ndr, "rid", r->in.rid); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "samr_OpenAlias"); + ndr->depth++; + ndr_print_ptr(ndr, "alias_handle", r->out.alias_handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "alias_handle", r->out.alias_handle); + ndr->depth--; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_QueryAliasInfo(struct ndr_push *ndr, int flags, const struct samr_QueryAliasInfo *r) +{ + if (flags & NDR_IN) { + if (r->in.alias_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.alias_handle)); + NDR_CHECK(ndr_push_samr_AliasInfoEnum(ndr, NDR_SCALARS, r->in.level)); + } + if (flags & NDR_OUT) { + if (r->out.info == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_set_switch_value(ndr, r->out.info, r->in.level)); + NDR_CHECK(ndr_push_samr_AliasInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.info)); + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_QueryAliasInfo(struct ndr_pull *ndr, int flags, struct samr_QueryAliasInfo *r) +{ + TALLOC_CTX *_mem_save_alias_handle_0; + TALLOC_CTX *_mem_save_info_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.alias_handle); + } + _mem_save_alias_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.alias_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.alias_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_alias_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_samr_AliasInfoEnum(ndr, NDR_SCALARS, &r->in.level)); + NDR_PULL_ALLOC(ndr, r->out.info); + ZERO_STRUCTP(r->out.info); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.info); + } + _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.info, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_set_switch_value(ndr, r->out.info, r->in.level)); + NDR_CHECK(ndr_pull_samr_AliasInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.info)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_QueryAliasInfo(struct ndr_print *ndr, const char *name, int flags, const struct samr_QueryAliasInfo *r) +{ + ndr_print_struct(ndr, name, "samr_QueryAliasInfo"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "samr_QueryAliasInfo"); + ndr->depth++; + ndr_print_ptr(ndr, "alias_handle", r->in.alias_handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "alias_handle", r->in.alias_handle); + ndr->depth--; + ndr_print_samr_AliasInfoEnum(ndr, "level", r->in.level); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "samr_QueryAliasInfo"); + ndr->depth++; + ndr_print_ptr(ndr, "info", r->out.info); + ndr->depth++; + ndr_print_set_switch_value(ndr, r->out.info, r->in.level); + ndr_print_samr_AliasInfo(ndr, "info", r->out.info); + ndr->depth--; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_SetAliasInfo(struct ndr_push *ndr, int flags, const struct samr_SetAliasInfo *r) +{ + if (flags & NDR_IN) { + if (r->in.alias_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.alias_handle)); + NDR_CHECK(ndr_push_samr_AliasInfoEnum(ndr, NDR_SCALARS, r->in.level)); + if (r->in.info == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_set_switch_value(ndr, r->in.info, r->in.level)); + NDR_CHECK(ndr_push_samr_AliasInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.info)); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_SetAliasInfo(struct ndr_pull *ndr, int flags, struct samr_SetAliasInfo *r) +{ + TALLOC_CTX *_mem_save_alias_handle_0; + TALLOC_CTX *_mem_save_info_0; + if (flags & NDR_IN) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.alias_handle); + } + _mem_save_alias_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.alias_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.alias_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_alias_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_samr_AliasInfoEnum(ndr, NDR_SCALARS, &r->in.level)); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.info); + } + _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.info, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_set_switch_value(ndr, r->in.info, r->in.level)); + NDR_CHECK(ndr_pull_samr_AliasInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.info)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, LIBNDR_FLAG_REF_ALLOC); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_SetAliasInfo(struct ndr_print *ndr, const char *name, int flags, const struct samr_SetAliasInfo *r) +{ + ndr_print_struct(ndr, name, "samr_SetAliasInfo"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "samr_SetAliasInfo"); + ndr->depth++; + ndr_print_ptr(ndr, "alias_handle", r->in.alias_handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "alias_handle", r->in.alias_handle); + ndr->depth--; + ndr_print_samr_AliasInfoEnum(ndr, "level", r->in.level); + ndr_print_ptr(ndr, "info", r->in.info); + ndr->depth++; + ndr_print_set_switch_value(ndr, r->in.info, r->in.level); + ndr_print_samr_AliasInfo(ndr, "info", r->in.info); + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "samr_SetAliasInfo"); + ndr->depth++; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_DeleteDomAlias(struct ndr_push *ndr, int flags, const struct samr_DeleteDomAlias *r) +{ + if (flags & NDR_IN) { + if (r->in.alias_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.alias_handle)); + } + if (flags & NDR_OUT) { + if (r->out.alias_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->out.alias_handle)); + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_DeleteDomAlias(struct ndr_pull *ndr, int flags, struct samr_DeleteDomAlias *r) +{ + TALLOC_CTX *_mem_save_alias_handle_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.alias_handle); + } + _mem_save_alias_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.alias_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.alias_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_alias_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_PULL_ALLOC(ndr, r->out.alias_handle); + *r->out.alias_handle = *r->in.alias_handle; + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.alias_handle); + } + _mem_save_alias_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.alias_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->out.alias_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_alias_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_DeleteDomAlias(struct ndr_print *ndr, const char *name, int flags, const struct samr_DeleteDomAlias *r) +{ + ndr_print_struct(ndr, name, "samr_DeleteDomAlias"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "samr_DeleteDomAlias"); + ndr->depth++; + ndr_print_ptr(ndr, "alias_handle", r->in.alias_handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "alias_handle", r->in.alias_handle); + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "samr_DeleteDomAlias"); + ndr->depth++; + ndr_print_ptr(ndr, "alias_handle", r->out.alias_handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "alias_handle", r->out.alias_handle); + ndr->depth--; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_AddAliasMember(struct ndr_push *ndr, int flags, const struct samr_AddAliasMember *r) +{ + if (flags & NDR_IN) { + if (r->in.alias_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.alias_handle)); + if (r->in.sid == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_dom_sid2(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.sid)); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_AddAliasMember(struct ndr_pull *ndr, int flags, struct samr_AddAliasMember *r) +{ + TALLOC_CTX *_mem_save_alias_handle_0; + TALLOC_CTX *_mem_save_sid_0; + if (flags & NDR_IN) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.alias_handle); + } + _mem_save_alias_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.alias_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.alias_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_alias_handle_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.sid); + } + _mem_save_sid_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.sid, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_dom_sid2(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.sid)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sid_0, LIBNDR_FLAG_REF_ALLOC); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_AddAliasMember(struct ndr_print *ndr, const char *name, int flags, const struct samr_AddAliasMember *r) +{ + ndr_print_struct(ndr, name, "samr_AddAliasMember"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "samr_AddAliasMember"); + ndr->depth++; + ndr_print_ptr(ndr, "alias_handle", r->in.alias_handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "alias_handle", r->in.alias_handle); + ndr->depth--; + ndr_print_ptr(ndr, "sid", r->in.sid); + ndr->depth++; + ndr_print_dom_sid2(ndr, "sid", r->in.sid); + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "samr_AddAliasMember"); + ndr->depth++; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_DeleteAliasMember(struct ndr_push *ndr, int flags, const struct samr_DeleteAliasMember *r) +{ + if (flags & NDR_IN) { + if (r->in.alias_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.alias_handle)); + if (r->in.sid == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_dom_sid2(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.sid)); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_DeleteAliasMember(struct ndr_pull *ndr, int flags, struct samr_DeleteAliasMember *r) +{ + TALLOC_CTX *_mem_save_alias_handle_0; + TALLOC_CTX *_mem_save_sid_0; + if (flags & NDR_IN) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.alias_handle); + } + _mem_save_alias_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.alias_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.alias_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_alias_handle_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.sid); + } + _mem_save_sid_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.sid, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_dom_sid2(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.sid)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sid_0, LIBNDR_FLAG_REF_ALLOC); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_DeleteAliasMember(struct ndr_print *ndr, const char *name, int flags, const struct samr_DeleteAliasMember *r) +{ + ndr_print_struct(ndr, name, "samr_DeleteAliasMember"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "samr_DeleteAliasMember"); + ndr->depth++; + ndr_print_ptr(ndr, "alias_handle", r->in.alias_handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "alias_handle", r->in.alias_handle); + ndr->depth--; + ndr_print_ptr(ndr, "sid", r->in.sid); + ndr->depth++; + ndr_print_dom_sid2(ndr, "sid", r->in.sid); + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "samr_DeleteAliasMember"); + ndr->depth++; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_GetMembersInAlias(struct ndr_push *ndr, int flags, const struct samr_GetMembersInAlias *r) +{ + if (flags & NDR_IN) { + if (r->in.alias_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.alias_handle)); + } + if (flags & NDR_OUT) { + if (r->out.sids == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_lsa_SidArray(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.sids)); + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_GetMembersInAlias(struct ndr_pull *ndr, int flags, struct samr_GetMembersInAlias *r) +{ + TALLOC_CTX *_mem_save_alias_handle_0; + TALLOC_CTX *_mem_save_sids_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.alias_handle); + } + _mem_save_alias_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.alias_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.alias_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_alias_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_PULL_ALLOC(ndr, r->out.sids); + ZERO_STRUCTP(r->out.sids); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.sids); + } + _mem_save_sids_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.sids, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_lsa_SidArray(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.sids)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sids_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_GetMembersInAlias(struct ndr_print *ndr, const char *name, int flags, const struct samr_GetMembersInAlias *r) +{ + ndr_print_struct(ndr, name, "samr_GetMembersInAlias"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "samr_GetMembersInAlias"); + ndr->depth++; + ndr_print_ptr(ndr, "alias_handle", r->in.alias_handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "alias_handle", r->in.alias_handle); + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "samr_GetMembersInAlias"); + ndr->depth++; + ndr_print_ptr(ndr, "sids", r->out.sids); + ndr->depth++; + ndr_print_lsa_SidArray(ndr, "sids", r->out.sids); + ndr->depth--; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +_PUBLIC_ enum ndr_err_code ndr_push_samr_OpenUser(struct ndr_push *ndr, int flags, const struct samr_OpenUser *r) +{ + if (flags & NDR_IN) { + if (r->in.domain_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.domain_handle)); + NDR_CHECK(ndr_push_samr_UserAccessMask(ndr, NDR_SCALARS, r->in.access_mask)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.rid)); + } + if (flags & NDR_OUT) { + if (r->out.user_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->out.user_handle)); + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_samr_OpenUser(struct ndr_pull *ndr, int flags, struct samr_OpenUser *r) +{ + TALLOC_CTX *_mem_save_domain_handle_0; + TALLOC_CTX *_mem_save_user_handle_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.domain_handle); + } + _mem_save_domain_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.domain_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.domain_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_samr_UserAccessMask(ndr, NDR_SCALARS, &r->in.access_mask)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.rid)); + NDR_PULL_ALLOC(ndr, r->out.user_handle); + ZERO_STRUCTP(r->out.user_handle); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.user_handle); + } + _mem_save_user_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.user_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->out.user_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_user_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_OpenUser(struct ndr_print *ndr, const char *name, int flags, const struct samr_OpenUser *r) +{ + ndr_print_struct(ndr, name, "samr_OpenUser"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "samr_OpenUser"); + ndr->depth++; + ndr_print_ptr(ndr, "domain_handle", r->in.domain_handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "domain_handle", r->in.domain_handle); + ndr->depth--; + ndr_print_samr_UserAccessMask(ndr, "access_mask", r->in.access_mask); + ndr_print_uint32(ndr, "rid", r->in.rid); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "samr_OpenUser"); + ndr->depth++; + ndr_print_ptr(ndr, "user_handle", r->out.user_handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "user_handle", r->out.user_handle); + ndr->depth--; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_DeleteUser(struct ndr_push *ndr, int flags, const struct samr_DeleteUser *r) +{ + if (flags & NDR_IN) { + if (r->in.user_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.user_handle)); + } + if (flags & NDR_OUT) { + if (r->out.user_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->out.user_handle)); + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_DeleteUser(struct ndr_pull *ndr, int flags, struct samr_DeleteUser *r) +{ + TALLOC_CTX *_mem_save_user_handle_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.user_handle); + } + _mem_save_user_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.user_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.user_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_user_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_PULL_ALLOC(ndr, r->out.user_handle); + *r->out.user_handle = *r->in.user_handle; + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.user_handle); + } + _mem_save_user_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.user_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->out.user_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_user_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_DeleteUser(struct ndr_print *ndr, const char *name, int flags, const struct samr_DeleteUser *r) +{ + ndr_print_struct(ndr, name, "samr_DeleteUser"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "samr_DeleteUser"); + ndr->depth++; + ndr_print_ptr(ndr, "user_handle", r->in.user_handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "user_handle", r->in.user_handle); + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "samr_DeleteUser"); + ndr->depth++; + ndr_print_ptr(ndr, "user_handle", r->out.user_handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "user_handle", r->out.user_handle); + ndr->depth--; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +_PUBLIC_ enum ndr_err_code ndr_push_samr_QueryUserInfo(struct ndr_push *ndr, int flags, const struct samr_QueryUserInfo *r) +{ + if (flags & NDR_IN) { + if (r->in.user_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.user_handle)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->in.level)); + } + if (flags & NDR_OUT) { + if (r->out.info == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_set_switch_value(ndr, r->out.info, r->in.level)); + NDR_CHECK(ndr_push_samr_UserInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.info)); + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_samr_QueryUserInfo(struct ndr_pull *ndr, int flags, struct samr_QueryUserInfo *r) +{ + TALLOC_CTX *_mem_save_user_handle_0; + TALLOC_CTX *_mem_save_info_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.user_handle); + } + _mem_save_user_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.user_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.user_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_user_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->in.level)); + NDR_PULL_ALLOC(ndr, r->out.info); + ZERO_STRUCTP(r->out.info); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.info); + } + _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.info, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_set_switch_value(ndr, r->out.info, r->in.level)); + NDR_CHECK(ndr_pull_samr_UserInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.info)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_QueryUserInfo(struct ndr_print *ndr, const char *name, int flags, const struct samr_QueryUserInfo *r) +{ + ndr_print_struct(ndr, name, "samr_QueryUserInfo"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "samr_QueryUserInfo"); + ndr->depth++; + ndr_print_ptr(ndr, "user_handle", r->in.user_handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "user_handle", r->in.user_handle); + ndr->depth--; + ndr_print_uint16(ndr, "level", r->in.level); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "samr_QueryUserInfo"); + ndr->depth++; + ndr_print_ptr(ndr, "info", r->out.info); + ndr->depth++; + ndr_print_set_switch_value(ndr, r->out.info, r->in.level); + ndr_print_samr_UserInfo(ndr, "info", r->out.info); + ndr->depth--; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +_PUBLIC_ enum ndr_err_code ndr_push_samr_SetUserInfo(struct ndr_push *ndr, int flags, const struct samr_SetUserInfo *r) +{ + if (flags & NDR_IN) { + if (r->in.user_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.user_handle)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->in.level)); + if (r->in.info == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_set_switch_value(ndr, r->in.info, r->in.level)); + NDR_CHECK(ndr_push_samr_UserInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.info)); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_samr_SetUserInfo(struct ndr_pull *ndr, int flags, struct samr_SetUserInfo *r) +{ + TALLOC_CTX *_mem_save_user_handle_0; + TALLOC_CTX *_mem_save_info_0; + if (flags & NDR_IN) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.user_handle); + } + _mem_save_user_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.user_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.user_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_user_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->in.level)); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.info); + } + _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.info, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_set_switch_value(ndr, r->in.info, r->in.level)); + NDR_CHECK(ndr_pull_samr_UserInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.info)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, LIBNDR_FLAG_REF_ALLOC); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_SetUserInfo(struct ndr_print *ndr, const char *name, int flags, const struct samr_SetUserInfo *r) +{ + ndr_print_struct(ndr, name, "samr_SetUserInfo"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "samr_SetUserInfo"); + ndr->depth++; + ndr_print_ptr(ndr, "user_handle", r->in.user_handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "user_handle", r->in.user_handle); + ndr->depth--; + ndr_print_uint16(ndr, "level", r->in.level); + ndr_print_ptr(ndr, "info", r->in.info); + ndr->depth++; + ndr_print_set_switch_value(ndr, r->in.info, r->in.level); + ndr_print_samr_UserInfo(ndr, "info", r->in.info); + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "samr_SetUserInfo"); + ndr->depth++; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_ChangePasswordUser(struct ndr_push *ndr, int flags, const struct samr_ChangePasswordUser *r) +{ + if (flags & NDR_IN) { + if (r->in.user_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.user_handle)); + NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->in.lm_present)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.old_lm_crypted)); + if (r->in.old_lm_crypted) { + NDR_CHECK(ndr_push_samr_Password(ndr, NDR_SCALARS, r->in.old_lm_crypted)); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.new_lm_crypted)); + if (r->in.new_lm_crypted) { + NDR_CHECK(ndr_push_samr_Password(ndr, NDR_SCALARS, r->in.new_lm_crypted)); + } + NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->in.nt_present)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.old_nt_crypted)); + if (r->in.old_nt_crypted) { + NDR_CHECK(ndr_push_samr_Password(ndr, NDR_SCALARS, r->in.old_nt_crypted)); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.new_nt_crypted)); + if (r->in.new_nt_crypted) { + NDR_CHECK(ndr_push_samr_Password(ndr, NDR_SCALARS, r->in.new_nt_crypted)); + } + NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->in.cross1_present)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.nt_cross)); + if (r->in.nt_cross) { + NDR_CHECK(ndr_push_samr_Password(ndr, NDR_SCALARS, r->in.nt_cross)); + } + NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->in.cross2_present)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.lm_cross)); + if (r->in.lm_cross) { + NDR_CHECK(ndr_push_samr_Password(ndr, NDR_SCALARS, r->in.lm_cross)); + } + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_ChangePasswordUser(struct ndr_pull *ndr, int flags, struct samr_ChangePasswordUser *r) +{ + uint32_t _ptr_old_lm_crypted; + uint32_t _ptr_new_lm_crypted; + uint32_t _ptr_old_nt_crypted; + uint32_t _ptr_new_nt_crypted; + uint32_t _ptr_nt_cross; + uint32_t _ptr_lm_cross; + TALLOC_CTX *_mem_save_user_handle_0; + TALLOC_CTX *_mem_save_old_lm_crypted_0; + TALLOC_CTX *_mem_save_new_lm_crypted_0; + TALLOC_CTX *_mem_save_old_nt_crypted_0; + TALLOC_CTX *_mem_save_new_nt_crypted_0; + TALLOC_CTX *_mem_save_nt_cross_0; + TALLOC_CTX *_mem_save_lm_cross_0; + if (flags & NDR_IN) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.user_handle); + } + _mem_save_user_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.user_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.user_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_user_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->in.lm_present)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_old_lm_crypted)); + if (_ptr_old_lm_crypted) { + NDR_PULL_ALLOC(ndr, r->in.old_lm_crypted); + } else { + r->in.old_lm_crypted = NULL; + } + if (r->in.old_lm_crypted) { + _mem_save_old_lm_crypted_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.old_lm_crypted, 0); + NDR_CHECK(ndr_pull_samr_Password(ndr, NDR_SCALARS, r->in.old_lm_crypted)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_old_lm_crypted_0, 0); + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_new_lm_crypted)); + if (_ptr_new_lm_crypted) { + NDR_PULL_ALLOC(ndr, r->in.new_lm_crypted); + } else { + r->in.new_lm_crypted = NULL; + } + if (r->in.new_lm_crypted) { + _mem_save_new_lm_crypted_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.new_lm_crypted, 0); + NDR_CHECK(ndr_pull_samr_Password(ndr, NDR_SCALARS, r->in.new_lm_crypted)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_new_lm_crypted_0, 0); + } + NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->in.nt_present)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_old_nt_crypted)); + if (_ptr_old_nt_crypted) { + NDR_PULL_ALLOC(ndr, r->in.old_nt_crypted); + } else { + r->in.old_nt_crypted = NULL; + } + if (r->in.old_nt_crypted) { + _mem_save_old_nt_crypted_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.old_nt_crypted, 0); + NDR_CHECK(ndr_pull_samr_Password(ndr, NDR_SCALARS, r->in.old_nt_crypted)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_old_nt_crypted_0, 0); + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_new_nt_crypted)); + if (_ptr_new_nt_crypted) { + NDR_PULL_ALLOC(ndr, r->in.new_nt_crypted); + } else { + r->in.new_nt_crypted = NULL; + } + if (r->in.new_nt_crypted) { + _mem_save_new_nt_crypted_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.new_nt_crypted, 0); + NDR_CHECK(ndr_pull_samr_Password(ndr, NDR_SCALARS, r->in.new_nt_crypted)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_new_nt_crypted_0, 0); + } + NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->in.cross1_present)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_nt_cross)); + if (_ptr_nt_cross) { + NDR_PULL_ALLOC(ndr, r->in.nt_cross); + } else { + r->in.nt_cross = NULL; + } + if (r->in.nt_cross) { + _mem_save_nt_cross_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.nt_cross, 0); + NDR_CHECK(ndr_pull_samr_Password(ndr, NDR_SCALARS, r->in.nt_cross)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_nt_cross_0, 0); + } + NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->in.cross2_present)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_lm_cross)); + if (_ptr_lm_cross) { + NDR_PULL_ALLOC(ndr, r->in.lm_cross); + } else { + r->in.lm_cross = NULL; + } + if (r->in.lm_cross) { + _mem_save_lm_cross_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.lm_cross, 0); + NDR_CHECK(ndr_pull_samr_Password(ndr, NDR_SCALARS, r->in.lm_cross)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_lm_cross_0, 0); + } + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_ChangePasswordUser(struct ndr_print *ndr, const char *name, int flags, const struct samr_ChangePasswordUser *r) +{ + ndr_print_struct(ndr, name, "samr_ChangePasswordUser"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "samr_ChangePasswordUser"); + ndr->depth++; + ndr_print_ptr(ndr, "user_handle", r->in.user_handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "user_handle", r->in.user_handle); + ndr->depth--; + ndr_print_uint8(ndr, "lm_present", r->in.lm_present); + ndr_print_ptr(ndr, "old_lm_crypted", r->in.old_lm_crypted); + ndr->depth++; + if (r->in.old_lm_crypted) { + ndr_print_samr_Password(ndr, "old_lm_crypted", r->in.old_lm_crypted); + } + ndr->depth--; + ndr_print_ptr(ndr, "new_lm_crypted", r->in.new_lm_crypted); + ndr->depth++; + if (r->in.new_lm_crypted) { + ndr_print_samr_Password(ndr, "new_lm_crypted", r->in.new_lm_crypted); + } + ndr->depth--; + ndr_print_uint8(ndr, "nt_present", r->in.nt_present); + ndr_print_ptr(ndr, "old_nt_crypted", r->in.old_nt_crypted); + ndr->depth++; + if (r->in.old_nt_crypted) { + ndr_print_samr_Password(ndr, "old_nt_crypted", r->in.old_nt_crypted); + } + ndr->depth--; + ndr_print_ptr(ndr, "new_nt_crypted", r->in.new_nt_crypted); + ndr->depth++; + if (r->in.new_nt_crypted) { + ndr_print_samr_Password(ndr, "new_nt_crypted", r->in.new_nt_crypted); + } + ndr->depth--; + ndr_print_uint8(ndr, "cross1_present", r->in.cross1_present); + ndr_print_ptr(ndr, "nt_cross", r->in.nt_cross); + ndr->depth++; + if (r->in.nt_cross) { + ndr_print_samr_Password(ndr, "nt_cross", r->in.nt_cross); + } + ndr->depth--; + ndr_print_uint8(ndr, "cross2_present", r->in.cross2_present); + ndr_print_ptr(ndr, "lm_cross", r->in.lm_cross); + ndr->depth++; + if (r->in.lm_cross) { + ndr_print_samr_Password(ndr, "lm_cross", r->in.lm_cross); + } + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "samr_ChangePasswordUser"); + ndr->depth++; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_GetGroupsForUser(struct ndr_push *ndr, int flags, const struct samr_GetGroupsForUser *r) +{ + if (flags & NDR_IN) { + if (r->in.user_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.user_handle)); + } + if (flags & NDR_OUT) { + if (r->out.rids == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_samr_RidWithAttributeArray(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.rids)); + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_GetGroupsForUser(struct ndr_pull *ndr, int flags, struct samr_GetGroupsForUser *r) +{ + TALLOC_CTX *_mem_save_user_handle_0; + TALLOC_CTX *_mem_save_rids_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.user_handle); + } + _mem_save_user_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.user_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.user_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_user_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_PULL_ALLOC(ndr, r->out.rids); + ZERO_STRUCTP(r->out.rids); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.rids); + } + _mem_save_rids_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.rids, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_samr_RidWithAttributeArray(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.rids)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_rids_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_GetGroupsForUser(struct ndr_print *ndr, const char *name, int flags, const struct samr_GetGroupsForUser *r) +{ + ndr_print_struct(ndr, name, "samr_GetGroupsForUser"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "samr_GetGroupsForUser"); + ndr->depth++; + ndr_print_ptr(ndr, "user_handle", r->in.user_handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "user_handle", r->in.user_handle); + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "samr_GetGroupsForUser"); + ndr->depth++; + ndr_print_ptr(ndr, "rids", r->out.rids); + ndr->depth++; + ndr_print_samr_RidWithAttributeArray(ndr, "rids", r->out.rids); + ndr->depth--; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_QueryDisplayInfo(struct ndr_push *ndr, int flags, const struct samr_QueryDisplayInfo *r) +{ + if (flags & NDR_IN) { + if (r->in.domain_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.domain_handle)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->in.level)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.start_idx)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.max_entries)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.buf_size)); + } + if (flags & NDR_OUT) { + if (r->out.total_size == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.total_size)); + if (r->out.returned_size == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.returned_size)); + if (r->out.info == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_set_switch_value(ndr, r->out.info, r->in.level)); + NDR_CHECK(ndr_push_samr_DispInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.info)); + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_QueryDisplayInfo(struct ndr_pull *ndr, int flags, struct samr_QueryDisplayInfo *r) +{ + TALLOC_CTX *_mem_save_domain_handle_0; + TALLOC_CTX *_mem_save_total_size_0; + TALLOC_CTX *_mem_save_returned_size_0; + TALLOC_CTX *_mem_save_info_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.domain_handle); + } + _mem_save_domain_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.domain_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.domain_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->in.level)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.start_idx)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.max_entries)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.buf_size)); + NDR_PULL_ALLOC(ndr, r->out.total_size); + ZERO_STRUCTP(r->out.total_size); + NDR_PULL_ALLOC(ndr, r->out.returned_size); + ZERO_STRUCTP(r->out.returned_size); + NDR_PULL_ALLOC(ndr, r->out.info); + ZERO_STRUCTP(r->out.info); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.total_size); + } + _mem_save_total_size_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.total_size, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.total_size)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_total_size_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.returned_size); + } + _mem_save_returned_size_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.returned_size, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.returned_size)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_returned_size_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.info); + } + _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.info, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_set_switch_value(ndr, r->out.info, r->in.level)); + NDR_CHECK(ndr_pull_samr_DispInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.info)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_QueryDisplayInfo(struct ndr_print *ndr, const char *name, int flags, const struct samr_QueryDisplayInfo *r) +{ + ndr_print_struct(ndr, name, "samr_QueryDisplayInfo"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "samr_QueryDisplayInfo"); + ndr->depth++; + ndr_print_ptr(ndr, "domain_handle", r->in.domain_handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "domain_handle", r->in.domain_handle); + ndr->depth--; + ndr_print_uint16(ndr, "level", r->in.level); + ndr_print_uint32(ndr, "start_idx", r->in.start_idx); + ndr_print_uint32(ndr, "max_entries", r->in.max_entries); + ndr_print_uint32(ndr, "buf_size", r->in.buf_size); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "samr_QueryDisplayInfo"); + ndr->depth++; + ndr_print_ptr(ndr, "total_size", r->out.total_size); + ndr->depth++; + ndr_print_uint32(ndr, "total_size", *r->out.total_size); + ndr->depth--; + ndr_print_ptr(ndr, "returned_size", r->out.returned_size); + ndr->depth++; + ndr_print_uint32(ndr, "returned_size", *r->out.returned_size); + ndr->depth--; + ndr_print_ptr(ndr, "info", r->out.info); + ndr->depth++; + ndr_print_set_switch_value(ndr, r->out.info, r->in.level); + ndr_print_samr_DispInfo(ndr, "info", r->out.info); + ndr->depth--; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_GetDisplayEnumerationIndex(struct ndr_push *ndr, int flags, const struct samr_GetDisplayEnumerationIndex *r) +{ + if (flags & NDR_IN) { + if (r->in.domain_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.domain_handle)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->in.level)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.name)); + } + if (flags & NDR_OUT) { + if (r->out.idx == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.idx)); + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_GetDisplayEnumerationIndex(struct ndr_pull *ndr, int flags, struct samr_GetDisplayEnumerationIndex *r) +{ + TALLOC_CTX *_mem_save_domain_handle_0; + TALLOC_CTX *_mem_save_idx_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.domain_handle); + } + _mem_save_domain_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.domain_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.domain_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->in.level)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.name)); + NDR_PULL_ALLOC(ndr, r->out.idx); + ZERO_STRUCTP(r->out.idx); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.idx); + } + _mem_save_idx_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.idx, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.idx)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_idx_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_GetDisplayEnumerationIndex(struct ndr_print *ndr, const char *name, int flags, const struct samr_GetDisplayEnumerationIndex *r) +{ + ndr_print_struct(ndr, name, "samr_GetDisplayEnumerationIndex"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "samr_GetDisplayEnumerationIndex"); + ndr->depth++; + ndr_print_ptr(ndr, "domain_handle", r->in.domain_handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "domain_handle", r->in.domain_handle); + ndr->depth--; + ndr_print_uint16(ndr, "level", r->in.level); + ndr_print_lsa_String(ndr, "name", &r->in.name); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "samr_GetDisplayEnumerationIndex"); + ndr->depth++; + ndr_print_ptr(ndr, "idx", r->out.idx); + ndr->depth++; + ndr_print_uint32(ndr, "idx", *r->out.idx); + ndr->depth--; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_TestPrivateFunctionsDomain(struct ndr_push *ndr, int flags, const struct samr_TestPrivateFunctionsDomain *r) +{ + if (flags & NDR_IN) { + if (r->in.domain_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.domain_handle)); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_TestPrivateFunctionsDomain(struct ndr_pull *ndr, int flags, struct samr_TestPrivateFunctionsDomain *r) +{ + TALLOC_CTX *_mem_save_domain_handle_0; + if (flags & NDR_IN) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.domain_handle); + } + _mem_save_domain_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.domain_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.domain_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_handle_0, LIBNDR_FLAG_REF_ALLOC); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_TestPrivateFunctionsDomain(struct ndr_print *ndr, const char *name, int flags, const struct samr_TestPrivateFunctionsDomain *r) +{ + ndr_print_struct(ndr, name, "samr_TestPrivateFunctionsDomain"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "samr_TestPrivateFunctionsDomain"); + ndr->depth++; + ndr_print_ptr(ndr, "domain_handle", r->in.domain_handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "domain_handle", r->in.domain_handle); + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "samr_TestPrivateFunctionsDomain"); + ndr->depth++; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_TestPrivateFunctionsUser(struct ndr_push *ndr, int flags, const struct samr_TestPrivateFunctionsUser *r) +{ + if (flags & NDR_IN) { + if (r->in.user_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.user_handle)); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_TestPrivateFunctionsUser(struct ndr_pull *ndr, int flags, struct samr_TestPrivateFunctionsUser *r) +{ + TALLOC_CTX *_mem_save_user_handle_0; + if (flags & NDR_IN) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.user_handle); + } + _mem_save_user_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.user_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.user_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_user_handle_0, LIBNDR_FLAG_REF_ALLOC); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_TestPrivateFunctionsUser(struct ndr_print *ndr, const char *name, int flags, const struct samr_TestPrivateFunctionsUser *r) +{ + ndr_print_struct(ndr, name, "samr_TestPrivateFunctionsUser"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "samr_TestPrivateFunctionsUser"); + ndr->depth++; + ndr_print_ptr(ndr, "user_handle", r->in.user_handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "user_handle", r->in.user_handle); + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "samr_TestPrivateFunctionsUser"); + ndr->depth++; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +_PUBLIC_ enum ndr_err_code ndr_push_samr_GetUserPwInfo(struct ndr_push *ndr, int flags, const struct samr_GetUserPwInfo *r) +{ + if (flags & NDR_IN) { + if (r->in.user_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.user_handle)); + } + if (flags & NDR_OUT) { + if (r->out.info == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_samr_PwInfo(ndr, NDR_SCALARS, r->out.info)); + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_samr_GetUserPwInfo(struct ndr_pull *ndr, int flags, struct samr_GetUserPwInfo *r) +{ + TALLOC_CTX *_mem_save_user_handle_0; + TALLOC_CTX *_mem_save_info_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.user_handle); + } + _mem_save_user_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.user_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.user_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_user_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_PULL_ALLOC(ndr, r->out.info); + ZERO_STRUCTP(r->out.info); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.info); + } + _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.info, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_samr_PwInfo(ndr, NDR_SCALARS, r->out.info)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_GetUserPwInfo(struct ndr_print *ndr, const char *name, int flags, const struct samr_GetUserPwInfo *r) +{ + ndr_print_struct(ndr, name, "samr_GetUserPwInfo"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "samr_GetUserPwInfo"); + ndr->depth++; + ndr_print_ptr(ndr, "user_handle", r->in.user_handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "user_handle", r->in.user_handle); + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "samr_GetUserPwInfo"); + ndr->depth++; + ndr_print_ptr(ndr, "info", r->out.info); + ndr->depth++; + ndr_print_samr_PwInfo(ndr, "info", r->out.info); + ndr->depth--; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_RemoveMemberFromForeignDomain(struct ndr_push *ndr, int flags, const struct samr_RemoveMemberFromForeignDomain *r) +{ + if (flags & NDR_IN) { + if (r->in.domain_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.domain_handle)); + if (r->in.sid == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_dom_sid2(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.sid)); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_RemoveMemberFromForeignDomain(struct ndr_pull *ndr, int flags, struct samr_RemoveMemberFromForeignDomain *r) +{ + TALLOC_CTX *_mem_save_domain_handle_0; + TALLOC_CTX *_mem_save_sid_0; + if (flags & NDR_IN) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.domain_handle); + } + _mem_save_domain_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.domain_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.domain_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_handle_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.sid); + } + _mem_save_sid_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.sid, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_dom_sid2(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.sid)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sid_0, LIBNDR_FLAG_REF_ALLOC); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_RemoveMemberFromForeignDomain(struct ndr_print *ndr, const char *name, int flags, const struct samr_RemoveMemberFromForeignDomain *r) +{ + ndr_print_struct(ndr, name, "samr_RemoveMemberFromForeignDomain"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "samr_RemoveMemberFromForeignDomain"); + ndr->depth++; + ndr_print_ptr(ndr, "domain_handle", r->in.domain_handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "domain_handle", r->in.domain_handle); + ndr->depth--; + ndr_print_ptr(ndr, "sid", r->in.sid); + ndr->depth++; + ndr_print_dom_sid2(ndr, "sid", r->in.sid); + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "samr_RemoveMemberFromForeignDomain"); + ndr->depth++; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_QueryDomainInfo2(struct ndr_push *ndr, int flags, const struct samr_QueryDomainInfo2 *r) +{ + if (flags & NDR_IN) { + if (r->in.domain_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.domain_handle)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->in.level)); + } + if (flags & NDR_OUT) { + if (r->out.info == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_set_switch_value(ndr, r->out.info, r->in.level)); + NDR_CHECK(ndr_push_samr_DomainInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.info)); + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_QueryDomainInfo2(struct ndr_pull *ndr, int flags, struct samr_QueryDomainInfo2 *r) +{ + TALLOC_CTX *_mem_save_domain_handle_0; + TALLOC_CTX *_mem_save_info_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.domain_handle); + } + _mem_save_domain_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.domain_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.domain_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->in.level)); + NDR_PULL_ALLOC(ndr, r->out.info); + ZERO_STRUCTP(r->out.info); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.info); + } + _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.info, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_set_switch_value(ndr, r->out.info, r->in.level)); + NDR_CHECK(ndr_pull_samr_DomainInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.info)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_QueryDomainInfo2(struct ndr_print *ndr, const char *name, int flags, const struct samr_QueryDomainInfo2 *r) +{ + ndr_print_struct(ndr, name, "samr_QueryDomainInfo2"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "samr_QueryDomainInfo2"); + ndr->depth++; + ndr_print_ptr(ndr, "domain_handle", r->in.domain_handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "domain_handle", r->in.domain_handle); + ndr->depth--; + ndr_print_uint16(ndr, "level", r->in.level); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "samr_QueryDomainInfo2"); + ndr->depth++; + ndr_print_ptr(ndr, "info", r->out.info); + ndr->depth++; + ndr_print_set_switch_value(ndr, r->out.info, r->in.level); + ndr_print_samr_DomainInfo(ndr, "info", r->out.info); + ndr->depth--; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_QueryUserInfo2(struct ndr_push *ndr, int flags, const struct samr_QueryUserInfo2 *r) +{ + if (flags & NDR_IN) { + if (r->in.user_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.user_handle)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->in.level)); + } + if (flags & NDR_OUT) { + if (r->out.info == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_set_switch_value(ndr, r->out.info, r->in.level)); + NDR_CHECK(ndr_push_samr_UserInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.info)); + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_QueryUserInfo2(struct ndr_pull *ndr, int flags, struct samr_QueryUserInfo2 *r) +{ + TALLOC_CTX *_mem_save_user_handle_0; + TALLOC_CTX *_mem_save_info_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.user_handle); + } + _mem_save_user_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.user_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.user_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_user_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->in.level)); + NDR_PULL_ALLOC(ndr, r->out.info); + ZERO_STRUCTP(r->out.info); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.info); + } + _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.info, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_set_switch_value(ndr, r->out.info, r->in.level)); + NDR_CHECK(ndr_pull_samr_UserInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.info)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_QueryUserInfo2(struct ndr_print *ndr, const char *name, int flags, const struct samr_QueryUserInfo2 *r) +{ + ndr_print_struct(ndr, name, "samr_QueryUserInfo2"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "samr_QueryUserInfo2"); + ndr->depth++; + ndr_print_ptr(ndr, "user_handle", r->in.user_handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "user_handle", r->in.user_handle); + ndr->depth--; + ndr_print_uint16(ndr, "level", r->in.level); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "samr_QueryUserInfo2"); + ndr->depth++; + ndr_print_ptr(ndr, "info", r->out.info); + ndr->depth++; + ndr_print_set_switch_value(ndr, r->out.info, r->in.level); + ndr_print_samr_UserInfo(ndr, "info", r->out.info); + ndr->depth--; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_QueryDisplayInfo2(struct ndr_push *ndr, int flags, const struct samr_QueryDisplayInfo2 *r) +{ + if (flags & NDR_IN) { + if (r->in.domain_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.domain_handle)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->in.level)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.start_idx)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.max_entries)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.buf_size)); + } + if (flags & NDR_OUT) { + if (r->out.total_size == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.total_size)); + if (r->out.returned_size == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.returned_size)); + if (r->out.info == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_set_switch_value(ndr, r->out.info, r->in.level)); + NDR_CHECK(ndr_push_samr_DispInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.info)); + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_QueryDisplayInfo2(struct ndr_pull *ndr, int flags, struct samr_QueryDisplayInfo2 *r) +{ + TALLOC_CTX *_mem_save_domain_handle_0; + TALLOC_CTX *_mem_save_total_size_0; + TALLOC_CTX *_mem_save_returned_size_0; + TALLOC_CTX *_mem_save_info_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.domain_handle); + } + _mem_save_domain_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.domain_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.domain_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->in.level)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.start_idx)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.max_entries)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.buf_size)); + NDR_PULL_ALLOC(ndr, r->out.total_size); + ZERO_STRUCTP(r->out.total_size); + NDR_PULL_ALLOC(ndr, r->out.returned_size); + ZERO_STRUCTP(r->out.returned_size); + NDR_PULL_ALLOC(ndr, r->out.info); + ZERO_STRUCTP(r->out.info); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.total_size); + } + _mem_save_total_size_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.total_size, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.total_size)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_total_size_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.returned_size); + } + _mem_save_returned_size_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.returned_size, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.returned_size)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_returned_size_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.info); + } + _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.info, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_set_switch_value(ndr, r->out.info, r->in.level)); + NDR_CHECK(ndr_pull_samr_DispInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.info)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_QueryDisplayInfo2(struct ndr_print *ndr, const char *name, int flags, const struct samr_QueryDisplayInfo2 *r) +{ + ndr_print_struct(ndr, name, "samr_QueryDisplayInfo2"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "samr_QueryDisplayInfo2"); + ndr->depth++; + ndr_print_ptr(ndr, "domain_handle", r->in.domain_handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "domain_handle", r->in.domain_handle); + ndr->depth--; + ndr_print_uint16(ndr, "level", r->in.level); + ndr_print_uint32(ndr, "start_idx", r->in.start_idx); + ndr_print_uint32(ndr, "max_entries", r->in.max_entries); + ndr_print_uint32(ndr, "buf_size", r->in.buf_size); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "samr_QueryDisplayInfo2"); + ndr->depth++; + ndr_print_ptr(ndr, "total_size", r->out.total_size); + ndr->depth++; + ndr_print_uint32(ndr, "total_size", *r->out.total_size); + ndr->depth--; + ndr_print_ptr(ndr, "returned_size", r->out.returned_size); + ndr->depth++; + ndr_print_uint32(ndr, "returned_size", *r->out.returned_size); + ndr->depth--; + ndr_print_ptr(ndr, "info", r->out.info); + ndr->depth++; + ndr_print_set_switch_value(ndr, r->out.info, r->in.level); + ndr_print_samr_DispInfo(ndr, "info", r->out.info); + ndr->depth--; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_GetDisplayEnumerationIndex2(struct ndr_push *ndr, int flags, const struct samr_GetDisplayEnumerationIndex2 *r) +{ + if (flags & NDR_IN) { + if (r->in.domain_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.domain_handle)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->in.level)); + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.name)); + } + if (flags & NDR_OUT) { + if (r->out.idx == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.idx)); + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_GetDisplayEnumerationIndex2(struct ndr_pull *ndr, int flags, struct samr_GetDisplayEnumerationIndex2 *r) +{ + TALLOC_CTX *_mem_save_domain_handle_0; + TALLOC_CTX *_mem_save_idx_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.domain_handle); + } + _mem_save_domain_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.domain_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.domain_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->in.level)); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.name)); + NDR_PULL_ALLOC(ndr, r->out.idx); + ZERO_STRUCTP(r->out.idx); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.idx); + } + _mem_save_idx_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.idx, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.idx)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_idx_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_GetDisplayEnumerationIndex2(struct ndr_print *ndr, const char *name, int flags, const struct samr_GetDisplayEnumerationIndex2 *r) +{ + ndr_print_struct(ndr, name, "samr_GetDisplayEnumerationIndex2"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "samr_GetDisplayEnumerationIndex2"); + ndr->depth++; + ndr_print_ptr(ndr, "domain_handle", r->in.domain_handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "domain_handle", r->in.domain_handle); + ndr->depth--; + ndr_print_uint16(ndr, "level", r->in.level); + ndr_print_lsa_String(ndr, "name", &r->in.name); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "samr_GetDisplayEnumerationIndex2"); + ndr->depth++; + ndr_print_ptr(ndr, "idx", r->out.idx); + ndr->depth++; + ndr_print_uint32(ndr, "idx", *r->out.idx); + ndr->depth--; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_CreateUser2(struct ndr_push *ndr, int flags, const struct samr_CreateUser2 *r) +{ + if (flags & NDR_IN) { + if (r->in.domain_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.domain_handle)); + if (r->in.account_name == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.account_name)); + NDR_CHECK(ndr_push_samr_AcctFlags(ndr, NDR_SCALARS, r->in.acct_flags)); + NDR_CHECK(ndr_push_samr_UserAccessMask(ndr, NDR_SCALARS, r->in.access_mask)); + } + if (flags & NDR_OUT) { + if (r->out.user_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->out.user_handle)); + if (r->out.access_granted == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.access_granted)); + if (r->out.rid == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.rid)); + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_CreateUser2(struct ndr_pull *ndr, int flags, struct samr_CreateUser2 *r) +{ + TALLOC_CTX *_mem_save_domain_handle_0; + TALLOC_CTX *_mem_save_account_name_0; + TALLOC_CTX *_mem_save_user_handle_0; + TALLOC_CTX *_mem_save_access_granted_0; + TALLOC_CTX *_mem_save_rid_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.domain_handle); + } + _mem_save_domain_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.domain_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.domain_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_handle_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.account_name); + } + _mem_save_account_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.account_name, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.account_name)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_account_name_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_samr_AcctFlags(ndr, NDR_SCALARS, &r->in.acct_flags)); + NDR_CHECK(ndr_pull_samr_UserAccessMask(ndr, NDR_SCALARS, &r->in.access_mask)); + NDR_PULL_ALLOC(ndr, r->out.user_handle); + ZERO_STRUCTP(r->out.user_handle); + NDR_PULL_ALLOC(ndr, r->out.access_granted); + ZERO_STRUCTP(r->out.access_granted); + NDR_PULL_ALLOC(ndr, r->out.rid); + ZERO_STRUCTP(r->out.rid); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.user_handle); + } + _mem_save_user_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.user_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->out.user_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_user_handle_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.access_granted); + } + _mem_save_access_granted_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.access_granted, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.access_granted)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_access_granted_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.rid); + } + _mem_save_rid_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.rid, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.rid)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_rid_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_CreateUser2(struct ndr_print *ndr, const char *name, int flags, const struct samr_CreateUser2 *r) +{ + ndr_print_struct(ndr, name, "samr_CreateUser2"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "samr_CreateUser2"); + ndr->depth++; + ndr_print_ptr(ndr, "domain_handle", r->in.domain_handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "domain_handle", r->in.domain_handle); + ndr->depth--; + ndr_print_ptr(ndr, "account_name", r->in.account_name); + ndr->depth++; + ndr_print_lsa_String(ndr, "account_name", r->in.account_name); + ndr->depth--; + ndr_print_samr_AcctFlags(ndr, "acct_flags", r->in.acct_flags); + ndr_print_samr_UserAccessMask(ndr, "access_mask", r->in.access_mask); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "samr_CreateUser2"); + ndr->depth++; + ndr_print_ptr(ndr, "user_handle", r->out.user_handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "user_handle", r->out.user_handle); + ndr->depth--; + ndr_print_ptr(ndr, "access_granted", r->out.access_granted); + ndr->depth++; + ndr_print_uint32(ndr, "access_granted", *r->out.access_granted); + ndr->depth--; + ndr_print_ptr(ndr, "rid", r->out.rid); + ndr->depth++; + ndr_print_uint32(ndr, "rid", *r->out.rid); + ndr->depth--; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_QueryDisplayInfo3(struct ndr_push *ndr, int flags, const struct samr_QueryDisplayInfo3 *r) +{ + if (flags & NDR_IN) { + if (r->in.domain_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.domain_handle)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->in.level)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.start_idx)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.max_entries)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.buf_size)); + } + if (flags & NDR_OUT) { + if (r->out.total_size == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.total_size)); + if (r->out.returned_size == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.returned_size)); + if (r->out.info == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_set_switch_value(ndr, r->out.info, r->in.level)); + NDR_CHECK(ndr_push_samr_DispInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.info)); + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_QueryDisplayInfo3(struct ndr_pull *ndr, int flags, struct samr_QueryDisplayInfo3 *r) +{ + TALLOC_CTX *_mem_save_domain_handle_0; + TALLOC_CTX *_mem_save_total_size_0; + TALLOC_CTX *_mem_save_returned_size_0; + TALLOC_CTX *_mem_save_info_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.domain_handle); + } + _mem_save_domain_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.domain_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.domain_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->in.level)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.start_idx)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.max_entries)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.buf_size)); + NDR_PULL_ALLOC(ndr, r->out.total_size); + ZERO_STRUCTP(r->out.total_size); + NDR_PULL_ALLOC(ndr, r->out.returned_size); + ZERO_STRUCTP(r->out.returned_size); + NDR_PULL_ALLOC(ndr, r->out.info); + ZERO_STRUCTP(r->out.info); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.total_size); + } + _mem_save_total_size_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.total_size, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.total_size)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_total_size_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.returned_size); + } + _mem_save_returned_size_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.returned_size, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.returned_size)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_returned_size_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.info); + } + _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.info, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_set_switch_value(ndr, r->out.info, r->in.level)); + NDR_CHECK(ndr_pull_samr_DispInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.info)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_QueryDisplayInfo3(struct ndr_print *ndr, const char *name, int flags, const struct samr_QueryDisplayInfo3 *r) +{ + ndr_print_struct(ndr, name, "samr_QueryDisplayInfo3"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "samr_QueryDisplayInfo3"); + ndr->depth++; + ndr_print_ptr(ndr, "domain_handle", r->in.domain_handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "domain_handle", r->in.domain_handle); + ndr->depth--; + ndr_print_uint16(ndr, "level", r->in.level); + ndr_print_uint32(ndr, "start_idx", r->in.start_idx); + ndr_print_uint32(ndr, "max_entries", r->in.max_entries); + ndr_print_uint32(ndr, "buf_size", r->in.buf_size); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "samr_QueryDisplayInfo3"); + ndr->depth++; + ndr_print_ptr(ndr, "total_size", r->out.total_size); + ndr->depth++; + ndr_print_uint32(ndr, "total_size", *r->out.total_size); + ndr->depth--; + ndr_print_ptr(ndr, "returned_size", r->out.returned_size); + ndr->depth++; + ndr_print_uint32(ndr, "returned_size", *r->out.returned_size); + ndr->depth--; + ndr_print_ptr(ndr, "info", r->out.info); + ndr->depth++; + ndr_print_set_switch_value(ndr, r->out.info, r->in.level); + ndr_print_samr_DispInfo(ndr, "info", r->out.info); + ndr->depth--; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_AddMultipleMembersToAlias(struct ndr_push *ndr, int flags, const struct samr_AddMultipleMembersToAlias *r) +{ + if (flags & NDR_IN) { + if (r->in.alias_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.alias_handle)); + if (r->in.sids == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_lsa_SidArray(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.sids)); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_AddMultipleMembersToAlias(struct ndr_pull *ndr, int flags, struct samr_AddMultipleMembersToAlias *r) +{ + TALLOC_CTX *_mem_save_alias_handle_0; + TALLOC_CTX *_mem_save_sids_0; + if (flags & NDR_IN) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.alias_handle); + } + _mem_save_alias_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.alias_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.alias_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_alias_handle_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.sids); + } + _mem_save_sids_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.sids, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_lsa_SidArray(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.sids)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sids_0, LIBNDR_FLAG_REF_ALLOC); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_AddMultipleMembersToAlias(struct ndr_print *ndr, const char *name, int flags, const struct samr_AddMultipleMembersToAlias *r) +{ + ndr_print_struct(ndr, name, "samr_AddMultipleMembersToAlias"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "samr_AddMultipleMembersToAlias"); + ndr->depth++; + ndr_print_ptr(ndr, "alias_handle", r->in.alias_handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "alias_handle", r->in.alias_handle); + ndr->depth--; + ndr_print_ptr(ndr, "sids", r->in.sids); + ndr->depth++; + ndr_print_lsa_SidArray(ndr, "sids", r->in.sids); + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "samr_AddMultipleMembersToAlias"); + ndr->depth++; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_RemoveMultipleMembersFromAlias(struct ndr_push *ndr, int flags, const struct samr_RemoveMultipleMembersFromAlias *r) +{ + if (flags & NDR_IN) { + if (r->in.alias_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.alias_handle)); + if (r->in.sids == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_lsa_SidArray(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.sids)); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_RemoveMultipleMembersFromAlias(struct ndr_pull *ndr, int flags, struct samr_RemoveMultipleMembersFromAlias *r) +{ + TALLOC_CTX *_mem_save_alias_handle_0; + TALLOC_CTX *_mem_save_sids_0; + if (flags & NDR_IN) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.alias_handle); + } + _mem_save_alias_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.alias_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.alias_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_alias_handle_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.sids); + } + _mem_save_sids_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.sids, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_lsa_SidArray(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.sids)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sids_0, LIBNDR_FLAG_REF_ALLOC); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_RemoveMultipleMembersFromAlias(struct ndr_print *ndr, const char *name, int flags, const struct samr_RemoveMultipleMembersFromAlias *r) +{ + ndr_print_struct(ndr, name, "samr_RemoveMultipleMembersFromAlias"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "samr_RemoveMultipleMembersFromAlias"); + ndr->depth++; + ndr_print_ptr(ndr, "alias_handle", r->in.alias_handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "alias_handle", r->in.alias_handle); + ndr->depth--; + ndr_print_ptr(ndr, "sids", r->in.sids); + ndr->depth++; + ndr_print_lsa_SidArray(ndr, "sids", r->in.sids); + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "samr_RemoveMultipleMembersFromAlias"); + ndr->depth++; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_OemChangePasswordUser2(struct ndr_push *ndr, int flags, const struct samr_OemChangePasswordUser2 *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server)); + if (r->in.server) { + NDR_CHECK(ndr_push_lsa_AsciiString(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.server)); + } + if (r->in.account == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_lsa_AsciiString(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.account)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.password)); + if (r->in.password) { + NDR_CHECK(ndr_push_samr_CryptPassword(ndr, NDR_SCALARS, r->in.password)); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.hash)); + if (r->in.hash) { + NDR_CHECK(ndr_push_samr_Password(ndr, NDR_SCALARS, r->in.hash)); + } + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_OemChangePasswordUser2(struct ndr_pull *ndr, int flags, struct samr_OemChangePasswordUser2 *r) +{ + uint32_t _ptr_server; + uint32_t _ptr_password; + uint32_t _ptr_hash; + TALLOC_CTX *_mem_save_server_0; + TALLOC_CTX *_mem_save_account_0; + TALLOC_CTX *_mem_save_password_0; + TALLOC_CTX *_mem_save_hash_0; + if (flags & NDR_IN) { + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server)); + if (_ptr_server) { + NDR_PULL_ALLOC(ndr, r->in.server); + } else { + r->in.server = NULL; + } + if (r->in.server) { + _mem_save_server_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.server, 0); + NDR_CHECK(ndr_pull_lsa_AsciiString(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.server)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_0, 0); + } + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.account); + } + _mem_save_account_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.account, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_lsa_AsciiString(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.account)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_account_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_password)); + if (_ptr_password) { + NDR_PULL_ALLOC(ndr, r->in.password); + } else { + r->in.password = NULL; + } + if (r->in.password) { + _mem_save_password_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.password, 0); + NDR_CHECK(ndr_pull_samr_CryptPassword(ndr, NDR_SCALARS, r->in.password)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_password_0, 0); + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_hash)); + if (_ptr_hash) { + NDR_PULL_ALLOC(ndr, r->in.hash); + } else { + r->in.hash = NULL; + } + if (r->in.hash) { + _mem_save_hash_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.hash, 0); + NDR_CHECK(ndr_pull_samr_Password(ndr, NDR_SCALARS, r->in.hash)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_hash_0, 0); + } + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_OemChangePasswordUser2(struct ndr_print *ndr, const char *name, int flags, const struct samr_OemChangePasswordUser2 *r) +{ + ndr_print_struct(ndr, name, "samr_OemChangePasswordUser2"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "samr_OemChangePasswordUser2"); + ndr->depth++; + ndr_print_ptr(ndr, "server", r->in.server); + ndr->depth++; + if (r->in.server) { + ndr_print_lsa_AsciiString(ndr, "server", r->in.server); + } + ndr->depth--; + ndr_print_ptr(ndr, "account", r->in.account); + ndr->depth++; + ndr_print_lsa_AsciiString(ndr, "account", r->in.account); + ndr->depth--; + ndr_print_ptr(ndr, "password", r->in.password); + ndr->depth++; + if (r->in.password) { + ndr_print_samr_CryptPassword(ndr, "password", r->in.password); + } + ndr->depth--; + ndr_print_ptr(ndr, "hash", r->in.hash); + ndr->depth++; + if (r->in.hash) { + ndr_print_samr_Password(ndr, "hash", r->in.hash); + } + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "samr_OemChangePasswordUser2"); + ndr->depth++; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_ChangePasswordUser2(struct ndr_push *ndr, int flags, const struct samr_ChangePasswordUser2 *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server)); + if (r->in.server) { + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.server)); + } + if (r->in.account == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.account)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.nt_password)); + if (r->in.nt_password) { + NDR_CHECK(ndr_push_samr_CryptPassword(ndr, NDR_SCALARS, r->in.nt_password)); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.nt_verifier)); + if (r->in.nt_verifier) { + NDR_CHECK(ndr_push_samr_Password(ndr, NDR_SCALARS, r->in.nt_verifier)); + } + NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->in.lm_change)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.lm_password)); + if (r->in.lm_password) { + NDR_CHECK(ndr_push_samr_CryptPassword(ndr, NDR_SCALARS, r->in.lm_password)); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.lm_verifier)); + if (r->in.lm_verifier) { + NDR_CHECK(ndr_push_samr_Password(ndr, NDR_SCALARS, r->in.lm_verifier)); + } + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_ChangePasswordUser2(struct ndr_pull *ndr, int flags, struct samr_ChangePasswordUser2 *r) +{ + uint32_t _ptr_server; + uint32_t _ptr_nt_password; + uint32_t _ptr_nt_verifier; + uint32_t _ptr_lm_password; + uint32_t _ptr_lm_verifier; + TALLOC_CTX *_mem_save_server_0; + TALLOC_CTX *_mem_save_account_0; + TALLOC_CTX *_mem_save_nt_password_0; + TALLOC_CTX *_mem_save_nt_verifier_0; + TALLOC_CTX *_mem_save_lm_password_0; + TALLOC_CTX *_mem_save_lm_verifier_0; + if (flags & NDR_IN) { + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server)); + if (_ptr_server) { + NDR_PULL_ALLOC(ndr, r->in.server); + } else { + r->in.server = NULL; + } + if (r->in.server) { + _mem_save_server_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.server, 0); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.server)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_0, 0); + } + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.account); + } + _mem_save_account_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.account, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.account)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_account_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_nt_password)); + if (_ptr_nt_password) { + NDR_PULL_ALLOC(ndr, r->in.nt_password); + } else { + r->in.nt_password = NULL; + } + if (r->in.nt_password) { + _mem_save_nt_password_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.nt_password, 0); + NDR_CHECK(ndr_pull_samr_CryptPassword(ndr, NDR_SCALARS, r->in.nt_password)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_nt_password_0, 0); + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_nt_verifier)); + if (_ptr_nt_verifier) { + NDR_PULL_ALLOC(ndr, r->in.nt_verifier); + } else { + r->in.nt_verifier = NULL; + } + if (r->in.nt_verifier) { + _mem_save_nt_verifier_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.nt_verifier, 0); + NDR_CHECK(ndr_pull_samr_Password(ndr, NDR_SCALARS, r->in.nt_verifier)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_nt_verifier_0, 0); + } + NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->in.lm_change)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_lm_password)); + if (_ptr_lm_password) { + NDR_PULL_ALLOC(ndr, r->in.lm_password); + } else { + r->in.lm_password = NULL; + } + if (r->in.lm_password) { + _mem_save_lm_password_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.lm_password, 0); + NDR_CHECK(ndr_pull_samr_CryptPassword(ndr, NDR_SCALARS, r->in.lm_password)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_lm_password_0, 0); + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_lm_verifier)); + if (_ptr_lm_verifier) { + NDR_PULL_ALLOC(ndr, r->in.lm_verifier); + } else { + r->in.lm_verifier = NULL; + } + if (r->in.lm_verifier) { + _mem_save_lm_verifier_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.lm_verifier, 0); + NDR_CHECK(ndr_pull_samr_Password(ndr, NDR_SCALARS, r->in.lm_verifier)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_lm_verifier_0, 0); + } + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_ChangePasswordUser2(struct ndr_print *ndr, const char *name, int flags, const struct samr_ChangePasswordUser2 *r) +{ + ndr_print_struct(ndr, name, "samr_ChangePasswordUser2"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "samr_ChangePasswordUser2"); + ndr->depth++; + ndr_print_ptr(ndr, "server", r->in.server); + ndr->depth++; + if (r->in.server) { + ndr_print_lsa_String(ndr, "server", r->in.server); + } + ndr->depth--; + ndr_print_ptr(ndr, "account", r->in.account); + ndr->depth++; + ndr_print_lsa_String(ndr, "account", r->in.account); + ndr->depth--; + ndr_print_ptr(ndr, "nt_password", r->in.nt_password); + ndr->depth++; + if (r->in.nt_password) { + ndr_print_samr_CryptPassword(ndr, "nt_password", r->in.nt_password); + } + ndr->depth--; + ndr_print_ptr(ndr, "nt_verifier", r->in.nt_verifier); + ndr->depth++; + if (r->in.nt_verifier) { + ndr_print_samr_Password(ndr, "nt_verifier", r->in.nt_verifier); + } + ndr->depth--; + ndr_print_uint8(ndr, "lm_change", r->in.lm_change); + ndr_print_ptr(ndr, "lm_password", r->in.lm_password); + ndr->depth++; + if (r->in.lm_password) { + ndr_print_samr_CryptPassword(ndr, "lm_password", r->in.lm_password); + } + ndr->depth--; + ndr_print_ptr(ndr, "lm_verifier", r->in.lm_verifier); + ndr->depth++; + if (r->in.lm_verifier) { + ndr_print_samr_Password(ndr, "lm_verifier", r->in.lm_verifier); + } + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "samr_ChangePasswordUser2"); + ndr->depth++; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_GetDomPwInfo(struct ndr_push *ndr, int flags, const struct samr_GetDomPwInfo *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.domain_name)); + if (r->in.domain_name) { + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.domain_name)); + } + } + if (flags & NDR_OUT) { + if (r->out.info == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_samr_PwInfo(ndr, NDR_SCALARS, r->out.info)); + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_GetDomPwInfo(struct ndr_pull *ndr, int flags, struct samr_GetDomPwInfo *r) +{ + uint32_t _ptr_domain_name; + TALLOC_CTX *_mem_save_domain_name_0; + TALLOC_CTX *_mem_save_info_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_domain_name)); + if (_ptr_domain_name) { + NDR_PULL_ALLOC(ndr, r->in.domain_name); + } else { + r->in.domain_name = NULL; + } + if (r->in.domain_name) { + _mem_save_domain_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.domain_name, 0); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.domain_name)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_name_0, 0); + } + NDR_PULL_ALLOC(ndr, r->out.info); + ZERO_STRUCTP(r->out.info); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.info); + } + _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.info, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_samr_PwInfo(ndr, NDR_SCALARS, r->out.info)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_GetDomPwInfo(struct ndr_print *ndr, const char *name, int flags, const struct samr_GetDomPwInfo *r) +{ + ndr_print_struct(ndr, name, "samr_GetDomPwInfo"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "samr_GetDomPwInfo"); + ndr->depth++; + ndr_print_ptr(ndr, "domain_name", r->in.domain_name); + ndr->depth++; + if (r->in.domain_name) { + ndr_print_lsa_String(ndr, "domain_name", r->in.domain_name); + } + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "samr_GetDomPwInfo"); + ndr->depth++; + ndr_print_ptr(ndr, "info", r->out.info); + ndr->depth++; + ndr_print_samr_PwInfo(ndr, "info", r->out.info); + ndr->depth--; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_Connect2(struct ndr_push *ndr, int flags, const struct samr_Connect2 *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.system_name)); + if (r->in.system_name) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.system_name, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.system_name, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.system_name, ndr_charset_length(r->in.system_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + NDR_CHECK(ndr_push_samr_ConnectAccessMask(ndr, NDR_SCALARS, r->in.access_mask)); + } + if (flags & NDR_OUT) { + if (r->out.connect_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->out.connect_handle)); + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_Connect2(struct ndr_pull *ndr, int flags, struct samr_Connect2 *r) +{ + uint32_t _ptr_system_name; + TALLOC_CTX *_mem_save_system_name_0; + TALLOC_CTX *_mem_save_connect_handle_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_system_name)); + if (_ptr_system_name) { + NDR_PULL_ALLOC(ndr, r->in.system_name); + } else { + r->in.system_name = NULL; + } + if (r->in.system_name) { + _mem_save_system_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.system_name, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.system_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.system_name)); + if (ndr_get_array_length(ndr, &r->in.system_name) > ndr_get_array_size(ndr, &r->in.system_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.system_name), ndr_get_array_length(ndr, &r->in.system_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.system_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.system_name, ndr_get_array_length(ndr, &r->in.system_name), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_system_name_0, 0); + } + NDR_CHECK(ndr_pull_samr_ConnectAccessMask(ndr, NDR_SCALARS, &r->in.access_mask)); + NDR_PULL_ALLOC(ndr, r->out.connect_handle); + ZERO_STRUCTP(r->out.connect_handle); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.connect_handle); + } + _mem_save_connect_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.connect_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->out.connect_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_connect_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_Connect2(struct ndr_print *ndr, const char *name, int flags, const struct samr_Connect2 *r) +{ + ndr_print_struct(ndr, name, "samr_Connect2"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "samr_Connect2"); + ndr->depth++; + ndr_print_ptr(ndr, "system_name", r->in.system_name); + ndr->depth++; + if (r->in.system_name) { + ndr_print_string(ndr, "system_name", r->in.system_name); + } + ndr->depth--; + ndr_print_samr_ConnectAccessMask(ndr, "access_mask", r->in.access_mask); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "samr_Connect2"); + ndr->depth++; + ndr_print_ptr(ndr, "connect_handle", r->out.connect_handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "connect_handle", r->out.connect_handle); + ndr->depth--; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +_PUBLIC_ enum ndr_err_code ndr_push_samr_SetUserInfo2(struct ndr_push *ndr, int flags, const struct samr_SetUserInfo2 *r) +{ + if (flags & NDR_IN) { + if (r->in.user_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.user_handle)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->in.level)); + if (r->in.info == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_set_switch_value(ndr, r->in.info, r->in.level)); + NDR_CHECK(ndr_push_samr_UserInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.info)); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_samr_SetUserInfo2(struct ndr_pull *ndr, int flags, struct samr_SetUserInfo2 *r) +{ + TALLOC_CTX *_mem_save_user_handle_0; + TALLOC_CTX *_mem_save_info_0; + if (flags & NDR_IN) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.user_handle); + } + _mem_save_user_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.user_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.user_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_user_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->in.level)); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.info); + } + _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.info, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_set_switch_value(ndr, r->in.info, r->in.level)); + NDR_CHECK(ndr_pull_samr_UserInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.info)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, LIBNDR_FLAG_REF_ALLOC); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_SetUserInfo2(struct ndr_print *ndr, const char *name, int flags, const struct samr_SetUserInfo2 *r) +{ + ndr_print_struct(ndr, name, "samr_SetUserInfo2"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "samr_SetUserInfo2"); + ndr->depth++; + ndr_print_ptr(ndr, "user_handle", r->in.user_handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "user_handle", r->in.user_handle); + ndr->depth--; + ndr_print_uint16(ndr, "level", r->in.level); + ndr_print_ptr(ndr, "info", r->in.info); + ndr->depth++; + ndr_print_set_switch_value(ndr, r->in.info, r->in.level); + ndr_print_samr_UserInfo(ndr, "info", r->in.info); + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "samr_SetUserInfo2"); + ndr->depth++; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_SetBootKeyInformation(struct ndr_push *ndr, int flags, const struct samr_SetBootKeyInformation *r) +{ + if (flags & NDR_IN) { + if (r->in.connect_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.connect_handle)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.unknown1)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.unknown2)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.unknown3)); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_SetBootKeyInformation(struct ndr_pull *ndr, int flags, struct samr_SetBootKeyInformation *r) +{ + TALLOC_CTX *_mem_save_connect_handle_0; + if (flags & NDR_IN) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.connect_handle); + } + _mem_save_connect_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.connect_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.connect_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_connect_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.unknown1)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.unknown2)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.unknown3)); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_SetBootKeyInformation(struct ndr_print *ndr, const char *name, int flags, const struct samr_SetBootKeyInformation *r) +{ + ndr_print_struct(ndr, name, "samr_SetBootKeyInformation"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "samr_SetBootKeyInformation"); + ndr->depth++; + ndr_print_ptr(ndr, "connect_handle", r->in.connect_handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "connect_handle", r->in.connect_handle); + ndr->depth--; + ndr_print_uint32(ndr, "unknown1", r->in.unknown1); + ndr_print_uint32(ndr, "unknown2", r->in.unknown2); + ndr_print_uint32(ndr, "unknown3", r->in.unknown3); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "samr_SetBootKeyInformation"); + ndr->depth++; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_GetBootKeyInformation(struct ndr_push *ndr, int flags, const struct samr_GetBootKeyInformation *r) +{ + if (flags & NDR_IN) { + if (r->in.domain_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.domain_handle)); + } + if (flags & NDR_OUT) { + if (r->out.unknown == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.unknown)); + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_GetBootKeyInformation(struct ndr_pull *ndr, int flags, struct samr_GetBootKeyInformation *r) +{ + TALLOC_CTX *_mem_save_domain_handle_0; + TALLOC_CTX *_mem_save_unknown_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.domain_handle); + } + _mem_save_domain_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.domain_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.domain_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_PULL_ALLOC(ndr, r->out.unknown); + ZERO_STRUCTP(r->out.unknown); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.unknown); + } + _mem_save_unknown_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.unknown, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.unknown)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_unknown_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_GetBootKeyInformation(struct ndr_print *ndr, const char *name, int flags, const struct samr_GetBootKeyInformation *r) +{ + ndr_print_struct(ndr, name, "samr_GetBootKeyInformation"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "samr_GetBootKeyInformation"); + ndr->depth++; + ndr_print_ptr(ndr, "domain_handle", r->in.domain_handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "domain_handle", r->in.domain_handle); + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "samr_GetBootKeyInformation"); + ndr->depth++; + ndr_print_ptr(ndr, "unknown", r->out.unknown); + ndr->depth++; + ndr_print_uint32(ndr, "unknown", *r->out.unknown); + ndr->depth--; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_Connect3(struct ndr_push *ndr, int flags, const struct samr_Connect3 *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.system_name)); + if (r->in.system_name) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.system_name, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.system_name, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.system_name, ndr_charset_length(r->in.system_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.unknown)); + NDR_CHECK(ndr_push_samr_ConnectAccessMask(ndr, NDR_SCALARS, r->in.access_mask)); + } + if (flags & NDR_OUT) { + if (r->out.connect_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->out.connect_handle)); + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_Connect3(struct ndr_pull *ndr, int flags, struct samr_Connect3 *r) +{ + uint32_t _ptr_system_name; + TALLOC_CTX *_mem_save_system_name_0; + TALLOC_CTX *_mem_save_connect_handle_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_system_name)); + if (_ptr_system_name) { + NDR_PULL_ALLOC(ndr, r->in.system_name); + } else { + r->in.system_name = NULL; + } + if (r->in.system_name) { + _mem_save_system_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.system_name, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.system_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.system_name)); + if (ndr_get_array_length(ndr, &r->in.system_name) > ndr_get_array_size(ndr, &r->in.system_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.system_name), ndr_get_array_length(ndr, &r->in.system_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.system_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.system_name, ndr_get_array_length(ndr, &r->in.system_name), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_system_name_0, 0); + } + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.unknown)); + NDR_CHECK(ndr_pull_samr_ConnectAccessMask(ndr, NDR_SCALARS, &r->in.access_mask)); + NDR_PULL_ALLOC(ndr, r->out.connect_handle); + ZERO_STRUCTP(r->out.connect_handle); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.connect_handle); + } + _mem_save_connect_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.connect_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->out.connect_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_connect_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_Connect3(struct ndr_print *ndr, const char *name, int flags, const struct samr_Connect3 *r) +{ + ndr_print_struct(ndr, name, "samr_Connect3"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "samr_Connect3"); + ndr->depth++; + ndr_print_ptr(ndr, "system_name", r->in.system_name); + ndr->depth++; + if (r->in.system_name) { + ndr_print_string(ndr, "system_name", r->in.system_name); + } + ndr->depth--; + ndr_print_uint32(ndr, "unknown", r->in.unknown); + ndr_print_samr_ConnectAccessMask(ndr, "access_mask", r->in.access_mask); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "samr_Connect3"); + ndr->depth++; + ndr_print_ptr(ndr, "connect_handle", r->out.connect_handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "connect_handle", r->out.connect_handle); + ndr->depth--; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_Connect4(struct ndr_push *ndr, int flags, const struct samr_Connect4 *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.system_name)); + if (r->in.system_name) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.system_name, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.system_name, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.system_name, ndr_charset_length(r->in.system_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.unknown)); + NDR_CHECK(ndr_push_samr_ConnectAccessMask(ndr, NDR_SCALARS, r->in.access_mask)); + } + if (flags & NDR_OUT) { + if (r->out.connect_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->out.connect_handle)); + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_Connect4(struct ndr_pull *ndr, int flags, struct samr_Connect4 *r) +{ + uint32_t _ptr_system_name; + TALLOC_CTX *_mem_save_system_name_0; + TALLOC_CTX *_mem_save_connect_handle_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_system_name)); + if (_ptr_system_name) { + NDR_PULL_ALLOC(ndr, r->in.system_name); + } else { + r->in.system_name = NULL; + } + if (r->in.system_name) { + _mem_save_system_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.system_name, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.system_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.system_name)); + if (ndr_get_array_length(ndr, &r->in.system_name) > ndr_get_array_size(ndr, &r->in.system_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.system_name), ndr_get_array_length(ndr, &r->in.system_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.system_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.system_name, ndr_get_array_length(ndr, &r->in.system_name), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_system_name_0, 0); + } + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.unknown)); + NDR_CHECK(ndr_pull_samr_ConnectAccessMask(ndr, NDR_SCALARS, &r->in.access_mask)); + NDR_PULL_ALLOC(ndr, r->out.connect_handle); + ZERO_STRUCTP(r->out.connect_handle); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.connect_handle); + } + _mem_save_connect_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.connect_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->out.connect_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_connect_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_Connect4(struct ndr_print *ndr, const char *name, int flags, const struct samr_Connect4 *r) +{ + ndr_print_struct(ndr, name, "samr_Connect4"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "samr_Connect4"); + ndr->depth++; + ndr_print_ptr(ndr, "system_name", r->in.system_name); + ndr->depth++; + if (r->in.system_name) { + ndr_print_string(ndr, "system_name", r->in.system_name); + } + ndr->depth--; + ndr_print_uint32(ndr, "unknown", r->in.unknown); + ndr_print_samr_ConnectAccessMask(ndr, "access_mask", r->in.access_mask); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "samr_Connect4"); + ndr->depth++; + ndr_print_ptr(ndr, "connect_handle", r->out.connect_handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "connect_handle", r->out.connect_handle); + ndr->depth--; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_ChangePasswordUser3(struct ndr_push *ndr, int flags, const struct samr_ChangePasswordUser3 *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server)); + if (r->in.server) { + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.server)); + } + if (r->in.account == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.account)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.nt_password)); + if (r->in.nt_password) { + NDR_CHECK(ndr_push_samr_CryptPassword(ndr, NDR_SCALARS, r->in.nt_password)); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.nt_verifier)); + if (r->in.nt_verifier) { + NDR_CHECK(ndr_push_samr_Password(ndr, NDR_SCALARS, r->in.nt_verifier)); + } + NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->in.lm_change)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.lm_password)); + if (r->in.lm_password) { + NDR_CHECK(ndr_push_samr_CryptPassword(ndr, NDR_SCALARS, r->in.lm_password)); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.lm_verifier)); + if (r->in.lm_verifier) { + NDR_CHECK(ndr_push_samr_Password(ndr, NDR_SCALARS, r->in.lm_verifier)); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.password3)); + if (r->in.password3) { + NDR_CHECK(ndr_push_samr_CryptPassword(ndr, NDR_SCALARS, r->in.password3)); + } + } + if (flags & NDR_OUT) { + if (r->out.dominfo == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_samr_DomInfo1(ndr, NDR_SCALARS, r->out.dominfo)); + if (r->out.reject == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_samr_ChangeReject(ndr, NDR_SCALARS, r->out.reject)); + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_ChangePasswordUser3(struct ndr_pull *ndr, int flags, struct samr_ChangePasswordUser3 *r) +{ + uint32_t _ptr_server; + uint32_t _ptr_nt_password; + uint32_t _ptr_nt_verifier; + uint32_t _ptr_lm_password; + uint32_t _ptr_lm_verifier; + uint32_t _ptr_password3; + TALLOC_CTX *_mem_save_server_0; + TALLOC_CTX *_mem_save_account_0; + TALLOC_CTX *_mem_save_nt_password_0; + TALLOC_CTX *_mem_save_nt_verifier_0; + TALLOC_CTX *_mem_save_lm_password_0; + TALLOC_CTX *_mem_save_lm_verifier_0; + TALLOC_CTX *_mem_save_password3_0; + TALLOC_CTX *_mem_save_dominfo_0; + TALLOC_CTX *_mem_save_reject_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server)); + if (_ptr_server) { + NDR_PULL_ALLOC(ndr, r->in.server); + } else { + r->in.server = NULL; + } + if (r->in.server) { + _mem_save_server_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.server, 0); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.server)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_0, 0); + } + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.account); + } + _mem_save_account_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.account, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.account)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_account_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_nt_password)); + if (_ptr_nt_password) { + NDR_PULL_ALLOC(ndr, r->in.nt_password); + } else { + r->in.nt_password = NULL; + } + if (r->in.nt_password) { + _mem_save_nt_password_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.nt_password, 0); + NDR_CHECK(ndr_pull_samr_CryptPassword(ndr, NDR_SCALARS, r->in.nt_password)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_nt_password_0, 0); + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_nt_verifier)); + if (_ptr_nt_verifier) { + NDR_PULL_ALLOC(ndr, r->in.nt_verifier); + } else { + r->in.nt_verifier = NULL; + } + if (r->in.nt_verifier) { + _mem_save_nt_verifier_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.nt_verifier, 0); + NDR_CHECK(ndr_pull_samr_Password(ndr, NDR_SCALARS, r->in.nt_verifier)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_nt_verifier_0, 0); + } + NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->in.lm_change)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_lm_password)); + if (_ptr_lm_password) { + NDR_PULL_ALLOC(ndr, r->in.lm_password); + } else { + r->in.lm_password = NULL; + } + if (r->in.lm_password) { + _mem_save_lm_password_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.lm_password, 0); + NDR_CHECK(ndr_pull_samr_CryptPassword(ndr, NDR_SCALARS, r->in.lm_password)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_lm_password_0, 0); + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_lm_verifier)); + if (_ptr_lm_verifier) { + NDR_PULL_ALLOC(ndr, r->in.lm_verifier); + } else { + r->in.lm_verifier = NULL; + } + if (r->in.lm_verifier) { + _mem_save_lm_verifier_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.lm_verifier, 0); + NDR_CHECK(ndr_pull_samr_Password(ndr, NDR_SCALARS, r->in.lm_verifier)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_lm_verifier_0, 0); + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_password3)); + if (_ptr_password3) { + NDR_PULL_ALLOC(ndr, r->in.password3); + } else { + r->in.password3 = NULL; + } + if (r->in.password3) { + _mem_save_password3_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.password3, 0); + NDR_CHECK(ndr_pull_samr_CryptPassword(ndr, NDR_SCALARS, r->in.password3)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_password3_0, 0); + } + NDR_PULL_ALLOC(ndr, r->out.dominfo); + ZERO_STRUCTP(r->out.dominfo); + NDR_PULL_ALLOC(ndr, r->out.reject); + ZERO_STRUCTP(r->out.reject); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.dominfo); + } + _mem_save_dominfo_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.dominfo, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_samr_DomInfo1(ndr, NDR_SCALARS, r->out.dominfo)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_dominfo_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.reject); + } + _mem_save_reject_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.reject, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_samr_ChangeReject(ndr, NDR_SCALARS, r->out.reject)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_reject_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_ChangePasswordUser3(struct ndr_print *ndr, const char *name, int flags, const struct samr_ChangePasswordUser3 *r) +{ + ndr_print_struct(ndr, name, "samr_ChangePasswordUser3"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "samr_ChangePasswordUser3"); + ndr->depth++; + ndr_print_ptr(ndr, "server", r->in.server); + ndr->depth++; + if (r->in.server) { + ndr_print_lsa_String(ndr, "server", r->in.server); + } + ndr->depth--; + ndr_print_ptr(ndr, "account", r->in.account); + ndr->depth++; + ndr_print_lsa_String(ndr, "account", r->in.account); + ndr->depth--; + ndr_print_ptr(ndr, "nt_password", r->in.nt_password); + ndr->depth++; + if (r->in.nt_password) { + ndr_print_samr_CryptPassword(ndr, "nt_password", r->in.nt_password); + } + ndr->depth--; + ndr_print_ptr(ndr, "nt_verifier", r->in.nt_verifier); + ndr->depth++; + if (r->in.nt_verifier) { + ndr_print_samr_Password(ndr, "nt_verifier", r->in.nt_verifier); + } + ndr->depth--; + ndr_print_uint8(ndr, "lm_change", r->in.lm_change); + ndr_print_ptr(ndr, "lm_password", r->in.lm_password); + ndr->depth++; + if (r->in.lm_password) { + ndr_print_samr_CryptPassword(ndr, "lm_password", r->in.lm_password); + } + ndr->depth--; + ndr_print_ptr(ndr, "lm_verifier", r->in.lm_verifier); + ndr->depth++; + if (r->in.lm_verifier) { + ndr_print_samr_Password(ndr, "lm_verifier", r->in.lm_verifier); + } + ndr->depth--; + ndr_print_ptr(ndr, "password3", r->in.password3); + ndr->depth++; + if (r->in.password3) { + ndr_print_samr_CryptPassword(ndr, "password3", r->in.password3); + } + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "samr_ChangePasswordUser3"); + ndr->depth++; + ndr_print_ptr(ndr, "dominfo", r->out.dominfo); + ndr->depth++; + ndr_print_samr_DomInfo1(ndr, "dominfo", r->out.dominfo); + ndr->depth--; + ndr_print_ptr(ndr, "reject", r->out.reject); + ndr->depth++; + ndr_print_samr_ChangeReject(ndr, "reject", r->out.reject); + ndr->depth--; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +_PUBLIC_ enum ndr_err_code ndr_push_samr_Connect5(struct ndr_push *ndr, int flags, const struct samr_Connect5 *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.system_name)); + if (r->in.system_name) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.system_name, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.system_name, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.system_name, ndr_charset_length(r->in.system_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + NDR_CHECK(ndr_push_samr_ConnectAccessMask(ndr, NDR_SCALARS, r->in.access_mask)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.level_in)); + if (r->in.info_in == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_set_switch_value(ndr, r->in.info_in, r->in.level_in)); + NDR_CHECK(ndr_push_samr_ConnectInfo(ndr, NDR_SCALARS, r->in.info_in)); + } + if (flags & NDR_OUT) { + if (r->out.level_out == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.level_out)); + if (r->out.info_out == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_set_switch_value(ndr, r->out.info_out, *r->out.level_out)); + NDR_CHECK(ndr_push_samr_ConnectInfo(ndr, NDR_SCALARS, r->out.info_out)); + if (r->out.connect_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->out.connect_handle)); + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_samr_Connect5(struct ndr_pull *ndr, int flags, struct samr_Connect5 *r) +{ + uint32_t _ptr_system_name; + TALLOC_CTX *_mem_save_system_name_0; + TALLOC_CTX *_mem_save_info_in_0; + TALLOC_CTX *_mem_save_level_out_0; + TALLOC_CTX *_mem_save_info_out_0; + TALLOC_CTX *_mem_save_connect_handle_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_system_name)); + if (_ptr_system_name) { + NDR_PULL_ALLOC(ndr, r->in.system_name); + } else { + r->in.system_name = NULL; + } + if (r->in.system_name) { + _mem_save_system_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.system_name, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.system_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.system_name)); + if (ndr_get_array_length(ndr, &r->in.system_name) > ndr_get_array_size(ndr, &r->in.system_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.system_name), ndr_get_array_length(ndr, &r->in.system_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.system_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.system_name, ndr_get_array_length(ndr, &r->in.system_name), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_system_name_0, 0); + } + NDR_CHECK(ndr_pull_samr_ConnectAccessMask(ndr, NDR_SCALARS, &r->in.access_mask)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.level_in)); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.info_in); + } + _mem_save_info_in_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.info_in, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_set_switch_value(ndr, r->in.info_in, r->in.level_in)); + NDR_CHECK(ndr_pull_samr_ConnectInfo(ndr, NDR_SCALARS, r->in.info_in)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_in_0, LIBNDR_FLAG_REF_ALLOC); + NDR_PULL_ALLOC(ndr, r->out.level_out); + ZERO_STRUCTP(r->out.level_out); + NDR_PULL_ALLOC(ndr, r->out.info_out); + ZERO_STRUCTP(r->out.info_out); + NDR_PULL_ALLOC(ndr, r->out.connect_handle); + ZERO_STRUCTP(r->out.connect_handle); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.level_out); + } + _mem_save_level_out_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.level_out, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.level_out)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_level_out_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.info_out); + } + _mem_save_info_out_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.info_out, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_set_switch_value(ndr, r->out.info_out, *r->out.level_out)); + NDR_CHECK(ndr_pull_samr_ConnectInfo(ndr, NDR_SCALARS, r->out.info_out)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_out_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.connect_handle); + } + _mem_save_connect_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.connect_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->out.connect_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_connect_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_Connect5(struct ndr_print *ndr, const char *name, int flags, const struct samr_Connect5 *r) +{ + ndr_print_struct(ndr, name, "samr_Connect5"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "samr_Connect5"); + ndr->depth++; + ndr_print_ptr(ndr, "system_name", r->in.system_name); + ndr->depth++; + if (r->in.system_name) { + ndr_print_string(ndr, "system_name", r->in.system_name); + } + ndr->depth--; + ndr_print_samr_ConnectAccessMask(ndr, "access_mask", r->in.access_mask); + ndr_print_uint32(ndr, "level_in", r->in.level_in); + ndr_print_ptr(ndr, "info_in", r->in.info_in); + ndr->depth++; + ndr_print_set_switch_value(ndr, r->in.info_in, r->in.level_in); + ndr_print_samr_ConnectInfo(ndr, "info_in", r->in.info_in); + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "samr_Connect5"); + ndr->depth++; + ndr_print_ptr(ndr, "level_out", r->out.level_out); + ndr->depth++; + ndr_print_uint32(ndr, "level_out", *r->out.level_out); + ndr->depth--; + ndr_print_ptr(ndr, "info_out", r->out.info_out); + ndr->depth++; + ndr_print_set_switch_value(ndr, r->out.info_out, *r->out.level_out); + ndr_print_samr_ConnectInfo(ndr, "info_out", r->out.info_out); + ndr->depth--; + ndr_print_ptr(ndr, "connect_handle", r->out.connect_handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "connect_handle", r->out.connect_handle); + ndr->depth--; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_RidToSid(struct ndr_push *ndr, int flags, const struct samr_RidToSid *r) +{ + if (flags & NDR_IN) { + if (r->in.domain_handle == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.domain_handle)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.rid)); + } + if (flags & NDR_OUT) { + if (r->out.sid == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_dom_sid2(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.sid)); + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_RidToSid(struct ndr_pull *ndr, int flags, struct samr_RidToSid *r) +{ + TALLOC_CTX *_mem_save_domain_handle_0; + TALLOC_CTX *_mem_save_sid_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.domain_handle); + } + _mem_save_domain_handle_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.domain_handle, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.domain_handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.rid)); + NDR_PULL_ALLOC(ndr, r->out.sid); + ZERO_STRUCTP(r->out.sid); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.sid); + } + _mem_save_sid_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.sid, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_dom_sid2(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.sid)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sid_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_RidToSid(struct ndr_print *ndr, const char *name, int flags, const struct samr_RidToSid *r) +{ + ndr_print_struct(ndr, name, "samr_RidToSid"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "samr_RidToSid"); + ndr->depth++; + ndr_print_ptr(ndr, "domain_handle", r->in.domain_handle); + ndr->depth++; + ndr_print_policy_handle(ndr, "domain_handle", r->in.domain_handle); + ndr->depth--; + ndr_print_uint32(ndr, "rid", r->in.rid); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "samr_RidToSid"); + ndr->depth++; + ndr_print_ptr(ndr, "sid", r->out.sid); + ndr->depth++; + ndr_print_dom_sid2(ndr, "sid", r->out.sid); + ndr->depth--; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_SetDsrmPassword(struct ndr_push *ndr, int flags, const struct samr_SetDsrmPassword *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.name)); + if (r->in.name) { + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.name)); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.unknown)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.hash)); + if (r->in.hash) { + NDR_CHECK(ndr_push_samr_Password(ndr, NDR_SCALARS, r->in.hash)); + } + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_SetDsrmPassword(struct ndr_pull *ndr, int flags, struct samr_SetDsrmPassword *r) +{ + uint32_t _ptr_name; + uint32_t _ptr_hash; + TALLOC_CTX *_mem_save_name_0; + TALLOC_CTX *_mem_save_hash_0; + if (flags & NDR_IN) { + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_name)); + if (_ptr_name) { + NDR_PULL_ALLOC(ndr, r->in.name); + } else { + r->in.name = NULL; + } + if (r->in.name) { + _mem_save_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.name, 0); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.name)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_name_0, 0); + } + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.unknown)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_hash)); + if (_ptr_hash) { + NDR_PULL_ALLOC(ndr, r->in.hash); + } else { + r->in.hash = NULL; + } + if (r->in.hash) { + _mem_save_hash_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.hash, 0); + NDR_CHECK(ndr_pull_samr_Password(ndr, NDR_SCALARS, r->in.hash)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_hash_0, 0); + } + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_SetDsrmPassword(struct ndr_print *ndr, const char *name, int flags, const struct samr_SetDsrmPassword *r) +{ + ndr_print_struct(ndr, name, "samr_SetDsrmPassword"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "samr_SetDsrmPassword"); + ndr->depth++; + ndr_print_ptr(ndr, "name", r->in.name); + ndr->depth++; + if (r->in.name) { + ndr_print_lsa_String(ndr, "name", r->in.name); + } + ndr->depth--; + ndr_print_uint32(ndr, "unknown", r->in.unknown); + ndr_print_ptr(ndr, "hash", r->in.hash); + ndr->depth++; + if (r->in.hash) { + ndr_print_samr_Password(ndr, "hash", r->in.hash); + } + ndr->depth--; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "samr_SetDsrmPassword"); + ndr->depth++; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_samr_ValidatePassword(struct ndr_push *ndr, int flags, const struct samr_ValidatePassword *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_samr_ValidatePasswordLevel(ndr, NDR_SCALARS, r->in.level)); + NDR_CHECK(ndr_push_set_switch_value(ndr, &r->in.req, r->in.level)); + NDR_CHECK(ndr_push_samr_ValidatePasswordReq(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.req)); + } + if (flags & NDR_OUT) { + if (r->out.rep == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_set_switch_value(ndr, r->out.rep, r->in.level)); + NDR_CHECK(ndr_push_samr_ValidatePasswordRep(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.rep)); + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_ValidatePassword(struct ndr_pull *ndr, int flags, struct samr_ValidatePassword *r) +{ + TALLOC_CTX *_mem_save_rep_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + NDR_CHECK(ndr_pull_samr_ValidatePasswordLevel(ndr, NDR_SCALARS, &r->in.level)); + NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->in.req, r->in.level)); + NDR_CHECK(ndr_pull_samr_ValidatePasswordReq(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.req)); + NDR_PULL_ALLOC(ndr, r->out.rep); + ZERO_STRUCTP(r->out.rep); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.rep); + } + _mem_save_rep_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.rep, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_set_switch_value(ndr, r->out.rep, r->in.level)); + NDR_CHECK(ndr_pull_samr_ValidatePasswordRep(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.rep)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_rep_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_ValidatePassword(struct ndr_print *ndr, const char *name, int flags, const struct samr_ValidatePassword *r) +{ + ndr_print_struct(ndr, name, "samr_ValidatePassword"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "samr_ValidatePassword"); + ndr->depth++; + ndr_print_samr_ValidatePasswordLevel(ndr, "level", r->in.level); + ndr_print_set_switch_value(ndr, &r->in.req, r->in.level); + ndr_print_samr_ValidatePasswordReq(ndr, "req", &r->in.req); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "samr_ValidatePassword"); + ndr->depth++; + ndr_print_ptr(ndr, "rep", r->out.rep); + ndr->depth++; + ndr_print_set_switch_value(ndr, r->out.rep, r->in.level); + ndr_print_samr_ValidatePasswordRep(ndr, "rep", r->out.rep); + ndr->depth--; + ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static const struct ndr_interface_call samr_calls[] = { + { + "samr_Connect", + sizeof(struct samr_Connect), + (ndr_push_flags_fn_t) ndr_push_samr_Connect, + (ndr_pull_flags_fn_t) ndr_pull_samr_Connect, + (ndr_print_function_t) ndr_print_samr_Connect, + false, + }, + { + "samr_Close", + sizeof(struct samr_Close), + (ndr_push_flags_fn_t) ndr_push_samr_Close, + (ndr_pull_flags_fn_t) ndr_pull_samr_Close, + (ndr_print_function_t) ndr_print_samr_Close, + false, + }, + { + "samr_SetSecurity", + sizeof(struct samr_SetSecurity), + (ndr_push_flags_fn_t) ndr_push_samr_SetSecurity, + (ndr_pull_flags_fn_t) ndr_pull_samr_SetSecurity, + (ndr_print_function_t) ndr_print_samr_SetSecurity, + false, + }, + { + "samr_QuerySecurity", + sizeof(struct samr_QuerySecurity), + (ndr_push_flags_fn_t) ndr_push_samr_QuerySecurity, + (ndr_pull_flags_fn_t) ndr_pull_samr_QuerySecurity, + (ndr_print_function_t) ndr_print_samr_QuerySecurity, + false, + }, + { + "samr_Shutdown", + sizeof(struct samr_Shutdown), + (ndr_push_flags_fn_t) ndr_push_samr_Shutdown, + (ndr_pull_flags_fn_t) ndr_pull_samr_Shutdown, + (ndr_print_function_t) ndr_print_samr_Shutdown, + false, + }, + { + "samr_LookupDomain", + sizeof(struct samr_LookupDomain), + (ndr_push_flags_fn_t) ndr_push_samr_LookupDomain, + (ndr_pull_flags_fn_t) ndr_pull_samr_LookupDomain, + (ndr_print_function_t) ndr_print_samr_LookupDomain, + false, + }, + { + "samr_EnumDomains", + sizeof(struct samr_EnumDomains), + (ndr_push_flags_fn_t) ndr_push_samr_EnumDomains, + (ndr_pull_flags_fn_t) ndr_pull_samr_EnumDomains, + (ndr_print_function_t) ndr_print_samr_EnumDomains, + false, + }, + { + "samr_OpenDomain", + sizeof(struct samr_OpenDomain), + (ndr_push_flags_fn_t) ndr_push_samr_OpenDomain, + (ndr_pull_flags_fn_t) ndr_pull_samr_OpenDomain, + (ndr_print_function_t) ndr_print_samr_OpenDomain, + false, + }, + { + "samr_QueryDomainInfo", + sizeof(struct samr_QueryDomainInfo), + (ndr_push_flags_fn_t) ndr_push_samr_QueryDomainInfo, + (ndr_pull_flags_fn_t) ndr_pull_samr_QueryDomainInfo, + (ndr_print_function_t) ndr_print_samr_QueryDomainInfo, + false, + }, + { + "samr_SetDomainInfo", + sizeof(struct samr_SetDomainInfo), + (ndr_push_flags_fn_t) ndr_push_samr_SetDomainInfo, + (ndr_pull_flags_fn_t) ndr_pull_samr_SetDomainInfo, + (ndr_print_function_t) ndr_print_samr_SetDomainInfo, + false, + }, + { + "samr_CreateDomainGroup", + sizeof(struct samr_CreateDomainGroup), + (ndr_push_flags_fn_t) ndr_push_samr_CreateDomainGroup, + (ndr_pull_flags_fn_t) ndr_pull_samr_CreateDomainGroup, + (ndr_print_function_t) ndr_print_samr_CreateDomainGroup, + false, + }, + { + "samr_EnumDomainGroups", + sizeof(struct samr_EnumDomainGroups), + (ndr_push_flags_fn_t) ndr_push_samr_EnumDomainGroups, + (ndr_pull_flags_fn_t) ndr_pull_samr_EnumDomainGroups, + (ndr_print_function_t) ndr_print_samr_EnumDomainGroups, + false, + }, + { + "samr_CreateUser", + sizeof(struct samr_CreateUser), + (ndr_push_flags_fn_t) ndr_push_samr_CreateUser, + (ndr_pull_flags_fn_t) ndr_pull_samr_CreateUser, + (ndr_print_function_t) ndr_print_samr_CreateUser, + false, + }, + { + "samr_EnumDomainUsers", + sizeof(struct samr_EnumDomainUsers), + (ndr_push_flags_fn_t) ndr_push_samr_EnumDomainUsers, + (ndr_pull_flags_fn_t) ndr_pull_samr_EnumDomainUsers, + (ndr_print_function_t) ndr_print_samr_EnumDomainUsers, + false, + }, + { + "samr_CreateDomAlias", + sizeof(struct samr_CreateDomAlias), + (ndr_push_flags_fn_t) ndr_push_samr_CreateDomAlias, + (ndr_pull_flags_fn_t) ndr_pull_samr_CreateDomAlias, + (ndr_print_function_t) ndr_print_samr_CreateDomAlias, + false, + }, + { + "samr_EnumDomainAliases", + sizeof(struct samr_EnumDomainAliases), + (ndr_push_flags_fn_t) ndr_push_samr_EnumDomainAliases, + (ndr_pull_flags_fn_t) ndr_pull_samr_EnumDomainAliases, + (ndr_print_function_t) ndr_print_samr_EnumDomainAliases, + false, + }, + { + "samr_GetAliasMembership", + sizeof(struct samr_GetAliasMembership), + (ndr_push_flags_fn_t) ndr_push_samr_GetAliasMembership, + (ndr_pull_flags_fn_t) ndr_pull_samr_GetAliasMembership, + (ndr_print_function_t) ndr_print_samr_GetAliasMembership, + false, + }, + { + "samr_LookupNames", + sizeof(struct samr_LookupNames), + (ndr_push_flags_fn_t) ndr_push_samr_LookupNames, + (ndr_pull_flags_fn_t) ndr_pull_samr_LookupNames, + (ndr_print_function_t) ndr_print_samr_LookupNames, + false, + }, + { + "samr_LookupRids", + sizeof(struct samr_LookupRids), + (ndr_push_flags_fn_t) ndr_push_samr_LookupRids, + (ndr_pull_flags_fn_t) ndr_pull_samr_LookupRids, + (ndr_print_function_t) ndr_print_samr_LookupRids, + false, + }, + { + "samr_OpenGroup", + sizeof(struct samr_OpenGroup), + (ndr_push_flags_fn_t) ndr_push_samr_OpenGroup, + (ndr_pull_flags_fn_t) ndr_pull_samr_OpenGroup, + (ndr_print_function_t) ndr_print_samr_OpenGroup, + false, + }, + { + "samr_QueryGroupInfo", + sizeof(struct samr_QueryGroupInfo), + (ndr_push_flags_fn_t) ndr_push_samr_QueryGroupInfo, + (ndr_pull_flags_fn_t) ndr_pull_samr_QueryGroupInfo, + (ndr_print_function_t) ndr_print_samr_QueryGroupInfo, + false, + }, + { + "samr_SetGroupInfo", + sizeof(struct samr_SetGroupInfo), + (ndr_push_flags_fn_t) ndr_push_samr_SetGroupInfo, + (ndr_pull_flags_fn_t) ndr_pull_samr_SetGroupInfo, + (ndr_print_function_t) ndr_print_samr_SetGroupInfo, + false, + }, + { + "samr_AddGroupMember", + sizeof(struct samr_AddGroupMember), + (ndr_push_flags_fn_t) ndr_push_samr_AddGroupMember, + (ndr_pull_flags_fn_t) ndr_pull_samr_AddGroupMember, + (ndr_print_function_t) ndr_print_samr_AddGroupMember, + false, + }, + { + "samr_DeleteDomainGroup", + sizeof(struct samr_DeleteDomainGroup), + (ndr_push_flags_fn_t) ndr_push_samr_DeleteDomainGroup, + (ndr_pull_flags_fn_t) ndr_pull_samr_DeleteDomainGroup, + (ndr_print_function_t) ndr_print_samr_DeleteDomainGroup, + false, + }, + { + "samr_DeleteGroupMember", + sizeof(struct samr_DeleteGroupMember), + (ndr_push_flags_fn_t) ndr_push_samr_DeleteGroupMember, + (ndr_pull_flags_fn_t) ndr_pull_samr_DeleteGroupMember, + (ndr_print_function_t) ndr_print_samr_DeleteGroupMember, + false, + }, + { + "samr_QueryGroupMember", + sizeof(struct samr_QueryGroupMember), + (ndr_push_flags_fn_t) ndr_push_samr_QueryGroupMember, + (ndr_pull_flags_fn_t) ndr_pull_samr_QueryGroupMember, + (ndr_print_function_t) ndr_print_samr_QueryGroupMember, + false, + }, + { + "samr_SetMemberAttributesOfGroup", + sizeof(struct samr_SetMemberAttributesOfGroup), + (ndr_push_flags_fn_t) ndr_push_samr_SetMemberAttributesOfGroup, + (ndr_pull_flags_fn_t) ndr_pull_samr_SetMemberAttributesOfGroup, + (ndr_print_function_t) ndr_print_samr_SetMemberAttributesOfGroup, + false, + }, + { + "samr_OpenAlias", + sizeof(struct samr_OpenAlias), + (ndr_push_flags_fn_t) ndr_push_samr_OpenAlias, + (ndr_pull_flags_fn_t) ndr_pull_samr_OpenAlias, + (ndr_print_function_t) ndr_print_samr_OpenAlias, + false, + }, + { + "samr_QueryAliasInfo", + sizeof(struct samr_QueryAliasInfo), + (ndr_push_flags_fn_t) ndr_push_samr_QueryAliasInfo, + (ndr_pull_flags_fn_t) ndr_pull_samr_QueryAliasInfo, + (ndr_print_function_t) ndr_print_samr_QueryAliasInfo, + false, + }, + { + "samr_SetAliasInfo", + sizeof(struct samr_SetAliasInfo), + (ndr_push_flags_fn_t) ndr_push_samr_SetAliasInfo, + (ndr_pull_flags_fn_t) ndr_pull_samr_SetAliasInfo, + (ndr_print_function_t) ndr_print_samr_SetAliasInfo, + false, + }, + { + "samr_DeleteDomAlias", + sizeof(struct samr_DeleteDomAlias), + (ndr_push_flags_fn_t) ndr_push_samr_DeleteDomAlias, + (ndr_pull_flags_fn_t) ndr_pull_samr_DeleteDomAlias, + (ndr_print_function_t) ndr_print_samr_DeleteDomAlias, + false, + }, + { + "samr_AddAliasMember", + sizeof(struct samr_AddAliasMember), + (ndr_push_flags_fn_t) ndr_push_samr_AddAliasMember, + (ndr_pull_flags_fn_t) ndr_pull_samr_AddAliasMember, + (ndr_print_function_t) ndr_print_samr_AddAliasMember, + false, + }, + { + "samr_DeleteAliasMember", + sizeof(struct samr_DeleteAliasMember), + (ndr_push_flags_fn_t) ndr_push_samr_DeleteAliasMember, + (ndr_pull_flags_fn_t) ndr_pull_samr_DeleteAliasMember, + (ndr_print_function_t) ndr_print_samr_DeleteAliasMember, + false, + }, + { + "samr_GetMembersInAlias", + sizeof(struct samr_GetMembersInAlias), + (ndr_push_flags_fn_t) ndr_push_samr_GetMembersInAlias, + (ndr_pull_flags_fn_t) ndr_pull_samr_GetMembersInAlias, + (ndr_print_function_t) ndr_print_samr_GetMembersInAlias, + false, + }, + { + "samr_OpenUser", + sizeof(struct samr_OpenUser), + (ndr_push_flags_fn_t) ndr_push_samr_OpenUser, + (ndr_pull_flags_fn_t) ndr_pull_samr_OpenUser, + (ndr_print_function_t) ndr_print_samr_OpenUser, + false, + }, + { + "samr_DeleteUser", + sizeof(struct samr_DeleteUser), + (ndr_push_flags_fn_t) ndr_push_samr_DeleteUser, + (ndr_pull_flags_fn_t) ndr_pull_samr_DeleteUser, + (ndr_print_function_t) ndr_print_samr_DeleteUser, + false, + }, + { + "samr_QueryUserInfo", + sizeof(struct samr_QueryUserInfo), + (ndr_push_flags_fn_t) ndr_push_samr_QueryUserInfo, + (ndr_pull_flags_fn_t) ndr_pull_samr_QueryUserInfo, + (ndr_print_function_t) ndr_print_samr_QueryUserInfo, + false, + }, + { + "samr_SetUserInfo", + sizeof(struct samr_SetUserInfo), + (ndr_push_flags_fn_t) ndr_push_samr_SetUserInfo, + (ndr_pull_flags_fn_t) ndr_pull_samr_SetUserInfo, + (ndr_print_function_t) ndr_print_samr_SetUserInfo, + false, + }, + { + "samr_ChangePasswordUser", + sizeof(struct samr_ChangePasswordUser), + (ndr_push_flags_fn_t) ndr_push_samr_ChangePasswordUser, + (ndr_pull_flags_fn_t) ndr_pull_samr_ChangePasswordUser, + (ndr_print_function_t) ndr_print_samr_ChangePasswordUser, + false, + }, + { + "samr_GetGroupsForUser", + sizeof(struct samr_GetGroupsForUser), + (ndr_push_flags_fn_t) ndr_push_samr_GetGroupsForUser, + (ndr_pull_flags_fn_t) ndr_pull_samr_GetGroupsForUser, + (ndr_print_function_t) ndr_print_samr_GetGroupsForUser, + false, + }, + { + "samr_QueryDisplayInfo", + sizeof(struct samr_QueryDisplayInfo), + (ndr_push_flags_fn_t) ndr_push_samr_QueryDisplayInfo, + (ndr_pull_flags_fn_t) ndr_pull_samr_QueryDisplayInfo, + (ndr_print_function_t) ndr_print_samr_QueryDisplayInfo, + false, + }, + { + "samr_GetDisplayEnumerationIndex", + sizeof(struct samr_GetDisplayEnumerationIndex), + (ndr_push_flags_fn_t) ndr_push_samr_GetDisplayEnumerationIndex, + (ndr_pull_flags_fn_t) ndr_pull_samr_GetDisplayEnumerationIndex, + (ndr_print_function_t) ndr_print_samr_GetDisplayEnumerationIndex, + false, + }, + { + "samr_TestPrivateFunctionsDomain", + sizeof(struct samr_TestPrivateFunctionsDomain), + (ndr_push_flags_fn_t) ndr_push_samr_TestPrivateFunctionsDomain, + (ndr_pull_flags_fn_t) ndr_pull_samr_TestPrivateFunctionsDomain, + (ndr_print_function_t) ndr_print_samr_TestPrivateFunctionsDomain, + false, + }, + { + "samr_TestPrivateFunctionsUser", + sizeof(struct samr_TestPrivateFunctionsUser), + (ndr_push_flags_fn_t) ndr_push_samr_TestPrivateFunctionsUser, + (ndr_pull_flags_fn_t) ndr_pull_samr_TestPrivateFunctionsUser, + (ndr_print_function_t) ndr_print_samr_TestPrivateFunctionsUser, + false, + }, + { + "samr_GetUserPwInfo", + sizeof(struct samr_GetUserPwInfo), + (ndr_push_flags_fn_t) ndr_push_samr_GetUserPwInfo, + (ndr_pull_flags_fn_t) ndr_pull_samr_GetUserPwInfo, + (ndr_print_function_t) ndr_print_samr_GetUserPwInfo, + false, + }, + { + "samr_RemoveMemberFromForeignDomain", + sizeof(struct samr_RemoveMemberFromForeignDomain), + (ndr_push_flags_fn_t) ndr_push_samr_RemoveMemberFromForeignDomain, + (ndr_pull_flags_fn_t) ndr_pull_samr_RemoveMemberFromForeignDomain, + (ndr_print_function_t) ndr_print_samr_RemoveMemberFromForeignDomain, + false, + }, + { + "samr_QueryDomainInfo2", + sizeof(struct samr_QueryDomainInfo2), + (ndr_push_flags_fn_t) ndr_push_samr_QueryDomainInfo2, + (ndr_pull_flags_fn_t) ndr_pull_samr_QueryDomainInfo2, + (ndr_print_function_t) ndr_print_samr_QueryDomainInfo2, + false, + }, + { + "samr_QueryUserInfo2", + sizeof(struct samr_QueryUserInfo2), + (ndr_push_flags_fn_t) ndr_push_samr_QueryUserInfo2, + (ndr_pull_flags_fn_t) ndr_pull_samr_QueryUserInfo2, + (ndr_print_function_t) ndr_print_samr_QueryUserInfo2, + false, + }, + { + "samr_QueryDisplayInfo2", + sizeof(struct samr_QueryDisplayInfo2), + (ndr_push_flags_fn_t) ndr_push_samr_QueryDisplayInfo2, + (ndr_pull_flags_fn_t) ndr_pull_samr_QueryDisplayInfo2, + (ndr_print_function_t) ndr_print_samr_QueryDisplayInfo2, + false, + }, + { + "samr_GetDisplayEnumerationIndex2", + sizeof(struct samr_GetDisplayEnumerationIndex2), + (ndr_push_flags_fn_t) ndr_push_samr_GetDisplayEnumerationIndex2, + (ndr_pull_flags_fn_t) ndr_pull_samr_GetDisplayEnumerationIndex2, + (ndr_print_function_t) ndr_print_samr_GetDisplayEnumerationIndex2, + false, + }, + { + "samr_CreateUser2", + sizeof(struct samr_CreateUser2), + (ndr_push_flags_fn_t) ndr_push_samr_CreateUser2, + (ndr_pull_flags_fn_t) ndr_pull_samr_CreateUser2, + (ndr_print_function_t) ndr_print_samr_CreateUser2, + false, + }, + { + "samr_QueryDisplayInfo3", + sizeof(struct samr_QueryDisplayInfo3), + (ndr_push_flags_fn_t) ndr_push_samr_QueryDisplayInfo3, + (ndr_pull_flags_fn_t) ndr_pull_samr_QueryDisplayInfo3, + (ndr_print_function_t) ndr_print_samr_QueryDisplayInfo3, + false, + }, + { + "samr_AddMultipleMembersToAlias", + sizeof(struct samr_AddMultipleMembersToAlias), + (ndr_push_flags_fn_t) ndr_push_samr_AddMultipleMembersToAlias, + (ndr_pull_flags_fn_t) ndr_pull_samr_AddMultipleMembersToAlias, + (ndr_print_function_t) ndr_print_samr_AddMultipleMembersToAlias, + false, + }, + { + "samr_RemoveMultipleMembersFromAlias", + sizeof(struct samr_RemoveMultipleMembersFromAlias), + (ndr_push_flags_fn_t) ndr_push_samr_RemoveMultipleMembersFromAlias, + (ndr_pull_flags_fn_t) ndr_pull_samr_RemoveMultipleMembersFromAlias, + (ndr_print_function_t) ndr_print_samr_RemoveMultipleMembersFromAlias, + false, + }, + { + "samr_OemChangePasswordUser2", + sizeof(struct samr_OemChangePasswordUser2), + (ndr_push_flags_fn_t) ndr_push_samr_OemChangePasswordUser2, + (ndr_pull_flags_fn_t) ndr_pull_samr_OemChangePasswordUser2, + (ndr_print_function_t) ndr_print_samr_OemChangePasswordUser2, + false, + }, + { + "samr_ChangePasswordUser2", + sizeof(struct samr_ChangePasswordUser2), + (ndr_push_flags_fn_t) ndr_push_samr_ChangePasswordUser2, + (ndr_pull_flags_fn_t) ndr_pull_samr_ChangePasswordUser2, + (ndr_print_function_t) ndr_print_samr_ChangePasswordUser2, + false, + }, + { + "samr_GetDomPwInfo", + sizeof(struct samr_GetDomPwInfo), + (ndr_push_flags_fn_t) ndr_push_samr_GetDomPwInfo, + (ndr_pull_flags_fn_t) ndr_pull_samr_GetDomPwInfo, + (ndr_print_function_t) ndr_print_samr_GetDomPwInfo, + false, + }, + { + "samr_Connect2", + sizeof(struct samr_Connect2), + (ndr_push_flags_fn_t) ndr_push_samr_Connect2, + (ndr_pull_flags_fn_t) ndr_pull_samr_Connect2, + (ndr_print_function_t) ndr_print_samr_Connect2, + false, + }, + { + "samr_SetUserInfo2", + sizeof(struct samr_SetUserInfo2), + (ndr_push_flags_fn_t) ndr_push_samr_SetUserInfo2, + (ndr_pull_flags_fn_t) ndr_pull_samr_SetUserInfo2, + (ndr_print_function_t) ndr_print_samr_SetUserInfo2, + false, + }, + { + "samr_SetBootKeyInformation", + sizeof(struct samr_SetBootKeyInformation), + (ndr_push_flags_fn_t) ndr_push_samr_SetBootKeyInformation, + (ndr_pull_flags_fn_t) ndr_pull_samr_SetBootKeyInformation, + (ndr_print_function_t) ndr_print_samr_SetBootKeyInformation, + false, + }, + { + "samr_GetBootKeyInformation", + sizeof(struct samr_GetBootKeyInformation), + (ndr_push_flags_fn_t) ndr_push_samr_GetBootKeyInformation, + (ndr_pull_flags_fn_t) ndr_pull_samr_GetBootKeyInformation, + (ndr_print_function_t) ndr_print_samr_GetBootKeyInformation, + false, + }, + { + "samr_Connect3", + sizeof(struct samr_Connect3), + (ndr_push_flags_fn_t) ndr_push_samr_Connect3, + (ndr_pull_flags_fn_t) ndr_pull_samr_Connect3, + (ndr_print_function_t) ndr_print_samr_Connect3, + false, + }, + { + "samr_Connect4", + sizeof(struct samr_Connect4), + (ndr_push_flags_fn_t) ndr_push_samr_Connect4, + (ndr_pull_flags_fn_t) ndr_pull_samr_Connect4, + (ndr_print_function_t) ndr_print_samr_Connect4, + false, + }, + { + "samr_ChangePasswordUser3", + sizeof(struct samr_ChangePasswordUser3), + (ndr_push_flags_fn_t) ndr_push_samr_ChangePasswordUser3, + (ndr_pull_flags_fn_t) ndr_pull_samr_ChangePasswordUser3, + (ndr_print_function_t) ndr_print_samr_ChangePasswordUser3, + false, + }, + { + "samr_Connect5", + sizeof(struct samr_Connect5), + (ndr_push_flags_fn_t) ndr_push_samr_Connect5, + (ndr_pull_flags_fn_t) ndr_pull_samr_Connect5, + (ndr_print_function_t) ndr_print_samr_Connect5, + false, + }, + { + "samr_RidToSid", + sizeof(struct samr_RidToSid), + (ndr_push_flags_fn_t) ndr_push_samr_RidToSid, + (ndr_pull_flags_fn_t) ndr_pull_samr_RidToSid, + (ndr_print_function_t) ndr_print_samr_RidToSid, + false, + }, + { + "samr_SetDsrmPassword", + sizeof(struct samr_SetDsrmPassword), + (ndr_push_flags_fn_t) ndr_push_samr_SetDsrmPassword, + (ndr_pull_flags_fn_t) ndr_pull_samr_SetDsrmPassword, + (ndr_print_function_t) ndr_print_samr_SetDsrmPassword, + false, + }, + { + "samr_ValidatePassword", + sizeof(struct samr_ValidatePassword), + (ndr_push_flags_fn_t) ndr_push_samr_ValidatePassword, + (ndr_pull_flags_fn_t) ndr_pull_samr_ValidatePassword, + (ndr_print_function_t) ndr_print_samr_ValidatePassword, + false, + }, + { NULL, 0, NULL, NULL, NULL, false } +}; + +static const char * const samr_endpoint_strings[] = { + "ncacn_np:[\\pipe\\samr]", + "ncacn_ip_tcp:", + "ncalrpc:", +}; + +static const struct ndr_interface_string_array samr_endpoints = { + .count = 3, + .names = samr_endpoint_strings +}; + +static const char * const samr_authservice_strings[] = { + "host", +}; + +static const struct ndr_interface_string_array samr_authservices = { + .count = 3, + .names = samr_authservice_strings +}; + + +const struct ndr_interface_table ndr_table_samr = { + .name = "samr", + .syntax_id = { + {0x12345778,0x1234,0xabcd,{0xef,0x00},{0x01,0x23,0x45,0x67,0x89,0xac}}, + NDR_SAMR_VERSION + }, + .helpstring = NDR_SAMR_HELPSTRING, + .num_calls = 68, + .calls = samr_calls, + .endpoints = &samr_endpoints, + .authservices = &samr_authservices +}; + diff --git a/source3/librpc/gen_ndr/ndr_samr.h b/source3/librpc/gen_ndr/ndr_samr.h new file mode 100644 index 0000000000..96fd59b507 --- /dev/null +++ b/source3/librpc/gen_ndr/ndr_samr.h @@ -0,0 +1,340 @@ +/* header auto-generated by pidl */ + +#include "librpc/ndr/libndr.h" +#include "librpc/gen_ndr/samr.h" + +#ifndef _HEADER_NDR_samr +#define _HEADER_NDR_samr + +#define NDR_SAMR_UUID "12345778-1234-abcd-ef00-0123456789ac" +#define NDR_SAMR_VERSION 1.0 +#define NDR_SAMR_NAME "samr" +#define NDR_SAMR_HELPSTRING NULL +extern const struct ndr_interface_table ndr_table_samr; +#define NDR_SAMR_CONNECT (0x00) + +#define NDR_SAMR_CLOSE (0x01) + +#define NDR_SAMR_SETSECURITY (0x02) + +#define NDR_SAMR_QUERYSECURITY (0x03) + +#define NDR_SAMR_SHUTDOWN (0x04) + +#define NDR_SAMR_LOOKUPDOMAIN (0x05) + +#define NDR_SAMR_ENUMDOMAINS (0x06) + +#define NDR_SAMR_OPENDOMAIN (0x07) + +#define NDR_SAMR_QUERYDOMAININFO (0x08) + +#define NDR_SAMR_SETDOMAININFO (0x09) + +#define NDR_SAMR_CREATEDOMAINGROUP (0x0a) + +#define NDR_SAMR_ENUMDOMAINGROUPS (0x0b) + +#define NDR_SAMR_CREATEUSER (0x0c) + +#define NDR_SAMR_ENUMDOMAINUSERS (0x0d) + +#define NDR_SAMR_CREATEDOMALIAS (0x0e) + +#define NDR_SAMR_ENUMDOMAINALIASES (0x0f) + +#define NDR_SAMR_GETALIASMEMBERSHIP (0x10) + +#define NDR_SAMR_LOOKUPNAMES (0x11) + +#define NDR_SAMR_LOOKUPRIDS (0x12) + +#define NDR_SAMR_OPENGROUP (0x13) + +#define NDR_SAMR_QUERYGROUPINFO (0x14) + +#define NDR_SAMR_SETGROUPINFO (0x15) + +#define NDR_SAMR_ADDGROUPMEMBER (0x16) + +#define NDR_SAMR_DELETEDOMAINGROUP (0x17) + +#define NDR_SAMR_DELETEGROUPMEMBER (0x18) + +#define NDR_SAMR_QUERYGROUPMEMBER (0x19) + +#define NDR_SAMR_SETMEMBERATTRIBUTESOFGROUP (0x1a) + +#define NDR_SAMR_OPENALIAS (0x1b) + +#define NDR_SAMR_QUERYALIASINFO (0x1c) + +#define NDR_SAMR_SETALIASINFO (0x1d) + +#define NDR_SAMR_DELETEDOMALIAS (0x1e) + +#define NDR_SAMR_ADDALIASMEMBER (0x1f) + +#define NDR_SAMR_DELETEALIASMEMBER (0x20) + +#define NDR_SAMR_GETMEMBERSINALIAS (0x21) + +#define NDR_SAMR_OPENUSER (0x22) + +#define NDR_SAMR_DELETEUSER (0x23) + +#define NDR_SAMR_QUERYUSERINFO (0x24) + +#define NDR_SAMR_SETUSERINFO (0x25) + +#define NDR_SAMR_CHANGEPASSWORDUSER (0x26) + +#define NDR_SAMR_GETGROUPSFORUSER (0x27) + +#define NDR_SAMR_QUERYDISPLAYINFO (0x28) + +#define NDR_SAMR_GETDISPLAYENUMERATIONINDEX (0x29) + +#define NDR_SAMR_TESTPRIVATEFUNCTIONSDOMAIN (0x2a) + +#define NDR_SAMR_TESTPRIVATEFUNCTIONSUSER (0x2b) + +#define NDR_SAMR_GETUSERPWINFO (0x2c) + +#define NDR_SAMR_REMOVEMEMBERFROMFOREIGNDOMAIN (0x2d) + +#define NDR_SAMR_QUERYDOMAININFO2 (0x2e) + +#define NDR_SAMR_QUERYUSERINFO2 (0x2f) + +#define NDR_SAMR_QUERYDISPLAYINFO2 (0x30) + +#define NDR_SAMR_GETDISPLAYENUMERATIONINDEX2 (0x31) + +#define NDR_SAMR_CREATEUSER2 (0x32) + +#define NDR_SAMR_QUERYDISPLAYINFO3 (0x33) + +#define NDR_SAMR_ADDMULTIPLEMEMBERSTOALIAS (0x34) + +#define NDR_SAMR_REMOVEMULTIPLEMEMBERSFROMALIAS (0x35) + +#define NDR_SAMR_OEMCHANGEPASSWORDUSER2 (0x36) + +#define NDR_SAMR_CHANGEPASSWORDUSER2 (0x37) + +#define NDR_SAMR_GETDOMPWINFO (0x38) + +#define NDR_SAMR_CONNECT2 (0x39) + +#define NDR_SAMR_SETUSERINFO2 (0x3a) + +#define NDR_SAMR_SETBOOTKEYINFORMATION (0x3b) + +#define NDR_SAMR_GETBOOTKEYINFORMATION (0x3c) + +#define NDR_SAMR_CONNECT3 (0x3d) + +#define NDR_SAMR_CONNECT4 (0x3e) + +#define NDR_SAMR_CHANGEPASSWORDUSER3 (0x3f) + +#define NDR_SAMR_CONNECT5 (0x40) + +#define NDR_SAMR_RIDTOSID (0x41) + +#define NDR_SAMR_SETDSRMPASSWORD (0x42) + +#define NDR_SAMR_VALIDATEPASSWORD (0x43) + +#define NDR_SAMR_CALL_COUNT (68) +enum ndr_err_code ndr_push_samr_AcctFlags(struct ndr_push *ndr, int ndr_flags, uint32_t r); +enum ndr_err_code ndr_pull_samr_AcctFlags(struct ndr_pull *ndr, int ndr_flags, uint32_t *r); +void ndr_print_samr_AcctFlags(struct ndr_print *ndr, const char *name, uint32_t r); +void ndr_print_samr_ConnectAccessMask(struct ndr_print *ndr, const char *name, uint32_t r); +void ndr_print_samr_UserAccessMask(struct ndr_print *ndr, const char *name, uint32_t r); +void ndr_print_samr_DomainAccessMask(struct ndr_print *ndr, const char *name, uint32_t r); +void ndr_print_samr_GroupAccessMask(struct ndr_print *ndr, const char *name, uint32_t r); +void ndr_print_samr_AliasAccessMask(struct ndr_print *ndr, const char *name, uint32_t r); +void ndr_print_samr_SamEntry(struct ndr_print *ndr, const char *name, const struct samr_SamEntry *r); +void ndr_print_samr_SamArray(struct ndr_print *ndr, const char *name, const struct samr_SamArray *r); +void ndr_print_samr_Role(struct ndr_print *ndr, const char *name, enum samr_Role r); +enum ndr_err_code ndr_push_samr_PasswordProperties(struct ndr_push *ndr, int ndr_flags, uint32_t r); +enum ndr_err_code ndr_pull_samr_PasswordProperties(struct ndr_pull *ndr, int ndr_flags, uint32_t *r); +void ndr_print_samr_PasswordProperties(struct ndr_print *ndr, const char *name, uint32_t r); +void ndr_print_samr_DomInfo1(struct ndr_print *ndr, const char *name, const struct samr_DomInfo1 *r); +void ndr_print_samr_DomInfo2(struct ndr_print *ndr, const char *name, const struct samr_DomInfo2 *r); +void ndr_print_samr_DomInfo3(struct ndr_print *ndr, const char *name, const struct samr_DomInfo3 *r); +void ndr_print_samr_DomInfo4(struct ndr_print *ndr, const char *name, const struct samr_DomInfo4 *r); +void ndr_print_samr_DomInfo5(struct ndr_print *ndr, const char *name, const struct samr_DomInfo5 *r); +void ndr_print_samr_DomInfo6(struct ndr_print *ndr, const char *name, const struct samr_DomInfo6 *r); +void ndr_print_samr_DomInfo7(struct ndr_print *ndr, const char *name, const struct samr_DomInfo7 *r); +void ndr_print_samr_DomInfo8(struct ndr_print *ndr, const char *name, const struct samr_DomInfo8 *r); +void ndr_print_samr_DomInfo9(struct ndr_print *ndr, const char *name, const struct samr_DomInfo9 *r); +void ndr_print_samr_DomInfo11(struct ndr_print *ndr, const char *name, const struct samr_DomInfo11 *r); +void ndr_print_samr_DomInfo12(struct ndr_print *ndr, const char *name, const struct samr_DomInfo12 *r); +void ndr_print_samr_DomInfo13(struct ndr_print *ndr, const char *name, const struct samr_DomInfo13 *r); +void ndr_print_samr_DomainInfo(struct ndr_print *ndr, const char *name, const union samr_DomainInfo *r); +void ndr_print_samr_Ids(struct ndr_print *ndr, const char *name, const struct samr_Ids *r); +enum ndr_err_code ndr_push_samr_GroupAttrs(struct ndr_push *ndr, int ndr_flags, uint32_t r); +enum ndr_err_code ndr_pull_samr_GroupAttrs(struct ndr_pull *ndr, int ndr_flags, uint32_t *r); +void ndr_print_samr_GroupAttrs(struct ndr_print *ndr, const char *name, uint32_t r); +void ndr_print_samr_GroupInfoAll(struct ndr_print *ndr, const char *name, const struct samr_GroupInfoAll *r); +void ndr_print_samr_GroupInfoAttributes(struct ndr_print *ndr, const char *name, const struct samr_GroupInfoAttributes *r); +void ndr_print_samr_GroupInfoEnum(struct ndr_print *ndr, const char *name, enum samr_GroupInfoEnum r); +void ndr_print_samr_GroupInfo(struct ndr_print *ndr, const char *name, const union samr_GroupInfo *r); +void ndr_print_samr_RidTypeArray(struct ndr_print *ndr, const char *name, const struct samr_RidTypeArray *r); +void ndr_print_samr_AliasInfoAll(struct ndr_print *ndr, const char *name, const struct samr_AliasInfoAll *r); +void ndr_print_samr_AliasInfoEnum(struct ndr_print *ndr, const char *name, enum samr_AliasInfoEnum r); +void ndr_print_samr_AliasInfo(struct ndr_print *ndr, const char *name, const union samr_AliasInfo *r); +void ndr_print_samr_UserInfo1(struct ndr_print *ndr, const char *name, const struct samr_UserInfo1 *r); +void ndr_print_samr_UserInfo2(struct ndr_print *ndr, const char *name, const struct samr_UserInfo2 *r); +enum ndr_err_code ndr_push_samr_LogonHours(struct ndr_push *ndr, int ndr_flags, const struct samr_LogonHours *r); +enum ndr_err_code ndr_pull_samr_LogonHours(struct ndr_pull *ndr, int ndr_flags, struct samr_LogonHours *r); +void ndr_print_samr_LogonHours(struct ndr_print *ndr, const char *name, const struct samr_LogonHours *r); +void ndr_print_samr_UserInfo3(struct ndr_print *ndr, const char *name, const struct samr_UserInfo3 *r); +void ndr_print_samr_UserInfo4(struct ndr_print *ndr, const char *name, const struct samr_UserInfo4 *r); +void ndr_print_samr_UserInfo5(struct ndr_print *ndr, const char *name, const struct samr_UserInfo5 *r); +void ndr_print_samr_UserInfo6(struct ndr_print *ndr, const char *name, const struct samr_UserInfo6 *r); +void ndr_print_samr_UserInfo7(struct ndr_print *ndr, const char *name, const struct samr_UserInfo7 *r); +void ndr_print_samr_UserInfo8(struct ndr_print *ndr, const char *name, const struct samr_UserInfo8 *r); +void ndr_print_samr_UserInfo9(struct ndr_print *ndr, const char *name, const struct samr_UserInfo9 *r); +void ndr_print_samr_UserInfo10(struct ndr_print *ndr, const char *name, const struct samr_UserInfo10 *r); +void ndr_print_samr_UserInfo11(struct ndr_print *ndr, const char *name, const struct samr_UserInfo11 *r); +void ndr_print_samr_UserInfo12(struct ndr_print *ndr, const char *name, const struct samr_UserInfo12 *r); +void ndr_print_samr_UserInfo13(struct ndr_print *ndr, const char *name, const struct samr_UserInfo13 *r); +void ndr_print_samr_UserInfo14(struct ndr_print *ndr, const char *name, const struct samr_UserInfo14 *r); +void ndr_print_samr_UserInfo16(struct ndr_print *ndr, const char *name, const struct samr_UserInfo16 *r); +void ndr_print_samr_UserInfo17(struct ndr_print *ndr, const char *name, const struct samr_UserInfo17 *r); +void ndr_print_samr_UserInfo20(struct ndr_print *ndr, const char *name, const struct samr_UserInfo20 *r); +void ndr_print_samr_FieldsPresent(struct ndr_print *ndr, const char *name, uint32_t r); +void ndr_print_samr_UserInfo21(struct ndr_print *ndr, const char *name, const struct samr_UserInfo21 *r); +enum ndr_err_code ndr_push_samr_CryptPassword(struct ndr_push *ndr, int ndr_flags, const struct samr_CryptPassword *r); +enum ndr_err_code ndr_pull_samr_CryptPassword(struct ndr_pull *ndr, int ndr_flags, struct samr_CryptPassword *r); +void ndr_print_samr_CryptPassword(struct ndr_print *ndr, const char *name, const struct samr_CryptPassword *r); +void ndr_print_samr_UserInfo23(struct ndr_print *ndr, const char *name, const struct samr_UserInfo23 *r); +void ndr_print_samr_UserInfo24(struct ndr_print *ndr, const char *name, const struct samr_UserInfo24 *r); +void ndr_print_samr_CryptPasswordEx(struct ndr_print *ndr, const char *name, const struct samr_CryptPasswordEx *r); +void ndr_print_samr_UserInfo25(struct ndr_print *ndr, const char *name, const struct samr_UserInfo25 *r); +void ndr_print_samr_UserInfo26(struct ndr_print *ndr, const char *name, const struct samr_UserInfo26 *r); +void ndr_print_samr_UserInfo(struct ndr_print *ndr, const char *name, const union samr_UserInfo *r); +enum ndr_err_code ndr_push_samr_Password(struct ndr_push *ndr, int ndr_flags, const struct samr_Password *r); +enum ndr_err_code ndr_pull_samr_Password(struct ndr_pull *ndr, int ndr_flags, struct samr_Password *r); +void ndr_print_samr_Password(struct ndr_print *ndr, const char *name, const struct samr_Password *r); +enum ndr_err_code ndr_push_samr_RidWithAttribute(struct ndr_push *ndr, int ndr_flags, const struct samr_RidWithAttribute *r); +enum ndr_err_code ndr_pull_samr_RidWithAttribute(struct ndr_pull *ndr, int ndr_flags, struct samr_RidWithAttribute *r); +void ndr_print_samr_RidWithAttribute(struct ndr_print *ndr, const char *name, const struct samr_RidWithAttribute *r); +enum ndr_err_code ndr_push_samr_RidWithAttributeArray(struct ndr_push *ndr, int ndr_flags, const struct samr_RidWithAttributeArray *r); +enum ndr_err_code ndr_pull_samr_RidWithAttributeArray(struct ndr_pull *ndr, int ndr_flags, struct samr_RidWithAttributeArray *r); +void ndr_print_samr_RidWithAttributeArray(struct ndr_print *ndr, const char *name, const struct samr_RidWithAttributeArray *r); +void ndr_print_samr_DispEntryGeneral(struct ndr_print *ndr, const char *name, const struct samr_DispEntryGeneral *r); +void ndr_print_samr_DispInfoGeneral(struct ndr_print *ndr, const char *name, const struct samr_DispInfoGeneral *r); +void ndr_print_samr_DispEntryFull(struct ndr_print *ndr, const char *name, const struct samr_DispEntryFull *r); +void ndr_print_samr_DispInfoFull(struct ndr_print *ndr, const char *name, const struct samr_DispInfoFull *r); +void ndr_print_samr_DispEntryFullGroup(struct ndr_print *ndr, const char *name, const struct samr_DispEntryFullGroup *r); +void ndr_print_samr_DispInfoFullGroups(struct ndr_print *ndr, const char *name, const struct samr_DispInfoFullGroups *r); +void ndr_print_samr_DispEntryAscii(struct ndr_print *ndr, const char *name, const struct samr_DispEntryAscii *r); +void ndr_print_samr_DispInfoAscii(struct ndr_print *ndr, const char *name, const struct samr_DispInfoAscii *r); +void ndr_print_samr_DispInfo(struct ndr_print *ndr, const char *name, const union samr_DispInfo *r); +void ndr_print_samr_PwInfo(struct ndr_print *ndr, const char *name, const struct samr_PwInfo *r); +void ndr_print_samr_ChangeReject(struct ndr_print *ndr, const char *name, const struct samr_ChangeReject *r); +void ndr_print_samr_ConnectInfo1(struct ndr_print *ndr, const char *name, const struct samr_ConnectInfo1 *r); +void ndr_print_samr_ConnectInfo(struct ndr_print *ndr, const char *name, const union samr_ConnectInfo *r); +void ndr_print_samr_ValidateFieldsPresent(struct ndr_print *ndr, const char *name, uint32_t r); +void ndr_print_samr_ValidatePasswordLevel(struct ndr_print *ndr, const char *name, enum samr_ValidatePasswordLevel r); +void ndr_print_samr_ValidationStatus(struct ndr_print *ndr, const char *name, enum samr_ValidationStatus r); +void ndr_print_samr_ValidationBlob(struct ndr_print *ndr, const char *name, const struct samr_ValidationBlob *r); +void ndr_print_samr_ValidatePasswordInfo(struct ndr_print *ndr, const char *name, const struct samr_ValidatePasswordInfo *r); +void ndr_print_samr_ValidatePasswordRepCtr(struct ndr_print *ndr, const char *name, const struct samr_ValidatePasswordRepCtr *r); +void ndr_print_samr_ValidatePasswordRep(struct ndr_print *ndr, const char *name, const union samr_ValidatePasswordRep *r); +void ndr_print_samr_ValidatePasswordReq3(struct ndr_print *ndr, const char *name, const struct samr_ValidatePasswordReq3 *r); +void ndr_print_samr_ValidatePasswordReq2(struct ndr_print *ndr, const char *name, const struct samr_ValidatePasswordReq2 *r); +void ndr_print_samr_ValidatePasswordReq1(struct ndr_print *ndr, const char *name, const struct samr_ValidatePasswordReq1 *r); +void ndr_print_samr_ValidatePasswordReq(struct ndr_print *ndr, const char *name, const union samr_ValidatePasswordReq *r); +void ndr_print_samr_Connect(struct ndr_print *ndr, const char *name, int flags, const struct samr_Connect *r); +enum ndr_err_code ndr_push_samr_Close(struct ndr_push *ndr, int flags, const struct samr_Close *r); +enum ndr_err_code ndr_pull_samr_Close(struct ndr_pull *ndr, int flags, struct samr_Close *r); +void ndr_print_samr_Close(struct ndr_print *ndr, const char *name, int flags, const struct samr_Close *r); +void ndr_print_samr_SetSecurity(struct ndr_print *ndr, const char *name, int flags, const struct samr_SetSecurity *r); +void ndr_print_samr_QuerySecurity(struct ndr_print *ndr, const char *name, int flags, const struct samr_QuerySecurity *r); +void ndr_print_samr_Shutdown(struct ndr_print *ndr, const char *name, int flags, const struct samr_Shutdown *r); +void ndr_print_samr_LookupDomain(struct ndr_print *ndr, const char *name, int flags, const struct samr_LookupDomain *r); +void ndr_print_samr_EnumDomains(struct ndr_print *ndr, const char *name, int flags, const struct samr_EnumDomains *r); +enum ndr_err_code ndr_push_samr_OpenDomain(struct ndr_push *ndr, int flags, const struct samr_OpenDomain *r); +enum ndr_err_code ndr_pull_samr_OpenDomain(struct ndr_pull *ndr, int flags, struct samr_OpenDomain *r); +void ndr_print_samr_OpenDomain(struct ndr_print *ndr, const char *name, int flags, const struct samr_OpenDomain *r); +void ndr_print_samr_QueryDomainInfo(struct ndr_print *ndr, const char *name, int flags, const struct samr_QueryDomainInfo *r); +void ndr_print_samr_SetDomainInfo(struct ndr_print *ndr, const char *name, int flags, const struct samr_SetDomainInfo *r); +void ndr_print_samr_CreateDomainGroup(struct ndr_print *ndr, const char *name, int flags, const struct samr_CreateDomainGroup *r); +void ndr_print_samr_EnumDomainGroups(struct ndr_print *ndr, const char *name, int flags, const struct samr_EnumDomainGroups *r); +void ndr_print_samr_CreateUser(struct ndr_print *ndr, const char *name, int flags, const struct samr_CreateUser *r); +void ndr_print_samr_EnumDomainUsers(struct ndr_print *ndr, const char *name, int flags, const struct samr_EnumDomainUsers *r); +void ndr_print_samr_CreateDomAlias(struct ndr_print *ndr, const char *name, int flags, const struct samr_CreateDomAlias *r); +void ndr_print_samr_EnumDomainAliases(struct ndr_print *ndr, const char *name, int flags, const struct samr_EnumDomainAliases *r); +void ndr_print_samr_GetAliasMembership(struct ndr_print *ndr, const char *name, int flags, const struct samr_GetAliasMembership *r); +enum ndr_err_code ndr_push_samr_LookupNames(struct ndr_push *ndr, int flags, const struct samr_LookupNames *r); +enum ndr_err_code ndr_pull_samr_LookupNames(struct ndr_pull *ndr, int flags, struct samr_LookupNames *r); +void ndr_print_samr_LookupNames(struct ndr_print *ndr, const char *name, int flags, const struct samr_LookupNames *r); +void ndr_print_samr_LookupRids(struct ndr_print *ndr, const char *name, int flags, const struct samr_LookupRids *r); +void ndr_print_samr_OpenGroup(struct ndr_print *ndr, const char *name, int flags, const struct samr_OpenGroup *r); +void ndr_print_samr_QueryGroupInfo(struct ndr_print *ndr, const char *name, int flags, const struct samr_QueryGroupInfo *r); +void ndr_print_samr_SetGroupInfo(struct ndr_print *ndr, const char *name, int flags, const struct samr_SetGroupInfo *r); +void ndr_print_samr_AddGroupMember(struct ndr_print *ndr, const char *name, int flags, const struct samr_AddGroupMember *r); +void ndr_print_samr_DeleteDomainGroup(struct ndr_print *ndr, const char *name, int flags, const struct samr_DeleteDomainGroup *r); +void ndr_print_samr_DeleteGroupMember(struct ndr_print *ndr, const char *name, int flags, const struct samr_DeleteGroupMember *r); +void ndr_print_samr_QueryGroupMember(struct ndr_print *ndr, const char *name, int flags, const struct samr_QueryGroupMember *r); +void ndr_print_samr_SetMemberAttributesOfGroup(struct ndr_print *ndr, const char *name, int flags, const struct samr_SetMemberAttributesOfGroup *r); +void ndr_print_samr_OpenAlias(struct ndr_print *ndr, const char *name, int flags, const struct samr_OpenAlias *r); +void ndr_print_samr_QueryAliasInfo(struct ndr_print *ndr, const char *name, int flags, const struct samr_QueryAliasInfo *r); +void ndr_print_samr_SetAliasInfo(struct ndr_print *ndr, const char *name, int flags, const struct samr_SetAliasInfo *r); +void ndr_print_samr_DeleteDomAlias(struct ndr_print *ndr, const char *name, int flags, const struct samr_DeleteDomAlias *r); +void ndr_print_samr_AddAliasMember(struct ndr_print *ndr, const char *name, int flags, const struct samr_AddAliasMember *r); +void ndr_print_samr_DeleteAliasMember(struct ndr_print *ndr, const char *name, int flags, const struct samr_DeleteAliasMember *r); +void ndr_print_samr_GetMembersInAlias(struct ndr_print *ndr, const char *name, int flags, const struct samr_GetMembersInAlias *r); +enum ndr_err_code ndr_push_samr_OpenUser(struct ndr_push *ndr, int flags, const struct samr_OpenUser *r); +enum ndr_err_code ndr_pull_samr_OpenUser(struct ndr_pull *ndr, int flags, struct samr_OpenUser *r); +void ndr_print_samr_OpenUser(struct ndr_print *ndr, const char *name, int flags, const struct samr_OpenUser *r); +void ndr_print_samr_DeleteUser(struct ndr_print *ndr, const char *name, int flags, const struct samr_DeleteUser *r); +enum ndr_err_code ndr_push_samr_QueryUserInfo(struct ndr_push *ndr, int flags, const struct samr_QueryUserInfo *r); +enum ndr_err_code ndr_pull_samr_QueryUserInfo(struct ndr_pull *ndr, int flags, struct samr_QueryUserInfo *r); +void ndr_print_samr_QueryUserInfo(struct ndr_print *ndr, const char *name, int flags, const struct samr_QueryUserInfo *r); +enum ndr_err_code ndr_push_samr_SetUserInfo(struct ndr_push *ndr, int flags, const struct samr_SetUserInfo *r); +enum ndr_err_code ndr_pull_samr_SetUserInfo(struct ndr_pull *ndr, int flags, struct samr_SetUserInfo *r); +void ndr_print_samr_SetUserInfo(struct ndr_print *ndr, const char *name, int flags, const struct samr_SetUserInfo *r); +void ndr_print_samr_ChangePasswordUser(struct ndr_print *ndr, const char *name, int flags, const struct samr_ChangePasswordUser *r); +void ndr_print_samr_GetGroupsForUser(struct ndr_print *ndr, const char *name, int flags, const struct samr_GetGroupsForUser *r); +void ndr_print_samr_QueryDisplayInfo(struct ndr_print *ndr, const char *name, int flags, const struct samr_QueryDisplayInfo *r); +void ndr_print_samr_GetDisplayEnumerationIndex(struct ndr_print *ndr, const char *name, int flags, const struct samr_GetDisplayEnumerationIndex *r); +void ndr_print_samr_TestPrivateFunctionsDomain(struct ndr_print *ndr, const char *name, int flags, const struct samr_TestPrivateFunctionsDomain *r); +void ndr_print_samr_TestPrivateFunctionsUser(struct ndr_print *ndr, const char *name, int flags, const struct samr_TestPrivateFunctionsUser *r); +enum ndr_err_code ndr_push_samr_GetUserPwInfo(struct ndr_push *ndr, int flags, const struct samr_GetUserPwInfo *r); +enum ndr_err_code ndr_pull_samr_GetUserPwInfo(struct ndr_pull *ndr, int flags, struct samr_GetUserPwInfo *r); +void ndr_print_samr_GetUserPwInfo(struct ndr_print *ndr, const char *name, int flags, const struct samr_GetUserPwInfo *r); +void ndr_print_samr_RemoveMemberFromForeignDomain(struct ndr_print *ndr, const char *name, int flags, const struct samr_RemoveMemberFromForeignDomain *r); +void ndr_print_samr_QueryDomainInfo2(struct ndr_print *ndr, const char *name, int flags, const struct samr_QueryDomainInfo2 *r); +void ndr_print_samr_QueryUserInfo2(struct ndr_print *ndr, const char *name, int flags, const struct samr_QueryUserInfo2 *r); +void ndr_print_samr_QueryDisplayInfo2(struct ndr_print *ndr, const char *name, int flags, const struct samr_QueryDisplayInfo2 *r); +void ndr_print_samr_GetDisplayEnumerationIndex2(struct ndr_print *ndr, const char *name, int flags, const struct samr_GetDisplayEnumerationIndex2 *r); +void ndr_print_samr_CreateUser2(struct ndr_print *ndr, const char *name, int flags, const struct samr_CreateUser2 *r); +void ndr_print_samr_QueryDisplayInfo3(struct ndr_print *ndr, const char *name, int flags, const struct samr_QueryDisplayInfo3 *r); +void ndr_print_samr_AddMultipleMembersToAlias(struct ndr_print *ndr, const char *name, int flags, const struct samr_AddMultipleMembersToAlias *r); +void ndr_print_samr_RemoveMultipleMembersFromAlias(struct ndr_print *ndr, const char *name, int flags, const struct samr_RemoveMultipleMembersFromAlias *r); +void ndr_print_samr_OemChangePasswordUser2(struct ndr_print *ndr, const char *name, int flags, const struct samr_OemChangePasswordUser2 *r); +void ndr_print_samr_ChangePasswordUser2(struct ndr_print *ndr, const char *name, int flags, const struct samr_ChangePasswordUser2 *r); +void ndr_print_samr_GetDomPwInfo(struct ndr_print *ndr, const char *name, int flags, const struct samr_GetDomPwInfo *r); +void ndr_print_samr_Connect2(struct ndr_print *ndr, const char *name, int flags, const struct samr_Connect2 *r); +enum ndr_err_code ndr_push_samr_SetUserInfo2(struct ndr_push *ndr, int flags, const struct samr_SetUserInfo2 *r); +enum ndr_err_code ndr_pull_samr_SetUserInfo2(struct ndr_pull *ndr, int flags, struct samr_SetUserInfo2 *r); +void ndr_print_samr_SetUserInfo2(struct ndr_print *ndr, const char *name, int flags, const struct samr_SetUserInfo2 *r); +void ndr_print_samr_SetBootKeyInformation(struct ndr_print *ndr, const char *name, int flags, const struct samr_SetBootKeyInformation *r); +void ndr_print_samr_GetBootKeyInformation(struct ndr_print *ndr, const char *name, int flags, const struct samr_GetBootKeyInformation *r); +void ndr_print_samr_Connect3(struct ndr_print *ndr, const char *name, int flags, const struct samr_Connect3 *r); +void ndr_print_samr_Connect4(struct ndr_print *ndr, const char *name, int flags, const struct samr_Connect4 *r); +void ndr_print_samr_ChangePasswordUser3(struct ndr_print *ndr, const char *name, int flags, const struct samr_ChangePasswordUser3 *r); +enum ndr_err_code ndr_push_samr_Connect5(struct ndr_push *ndr, int flags, const struct samr_Connect5 *r); +enum ndr_err_code ndr_pull_samr_Connect5(struct ndr_pull *ndr, int flags, struct samr_Connect5 *r); +void ndr_print_samr_Connect5(struct ndr_print *ndr, const char *name, int flags, const struct samr_Connect5 *r); +void ndr_print_samr_RidToSid(struct ndr_print *ndr, const char *name, int flags, const struct samr_RidToSid *r); +void ndr_print_samr_SetDsrmPassword(struct ndr_print *ndr, const char *name, int flags, const struct samr_SetDsrmPassword *r); +void ndr_print_samr_ValidatePassword(struct ndr_print *ndr, const char *name, int flags, const struct samr_ValidatePassword *r); +#endif /* _HEADER_NDR_samr */ diff --git a/source3/librpc/gen_ndr/samr.h b/source3/librpc/gen_ndr/samr.h new file mode 100644 index 0000000000..a512a64380 --- /dev/null +++ b/source3/librpc/gen_ndr/samr.h @@ -0,0 +1,1754 @@ +/* header auto-generated by pidl */ + +#include <stdint.h> + +#include "librpc/gen_ndr/misc.h" +#include "librpc/gen_ndr/lsa.h" +#include "librpc/gen_ndr/security.h" +#ifndef _HEADER_samr +#define _HEADER_samr + +#define SAMR_ENUM_USERS_MULTIPLIER ( 54 ) +; + +/* bitmap samr_AcctFlags */ +#define ACB_DISABLED ( 0x00000001 ) +#define ACB_HOMDIRREQ ( 0x00000002 ) +#define ACB_PWNOTREQ ( 0x00000004 ) +#define ACB_TEMPDUP ( 0x00000008 ) +#define ACB_NORMAL ( 0x00000010 ) +#define ACB_MNS ( 0x00000020 ) +#define ACB_DOMTRUST ( 0x00000040 ) +#define ACB_WSTRUST ( 0x00000080 ) +#define ACB_SVRTRUST ( 0x00000100 ) +#define ACB_PWNOEXP ( 0x00000200 ) +#define ACB_AUTOLOCK ( 0x00000400 ) +#define ACB_ENC_TXT_PWD_ALLOWED ( 0x00000800 ) +#define ACB_SMARTCARD_REQUIRED ( 0x00001000 ) +#define ACB_TRUSTED_FOR_DELEGATION ( 0x00002000 ) +#define ACB_NOT_DELEGATED ( 0x00004000 ) +#define ACB_USE_DES_KEY_ONLY ( 0x00008000 ) +#define ACB_DONT_REQUIRE_PREAUTH ( 0x00010000 ) +#define ACB_PW_EXPIRED ( 0x00020000 ) +#define ACB_NO_AUTH_DATA_REQD ( 0x00080000 ) + +; + +/* bitmap samr_ConnectAccessMask */ +#define SAMR_ACCESS_CONNECT_TO_SERVER ( 0x00000001 ) +#define SAMR_ACCESS_SHUTDOWN_SERVER ( 0x00000002 ) +#define SAMR_ACCESS_INITIALIZE_SERVER ( 0x00000004 ) +#define SAMR_ACCESS_CREATE_DOMAIN ( 0x00000008 ) +#define SAMR_ACCESS_ENUM_DOMAINS ( 0x00000010 ) +#define SAMR_ACCESS_OPEN_DOMAIN ( 0x00000020 ) + +; + +/* bitmap samr_UserAccessMask */ +#define USER_ACCESS_GET_NAME_ETC ( 0x00000001 ) +#define USER_ACCESS_GET_LOCALE ( 0x00000002 ) +#define USER_ACCESS_SET_LOC_COM ( 0x00000004 ) +#define USER_ACCESS_GET_LOGONINFO ( 0x00000008 ) +#define USER_ACCESS_GET_ATTRIBUTES ( 0x00000010 ) +#define USER_ACCESS_SET_ATTRIBUTES ( 0x00000020 ) +#define USER_ACCESS_CHANGE_PASSWORD ( 0x00000040 ) +#define USER_ACCESS_SET_PASSWORD ( 0x00000080 ) +#define USER_ACCESS_GET_GROUPS ( 0x00000100 ) +#define USER_ACCESS_GET_GROUP_MEMBERSHIP ( 0x00000200 ) +#define USER_ACCESS_CHANGE_GROUP_MEMBERSHIP ( 0x00000400 ) + +; + +/* bitmap samr_DomainAccessMask */ +#define DOMAIN_ACCESS_LOOKUP_INFO_1 ( 0x00000001 ) +#define DOMAIN_ACCESS_SET_INFO_1 ( 0x00000002 ) +#define DOMAIN_ACCESS_LOOKUP_INFO_2 ( 0x00000004 ) +#define DOMAIN_ACCESS_SET_INFO_2 ( 0x00000008 ) +#define DOMAIN_ACCESS_CREATE_USER ( 0x00000010 ) +#define DOMAIN_ACCESS_CREATE_GROUP ( 0x00000020 ) +#define DOMAIN_ACCESS_CREATE_ALIAS ( 0x00000040 ) +#define DOMAIN_ACCESS_LOOKUP_ALIAS ( 0x00000080 ) +#define DOMAIN_ACCESS_ENUM_ACCOUNTS ( 0x00000100 ) +#define DOMAIN_ACCESS_OPEN_ACCOUNT ( 0x00000200 ) +#define DOMAIN_ACCESS_SET_INFO_3 ( 0x00000400 ) + +; + +/* bitmap samr_GroupAccessMask */ +#define GROUP_ACCESS_LOOKUP_INFO ( 0x00000001 ) +#define GROUP_ACCESS_SET_INFO ( 0x00000002 ) +#define GROUP_ACCESS_ADD_MEMBER ( 0x00000004 ) +#define GROUP_ACCESS_REMOVE_MEMBER ( 0x00000008 ) +#define GROUP_ACCESS_GET_MEMBERS ( 0x00000010 ) + +; + +/* bitmap samr_AliasAccessMask */ +#define ALIAS_ACCESS_ADD_MEMBER ( 0x00000001 ) +#define ALIAS_ACCESS_REMOVE_MEMBER ( 0x00000002 ) +#define ALIAS_ACCESS_GET_MEMBERS ( 0x00000004 ) +#define ALIAS_ACCESS_LOOKUP_INFO ( 0x00000008 ) +#define ALIAS_ACCESS_SET_INFO ( 0x00000010 ) + +; + +struct samr_SamEntry { + uint32_t idx; + struct lsa_String name; +}; + +struct samr_SamArray { + uint32_t count; + struct samr_SamEntry *entries;/* [unique,size_is(count)] */ +}; + +enum samr_Role +#ifndef USE_UINT_ENUMS + { + SAMR_ROLE_STANDALONE=0, + SAMR_ROLE_DOMAIN_MEMBER=1, + SAMR_ROLE_DOMAIN_BDC=2, + SAMR_ROLE_DOMAIN_PDC=3 +} +#else + { __donnot_use_enum_samr_Role=0x7FFFFFFF} +#define SAMR_ROLE_STANDALONE ( 0 ) +#define SAMR_ROLE_DOMAIN_MEMBER ( 1 ) +#define SAMR_ROLE_DOMAIN_BDC ( 2 ) +#define SAMR_ROLE_DOMAIN_PDC ( 3 ) +#endif +; + +/* bitmap samr_PasswordProperties */ +#define DOMAIN_PASSWORD_COMPLEX ( 0x00000001 ) +#define DOMAIN_PASSWORD_NO_ANON_CHANGE ( 0x00000002 ) +#define DOMAIN_PASSWORD_NO_CLEAR_CHANGE ( 0x00000004 ) +#define DOMAIN_PASSWORD_LOCKOUT_ADMINS ( 0x00000008 ) +#define DOMAIN_PASSWORD_STORE_CLEARTEXT ( 0x00000010 ) +#define DOMAIN_REFUSE_PASSWORD_CHANGE ( 0x00000020 ) + +; + +struct samr_DomInfo1 { + uint16_t min_password_length; + uint16_t password_history_length; + uint32_t password_properties; + int64_t max_password_age; + int64_t min_password_age; +}; + +struct samr_DomInfo2 { + NTTIME force_logoff_time; + struct lsa_String comment; + struct lsa_String domain_name; + struct lsa_String primary; + uint64_t sequence_num; + uint32_t unknown2; + enum samr_Role role; + uint32_t unknown3; + uint32_t num_users; + uint32_t num_groups; + uint32_t num_aliases; +}; + +struct samr_DomInfo3 { + NTTIME force_logoff_time; +}; + +struct samr_DomInfo4 { + struct lsa_String comment; +}; + +struct samr_DomInfo5 { + struct lsa_String domain_name; +}; + +struct samr_DomInfo6 { + struct lsa_String primary; +}; + +struct samr_DomInfo7 { + enum samr_Role role; +}; + +struct samr_DomInfo8 { + uint64_t sequence_num; + NTTIME domain_create_time; +}; + +struct samr_DomInfo9 { + uint32_t unknown; +}; + +struct samr_DomInfo11 { + struct samr_DomInfo2 info2; + uint64_t lockout_duration; + uint64_t lockout_window; + uint16_t lockout_threshold; +}; + +struct samr_DomInfo12 { + uint64_t lockout_duration; + uint64_t lockout_window; + uint16_t lockout_threshold; +}; + +struct samr_DomInfo13 { + uint64_t sequence_num; + NTTIME domain_create_time; + uint32_t unknown1; + uint32_t unknown2; +}; + +union samr_DomainInfo { + struct samr_DomInfo1 info1;/* [case] */ + struct samr_DomInfo2 info2;/* [case(2)] */ + struct samr_DomInfo3 info3;/* [case(3)] */ + struct samr_DomInfo4 info4;/* [case(4)] */ + struct samr_DomInfo5 info5;/* [case(5)] */ + struct samr_DomInfo6 info6;/* [case(6)] */ + struct samr_DomInfo7 info7;/* [case(7)] */ + struct samr_DomInfo8 info8;/* [case(8)] */ + struct samr_DomInfo9 info9;/* [case(9)] */ + struct samr_DomInfo11 info11;/* [case(11)] */ + struct samr_DomInfo12 info12;/* [case(12)] */ + struct samr_DomInfo13 info13;/* [case(13)] */ +}/* [switch_type(uint16)] */; + +struct samr_Ids { + uint32_t count;/* [range(0 1024)] */ + uint32_t *ids;/* [unique,size_is(count)] */ +}; + +/* bitmap samr_GroupAttrs */ +#define SE_GROUP_MANDATORY ( 0x00000001 ) +#define SE_GROUP_ENABLED_BY_DEFAULT ( 0x00000002 ) +#define SE_GROUP_ENABLED ( 0x00000004 ) +#define SE_GROUP_OWNER ( 0x00000008 ) +#define SE_GROUP_USE_FOR_DENY_ONLY ( 0x00000010 ) +#define SE_GROUP_RESOURCE ( 0x20000000 ) +#define SE_GROUP_LOGON_ID ( 0xC0000000 ) + +; + +struct samr_GroupInfoAll { + struct lsa_String name; + uint32_t attributes; + uint32_t num_members; + struct lsa_String description; +}; + +struct samr_GroupInfoAttributes { + uint32_t attributes; +}; + +struct samr_GroupInfoDescription { + struct lsa_String description; +}; + +enum samr_GroupInfoEnum +#ifndef USE_UINT_ENUMS + { + GROUPINFOALL=1, + GROUPINFONAME=2, + GROUPINFOATTRIBUTES=3, + GROUPINFODESCRIPTION=4, + GROUPINFOALL2=5 +} +#else + { __donnot_use_enum_samr_GroupInfoEnum=0x7FFFFFFF} +#define GROUPINFOALL ( 1 ) +#define GROUPINFONAME ( 2 ) +#define GROUPINFOATTRIBUTES ( 3 ) +#define GROUPINFODESCRIPTION ( 4 ) +#define GROUPINFOALL2 ( 5 ) +#endif +; + +union samr_GroupInfo { + struct samr_GroupInfoAll all;/* [case(GROUPINFOALL)] */ + struct lsa_String name;/* [case(GROUPINFONAME)] */ + struct samr_GroupInfoAttributes attributes;/* [case(GROUPINFOATTRIBUTES)] */ + struct lsa_String description;/* [case(GROUPINFODESCRIPTION)] */ + struct samr_GroupInfoAll all2;/* [case(GROUPINFOALL2)] */ +}/* [switch_type(samr_GroupInfoEnum)] */; + +struct samr_RidTypeArray { + uint32_t count; + uint32_t *rids;/* [unique,size_is(count)] */ + uint32_t *types;/* [unique,size_is(count)] */ +}; + +struct samr_AliasInfoAll { + struct lsa_String name; + uint32_t num_members; + struct lsa_String description; +}; + +enum samr_AliasInfoEnum +#ifndef USE_UINT_ENUMS + { + ALIASINFOALL=1, + ALIASINFONAME=2, + ALIASINFODESCRIPTION=3 +} +#else + { __donnot_use_enum_samr_AliasInfoEnum=0x7FFFFFFF} +#define ALIASINFOALL ( 1 ) +#define ALIASINFONAME ( 2 ) +#define ALIASINFODESCRIPTION ( 3 ) +#endif +; + +union samr_AliasInfo { + struct samr_AliasInfoAll all;/* [case(ALIASINFOALL)] */ + struct lsa_String name;/* [case(ALIASINFONAME)] */ + struct lsa_String description;/* [case(ALIASINFODESCRIPTION)] */ +}/* [switch_type(samr_AliasInfoEnum)] */; + +struct samr_UserInfo1 { + struct lsa_String account_name; + struct lsa_String full_name; + uint32_t primary_gid; + struct lsa_String description; + struct lsa_String comment; +}; + +struct samr_UserInfo2 { + struct lsa_String comment; + struct lsa_String unknown; + uint16_t country_code; + uint16_t code_page; +}; + +struct samr_LogonHours { + uint16_t units_per_week; + uint8_t *bits;/* [unique,length_is(units_per_week/8),size_is(1260)] */ +}/* [public,flag(LIBNDR_PRINT_ARRAY_HEX)] */; + +struct samr_UserInfo3 { + struct lsa_String account_name; + struct lsa_String full_name; + uint32_t rid; + uint32_t primary_gid; + struct lsa_String home_directory; + struct lsa_String home_drive; + struct lsa_String logon_script; + struct lsa_String profile_path; + struct lsa_String workstations; + NTTIME last_logon; + NTTIME last_logoff; + NTTIME last_password_change; + NTTIME allow_password_change; + NTTIME force_password_change; + struct samr_LogonHours logon_hours; + uint16_t bad_password_count; + uint16_t logon_count; + uint32_t acct_flags; +}; + +struct samr_UserInfo4 { + struct samr_LogonHours logon_hours; +}; + +struct samr_UserInfo5 { + struct lsa_String account_name; + struct lsa_String full_name; + uint32_t rid; + uint32_t primary_gid; + struct lsa_String home_directory; + struct lsa_String home_drive; + struct lsa_String logon_script; + struct lsa_String profile_path; + struct lsa_String description; + struct lsa_String workstations; + NTTIME last_logon; + NTTIME last_logoff; + struct samr_LogonHours logon_hours; + uint16_t bad_password_count; + uint16_t logon_count; + NTTIME last_password_change; + NTTIME acct_expiry; + uint32_t acct_flags; +}; + +struct samr_UserInfo6 { + struct lsa_String account_name; + struct lsa_String full_name; +}; + +struct samr_UserInfo7 { + struct lsa_String account_name; +}; + +struct samr_UserInfo8 { + struct lsa_String full_name; +}; + +struct samr_UserInfo9 { + uint32_t primary_gid; +}; + +struct samr_UserInfo10 { + struct lsa_String home_directory; + struct lsa_String home_drive; +}; + +struct samr_UserInfo11 { + struct lsa_String logon_script; +}; + +struct samr_UserInfo12 { + struct lsa_String profile_path; +}; + +struct samr_UserInfo13 { + struct lsa_String description; +}; + +struct samr_UserInfo14 { + struct lsa_String workstations; +}; + +struct samr_UserInfo16 { + uint32_t acct_flags; +}; + +struct samr_UserInfo17 { + NTTIME acct_expiry; +}; + +struct samr_UserInfo20 { + struct lsa_String parameters; +}; + +/* bitmap samr_FieldsPresent */ +#define SAMR_FIELD_ACCOUNT_NAME ( 0x00000001 ) +#define SAMR_FIELD_FULL_NAME ( 0x00000002 ) +#define SAMR_FIELD_RID ( 0x00000004 ) +#define SAMR_FIELD_PRIMARY_GID ( 0x00000008 ) +#define SAMR_FIELD_DESCRIPTION ( 0x00000010 ) +#define SAMR_FIELD_COMMENT ( 0x00000020 ) +#define SAMR_FIELD_HOME_DIRECTORY ( 0x00000040 ) +#define SAMR_FIELD_HOME_DRIVE ( 0x00000080 ) +#define SAMR_FIELD_LOGON_SCRIPT ( 0x00000100 ) +#define SAMR_FIELD_PROFILE_PATH ( 0x00000200 ) +#define SAMR_FIELD_WORKSTATIONS ( 0x00000400 ) +#define SAMR_FIELD_LAST_LOGON ( 0x00000800 ) +#define SAMR_FIELD_LAST_LOGOFF ( 0x00001000 ) +#define SAMR_FIELD_LOGON_HOURS ( 0x00002000 ) +#define SAMR_FIELD_BAD_PWD_COUNT ( 0x00004000 ) +#define SAMR_FIELD_NUM_LOGONS ( 0x00008000 ) +#define SAMR_FIELD_ALLOW_PWD_CHANGE ( 0x00010000 ) +#define SAMR_FIELD_FORCE_PWD_CHANGE ( 0x00020000 ) +#define SAMR_FIELD_LAST_PWD_CHANGE ( 0x00040000 ) +#define SAMR_FIELD_ACCT_EXPIRY ( 0x00080000 ) +#define SAMR_FIELD_ACCT_FLAGS ( 0x00100000 ) +#define SAMR_FIELD_PARAMETERS ( 0x00200000 ) +#define SAMR_FIELD_COUNTRY_CODE ( 0x00400000 ) +#define SAMR_FIELD_CODE_PAGE ( 0x00800000 ) +#define SAMR_FIELD_PASSWORD ( 0x01000000 ) +#define SAMR_FIELD_PASSWORD2 ( 0x02000000 ) +#define SAMR_FIELD_PRIVATE_DATA ( 0x04000000 ) +#define SAMR_FIELD_EXPIRED_FLAG ( 0x08000000 ) +#define SAMR_FIELD_SEC_DESC ( 0x10000000 ) +#define SAMR_FIELD_OWF_PWD ( 0x20000000 ) + +; + +struct samr_UserInfo21 { + NTTIME last_logon; + NTTIME last_logoff; + NTTIME last_password_change; + NTTIME acct_expiry; + NTTIME allow_password_change; + NTTIME force_password_change; + struct lsa_String account_name; + struct lsa_String full_name; + struct lsa_String home_directory; + struct lsa_String home_drive; + struct lsa_String logon_script; + struct lsa_String profile_path; + struct lsa_String description; + struct lsa_String workstations; + struct lsa_String comment; + struct lsa_String parameters; + struct lsa_String unknown1; + struct lsa_String unknown2; + struct lsa_String unknown3; + uint32_t buf_count; + uint8_t *buffer;/* [unique,size_is(buf_count)] */ + uint32_t rid; + uint32_t primary_gid; + uint32_t acct_flags; + uint32_t fields_present; + struct samr_LogonHours logon_hours; + uint16_t bad_password_count; + uint16_t logon_count; + uint16_t country_code; + uint16_t code_page; + uint8_t nt_password_set; + uint8_t lm_password_set; + uint8_t password_expired; + uint8_t unknown4; +}; + +struct samr_CryptPassword { + uint8_t data[516]; +}/* [public,flag(LIBNDR_PRINT_ARRAY_HEX)] */; + +struct samr_UserInfo23 { + struct samr_UserInfo21 info; + struct samr_CryptPassword password; +}; + +struct samr_UserInfo24 { + struct samr_CryptPassword password; + uint8_t pw_len; +}; + +struct samr_CryptPasswordEx { + uint8_t data[532]; +}/* [flag(LIBNDR_PRINT_ARRAY_HEX)] */; + +struct samr_UserInfo25 { + struct samr_UserInfo21 info; + struct samr_CryptPasswordEx password; +}; + +struct samr_UserInfo26 { + struct samr_CryptPasswordEx password; + uint8_t pw_len; +}; + +union samr_UserInfo { + struct samr_UserInfo1 info1;/* [case] */ + struct samr_UserInfo2 info2;/* [case(2)] */ + struct samr_UserInfo3 info3;/* [case(3)] */ + struct samr_UserInfo4 info4;/* [case(4)] */ + struct samr_UserInfo5 info5;/* [case(5)] */ + struct samr_UserInfo6 info6;/* [case(6)] */ + struct samr_UserInfo7 info7;/* [case(7)] */ + struct samr_UserInfo8 info8;/* [case(8)] */ + struct samr_UserInfo9 info9;/* [case(9)] */ + struct samr_UserInfo10 info10;/* [case(10)] */ + struct samr_UserInfo11 info11;/* [case(11)] */ + struct samr_UserInfo12 info12;/* [case(12)] */ + struct samr_UserInfo13 info13;/* [case(13)] */ + struct samr_UserInfo14 info14;/* [case(14)] */ + struct samr_UserInfo16 info16;/* [case(16)] */ + struct samr_UserInfo17 info17;/* [case(17)] */ + struct samr_UserInfo20 info20;/* [case(20)] */ + struct samr_UserInfo21 info21;/* [case(21)] */ + struct samr_UserInfo23 info23;/* [case(23)] */ + struct samr_UserInfo24 info24;/* [case(24)] */ + struct samr_UserInfo25 info25;/* [case(25)] */ + struct samr_UserInfo26 info26;/* [case(26)] */ +}/* [switch_type(uint16)] */; + +struct samr_Password { + uint8_t hash[16]; +}/* [public,flag(LIBNDR_PRINT_ARRAY_HEX)] */; + +struct samr_RidWithAttribute { + uint32_t rid; + uint32_t attributes; +}/* [public] */; + +struct samr_RidWithAttributeArray { + uint32_t count; + struct samr_RidWithAttribute *rids;/* [unique,size_is(count)] */ +}/* [public] */; + +struct samr_DispEntryGeneral { + uint32_t idx; + uint32_t rid; + uint32_t acct_flags; + struct lsa_String account_name; + struct lsa_String description; + struct lsa_String full_name; +}; + +struct samr_DispInfoGeneral { + uint32_t count; + struct samr_DispEntryGeneral *entries;/* [unique,size_is(count)] */ +}; + +struct samr_DispEntryFull { + uint32_t idx; + uint32_t rid; + uint32_t acct_flags; + struct lsa_String account_name; + struct lsa_String description; +}; + +struct samr_DispInfoFull { + uint32_t count; + struct samr_DispEntryFull *entries;/* [unique,size_is(count)] */ +}; + +struct samr_DispEntryFullGroup { + uint32_t idx; + uint32_t rid; + uint32_t acct_flags; + struct lsa_String account_name; + struct lsa_String description; +}; + +struct samr_DispInfoFullGroups { + uint32_t count; + struct samr_DispEntryFullGroup *entries;/* [unique,size_is(count)] */ +}; + +struct samr_DispEntryAscii { + uint32_t idx; + struct lsa_AsciiString account_name; +}; + +struct samr_DispInfoAscii { + uint32_t count; + struct samr_DispEntryAscii *entries;/* [unique,size_is(count)] */ +}; + +union samr_DispInfo { + struct samr_DispInfoGeneral info1;/* [case] */ + struct samr_DispInfoFull info2;/* [case(2)] */ + struct samr_DispInfoFullGroups info3;/* [case(3)] */ + struct samr_DispInfoAscii info4;/* [case(4)] */ + struct samr_DispInfoAscii info5;/* [case(5)] */ +}/* [switch_type(uint16)] */; + +struct samr_PwInfo { + uint16_t min_password_length; + uint32_t password_properties; +}; + +enum samr_RejectReason; + +struct samr_ChangeReject { + enum samr_RejectReason reason; + uint32_t unknown1; + uint32_t unknown2; +}; + +struct samr_ConnectInfo1 { + uint32_t unknown1; + uint32_t unknown2; +}; + +union samr_ConnectInfo { + struct samr_ConnectInfo1 info1;/* [case] */ +}; + +/* bitmap samr_ValidateFieldsPresent */ +#define SAMR_VALIDATE_FIELD_PASSWORD_LAST_SET ( 0x00000001 ) +#define SAMR_VALIDATE_FIELD_BAD_PASSWORD_TIME ( 0x00000002 ) +#define SAMR_VALIDATE_FIELD_LOCKOUT_TIME ( 0x00000004 ) +#define SAMR_VALIDATE_FIELD_BAD_PASSWORD_COUNT ( 0x00000008 ) +#define SAMR_VALIDATE_FIELD_PASSWORD_HISTORY_LENGTH ( 0x00000010 ) +#define SAMR_VALIDATE_FIELD_PASSWORD_HISTORY ( 0x00000020 ) + +; + +enum samr_ValidatePasswordLevel +#ifndef USE_UINT_ENUMS + { + NetValidateAuthentication=1, + NetValidatePasswordChange=2, + NetValidatePasswordReset=3 +} +#else + { __donnot_use_enum_samr_ValidatePasswordLevel=0x7FFFFFFF} +#define NetValidateAuthentication ( 1 ) +#define NetValidatePasswordChange ( 2 ) +#define NetValidatePasswordReset ( 3 ) +#endif +; + +enum samr_ValidationStatus +#ifndef USE_UINT_ENUMS + { + SAMR_VALIDATION_STATUS_SUCCESS=0, + SAMR_VALIDATION_STATUS_PASSWORD_MUST_CHANGE=1, + SAMR_VALIDATION_STATUS_ACCOUNT_LOCKED_OUT=2, + SAMR_VALIDATION_STATUS_BAD_PASSWORD=4, + SAMR_VALIDATION_STATUS_PWD_HISTORY_CONFLICT=5, + SAMR_VALIDATION_STATUS_PWD_TOO_SHORT=6, + SAMR_VALIDATION_STATUS_PWD_TOO_LONG=7, + SAMR_VALIDATION_STATUS_NOT_COMPLEX_ENOUGH=8, + SAMR_VALIDATION_STATUS_PASSWORD_TOO_RECENT=9 +} +#else + { __donnot_use_enum_samr_ValidationStatus=0x7FFFFFFF} +#define SAMR_VALIDATION_STATUS_SUCCESS ( 0 ) +#define SAMR_VALIDATION_STATUS_PASSWORD_MUST_CHANGE ( 1 ) +#define SAMR_VALIDATION_STATUS_ACCOUNT_LOCKED_OUT ( 2 ) +#define SAMR_VALIDATION_STATUS_BAD_PASSWORD ( 4 ) +#define SAMR_VALIDATION_STATUS_PWD_HISTORY_CONFLICT ( 5 ) +#define SAMR_VALIDATION_STATUS_PWD_TOO_SHORT ( 6 ) +#define SAMR_VALIDATION_STATUS_PWD_TOO_LONG ( 7 ) +#define SAMR_VALIDATION_STATUS_NOT_COMPLEX_ENOUGH ( 8 ) +#define SAMR_VALIDATION_STATUS_PASSWORD_TOO_RECENT ( 9 ) +#endif +; + +struct samr_ValidationBlob { + uint32_t length; + uint8_t *data;/* [unique,size_is(length)] */ +}; + +struct samr_ValidatePasswordInfo { + uint32_t fields_present; + NTTIME last_password_change; + NTTIME bad_password_time; + NTTIME lockout_time; + uint32_t bad_pwd_count; + uint32_t pwd_history_len; + struct samr_ValidationBlob *pwd_history;/* [unique,size_is(pwd_history_len)] */ +}; + +struct samr_ValidatePasswordRepCtr { + struct samr_ValidatePasswordInfo info; + enum samr_ValidationStatus status; +}; + +union samr_ValidatePasswordRep { + struct samr_ValidatePasswordRepCtr ctr1;/* [case] */ + struct samr_ValidatePasswordRepCtr ctr2;/* [case(2)] */ + struct samr_ValidatePasswordRepCtr ctr3;/* [case(3)] */ +}/* [switch_type(uint16)] */; + +struct samr_ValidatePasswordReq3 { + struct samr_ValidatePasswordInfo info; + struct lsa_StringLarge password; + struct lsa_StringLarge account; + struct samr_ValidationBlob hash; + uint8_t pwd_must_change_at_next_logon; + uint8_t clear_lockout; +}; + +struct samr_ValidatePasswordReq2 { + struct samr_ValidatePasswordInfo info; + struct lsa_StringLarge password; + struct lsa_StringLarge account; + struct samr_ValidationBlob hash; + uint8_t password_matched; +}; + +struct samr_ValidatePasswordReq1 { + struct samr_ValidatePasswordInfo info; + uint8_t password_matched; +}; + +union samr_ValidatePasswordReq { + struct samr_ValidatePasswordReq1 req1;/* [case] */ + struct samr_ValidatePasswordReq2 req2;/* [case(2)] */ + struct samr_ValidatePasswordReq3 req3;/* [case(3)] */ +}/* [switch_type(uint16)] */; + + +struct samr_Connect { + struct { + uint16_t *system_name;/* [unique] */ + uint32_t access_mask; + } in; + + struct { + struct policy_handle *connect_handle;/* [ref] */ + NTSTATUS result; + } out; + +}; + + +struct samr_Close { + struct { + struct policy_handle *handle;/* [ref] */ + } in; + + struct { + struct policy_handle *handle;/* [ref] */ + NTSTATUS result; + } out; + +}; + + +struct samr_SetSecurity { + struct { + struct policy_handle *handle;/* [ref] */ + uint32_t sec_info; + struct sec_desc_buf *sdbuf;/* [ref] */ + } in; + + struct { + NTSTATUS result; + } out; + +}; + + +struct samr_QuerySecurity { + struct { + struct policy_handle *handle;/* [ref] */ + uint32_t sec_info; + } in; + + struct { + struct sec_desc_buf *sdbuf;/* [ref] */ + NTSTATUS result; + } out; + +}; + + +struct samr_Shutdown { + struct { + struct policy_handle *connect_handle;/* [ref] */ + } in; + + struct { + NTSTATUS result; + } out; + +}; + + +struct samr_LookupDomain { + struct { + struct policy_handle *connect_handle;/* [ref] */ + struct lsa_String *domain_name;/* [ref] */ + } in; + + struct { + struct dom_sid2 *sid;/* [ref] */ + NTSTATUS result; + } out; + +}; + + +struct samr_EnumDomains { + struct { + struct policy_handle *connect_handle;/* [ref] */ + uint32_t buf_size; + uint32_t *resume_handle;/* [ref] */ + } in; + + struct { + struct samr_SamArray *sam;/* [ref] */ + uint32_t *num_entries;/* [ref] */ + uint32_t *resume_handle;/* [ref] */ + NTSTATUS result; + } out; + +}; + + +struct samr_OpenDomain { + struct { + struct policy_handle *connect_handle;/* [ref] */ + uint32_t access_mask; + struct dom_sid2 *sid;/* [ref] */ + } in; + + struct { + struct policy_handle *domain_handle;/* [ref] */ + NTSTATUS result; + } out; + +}; + + +struct samr_QueryDomainInfo { + struct { + struct policy_handle *domain_handle;/* [ref] */ + uint16_t level; + } in; + + struct { + union samr_DomainInfo *info;/* [ref,switch_is(level)] */ + NTSTATUS result; + } out; + +}; + + +struct samr_SetDomainInfo { + struct { + struct policy_handle *domain_handle;/* [ref] */ + uint16_t level; + union samr_DomainInfo *info;/* [ref,switch_is(level)] */ + } in; + + struct { + NTSTATUS result; + } out; + +}; + + +struct samr_CreateDomainGroup { + struct { + struct policy_handle *domain_handle;/* [ref] */ + struct lsa_String *name;/* [ref] */ + uint32_t access_mask; + } in; + + struct { + struct policy_handle *group_handle;/* [ref] */ + uint32_t *rid;/* [ref] */ + NTSTATUS result; + } out; + +}; + + +struct samr_EnumDomainGroups { + struct { + struct policy_handle *domain_handle;/* [ref] */ + uint32_t max_size; + uint32_t *resume_handle;/* [ref] */ + } in; + + struct { + struct samr_SamArray *sam;/* [ref] */ + uint32_t *num_entries;/* [ref] */ + uint32_t *resume_handle;/* [ref] */ + NTSTATUS result; + } out; + +}; + + +struct samr_CreateUser { + struct { + struct policy_handle *domain_handle;/* [ref] */ + struct lsa_String *account_name;/* [ref] */ + uint32_t access_mask; + } in; + + struct { + struct policy_handle *user_handle;/* [ref] */ + uint32_t *rid;/* [ref] */ + NTSTATUS result; + } out; + +}; + + +struct samr_EnumDomainUsers { + struct { + struct policy_handle *domain_handle;/* [ref] */ + uint32_t acct_flags; + uint32_t max_size; + uint32_t *resume_handle;/* [ref] */ + } in; + + struct { + struct samr_SamArray *sam;/* [ref] */ + uint32_t *num_entries;/* [ref] */ + uint32_t *resume_handle;/* [ref] */ + NTSTATUS result; + } out; + +}; + + +struct samr_CreateDomAlias { + struct { + struct policy_handle *domain_handle;/* [ref] */ + struct lsa_String *alias_name;/* [ref] */ + uint32_t access_mask; + } in; + + struct { + struct policy_handle *alias_handle;/* [ref] */ + uint32_t *rid;/* [ref] */ + NTSTATUS result; + } out; + +}; + + +struct samr_EnumDomainAliases { + struct { + struct policy_handle *domain_handle;/* [ref] */ + uint32_t acct_flags; + uint32_t *resume_handle;/* [ref] */ + } in; + + struct { + struct samr_SamArray *sam;/* [ref] */ + uint32_t *num_entries;/* [ref] */ + uint32_t *resume_handle;/* [ref] */ + NTSTATUS result; + } out; + +}; + + +struct samr_GetAliasMembership { + struct { + struct policy_handle *domain_handle;/* [ref] */ + struct lsa_SidArray *sids;/* [ref] */ + } in; + + struct { + struct samr_Ids *rids;/* [ref] */ + NTSTATUS result; + } out; + +}; + + +struct samr_LookupNames { + struct { + struct policy_handle *domain_handle;/* [ref] */ + uint32_t num_names;/* [range(0 1000)] */ + struct lsa_String *names;/* [length_is(num_names),size_is(1000)] */ + } in; + + struct { + struct samr_Ids *rids;/* [ref] */ + struct samr_Ids *types;/* [ref] */ + NTSTATUS result; + } out; + +}; + + +struct samr_LookupRids { + struct { + struct policy_handle *domain_handle;/* [ref] */ + uint32_t num_rids;/* [range(0 1000)] */ + uint32_t *rids;/* [length_is(num_rids),size_is(1000)] */ + } in; + + struct { + struct lsa_Strings *names;/* [ref] */ + struct samr_Ids *types;/* [ref] */ + NTSTATUS result; + } out; + +}; + + +struct samr_OpenGroup { + struct { + struct policy_handle *domain_handle;/* [ref] */ + uint32_t access_mask; + uint32_t rid; + } in; + + struct { + struct policy_handle *group_handle;/* [ref] */ + NTSTATUS result; + } out; + +}; + + +struct samr_QueryGroupInfo { + struct { + struct policy_handle *group_handle;/* [ref] */ + enum samr_GroupInfoEnum level; + } in; + + struct { + union samr_GroupInfo *info;/* [ref,switch_is(level)] */ + NTSTATUS result; + } out; + +}; + + +struct samr_SetGroupInfo { + struct { + struct policy_handle *group_handle;/* [ref] */ + enum samr_GroupInfoEnum level; + union samr_GroupInfo *info;/* [ref,switch_is(level)] */ + } in; + + struct { + NTSTATUS result; + } out; + +}; + + +struct samr_AddGroupMember { + struct { + struct policy_handle *group_handle;/* [ref] */ + uint32_t rid; + uint32_t flags; + } in; + + struct { + NTSTATUS result; + } out; + +}; + + +struct samr_DeleteDomainGroup { + struct { + struct policy_handle *group_handle;/* [ref] */ + } in; + + struct { + struct policy_handle *group_handle;/* [ref] */ + NTSTATUS result; + } out; + +}; + + +struct samr_DeleteGroupMember { + struct { + struct policy_handle *group_handle;/* [ref] */ + uint32_t rid; + } in; + + struct { + NTSTATUS result; + } out; + +}; + + +struct samr_QueryGroupMember { + struct { + struct policy_handle *group_handle;/* [ref] */ + } in; + + struct { + struct samr_RidTypeArray *rids;/* [ref] */ + NTSTATUS result; + } out; + +}; + + +struct samr_SetMemberAttributesOfGroup { + struct { + struct policy_handle *group_handle;/* [ref] */ + uint32_t unknown1; + uint32_t unknown2; + } in; + + struct { + NTSTATUS result; + } out; + +}; + + +struct samr_OpenAlias { + struct { + struct policy_handle *domain_handle;/* [ref] */ + uint32_t access_mask; + uint32_t rid; + } in; + + struct { + struct policy_handle *alias_handle;/* [ref] */ + NTSTATUS result; + } out; + +}; + + +struct samr_QueryAliasInfo { + struct { + struct policy_handle *alias_handle;/* [ref] */ + enum samr_AliasInfoEnum level; + } in; + + struct { + union samr_AliasInfo *info;/* [ref,switch_is(level)] */ + NTSTATUS result; + } out; + +}; + + +struct samr_SetAliasInfo { + struct { + struct policy_handle *alias_handle;/* [ref] */ + enum samr_AliasInfoEnum level; + union samr_AliasInfo *info;/* [ref,switch_is(level)] */ + } in; + + struct { + NTSTATUS result; + } out; + +}; + + +struct samr_DeleteDomAlias { + struct { + struct policy_handle *alias_handle;/* [ref] */ + } in; + + struct { + struct policy_handle *alias_handle;/* [ref] */ + NTSTATUS result; + } out; + +}; + + +struct samr_AddAliasMember { + struct { + struct policy_handle *alias_handle;/* [ref] */ + struct dom_sid2 *sid;/* [ref] */ + } in; + + struct { + NTSTATUS result; + } out; + +}; + + +struct samr_DeleteAliasMember { + struct { + struct policy_handle *alias_handle;/* [ref] */ + struct dom_sid2 *sid;/* [ref] */ + } in; + + struct { + NTSTATUS result; + } out; + +}; + + +struct samr_GetMembersInAlias { + struct { + struct policy_handle *alias_handle;/* [ref] */ + } in; + + struct { + struct lsa_SidArray *sids;/* [ref] */ + NTSTATUS result; + } out; + +}; + + +struct samr_OpenUser { + struct { + struct policy_handle *domain_handle;/* [ref] */ + uint32_t access_mask; + uint32_t rid; + } in; + + struct { + struct policy_handle *user_handle;/* [ref] */ + NTSTATUS result; + } out; + +}; + + +struct samr_DeleteUser { + struct { + struct policy_handle *user_handle;/* [ref] */ + } in; + + struct { + struct policy_handle *user_handle;/* [ref] */ + NTSTATUS result; + } out; + +}; + + +struct samr_QueryUserInfo { + struct { + struct policy_handle *user_handle;/* [ref] */ + uint16_t level; + } in; + + struct { + union samr_UserInfo *info;/* [ref,switch_is(level)] */ + NTSTATUS result; + } out; + +}; + + +struct samr_SetUserInfo { + struct { + struct policy_handle *user_handle;/* [ref] */ + uint16_t level; + union samr_UserInfo *info;/* [ref,switch_is(level)] */ + } in; + + struct { + NTSTATUS result; + } out; + +}; + + +struct samr_ChangePasswordUser { + struct { + struct policy_handle *user_handle;/* [ref] */ + uint8_t lm_present; + struct samr_Password *old_lm_crypted;/* [unique] */ + struct samr_Password *new_lm_crypted;/* [unique] */ + uint8_t nt_present; + struct samr_Password *old_nt_crypted;/* [unique] */ + struct samr_Password *new_nt_crypted;/* [unique] */ + uint8_t cross1_present; + struct samr_Password *nt_cross;/* [unique] */ + uint8_t cross2_present; + struct samr_Password *lm_cross;/* [unique] */ + } in; + + struct { + NTSTATUS result; + } out; + +}; + + +struct samr_GetGroupsForUser { + struct { + struct policy_handle *user_handle;/* [ref] */ + } in; + + struct { + struct samr_RidWithAttributeArray *rids;/* [ref] */ + NTSTATUS result; + } out; + +}; + + +struct samr_QueryDisplayInfo { + struct { + struct policy_handle *domain_handle;/* [ref] */ + uint16_t level; + uint32_t start_idx; + uint32_t max_entries; + uint32_t buf_size; + } in; + + struct { + uint32_t *total_size;/* [ref] */ + uint32_t *returned_size;/* [ref] */ + union samr_DispInfo *info;/* [ref,switch_is(level)] */ + NTSTATUS result; + } out; + +}; + + +struct samr_GetDisplayEnumerationIndex { + struct { + struct policy_handle *domain_handle;/* [ref] */ + uint16_t level; + struct lsa_String name; + } in; + + struct { + uint32_t *idx;/* [ref] */ + NTSTATUS result; + } out; + +}; + + +struct samr_TestPrivateFunctionsDomain { + struct { + struct policy_handle *domain_handle;/* [ref] */ + } in; + + struct { + NTSTATUS result; + } out; + +}; + + +struct samr_TestPrivateFunctionsUser { + struct { + struct policy_handle *user_handle;/* [ref] */ + } in; + + struct { + NTSTATUS result; + } out; + +}; + + +struct samr_GetUserPwInfo { + struct { + struct policy_handle *user_handle;/* [ref] */ + } in; + + struct { + struct samr_PwInfo *info;/* [ref] */ + NTSTATUS result; + } out; + +}; + + +struct samr_RemoveMemberFromForeignDomain { + struct { + struct policy_handle *domain_handle;/* [ref] */ + struct dom_sid2 *sid;/* [ref] */ + } in; + + struct { + NTSTATUS result; + } out; + +}; + + +struct samr_QueryDomainInfo2 { + struct { + struct policy_handle *domain_handle;/* [ref] */ + uint16_t level; + } in; + + struct { + union samr_DomainInfo *info;/* [ref,switch_is(level)] */ + NTSTATUS result; + } out; + +}; + + +struct samr_QueryUserInfo2 { + struct { + struct policy_handle *user_handle;/* [ref] */ + uint16_t level; + } in; + + struct { + union samr_UserInfo *info;/* [ref,switch_is(level)] */ + NTSTATUS result; + } out; + +}; + + +struct samr_QueryDisplayInfo2 { + struct { + struct policy_handle *domain_handle;/* [ref] */ + uint16_t level; + uint32_t start_idx; + uint32_t max_entries; + uint32_t buf_size; + } in; + + struct { + uint32_t *total_size;/* [ref] */ + uint32_t *returned_size;/* [ref] */ + union samr_DispInfo *info;/* [ref,switch_is(level)] */ + NTSTATUS result; + } out; + +}; + + +struct samr_GetDisplayEnumerationIndex2 { + struct { + struct policy_handle *domain_handle;/* [ref] */ + uint16_t level; + struct lsa_String name; + } in; + + struct { + uint32_t *idx;/* [ref] */ + NTSTATUS result; + } out; + +}; + + +struct samr_CreateUser2 { + struct { + struct policy_handle *domain_handle;/* [ref] */ + struct lsa_String *account_name;/* [ref] */ + uint32_t acct_flags; + uint32_t access_mask; + } in; + + struct { + struct policy_handle *user_handle;/* [ref] */ + uint32_t *access_granted;/* [ref] */ + uint32_t *rid;/* [ref] */ + NTSTATUS result; + } out; + +}; + + +struct samr_QueryDisplayInfo3 { + struct { + struct policy_handle *domain_handle;/* [ref] */ + uint16_t level; + uint32_t start_idx; + uint32_t max_entries; + uint32_t buf_size; + } in; + + struct { + uint32_t *total_size;/* [ref] */ + uint32_t *returned_size;/* [ref] */ + union samr_DispInfo *info;/* [ref,switch_is(level)] */ + NTSTATUS result; + } out; + +}; + + +struct samr_AddMultipleMembersToAlias { + struct { + struct policy_handle *alias_handle;/* [ref] */ + struct lsa_SidArray *sids;/* [ref] */ + } in; + + struct { + NTSTATUS result; + } out; + +}; + + +struct samr_RemoveMultipleMembersFromAlias { + struct { + struct policy_handle *alias_handle;/* [ref] */ + struct lsa_SidArray *sids;/* [ref] */ + } in; + + struct { + NTSTATUS result; + } out; + +}; + + +struct samr_OemChangePasswordUser2 { + struct { + struct lsa_AsciiString *server;/* [unique] */ + struct lsa_AsciiString *account;/* [ref] */ + struct samr_CryptPassword *password;/* [unique] */ + struct samr_Password *hash;/* [unique] */ + } in; + + struct { + NTSTATUS result; + } out; + +}; + + +struct samr_ChangePasswordUser2 { + struct { + struct lsa_String *server;/* [unique] */ + struct lsa_String *account;/* [ref] */ + struct samr_CryptPassword *nt_password;/* [unique] */ + struct samr_Password *nt_verifier;/* [unique] */ + uint8_t lm_change; + struct samr_CryptPassword *lm_password;/* [unique] */ + struct samr_Password *lm_verifier;/* [unique] */ + } in; + + struct { + NTSTATUS result; + } out; + +}; + + +struct samr_GetDomPwInfo { + struct { + struct lsa_String *domain_name;/* [unique] */ + } in; + + struct { + struct samr_PwInfo *info;/* [ref] */ + NTSTATUS result; + } out; + +}; + + +struct samr_Connect2 { + struct { + const char *system_name;/* [unique,charset(UTF16)] */ + uint32_t access_mask; + } in; + + struct { + struct policy_handle *connect_handle;/* [ref] */ + NTSTATUS result; + } out; + +}; + + +struct samr_SetUserInfo2 { + struct { + struct policy_handle *user_handle;/* [ref] */ + uint16_t level; + union samr_UserInfo *info;/* [ref,switch_is(level)] */ + } in; + + struct { + NTSTATUS result; + } out; + +}; + + +struct samr_SetBootKeyInformation { + struct { + struct policy_handle *connect_handle;/* [ref] */ + uint32_t unknown1; + uint32_t unknown2; + uint32_t unknown3; + } in; + + struct { + NTSTATUS result; + } out; + +}; + + +struct samr_GetBootKeyInformation { + struct { + struct policy_handle *domain_handle;/* [ref] */ + } in; + + struct { + uint32_t *unknown;/* [ref] */ + NTSTATUS result; + } out; + +}; + + +struct samr_Connect3 { + struct { + const char *system_name;/* [unique,charset(UTF16)] */ + uint32_t unknown; + uint32_t access_mask; + } in; + + struct { + struct policy_handle *connect_handle;/* [ref] */ + NTSTATUS result; + } out; + +}; + + +struct samr_Connect4 { + struct { + const char *system_name;/* [unique,charset(UTF16)] */ + uint32_t unknown; + uint32_t access_mask; + } in; + + struct { + struct policy_handle *connect_handle;/* [ref] */ + NTSTATUS result; + } out; + +}; + + +struct samr_ChangePasswordUser3 { + struct { + struct lsa_String *server;/* [unique] */ + struct lsa_String *account;/* [ref] */ + struct samr_CryptPassword *nt_password;/* [unique] */ + struct samr_Password *nt_verifier;/* [unique] */ + uint8_t lm_change; + struct samr_CryptPassword *lm_password;/* [unique] */ + struct samr_Password *lm_verifier;/* [unique] */ + struct samr_CryptPassword *password3;/* [unique] */ + } in; + + struct { + struct samr_DomInfo1 *dominfo;/* [ref] */ + struct samr_ChangeReject *reject;/* [ref] */ + NTSTATUS result; + } out; + +}; + + +struct samr_Connect5 { + struct { + const char *system_name;/* [unique,charset(UTF16)] */ + uint32_t access_mask; + uint32_t level_in; + union samr_ConnectInfo *info_in;/* [ref,switch_is(level_in)] */ + } in; + + struct { + uint32_t *level_out;/* [ref] */ + union samr_ConnectInfo *info_out;/* [ref,switch_is(*level_out)] */ + struct policy_handle *connect_handle;/* [ref] */ + NTSTATUS result; + } out; + +}; + + +struct samr_RidToSid { + struct { + struct policy_handle *domain_handle;/* [ref] */ + uint32_t rid; + } in; + + struct { + struct dom_sid2 *sid;/* [ref] */ + NTSTATUS result; + } out; + +}; + + +struct samr_SetDsrmPassword { + struct { + struct lsa_String *name;/* [unique] */ + uint32_t unknown; + struct samr_Password *hash;/* [unique] */ + } in; + + struct { + NTSTATUS result; + } out; + +}; + + +struct samr_ValidatePassword { + struct { + enum samr_ValidatePasswordLevel level; + union samr_ValidatePasswordReq req;/* [switch_is(level)] */ + } in; + + struct { + union samr_ValidatePasswordRep *rep;/* [ref,switch_is(level)] */ + NTSTATUS result; + } out; + +}; + +#endif /* _HEADER_samr */ diff --git a/source3/librpc/gen_ndr/srv_samr.c b/source3/librpc/gen_ndr/srv_samr.c new file mode 100644 index 0000000000..72116f355b --- /dev/null +++ b/source3/librpc/gen_ndr/srv_samr.c @@ -0,0 +1,5482 @@ +/* + * Unix SMB/CIFS implementation. + * server auto-generated by pidl. DO NOT MODIFY! + */ + +#include "includes.h" +#include "librpc/gen_ndr/srv_samr.h" + +static bool api_samr_Connect(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct samr_Connect *r; + + call = &ndr_table_samr.calls[NDR_SAMR_CONNECT]; + + r = talloc(NULL, struct samr_Connect); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_Connect, r); + } + + ZERO_STRUCT(r->out); + r->out.connect_handle = talloc_zero(r, struct policy_handle); + if (r->out.connect_handle == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _samr_Connect(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_Connect, r); + } + + push = ndr_push_init_ctx(r); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_samr_Close(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct samr_Close *r; + + call = &ndr_table_samr.calls[NDR_SAMR_CLOSE]; + + r = talloc(NULL, struct samr_Close); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_Close, r); + } + + ZERO_STRUCT(r->out); + r->out.handle = r->in.handle; + r->out.result = _samr_Close(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_Close, r); + } + + push = ndr_push_init_ctx(r); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_samr_SetSecurity(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct samr_SetSecurity *r; + + call = &ndr_table_samr.calls[NDR_SAMR_SETSECURITY]; + + r = talloc(NULL, struct samr_SetSecurity); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_SetSecurity, r); + } + + r->out.result = _samr_SetSecurity(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_SetSecurity, r); + } + + push = ndr_push_init_ctx(r); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_samr_QuerySecurity(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct samr_QuerySecurity *r; + + call = &ndr_table_samr.calls[NDR_SAMR_QUERYSECURITY]; + + r = talloc(NULL, struct samr_QuerySecurity); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_QuerySecurity, r); + } + + ZERO_STRUCT(r->out); + r->out.sdbuf = talloc_zero(r, struct sec_desc_buf); + if (r->out.sdbuf == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _samr_QuerySecurity(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_QuerySecurity, r); + } + + push = ndr_push_init_ctx(r); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_samr_Shutdown(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct samr_Shutdown *r; + + call = &ndr_table_samr.calls[NDR_SAMR_SHUTDOWN]; + + r = talloc(NULL, struct samr_Shutdown); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_Shutdown, r); + } + + r->out.result = _samr_Shutdown(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_Shutdown, r); + } + + push = ndr_push_init_ctx(r); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_samr_LookupDomain(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct samr_LookupDomain *r; + + call = &ndr_table_samr.calls[NDR_SAMR_LOOKUPDOMAIN]; + + r = talloc(NULL, struct samr_LookupDomain); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_LookupDomain, r); + } + + ZERO_STRUCT(r->out); + r->out.sid = talloc_zero(r, struct dom_sid2); + if (r->out.sid == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _samr_LookupDomain(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_LookupDomain, r); + } + + push = ndr_push_init_ctx(r); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_samr_EnumDomains(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct samr_EnumDomains *r; + + call = &ndr_table_samr.calls[NDR_SAMR_ENUMDOMAINS]; + + r = talloc(NULL, struct samr_EnumDomains); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_EnumDomains, r); + } + + ZERO_STRUCT(r->out); + r->out.resume_handle = r->in.resume_handle; + r->out.sam = talloc_zero(r, struct samr_SamArray); + if (r->out.sam == NULL) { + talloc_free(r); + return false; + } + + r->out.num_entries = talloc_zero(r, uint32_t); + if (r->out.num_entries == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _samr_EnumDomains(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_EnumDomains, r); + } + + push = ndr_push_init_ctx(r); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_samr_OpenDomain(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct samr_OpenDomain *r; + + call = &ndr_table_samr.calls[NDR_SAMR_OPENDOMAIN]; + + r = talloc(NULL, struct samr_OpenDomain); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_OpenDomain, r); + } + + ZERO_STRUCT(r->out); + r->out.domain_handle = talloc_zero(r, struct policy_handle); + if (r->out.domain_handle == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _samr_OpenDomain(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_OpenDomain, r); + } + + push = ndr_push_init_ctx(r); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_samr_QueryDomainInfo(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct samr_QueryDomainInfo *r; + + call = &ndr_table_samr.calls[NDR_SAMR_QUERYDOMAININFO]; + + r = talloc(NULL, struct samr_QueryDomainInfo); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_QueryDomainInfo, r); + } + + ZERO_STRUCT(r->out); + r->out.info = talloc_zero(r, union samr_DomainInfo); + if (r->out.info == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _samr_QueryDomainInfo(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_QueryDomainInfo, r); + } + + push = ndr_push_init_ctx(r); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_samr_SetDomainInfo(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct samr_SetDomainInfo *r; + + call = &ndr_table_samr.calls[NDR_SAMR_SETDOMAININFO]; + + r = talloc(NULL, struct samr_SetDomainInfo); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_SetDomainInfo, r); + } + + r->out.result = _samr_SetDomainInfo(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_SetDomainInfo, r); + } + + push = ndr_push_init_ctx(r); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_samr_CreateDomainGroup(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct samr_CreateDomainGroup *r; + + call = &ndr_table_samr.calls[NDR_SAMR_CREATEDOMAINGROUP]; + + r = talloc(NULL, struct samr_CreateDomainGroup); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_CreateDomainGroup, r); + } + + ZERO_STRUCT(r->out); + r->out.group_handle = talloc_zero(r, struct policy_handle); + if (r->out.group_handle == NULL) { + talloc_free(r); + return false; + } + + r->out.rid = talloc_zero(r, uint32_t); + if (r->out.rid == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _samr_CreateDomainGroup(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_CreateDomainGroup, r); + } + + push = ndr_push_init_ctx(r); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_samr_EnumDomainGroups(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct samr_EnumDomainGroups *r; + + call = &ndr_table_samr.calls[NDR_SAMR_ENUMDOMAINGROUPS]; + + r = talloc(NULL, struct samr_EnumDomainGroups); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_EnumDomainGroups, r); + } + + ZERO_STRUCT(r->out); + r->out.resume_handle = r->in.resume_handle; + r->out.sam = talloc_zero(r, struct samr_SamArray); + if (r->out.sam == NULL) { + talloc_free(r); + return false; + } + + r->out.num_entries = talloc_zero(r, uint32_t); + if (r->out.num_entries == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _samr_EnumDomainGroups(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_EnumDomainGroups, r); + } + + push = ndr_push_init_ctx(r); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_samr_CreateUser(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct samr_CreateUser *r; + + call = &ndr_table_samr.calls[NDR_SAMR_CREATEUSER]; + + r = talloc(NULL, struct samr_CreateUser); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_CreateUser, r); + } + + ZERO_STRUCT(r->out); + r->out.user_handle = talloc_zero(r, struct policy_handle); + if (r->out.user_handle == NULL) { + talloc_free(r); + return false; + } + + r->out.rid = talloc_zero(r, uint32_t); + if (r->out.rid == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _samr_CreateUser(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_CreateUser, r); + } + + push = ndr_push_init_ctx(r); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_samr_EnumDomainUsers(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct samr_EnumDomainUsers *r; + + call = &ndr_table_samr.calls[NDR_SAMR_ENUMDOMAINUSERS]; + + r = talloc(NULL, struct samr_EnumDomainUsers); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_EnumDomainUsers, r); + } + + ZERO_STRUCT(r->out); + r->out.resume_handle = r->in.resume_handle; + r->out.sam = talloc_zero(r, struct samr_SamArray); + if (r->out.sam == NULL) { + talloc_free(r); + return false; + } + + r->out.num_entries = talloc_zero(r, uint32_t); + if (r->out.num_entries == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _samr_EnumDomainUsers(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_EnumDomainUsers, r); + } + + push = ndr_push_init_ctx(r); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_samr_CreateDomAlias(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct samr_CreateDomAlias *r; + + call = &ndr_table_samr.calls[NDR_SAMR_CREATEDOMALIAS]; + + r = talloc(NULL, struct samr_CreateDomAlias); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_CreateDomAlias, r); + } + + ZERO_STRUCT(r->out); + r->out.alias_handle = talloc_zero(r, struct policy_handle); + if (r->out.alias_handle == NULL) { + talloc_free(r); + return false; + } + + r->out.rid = talloc_zero(r, uint32_t); + if (r->out.rid == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _samr_CreateDomAlias(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_CreateDomAlias, r); + } + + push = ndr_push_init_ctx(r); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_samr_EnumDomainAliases(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct samr_EnumDomainAliases *r; + + call = &ndr_table_samr.calls[NDR_SAMR_ENUMDOMAINALIASES]; + + r = talloc(NULL, struct samr_EnumDomainAliases); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_EnumDomainAliases, r); + } + + ZERO_STRUCT(r->out); + r->out.resume_handle = r->in.resume_handle; + r->out.sam = talloc_zero(r, struct samr_SamArray); + if (r->out.sam == NULL) { + talloc_free(r); + return false; + } + + r->out.num_entries = talloc_zero(r, uint32_t); + if (r->out.num_entries == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _samr_EnumDomainAliases(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_EnumDomainAliases, r); + } + + push = ndr_push_init_ctx(r); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_samr_GetAliasMembership(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct samr_GetAliasMembership *r; + + call = &ndr_table_samr.calls[NDR_SAMR_GETALIASMEMBERSHIP]; + + r = talloc(NULL, struct samr_GetAliasMembership); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_GetAliasMembership, r); + } + + ZERO_STRUCT(r->out); + r->out.rids = talloc_zero(r, struct samr_Ids); + if (r->out.rids == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _samr_GetAliasMembership(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_GetAliasMembership, r); + } + + push = ndr_push_init_ctx(r); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_samr_LookupNames(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct samr_LookupNames *r; + + call = &ndr_table_samr.calls[NDR_SAMR_LOOKUPNAMES]; + + r = talloc(NULL, struct samr_LookupNames); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_LookupNames, r); + } + + ZERO_STRUCT(r->out); + r->out.rids = talloc_zero(r, struct samr_Ids); + if (r->out.rids == NULL) { + talloc_free(r); + return false; + } + + r->out.types = talloc_zero(r, struct samr_Ids); + if (r->out.types == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _samr_LookupNames(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_LookupNames, r); + } + + push = ndr_push_init_ctx(r); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_samr_LookupRids(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct samr_LookupRids *r; + + call = &ndr_table_samr.calls[NDR_SAMR_LOOKUPRIDS]; + + r = talloc(NULL, struct samr_LookupRids); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_LookupRids, r); + } + + ZERO_STRUCT(r->out); + r->out.names = talloc_zero(r, struct lsa_Strings); + if (r->out.names == NULL) { + talloc_free(r); + return false; + } + + r->out.types = talloc_zero(r, struct samr_Ids); + if (r->out.types == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _samr_LookupRids(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_LookupRids, r); + } + + push = ndr_push_init_ctx(r); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_samr_OpenGroup(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct samr_OpenGroup *r; + + call = &ndr_table_samr.calls[NDR_SAMR_OPENGROUP]; + + r = talloc(NULL, struct samr_OpenGroup); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_OpenGroup, r); + } + + ZERO_STRUCT(r->out); + r->out.group_handle = talloc_zero(r, struct policy_handle); + if (r->out.group_handle == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _samr_OpenGroup(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_OpenGroup, r); + } + + push = ndr_push_init_ctx(r); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_samr_QueryGroupInfo(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct samr_QueryGroupInfo *r; + + call = &ndr_table_samr.calls[NDR_SAMR_QUERYGROUPINFO]; + + r = talloc(NULL, struct samr_QueryGroupInfo); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_QueryGroupInfo, r); + } + + ZERO_STRUCT(r->out); + r->out.info = talloc_zero(r, union samr_GroupInfo); + if (r->out.info == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _samr_QueryGroupInfo(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_QueryGroupInfo, r); + } + + push = ndr_push_init_ctx(r); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_samr_SetGroupInfo(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct samr_SetGroupInfo *r; + + call = &ndr_table_samr.calls[NDR_SAMR_SETGROUPINFO]; + + r = talloc(NULL, struct samr_SetGroupInfo); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_SetGroupInfo, r); + } + + r->out.result = _samr_SetGroupInfo(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_SetGroupInfo, r); + } + + push = ndr_push_init_ctx(r); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_samr_AddGroupMember(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct samr_AddGroupMember *r; + + call = &ndr_table_samr.calls[NDR_SAMR_ADDGROUPMEMBER]; + + r = talloc(NULL, struct samr_AddGroupMember); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_AddGroupMember, r); + } + + r->out.result = _samr_AddGroupMember(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_AddGroupMember, r); + } + + push = ndr_push_init_ctx(r); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_samr_DeleteDomainGroup(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct samr_DeleteDomainGroup *r; + + call = &ndr_table_samr.calls[NDR_SAMR_DELETEDOMAINGROUP]; + + r = talloc(NULL, struct samr_DeleteDomainGroup); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_DeleteDomainGroup, r); + } + + ZERO_STRUCT(r->out); + r->out.group_handle = r->in.group_handle; + r->out.result = _samr_DeleteDomainGroup(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_DeleteDomainGroup, r); + } + + push = ndr_push_init_ctx(r); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_samr_DeleteGroupMember(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct samr_DeleteGroupMember *r; + + call = &ndr_table_samr.calls[NDR_SAMR_DELETEGROUPMEMBER]; + + r = talloc(NULL, struct samr_DeleteGroupMember); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_DeleteGroupMember, r); + } + + r->out.result = _samr_DeleteGroupMember(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_DeleteGroupMember, r); + } + + push = ndr_push_init_ctx(r); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_samr_QueryGroupMember(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct samr_QueryGroupMember *r; + + call = &ndr_table_samr.calls[NDR_SAMR_QUERYGROUPMEMBER]; + + r = talloc(NULL, struct samr_QueryGroupMember); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_QueryGroupMember, r); + } + + ZERO_STRUCT(r->out); + r->out.rids = talloc_zero(r, struct samr_RidTypeArray); + if (r->out.rids == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _samr_QueryGroupMember(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_QueryGroupMember, r); + } + + push = ndr_push_init_ctx(r); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_samr_SetMemberAttributesOfGroup(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct samr_SetMemberAttributesOfGroup *r; + + call = &ndr_table_samr.calls[NDR_SAMR_SETMEMBERATTRIBUTESOFGROUP]; + + r = talloc(NULL, struct samr_SetMemberAttributesOfGroup); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_SetMemberAttributesOfGroup, r); + } + + r->out.result = _samr_SetMemberAttributesOfGroup(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_SetMemberAttributesOfGroup, r); + } + + push = ndr_push_init_ctx(r); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_samr_OpenAlias(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct samr_OpenAlias *r; + + call = &ndr_table_samr.calls[NDR_SAMR_OPENALIAS]; + + r = talloc(NULL, struct samr_OpenAlias); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_OpenAlias, r); + } + + ZERO_STRUCT(r->out); + r->out.alias_handle = talloc_zero(r, struct policy_handle); + if (r->out.alias_handle == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _samr_OpenAlias(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_OpenAlias, r); + } + + push = ndr_push_init_ctx(r); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_samr_QueryAliasInfo(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct samr_QueryAliasInfo *r; + + call = &ndr_table_samr.calls[NDR_SAMR_QUERYALIASINFO]; + + r = talloc(NULL, struct samr_QueryAliasInfo); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_QueryAliasInfo, r); + } + + ZERO_STRUCT(r->out); + r->out.info = talloc_zero(r, union samr_AliasInfo); + if (r->out.info == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _samr_QueryAliasInfo(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_QueryAliasInfo, r); + } + + push = ndr_push_init_ctx(r); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_samr_SetAliasInfo(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct samr_SetAliasInfo *r; + + call = &ndr_table_samr.calls[NDR_SAMR_SETALIASINFO]; + + r = talloc(NULL, struct samr_SetAliasInfo); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_SetAliasInfo, r); + } + + r->out.result = _samr_SetAliasInfo(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_SetAliasInfo, r); + } + + push = ndr_push_init_ctx(r); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_samr_DeleteDomAlias(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct samr_DeleteDomAlias *r; + + call = &ndr_table_samr.calls[NDR_SAMR_DELETEDOMALIAS]; + + r = talloc(NULL, struct samr_DeleteDomAlias); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_DeleteDomAlias, r); + } + + ZERO_STRUCT(r->out); + r->out.alias_handle = r->in.alias_handle; + r->out.result = _samr_DeleteDomAlias(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_DeleteDomAlias, r); + } + + push = ndr_push_init_ctx(r); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_samr_AddAliasMember(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct samr_AddAliasMember *r; + + call = &ndr_table_samr.calls[NDR_SAMR_ADDALIASMEMBER]; + + r = talloc(NULL, struct samr_AddAliasMember); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_AddAliasMember, r); + } + + r->out.result = _samr_AddAliasMember(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_AddAliasMember, r); + } + + push = ndr_push_init_ctx(r); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_samr_DeleteAliasMember(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct samr_DeleteAliasMember *r; + + call = &ndr_table_samr.calls[NDR_SAMR_DELETEALIASMEMBER]; + + r = talloc(NULL, struct samr_DeleteAliasMember); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_DeleteAliasMember, r); + } + + r->out.result = _samr_DeleteAliasMember(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_DeleteAliasMember, r); + } + + push = ndr_push_init_ctx(r); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_samr_GetMembersInAlias(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct samr_GetMembersInAlias *r; + + call = &ndr_table_samr.calls[NDR_SAMR_GETMEMBERSINALIAS]; + + r = talloc(NULL, struct samr_GetMembersInAlias); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_GetMembersInAlias, r); + } + + ZERO_STRUCT(r->out); + r->out.sids = talloc_zero(r, struct lsa_SidArray); + if (r->out.sids == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _samr_GetMembersInAlias(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_GetMembersInAlias, r); + } + + push = ndr_push_init_ctx(r); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_samr_OpenUser(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct samr_OpenUser *r; + + call = &ndr_table_samr.calls[NDR_SAMR_OPENUSER]; + + r = talloc(NULL, struct samr_OpenUser); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_OpenUser, r); + } + + ZERO_STRUCT(r->out); + r->out.user_handle = talloc_zero(r, struct policy_handle); + if (r->out.user_handle == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _samr_OpenUser(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_OpenUser, r); + } + + push = ndr_push_init_ctx(r); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_samr_DeleteUser(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct samr_DeleteUser *r; + + call = &ndr_table_samr.calls[NDR_SAMR_DELETEUSER]; + + r = talloc(NULL, struct samr_DeleteUser); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_DeleteUser, r); + } + + ZERO_STRUCT(r->out); + r->out.user_handle = r->in.user_handle; + r->out.result = _samr_DeleteUser(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_DeleteUser, r); + } + + push = ndr_push_init_ctx(r); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_samr_QueryUserInfo(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct samr_QueryUserInfo *r; + + call = &ndr_table_samr.calls[NDR_SAMR_QUERYUSERINFO]; + + r = talloc(NULL, struct samr_QueryUserInfo); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_QueryUserInfo, r); + } + + ZERO_STRUCT(r->out); + r->out.info = talloc_zero(r, union samr_UserInfo); + if (r->out.info == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _samr_QueryUserInfo(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_QueryUserInfo, r); + } + + push = ndr_push_init_ctx(r); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_samr_SetUserInfo(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct samr_SetUserInfo *r; + + call = &ndr_table_samr.calls[NDR_SAMR_SETUSERINFO]; + + r = talloc(NULL, struct samr_SetUserInfo); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_SetUserInfo, r); + } + + r->out.result = _samr_SetUserInfo(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_SetUserInfo, r); + } + + push = ndr_push_init_ctx(r); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_samr_ChangePasswordUser(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct samr_ChangePasswordUser *r; + + call = &ndr_table_samr.calls[NDR_SAMR_CHANGEPASSWORDUSER]; + + r = talloc(NULL, struct samr_ChangePasswordUser); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_ChangePasswordUser, r); + } + + r->out.result = _samr_ChangePasswordUser(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_ChangePasswordUser, r); + } + + push = ndr_push_init_ctx(r); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_samr_GetGroupsForUser(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct samr_GetGroupsForUser *r; + + call = &ndr_table_samr.calls[NDR_SAMR_GETGROUPSFORUSER]; + + r = talloc(NULL, struct samr_GetGroupsForUser); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_GetGroupsForUser, r); + } + + ZERO_STRUCT(r->out); + r->out.rids = talloc_zero(r, struct samr_RidWithAttributeArray); + if (r->out.rids == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _samr_GetGroupsForUser(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_GetGroupsForUser, r); + } + + push = ndr_push_init_ctx(r); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_samr_QueryDisplayInfo(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct samr_QueryDisplayInfo *r; + + call = &ndr_table_samr.calls[NDR_SAMR_QUERYDISPLAYINFO]; + + r = talloc(NULL, struct samr_QueryDisplayInfo); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_QueryDisplayInfo, r); + } + + ZERO_STRUCT(r->out); + r->out.total_size = talloc_zero(r, uint32_t); + if (r->out.total_size == NULL) { + talloc_free(r); + return false; + } + + r->out.returned_size = talloc_zero(r, uint32_t); + if (r->out.returned_size == NULL) { + talloc_free(r); + return false; + } + + r->out.info = talloc_zero(r, union samr_DispInfo); + if (r->out.info == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _samr_QueryDisplayInfo(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_QueryDisplayInfo, r); + } + + push = ndr_push_init_ctx(r); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_samr_GetDisplayEnumerationIndex(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct samr_GetDisplayEnumerationIndex *r; + + call = &ndr_table_samr.calls[NDR_SAMR_GETDISPLAYENUMERATIONINDEX]; + + r = talloc(NULL, struct samr_GetDisplayEnumerationIndex); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_GetDisplayEnumerationIndex, r); + } + + ZERO_STRUCT(r->out); + r->out.idx = talloc_zero(r, uint32_t); + if (r->out.idx == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _samr_GetDisplayEnumerationIndex(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_GetDisplayEnumerationIndex, r); + } + + push = ndr_push_init_ctx(r); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_samr_TestPrivateFunctionsDomain(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct samr_TestPrivateFunctionsDomain *r; + + call = &ndr_table_samr.calls[NDR_SAMR_TESTPRIVATEFUNCTIONSDOMAIN]; + + r = talloc(NULL, struct samr_TestPrivateFunctionsDomain); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_TestPrivateFunctionsDomain, r); + } + + r->out.result = _samr_TestPrivateFunctionsDomain(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_TestPrivateFunctionsDomain, r); + } + + push = ndr_push_init_ctx(r); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_samr_TestPrivateFunctionsUser(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct samr_TestPrivateFunctionsUser *r; + + call = &ndr_table_samr.calls[NDR_SAMR_TESTPRIVATEFUNCTIONSUSER]; + + r = talloc(NULL, struct samr_TestPrivateFunctionsUser); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_TestPrivateFunctionsUser, r); + } + + r->out.result = _samr_TestPrivateFunctionsUser(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_TestPrivateFunctionsUser, r); + } + + push = ndr_push_init_ctx(r); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_samr_GetUserPwInfo(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct samr_GetUserPwInfo *r; + + call = &ndr_table_samr.calls[NDR_SAMR_GETUSERPWINFO]; + + r = talloc(NULL, struct samr_GetUserPwInfo); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_GetUserPwInfo, r); + } + + ZERO_STRUCT(r->out); + r->out.info = talloc_zero(r, struct samr_PwInfo); + if (r->out.info == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _samr_GetUserPwInfo(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_GetUserPwInfo, r); + } + + push = ndr_push_init_ctx(r); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_samr_RemoveMemberFromForeignDomain(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct samr_RemoveMemberFromForeignDomain *r; + + call = &ndr_table_samr.calls[NDR_SAMR_REMOVEMEMBERFROMFOREIGNDOMAIN]; + + r = talloc(NULL, struct samr_RemoveMemberFromForeignDomain); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_RemoveMemberFromForeignDomain, r); + } + + r->out.result = _samr_RemoveMemberFromForeignDomain(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_RemoveMemberFromForeignDomain, r); + } + + push = ndr_push_init_ctx(r); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_samr_QueryDomainInfo2(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct samr_QueryDomainInfo2 *r; + + call = &ndr_table_samr.calls[NDR_SAMR_QUERYDOMAININFO2]; + + r = talloc(NULL, struct samr_QueryDomainInfo2); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_QueryDomainInfo2, r); + } + + ZERO_STRUCT(r->out); + r->out.info = talloc_zero(r, union samr_DomainInfo); + if (r->out.info == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _samr_QueryDomainInfo2(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_QueryDomainInfo2, r); + } + + push = ndr_push_init_ctx(r); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_samr_QueryUserInfo2(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct samr_QueryUserInfo2 *r; + + call = &ndr_table_samr.calls[NDR_SAMR_QUERYUSERINFO2]; + + r = talloc(NULL, struct samr_QueryUserInfo2); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_QueryUserInfo2, r); + } + + ZERO_STRUCT(r->out); + r->out.info = talloc_zero(r, union samr_UserInfo); + if (r->out.info == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _samr_QueryUserInfo2(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_QueryUserInfo2, r); + } + + push = ndr_push_init_ctx(r); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_samr_QueryDisplayInfo2(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct samr_QueryDisplayInfo2 *r; + + call = &ndr_table_samr.calls[NDR_SAMR_QUERYDISPLAYINFO2]; + + r = talloc(NULL, struct samr_QueryDisplayInfo2); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_QueryDisplayInfo2, r); + } + + ZERO_STRUCT(r->out); + r->out.total_size = talloc_zero(r, uint32_t); + if (r->out.total_size == NULL) { + talloc_free(r); + return false; + } + + r->out.returned_size = talloc_zero(r, uint32_t); + if (r->out.returned_size == NULL) { + talloc_free(r); + return false; + } + + r->out.info = talloc_zero(r, union samr_DispInfo); + if (r->out.info == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _samr_QueryDisplayInfo2(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_QueryDisplayInfo2, r); + } + + push = ndr_push_init_ctx(r); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_samr_GetDisplayEnumerationIndex2(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct samr_GetDisplayEnumerationIndex2 *r; + + call = &ndr_table_samr.calls[NDR_SAMR_GETDISPLAYENUMERATIONINDEX2]; + + r = talloc(NULL, struct samr_GetDisplayEnumerationIndex2); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_GetDisplayEnumerationIndex2, r); + } + + ZERO_STRUCT(r->out); + r->out.idx = talloc_zero(r, uint32_t); + if (r->out.idx == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _samr_GetDisplayEnumerationIndex2(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_GetDisplayEnumerationIndex2, r); + } + + push = ndr_push_init_ctx(r); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_samr_CreateUser2(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct samr_CreateUser2 *r; + + call = &ndr_table_samr.calls[NDR_SAMR_CREATEUSER2]; + + r = talloc(NULL, struct samr_CreateUser2); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_CreateUser2, r); + } + + ZERO_STRUCT(r->out); + r->out.user_handle = talloc_zero(r, struct policy_handle); + if (r->out.user_handle == NULL) { + talloc_free(r); + return false; + } + + r->out.access_granted = talloc_zero(r, uint32_t); + if (r->out.access_granted == NULL) { + talloc_free(r); + return false; + } + + r->out.rid = talloc_zero(r, uint32_t); + if (r->out.rid == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _samr_CreateUser2(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_CreateUser2, r); + } + + push = ndr_push_init_ctx(r); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_samr_QueryDisplayInfo3(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct samr_QueryDisplayInfo3 *r; + + call = &ndr_table_samr.calls[NDR_SAMR_QUERYDISPLAYINFO3]; + + r = talloc(NULL, struct samr_QueryDisplayInfo3); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_QueryDisplayInfo3, r); + } + + ZERO_STRUCT(r->out); + r->out.total_size = talloc_zero(r, uint32_t); + if (r->out.total_size == NULL) { + talloc_free(r); + return false; + } + + r->out.returned_size = talloc_zero(r, uint32_t); + if (r->out.returned_size == NULL) { + talloc_free(r); + return false; + } + + r->out.info = talloc_zero(r, union samr_DispInfo); + if (r->out.info == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _samr_QueryDisplayInfo3(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_QueryDisplayInfo3, r); + } + + push = ndr_push_init_ctx(r); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_samr_AddMultipleMembersToAlias(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct samr_AddMultipleMembersToAlias *r; + + call = &ndr_table_samr.calls[NDR_SAMR_ADDMULTIPLEMEMBERSTOALIAS]; + + r = talloc(NULL, struct samr_AddMultipleMembersToAlias); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_AddMultipleMembersToAlias, r); + } + + r->out.result = _samr_AddMultipleMembersToAlias(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_AddMultipleMembersToAlias, r); + } + + push = ndr_push_init_ctx(r); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_samr_RemoveMultipleMembersFromAlias(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct samr_RemoveMultipleMembersFromAlias *r; + + call = &ndr_table_samr.calls[NDR_SAMR_REMOVEMULTIPLEMEMBERSFROMALIAS]; + + r = talloc(NULL, struct samr_RemoveMultipleMembersFromAlias); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_RemoveMultipleMembersFromAlias, r); + } + + r->out.result = _samr_RemoveMultipleMembersFromAlias(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_RemoveMultipleMembersFromAlias, r); + } + + push = ndr_push_init_ctx(r); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_samr_OemChangePasswordUser2(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct samr_OemChangePasswordUser2 *r; + + call = &ndr_table_samr.calls[NDR_SAMR_OEMCHANGEPASSWORDUSER2]; + + r = talloc(NULL, struct samr_OemChangePasswordUser2); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_OemChangePasswordUser2, r); + } + + r->out.result = _samr_OemChangePasswordUser2(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_OemChangePasswordUser2, r); + } + + push = ndr_push_init_ctx(r); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_samr_ChangePasswordUser2(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct samr_ChangePasswordUser2 *r; + + call = &ndr_table_samr.calls[NDR_SAMR_CHANGEPASSWORDUSER2]; + + r = talloc(NULL, struct samr_ChangePasswordUser2); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_ChangePasswordUser2, r); + } + + r->out.result = _samr_ChangePasswordUser2(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_ChangePasswordUser2, r); + } + + push = ndr_push_init_ctx(r); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_samr_GetDomPwInfo(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct samr_GetDomPwInfo *r; + + call = &ndr_table_samr.calls[NDR_SAMR_GETDOMPWINFO]; + + r = talloc(NULL, struct samr_GetDomPwInfo); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_GetDomPwInfo, r); + } + + ZERO_STRUCT(r->out); + r->out.info = talloc_zero(r, struct samr_PwInfo); + if (r->out.info == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _samr_GetDomPwInfo(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_GetDomPwInfo, r); + } + + push = ndr_push_init_ctx(r); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_samr_Connect2(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct samr_Connect2 *r; + + call = &ndr_table_samr.calls[NDR_SAMR_CONNECT2]; + + r = talloc(NULL, struct samr_Connect2); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_Connect2, r); + } + + ZERO_STRUCT(r->out); + r->out.connect_handle = talloc_zero(r, struct policy_handle); + if (r->out.connect_handle == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _samr_Connect2(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_Connect2, r); + } + + push = ndr_push_init_ctx(r); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_samr_SetUserInfo2(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct samr_SetUserInfo2 *r; + + call = &ndr_table_samr.calls[NDR_SAMR_SETUSERINFO2]; + + r = talloc(NULL, struct samr_SetUserInfo2); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_SetUserInfo2, r); + } + + r->out.result = _samr_SetUserInfo2(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_SetUserInfo2, r); + } + + push = ndr_push_init_ctx(r); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_samr_SetBootKeyInformation(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct samr_SetBootKeyInformation *r; + + call = &ndr_table_samr.calls[NDR_SAMR_SETBOOTKEYINFORMATION]; + + r = talloc(NULL, struct samr_SetBootKeyInformation); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_SetBootKeyInformation, r); + } + + r->out.result = _samr_SetBootKeyInformation(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_SetBootKeyInformation, r); + } + + push = ndr_push_init_ctx(r); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_samr_GetBootKeyInformation(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct samr_GetBootKeyInformation *r; + + call = &ndr_table_samr.calls[NDR_SAMR_GETBOOTKEYINFORMATION]; + + r = talloc(NULL, struct samr_GetBootKeyInformation); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_GetBootKeyInformation, r); + } + + ZERO_STRUCT(r->out); + r->out.unknown = talloc_zero(r, uint32_t); + if (r->out.unknown == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _samr_GetBootKeyInformation(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_GetBootKeyInformation, r); + } + + push = ndr_push_init_ctx(r); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_samr_Connect3(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct samr_Connect3 *r; + + call = &ndr_table_samr.calls[NDR_SAMR_CONNECT3]; + + r = talloc(NULL, struct samr_Connect3); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_Connect3, r); + } + + ZERO_STRUCT(r->out); + r->out.connect_handle = talloc_zero(r, struct policy_handle); + if (r->out.connect_handle == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _samr_Connect3(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_Connect3, r); + } + + push = ndr_push_init_ctx(r); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_samr_Connect4(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct samr_Connect4 *r; + + call = &ndr_table_samr.calls[NDR_SAMR_CONNECT4]; + + r = talloc(NULL, struct samr_Connect4); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_Connect4, r); + } + + ZERO_STRUCT(r->out); + r->out.connect_handle = talloc_zero(r, struct policy_handle); + if (r->out.connect_handle == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _samr_Connect4(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_Connect4, r); + } + + push = ndr_push_init_ctx(r); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_samr_ChangePasswordUser3(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct samr_ChangePasswordUser3 *r; + + call = &ndr_table_samr.calls[NDR_SAMR_CHANGEPASSWORDUSER3]; + + r = talloc(NULL, struct samr_ChangePasswordUser3); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_ChangePasswordUser3, r); + } + + ZERO_STRUCT(r->out); + r->out.dominfo = talloc_zero(r, struct samr_DomInfo1); + if (r->out.dominfo == NULL) { + talloc_free(r); + return false; + } + + r->out.reject = talloc_zero(r, struct samr_ChangeReject); + if (r->out.reject == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _samr_ChangePasswordUser3(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_ChangePasswordUser3, r); + } + + push = ndr_push_init_ctx(r); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_samr_Connect5(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct samr_Connect5 *r; + + call = &ndr_table_samr.calls[NDR_SAMR_CONNECT5]; + + r = talloc(NULL, struct samr_Connect5); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_Connect5, r); + } + + ZERO_STRUCT(r->out); + r->out.level_out = talloc_zero(r, uint32_t); + if (r->out.level_out == NULL) { + talloc_free(r); + return false; + } + + r->out.info_out = talloc_zero(r, union samr_ConnectInfo); + if (r->out.info_out == NULL) { + talloc_free(r); + return false; + } + + r->out.connect_handle = talloc_zero(r, struct policy_handle); + if (r->out.connect_handle == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _samr_Connect5(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_Connect5, r); + } + + push = ndr_push_init_ctx(r); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_samr_RidToSid(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct samr_RidToSid *r; + + call = &ndr_table_samr.calls[NDR_SAMR_RIDTOSID]; + + r = talloc(NULL, struct samr_RidToSid); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_RidToSid, r); + } + + ZERO_STRUCT(r->out); + r->out.sid = talloc_zero(r, struct dom_sid2); + if (r->out.sid == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _samr_RidToSid(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_RidToSid, r); + } + + push = ndr_push_init_ctx(r); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_samr_SetDsrmPassword(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct samr_SetDsrmPassword *r; + + call = &ndr_table_samr.calls[NDR_SAMR_SETDSRMPASSWORD]; + + r = talloc(NULL, struct samr_SetDsrmPassword); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_SetDsrmPassword, r); + } + + r->out.result = _samr_SetDsrmPassword(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_SetDsrmPassword, r); + } + + push = ndr_push_init_ctx(r); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + +static bool api_samr_ValidatePassword(pipes_struct *p) +{ + const struct ndr_interface_call *call; + struct ndr_pull *pull; + struct ndr_push *push; + enum ndr_err_code ndr_err; + DATA_BLOB blob; + struct samr_ValidatePassword *r; + + call = &ndr_table_samr.calls[NDR_SAMR_VALIDATEPASSWORD]; + + r = talloc(NULL, struct samr_ValidatePassword); + if (r == NULL) { + return false; + } + + if (!prs_data_blob(&p->in_data.data, &blob, r)) { + talloc_free(r); + return false; + } + + pull = ndr_pull_init_blob(&blob, r); + if (pull == NULL) { + talloc_free(r); + return false; + } + + pull->flags |= LIBNDR_FLAG_REF_ALLOC; + ndr_err = call->ndr_pull(pull, NDR_IN, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(samr_ValidatePassword, r); + } + + ZERO_STRUCT(r->out); + r->out.rep = talloc_zero(r, union samr_ValidatePasswordRep); + if (r->out.rep == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _samr_ValidatePassword(p, r); + + if (p->rng_fault_state) { + talloc_free(r); + /* Return true here, srv_pipe_hnd.c will take care */ + return true; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(samr_ValidatePassword, r); + } + + push = ndr_push_init_ctx(r); + if (push == NULL) { + talloc_free(r); + return false; + } + + ndr_err = call->ndr_push(push, NDR_OUT, r); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + talloc_free(r); + return false; + } + + blob = ndr_push_blob(push); + if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { + talloc_free(r); + return false; + } + + talloc_free(r); + + return true; +} + + +/* Tables */ +static struct api_struct api_samr_cmds[] = +{ + {"SAMR_CONNECT", NDR_SAMR_CONNECT, api_samr_Connect}, + {"SAMR_CLOSE", NDR_SAMR_CLOSE, api_samr_Close}, + {"SAMR_SETSECURITY", NDR_SAMR_SETSECURITY, api_samr_SetSecurity}, + {"SAMR_QUERYSECURITY", NDR_SAMR_QUERYSECURITY, api_samr_QuerySecurity}, + {"SAMR_SHUTDOWN", NDR_SAMR_SHUTDOWN, api_samr_Shutdown}, + {"SAMR_LOOKUPDOMAIN", NDR_SAMR_LOOKUPDOMAIN, api_samr_LookupDomain}, + {"SAMR_ENUMDOMAINS", NDR_SAMR_ENUMDOMAINS, api_samr_EnumDomains}, + {"SAMR_OPENDOMAIN", NDR_SAMR_OPENDOMAIN, api_samr_OpenDomain}, + {"SAMR_QUERYDOMAININFO", NDR_SAMR_QUERYDOMAININFO, api_samr_QueryDomainInfo}, + {"SAMR_SETDOMAININFO", NDR_SAMR_SETDOMAININFO, api_samr_SetDomainInfo}, + {"SAMR_CREATEDOMAINGROUP", NDR_SAMR_CREATEDOMAINGROUP, api_samr_CreateDomainGroup}, + {"SAMR_ENUMDOMAINGROUPS", NDR_SAMR_ENUMDOMAINGROUPS, api_samr_EnumDomainGroups}, + {"SAMR_CREATEUSER", NDR_SAMR_CREATEUSER, api_samr_CreateUser}, + {"SAMR_ENUMDOMAINUSERS", NDR_SAMR_ENUMDOMAINUSERS, api_samr_EnumDomainUsers}, + {"SAMR_CREATEDOMALIAS", NDR_SAMR_CREATEDOMALIAS, api_samr_CreateDomAlias}, + {"SAMR_ENUMDOMAINALIASES", NDR_SAMR_ENUMDOMAINALIASES, api_samr_EnumDomainAliases}, + {"SAMR_GETALIASMEMBERSHIP", NDR_SAMR_GETALIASMEMBERSHIP, api_samr_GetAliasMembership}, + {"SAMR_LOOKUPNAMES", NDR_SAMR_LOOKUPNAMES, api_samr_LookupNames}, + {"SAMR_LOOKUPRIDS", NDR_SAMR_LOOKUPRIDS, api_samr_LookupRids}, + {"SAMR_OPENGROUP", NDR_SAMR_OPENGROUP, api_samr_OpenGroup}, + {"SAMR_QUERYGROUPINFO", NDR_SAMR_QUERYGROUPINFO, api_samr_QueryGroupInfo}, + {"SAMR_SETGROUPINFO", NDR_SAMR_SETGROUPINFO, api_samr_SetGroupInfo}, + {"SAMR_ADDGROUPMEMBER", NDR_SAMR_ADDGROUPMEMBER, api_samr_AddGroupMember}, + {"SAMR_DELETEDOMAINGROUP", NDR_SAMR_DELETEDOMAINGROUP, api_samr_DeleteDomainGroup}, + {"SAMR_DELETEGROUPMEMBER", NDR_SAMR_DELETEGROUPMEMBER, api_samr_DeleteGroupMember}, + {"SAMR_QUERYGROUPMEMBER", NDR_SAMR_QUERYGROUPMEMBER, api_samr_QueryGroupMember}, + {"SAMR_SETMEMBERATTRIBUTESOFGROUP", NDR_SAMR_SETMEMBERATTRIBUTESOFGROUP, api_samr_SetMemberAttributesOfGroup}, + {"SAMR_OPENALIAS", NDR_SAMR_OPENALIAS, api_samr_OpenAlias}, + {"SAMR_QUERYALIASINFO", NDR_SAMR_QUERYALIASINFO, api_samr_QueryAliasInfo}, + {"SAMR_SETALIASINFO", NDR_SAMR_SETALIASINFO, api_samr_SetAliasInfo}, + {"SAMR_DELETEDOMALIAS", NDR_SAMR_DELETEDOMALIAS, api_samr_DeleteDomAlias}, + {"SAMR_ADDALIASMEMBER", NDR_SAMR_ADDALIASMEMBER, api_samr_AddAliasMember}, + {"SAMR_DELETEALIASMEMBER", NDR_SAMR_DELETEALIASMEMBER, api_samr_DeleteAliasMember}, + {"SAMR_GETMEMBERSINALIAS", NDR_SAMR_GETMEMBERSINALIAS, api_samr_GetMembersInAlias}, + {"SAMR_OPENUSER", NDR_SAMR_OPENUSER, api_samr_OpenUser}, + {"SAMR_DELETEUSER", NDR_SAMR_DELETEUSER, api_samr_DeleteUser}, + {"SAMR_QUERYUSERINFO", NDR_SAMR_QUERYUSERINFO, api_samr_QueryUserInfo}, + {"SAMR_SETUSERINFO", NDR_SAMR_SETUSERINFO, api_samr_SetUserInfo}, + {"SAMR_CHANGEPASSWORDUSER", NDR_SAMR_CHANGEPASSWORDUSER, api_samr_ChangePasswordUser}, + {"SAMR_GETGROUPSFORUSER", NDR_SAMR_GETGROUPSFORUSER, api_samr_GetGroupsForUser}, + {"SAMR_QUERYDISPLAYINFO", NDR_SAMR_QUERYDISPLAYINFO, api_samr_QueryDisplayInfo}, + {"SAMR_GETDISPLAYENUMERATIONINDEX", NDR_SAMR_GETDISPLAYENUMERATIONINDEX, api_samr_GetDisplayEnumerationIndex}, + {"SAMR_TESTPRIVATEFUNCTIONSDOMAIN", NDR_SAMR_TESTPRIVATEFUNCTIONSDOMAIN, api_samr_TestPrivateFunctionsDomain}, + {"SAMR_TESTPRIVATEFUNCTIONSUSER", NDR_SAMR_TESTPRIVATEFUNCTIONSUSER, api_samr_TestPrivateFunctionsUser}, + {"SAMR_GETUSERPWINFO", NDR_SAMR_GETUSERPWINFO, api_samr_GetUserPwInfo}, + {"SAMR_REMOVEMEMBERFROMFOREIGNDOMAIN", NDR_SAMR_REMOVEMEMBERFROMFOREIGNDOMAIN, api_samr_RemoveMemberFromForeignDomain}, + {"SAMR_QUERYDOMAININFO2", NDR_SAMR_QUERYDOMAININFO2, api_samr_QueryDomainInfo2}, + {"SAMR_QUERYUSERINFO2", NDR_SAMR_QUERYUSERINFO2, api_samr_QueryUserInfo2}, + {"SAMR_QUERYDISPLAYINFO2", NDR_SAMR_QUERYDISPLAYINFO2, api_samr_QueryDisplayInfo2}, + {"SAMR_GETDISPLAYENUMERATIONINDEX2", NDR_SAMR_GETDISPLAYENUMERATIONINDEX2, api_samr_GetDisplayEnumerationIndex2}, + {"SAMR_CREATEUSER2", NDR_SAMR_CREATEUSER2, api_samr_CreateUser2}, + {"SAMR_QUERYDISPLAYINFO3", NDR_SAMR_QUERYDISPLAYINFO3, api_samr_QueryDisplayInfo3}, + {"SAMR_ADDMULTIPLEMEMBERSTOALIAS", NDR_SAMR_ADDMULTIPLEMEMBERSTOALIAS, api_samr_AddMultipleMembersToAlias}, + {"SAMR_REMOVEMULTIPLEMEMBERSFROMALIAS", NDR_SAMR_REMOVEMULTIPLEMEMBERSFROMALIAS, api_samr_RemoveMultipleMembersFromAlias}, + {"SAMR_OEMCHANGEPASSWORDUSER2", NDR_SAMR_OEMCHANGEPASSWORDUSER2, api_samr_OemChangePasswordUser2}, + {"SAMR_CHANGEPASSWORDUSER2", NDR_SAMR_CHANGEPASSWORDUSER2, api_samr_ChangePasswordUser2}, + {"SAMR_GETDOMPWINFO", NDR_SAMR_GETDOMPWINFO, api_samr_GetDomPwInfo}, + {"SAMR_CONNECT2", NDR_SAMR_CONNECT2, api_samr_Connect2}, + {"SAMR_SETUSERINFO2", NDR_SAMR_SETUSERINFO2, api_samr_SetUserInfo2}, + {"SAMR_SETBOOTKEYINFORMATION", NDR_SAMR_SETBOOTKEYINFORMATION, api_samr_SetBootKeyInformation}, + {"SAMR_GETBOOTKEYINFORMATION", NDR_SAMR_GETBOOTKEYINFORMATION, api_samr_GetBootKeyInformation}, + {"SAMR_CONNECT3", NDR_SAMR_CONNECT3, api_samr_Connect3}, + {"SAMR_CONNECT4", NDR_SAMR_CONNECT4, api_samr_Connect4}, + {"SAMR_CHANGEPASSWORDUSER3", NDR_SAMR_CHANGEPASSWORDUSER3, api_samr_ChangePasswordUser3}, + {"SAMR_CONNECT5", NDR_SAMR_CONNECT5, api_samr_Connect5}, + {"SAMR_RIDTOSID", NDR_SAMR_RIDTOSID, api_samr_RidToSid}, + {"SAMR_SETDSRMPASSWORD", NDR_SAMR_SETDSRMPASSWORD, api_samr_SetDsrmPassword}, + {"SAMR_VALIDATEPASSWORD", NDR_SAMR_VALIDATEPASSWORD, api_samr_ValidatePassword}, +}; + +void samr_get_pipe_fns(struct api_struct **fns, int *n_fns) +{ + *fns = api_samr_cmds; + *n_fns = sizeof(api_samr_cmds) / sizeof(struct api_struct); +} + +NTSTATUS rpc_samr_init(void) +{ + return rpc_pipe_register_commands(SMB_RPC_INTERFACE_VERSION, "samr", "samr", api_samr_cmds, sizeof(api_samr_cmds) / sizeof(struct api_struct)); +} diff --git a/source3/librpc/gen_ndr/srv_samr.h b/source3/librpc/gen_ndr/srv_samr.h new file mode 100644 index 0000000000..7d5cdd745d --- /dev/null +++ b/source3/librpc/gen_ndr/srv_samr.h @@ -0,0 +1,74 @@ +#include "librpc/gen_ndr/ndr_samr.h" +#ifndef __SRV_SAMR__ +#define __SRV_SAMR__ +NTSTATUS _samr_Connect(pipes_struct *p, struct samr_Connect *r); +NTSTATUS _samr_Close(pipes_struct *p, struct samr_Close *r); +NTSTATUS _samr_SetSecurity(pipes_struct *p, struct samr_SetSecurity *r); +NTSTATUS _samr_QuerySecurity(pipes_struct *p, struct samr_QuerySecurity *r); +NTSTATUS _samr_Shutdown(pipes_struct *p, struct samr_Shutdown *r); +NTSTATUS _samr_LookupDomain(pipes_struct *p, struct samr_LookupDomain *r); +NTSTATUS _samr_EnumDomains(pipes_struct *p, struct samr_EnumDomains *r); +NTSTATUS _samr_OpenDomain(pipes_struct *p, struct samr_OpenDomain *r); +NTSTATUS _samr_QueryDomainInfo(pipes_struct *p, struct samr_QueryDomainInfo *r); +NTSTATUS _samr_SetDomainInfo(pipes_struct *p, struct samr_SetDomainInfo *r); +NTSTATUS _samr_CreateDomainGroup(pipes_struct *p, struct samr_CreateDomainGroup *r); +NTSTATUS _samr_EnumDomainGroups(pipes_struct *p, struct samr_EnumDomainGroups *r); +NTSTATUS _samr_CreateUser(pipes_struct *p, struct samr_CreateUser *r); +NTSTATUS _samr_EnumDomainUsers(pipes_struct *p, struct samr_EnumDomainUsers *r); +NTSTATUS _samr_CreateDomAlias(pipes_struct *p, struct samr_CreateDomAlias *r); +NTSTATUS _samr_EnumDomainAliases(pipes_struct *p, struct samr_EnumDomainAliases *r); +NTSTATUS _samr_GetAliasMembership(pipes_struct *p, struct samr_GetAliasMembership *r); +NTSTATUS _samr_LookupNames(pipes_struct *p, struct samr_LookupNames *r); +NTSTATUS _samr_LookupRids(pipes_struct *p, struct samr_LookupRids *r); +NTSTATUS _samr_OpenGroup(pipes_struct *p, struct samr_OpenGroup *r); +NTSTATUS _samr_QueryGroupInfo(pipes_struct *p, struct samr_QueryGroupInfo *r); +NTSTATUS _samr_SetGroupInfo(pipes_struct *p, struct samr_SetGroupInfo *r); +NTSTATUS _samr_AddGroupMember(pipes_struct *p, struct samr_AddGroupMember *r); +NTSTATUS _samr_DeleteDomainGroup(pipes_struct *p, struct samr_DeleteDomainGroup *r); +NTSTATUS _samr_DeleteGroupMember(pipes_struct *p, struct samr_DeleteGroupMember *r); +NTSTATUS _samr_QueryGroupMember(pipes_struct *p, struct samr_QueryGroupMember *r); +NTSTATUS _samr_SetMemberAttributesOfGroup(pipes_struct *p, struct samr_SetMemberAttributesOfGroup *r); +NTSTATUS _samr_OpenAlias(pipes_struct *p, struct samr_OpenAlias *r); +NTSTATUS _samr_QueryAliasInfo(pipes_struct *p, struct samr_QueryAliasInfo *r); +NTSTATUS _samr_SetAliasInfo(pipes_struct *p, struct samr_SetAliasInfo *r); +NTSTATUS _samr_DeleteDomAlias(pipes_struct *p, struct samr_DeleteDomAlias *r); +NTSTATUS _samr_AddAliasMember(pipes_struct *p, struct samr_AddAliasMember *r); +NTSTATUS _samr_DeleteAliasMember(pipes_struct *p, struct samr_DeleteAliasMember *r); +NTSTATUS _samr_GetMembersInAlias(pipes_struct *p, struct samr_GetMembersInAlias *r); +NTSTATUS _samr_OpenUser(pipes_struct *p, struct samr_OpenUser *r); +NTSTATUS _samr_DeleteUser(pipes_struct *p, struct samr_DeleteUser *r); +NTSTATUS _samr_QueryUserInfo(pipes_struct *p, struct samr_QueryUserInfo *r); +NTSTATUS _samr_SetUserInfo(pipes_struct *p, struct samr_SetUserInfo *r); +NTSTATUS _samr_ChangePasswordUser(pipes_struct *p, struct samr_ChangePasswordUser *r); +NTSTATUS _samr_GetGroupsForUser(pipes_struct *p, struct samr_GetGroupsForUser *r); +NTSTATUS _samr_QueryDisplayInfo(pipes_struct *p, struct samr_QueryDisplayInfo *r); +NTSTATUS _samr_GetDisplayEnumerationIndex(pipes_struct *p, struct samr_GetDisplayEnumerationIndex *r); +NTSTATUS _samr_TestPrivateFunctionsDomain(pipes_struct *p, struct samr_TestPrivateFunctionsDomain *r); +NTSTATUS _samr_TestPrivateFunctionsUser(pipes_struct *p, struct samr_TestPrivateFunctionsUser *r); +NTSTATUS _samr_GetUserPwInfo(pipes_struct *p, struct samr_GetUserPwInfo *r); +NTSTATUS _samr_RemoveMemberFromForeignDomain(pipes_struct *p, struct samr_RemoveMemberFromForeignDomain *r); +NTSTATUS _samr_QueryDomainInfo2(pipes_struct *p, struct samr_QueryDomainInfo2 *r); +NTSTATUS _samr_QueryUserInfo2(pipes_struct *p, struct samr_QueryUserInfo2 *r); +NTSTATUS _samr_QueryDisplayInfo2(pipes_struct *p, struct samr_QueryDisplayInfo2 *r); +NTSTATUS _samr_GetDisplayEnumerationIndex2(pipes_struct *p, struct samr_GetDisplayEnumerationIndex2 *r); +NTSTATUS _samr_CreateUser2(pipes_struct *p, struct samr_CreateUser2 *r); +NTSTATUS _samr_QueryDisplayInfo3(pipes_struct *p, struct samr_QueryDisplayInfo3 *r); +NTSTATUS _samr_AddMultipleMembersToAlias(pipes_struct *p, struct samr_AddMultipleMembersToAlias *r); +NTSTATUS _samr_RemoveMultipleMembersFromAlias(pipes_struct *p, struct samr_RemoveMultipleMembersFromAlias *r); +NTSTATUS _samr_OemChangePasswordUser2(pipes_struct *p, struct samr_OemChangePasswordUser2 *r); +NTSTATUS _samr_ChangePasswordUser2(pipes_struct *p, struct samr_ChangePasswordUser2 *r); +NTSTATUS _samr_GetDomPwInfo(pipes_struct *p, struct samr_GetDomPwInfo *r); +NTSTATUS _samr_Connect2(pipes_struct *p, struct samr_Connect2 *r); +NTSTATUS _samr_SetUserInfo2(pipes_struct *p, struct samr_SetUserInfo2 *r); +NTSTATUS _samr_SetBootKeyInformation(pipes_struct *p, struct samr_SetBootKeyInformation *r); +NTSTATUS _samr_GetBootKeyInformation(pipes_struct *p, struct samr_GetBootKeyInformation *r); +NTSTATUS _samr_Connect3(pipes_struct *p, struct samr_Connect3 *r); +NTSTATUS _samr_Connect4(pipes_struct *p, struct samr_Connect4 *r); +NTSTATUS _samr_ChangePasswordUser3(pipes_struct *p, struct samr_ChangePasswordUser3 *r); +NTSTATUS _samr_Connect5(pipes_struct *p, struct samr_Connect5 *r); +NTSTATUS _samr_RidToSid(pipes_struct *p, struct samr_RidToSid *r); +NTSTATUS _samr_SetDsrmPassword(pipes_struct *p, struct samr_SetDsrmPassword *r); +NTSTATUS _samr_ValidatePassword(pipes_struct *p, struct samr_ValidatePassword *r); +void samr_get_pipe_fns(struct api_struct **fns, int *n_fns); +NTSTATUS rpc_samr_init(void); +#endif /* __SRV_SAMR__ */ |