diff options
author | Karolin Seeger <kseeger@samba.org> | 2008-02-29 10:44:38 +0100 |
---|---|---|
committer | Karolin Seeger <kseeger@samba.org> | 2008-02-29 10:44:38 +0100 |
commit | c4fbe2846231a6b322c1094c6a1dbf93b7305768 (patch) | |
tree | 09eb77a294f4acda131b41fe4c9bec4ed175eb16 /source3/librpc | |
parent | 1a6415fc77c708b87c8e2ce6e7828f486ffc87ac (diff) | |
parent | 695b6662abe64a40061bfa05ede12173fc4b1945 (diff) | |
download | samba-c4fbe2846231a6b322c1094c6a1dbf93b7305768.tar.gz samba-c4fbe2846231a6b322c1094c6a1dbf93b7305768.tar.bz2 samba-c4fbe2846231a6b322c1094c6a1dbf93b7305768.zip |
Merge commit 'origin/v3-2-test' into v3-2-stable
Conflicts:
WHATSNEW.txt
(This used to be commit a390bcf9403df4cf4d5eef42b35ebccbe253882e)
Diffstat (limited to 'source3/librpc')
119 files changed, 50933 insertions, 6571 deletions
diff --git a/source3/librpc/gen_ndr/cli_dfs.c b/source3/librpc/gen_ndr/cli_dfs.c index 9078ce7bba..fc00128f3f 100644 --- a/source3/librpc/gen_ndr/cli_dfs.c +++ b/source3/librpc/gen_ndr/cli_dfs.c @@ -789,12 +789,20 @@ NTSTATUS rpccli_dfs_AddStdRootForced(struct rpc_pipe_client *cli, NTSTATUS rpccli_dfs_GetDcAddress(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, + const char *servername, + const char **server_fullname, + uint8_t *is_root, + uint32_t *ttl, WERROR *werror) { struct dfs_GetDcAddress r; NTSTATUS status; /* In parameters */ + r.in.servername = servername; + r.in.server_fullname = server_fullname; + r.in.is_root = is_root; + r.in.ttl = ttl; if (DEBUGLEVEL >= 10) { NDR_PRINT_IN_DEBUG(dfs_GetDcAddress, &r); @@ -820,6 +828,9 @@ NTSTATUS rpccli_dfs_GetDcAddress(struct rpc_pipe_client *cli, } /* Return variables */ + *server_fullname = *r.out.server_fullname; + *is_root = *r.out.is_root; + *ttl = *r.out.ttl; /* Return result */ if (werror) { @@ -831,12 +842,20 @@ NTSTATUS rpccli_dfs_GetDcAddress(struct rpc_pipe_client *cli, NTSTATUS rpccli_dfs_SetDcAddress(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, + const char *servername, + const char *server_fullname, + uint32_t flags, + uint32_t ttl, WERROR *werror) { struct dfs_SetDcAddress r; NTSTATUS status; /* In parameters */ + r.in.servername = servername; + r.in.server_fullname = server_fullname; + r.in.flags = flags; + r.in.ttl = ttl; if (DEBUGLEVEL >= 10) { NDR_PRINT_IN_DEBUG(dfs_SetDcAddress, &r); diff --git a/source3/librpc/gen_ndr/cli_dfs.h b/source3/librpc/gen_ndr/cli_dfs.h index cdd0978bb4..d23bb90470 100644 --- a/source3/librpc/gen_ndr/cli_dfs.h +++ b/source3/librpc/gen_ndr/cli_dfs.h @@ -101,9 +101,17 @@ NTSTATUS rpccli_dfs_AddStdRootForced(struct rpc_pipe_client *cli, WERROR *werror); NTSTATUS rpccli_dfs_GetDcAddress(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, + const char *servername, + const char **server_fullname, + uint8_t *is_root, + uint32_t *ttl, WERROR *werror); NTSTATUS rpccli_dfs_SetDcAddress(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, + const char *servername, + const char *server_fullname, + uint32_t flags, + uint32_t ttl, WERROR *werror); NTSTATUS rpccli_dfs_FlushFtTable(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, diff --git a/source3/librpc/gen_ndr/cli_dssetup.c b/source3/librpc/gen_ndr/cli_dssetup.c new file mode 100644 index 0000000000..8947d99bb5 --- /dev/null +++ b/source3/librpc/gen_ndr/cli_dssetup.c @@ -0,0 +1,476 @@ +/* + * Unix SMB/CIFS implementation. + * client auto-generated by pidl. DO NOT MODIFY! + */ + +#include "includes.h" +#include "librpc/gen_ndr/cli_dssetup.h" + +NTSTATUS rpccli_dssetup_DsRoleGetPrimaryDomainInformation(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + enum dssetup_DsRoleInfoLevel level, + union dssetup_DsRoleInfo *info, + WERROR *werror) +{ + struct dssetup_DsRoleGetPrimaryDomainInformation r; + NTSTATUS status; + + /* In parameters */ + r.in.level = level; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(dssetup_DsRoleGetPrimaryDomainInformation, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + PI_DSSETUP, + &ndr_table_dssetup, + NDR_DSSETUP_DSROLEGETPRIMARYDOMAININFORMATION, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(dssetup_DsRoleGetPrimaryDomainInformation, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + if (info && r.out.info) { + *info = *r.out.info; + } + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_dssetup_DsRoleDnsNameToFlatName(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror) +{ + struct dssetup_DsRoleDnsNameToFlatName r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(dssetup_DsRoleDnsNameToFlatName, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + PI_DSSETUP, + &ndr_table_dssetup, + NDR_DSSETUP_DSROLEDNSNAMETOFLATNAME, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(dssetup_DsRoleDnsNameToFlatName, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_dssetup_DsRoleDcAsDc(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror) +{ + struct dssetup_DsRoleDcAsDc r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(dssetup_DsRoleDcAsDc, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + PI_DSSETUP, + &ndr_table_dssetup, + NDR_DSSETUP_DSROLEDCASDC, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(dssetup_DsRoleDcAsDc, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_dssetup_DsRoleDcAsReplica(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror) +{ + struct dssetup_DsRoleDcAsReplica r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(dssetup_DsRoleDcAsReplica, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + PI_DSSETUP, + &ndr_table_dssetup, + NDR_DSSETUP_DSROLEDCASREPLICA, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(dssetup_DsRoleDcAsReplica, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_dssetup_DsRoleDemoteDc(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror) +{ + struct dssetup_DsRoleDemoteDc r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(dssetup_DsRoleDemoteDc, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + PI_DSSETUP, + &ndr_table_dssetup, + NDR_DSSETUP_DSROLEDEMOTEDC, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(dssetup_DsRoleDemoteDc, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_dssetup_DsRoleGetDcOperationProgress(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror) +{ + struct dssetup_DsRoleGetDcOperationProgress r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(dssetup_DsRoleGetDcOperationProgress, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + PI_DSSETUP, + &ndr_table_dssetup, + NDR_DSSETUP_DSROLEGETDCOPERATIONPROGRESS, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(dssetup_DsRoleGetDcOperationProgress, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_dssetup_DsRoleGetDcOperationResults(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror) +{ + struct dssetup_DsRoleGetDcOperationResults r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(dssetup_DsRoleGetDcOperationResults, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + PI_DSSETUP, + &ndr_table_dssetup, + NDR_DSSETUP_DSROLEGETDCOPERATIONRESULTS, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(dssetup_DsRoleGetDcOperationResults, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_dssetup_DsRoleCancel(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror) +{ + struct dssetup_DsRoleCancel r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(dssetup_DsRoleCancel, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + PI_DSSETUP, + &ndr_table_dssetup, + NDR_DSSETUP_DSROLECANCEL, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(dssetup_DsRoleCancel, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_dssetup_DsRoleServerSaveStateForUpgrade(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror) +{ + struct dssetup_DsRoleServerSaveStateForUpgrade r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(dssetup_DsRoleServerSaveStateForUpgrade, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + PI_DSSETUP, + &ndr_table_dssetup, + NDR_DSSETUP_DSROLESERVERSAVESTATEFORUPGRADE, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(dssetup_DsRoleServerSaveStateForUpgrade, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_dssetup_DsRoleUpgradeDownlevelServer(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror) +{ + struct dssetup_DsRoleUpgradeDownlevelServer r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(dssetup_DsRoleUpgradeDownlevelServer, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + PI_DSSETUP, + &ndr_table_dssetup, + NDR_DSSETUP_DSROLEUPGRADEDOWNLEVELSERVER, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(dssetup_DsRoleUpgradeDownlevelServer, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_dssetup_DsRoleAbortDownlevelServerUpgrade(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror) +{ + struct dssetup_DsRoleAbortDownlevelServerUpgrade r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(dssetup_DsRoleAbortDownlevelServerUpgrade, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + PI_DSSETUP, + &ndr_table_dssetup, + NDR_DSSETUP_DSROLEABORTDOWNLEVELSERVERUPGRADE, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(dssetup_DsRoleAbortDownlevelServerUpgrade, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + diff --git a/source3/librpc/gen_ndr/cli_dssetup.h b/source3/librpc/gen_ndr/cli_dssetup.h new file mode 100644 index 0000000000..b645c26829 --- /dev/null +++ b/source3/librpc/gen_ndr/cli_dssetup.h @@ -0,0 +1,39 @@ +#include "librpc/gen_ndr/ndr_dssetup.h" +#ifndef __CLI_DSSETUP__ +#define __CLI_DSSETUP__ +NTSTATUS rpccli_dssetup_DsRoleGetPrimaryDomainInformation(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + enum dssetup_DsRoleInfoLevel level, + union dssetup_DsRoleInfo *info, + WERROR *werror); +NTSTATUS rpccli_dssetup_DsRoleDnsNameToFlatName(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror); +NTSTATUS rpccli_dssetup_DsRoleDcAsDc(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror); +NTSTATUS rpccli_dssetup_DsRoleDcAsReplica(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror); +NTSTATUS rpccli_dssetup_DsRoleDemoteDc(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror); +NTSTATUS rpccli_dssetup_DsRoleGetDcOperationProgress(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror); +NTSTATUS rpccli_dssetup_DsRoleGetDcOperationResults(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror); +NTSTATUS rpccli_dssetup_DsRoleCancel(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror); +NTSTATUS rpccli_dssetup_DsRoleServerSaveStateForUpgrade(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror); +NTSTATUS rpccli_dssetup_DsRoleUpgradeDownlevelServer(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror); +NTSTATUS rpccli_dssetup_DsRoleAbortDownlevelServerUpgrade(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror); +#endif /* __CLI_DSSETUP__ */ diff --git a/source3/librpc/gen_ndr/cli_eventlog.c b/source3/librpc/gen_ndr/cli_eventlog.c index 72cd886cb4..0084776a08 100644 --- a/source3/librpc/gen_ndr/cli_eventlog.c +++ b/source3/librpc/gen_ndr/cli_eventlog.c @@ -9,14 +9,14 @@ NTSTATUS rpccli_eventlog_ClearEventLogW(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, struct policy_handle *handle, - struct lsa_String *unknown) + struct lsa_String *backupfile) { struct eventlog_ClearEventLogW r; NTSTATUS status; /* In parameters */ r.in.handle = handle; - r.in.unknown = unknown; + r.in.backupfile = backupfile; if (DEBUGLEVEL >= 10) { NDR_PRINT_IN_DEBUG(eventlog_ClearEventLogW, &r); @@ -203,12 +203,15 @@ NTSTATUS rpccli_eventlog_GetNumRecords(struct rpc_pipe_client *cli, } NTSTATUS rpccli_eventlog_GetOldestRecord(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx) + TALLOC_CTX *mem_ctx, + struct policy_handle *handle, + uint32_t *oldest_entry) { struct eventlog_GetOldestRecord r; NTSTATUS status; /* In parameters */ + r.in.handle = handle; if (DEBUGLEVEL >= 10) { NDR_PRINT_IN_DEBUG(eventlog_GetOldestRecord, &r); @@ -234,6 +237,7 @@ NTSTATUS rpccli_eventlog_GetOldestRecord(struct rpc_pipe_client *cli, } /* Return variables */ + *oldest_entry = *r.out.oldest_entry; /* Return result */ return r.out.result; @@ -279,8 +283,8 @@ NTSTATUS rpccli_eventlog_ChangeNotify(struct rpc_pipe_client *cli, NTSTATUS rpccli_eventlog_OpenEventLogW(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, struct eventlog_OpenUnknown0 *unknown0, - struct lsa_String logname, - struct lsa_String servername, + struct lsa_String *logname, + struct lsa_String *servername, uint32_t unknown2, uint32_t unknown3, struct policy_handle *handle) diff --git a/source3/librpc/gen_ndr/cli_eventlog.h b/source3/librpc/gen_ndr/cli_eventlog.h index f75355c390..10790a21fc 100644 --- a/source3/librpc/gen_ndr/cli_eventlog.h +++ b/source3/librpc/gen_ndr/cli_eventlog.h @@ -4,7 +4,7 @@ NTSTATUS rpccli_eventlog_ClearEventLogW(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, struct policy_handle *handle, - struct lsa_String *unknown); + struct lsa_String *backupfile); NTSTATUS rpccli_eventlog_BackupEventLogW(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx); NTSTATUS rpccli_eventlog_CloseEventLog(struct rpc_pipe_client *cli, @@ -17,14 +17,16 @@ NTSTATUS rpccli_eventlog_GetNumRecords(struct rpc_pipe_client *cli, struct policy_handle *handle, uint32_t *number); NTSTATUS rpccli_eventlog_GetOldestRecord(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx); + TALLOC_CTX *mem_ctx, + struct policy_handle *handle, + uint32_t *oldest_entry); NTSTATUS rpccli_eventlog_ChangeNotify(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx); NTSTATUS rpccli_eventlog_OpenEventLogW(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, struct eventlog_OpenUnknown0 *unknown0, - struct lsa_String logname, - struct lsa_String servername, + struct lsa_String *logname, + struct lsa_String *servername, uint32_t unknown2, uint32_t unknown3, struct policy_handle *handle); diff --git a/source3/librpc/gen_ndr/cli_lsa.c b/source3/librpc/gen_ndr/cli_lsa.c index 92ba8bdfee..b1609ea97b 100644 --- a/source3/librpc/gen_ndr/cli_lsa.c +++ b/source3/librpc/gen_ndr/cli_lsa.c @@ -89,8 +89,8 @@ NTSTATUS rpccli_lsa_EnumPrivs(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, struct policy_handle *handle, uint32_t *resume_handle, - uint32_t max_count, - struct lsa_PrivArray *privs) + struct lsa_PrivArray *privs, + uint32_t max_count) { struct lsa_EnumPrivs r; NTSTATUS status; @@ -135,7 +135,7 @@ NTSTATUS rpccli_lsa_QuerySecurity(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, struct policy_handle *handle, uint32_t sec_info, - struct sec_desc_buf *sdbuf) + struct sec_desc_buf **sdbuf) { struct lsa_QuerySecurity r; NTSTATUS status; @@ -168,21 +168,25 @@ NTSTATUS rpccli_lsa_QuerySecurity(struct rpc_pipe_client *cli, } /* Return variables */ - if (sdbuf && r.out.sdbuf) { - *sdbuf = *r.out.sdbuf; - } + *sdbuf = *r.out.sdbuf; /* Return result */ return r.out.result; } NTSTATUS rpccli_lsa_SetSecObj(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx) + TALLOC_CTX *mem_ctx, + struct policy_handle *handle, + uint32_t sec_info, + struct sec_desc_buf *sdbuf) { struct lsa_SetSecObj 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(lsa_SetSecObj, &r); @@ -299,7 +303,7 @@ NTSTATUS rpccli_lsa_QueryInfoPolicy(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, struct policy_handle *handle, enum lsa_PolicyInfo level, - union lsa_PolicyInformation *info) + union lsa_PolicyInformation **info) { struct lsa_QueryInfoPolicy r; NTSTATUS status; @@ -332,9 +336,7 @@ NTSTATUS rpccli_lsa_QueryInfoPolicy(struct rpc_pipe_client *cli, } /* Return variables */ - if (info && r.out.info) { - *info = *r.out.info; - } + *info = *r.out.info; /* Return result */ return r.out.result; @@ -469,8 +471,8 @@ NTSTATUS rpccli_lsa_EnumAccounts(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, struct policy_handle *handle, uint32_t *resume_handle, - uint32_t num_entries, - struct lsa_SidArray *sids) + struct lsa_SidArray *sids, + uint32_t num_entries) { struct lsa_EnumAccounts r; NTSTATUS status; @@ -560,8 +562,8 @@ NTSTATUS rpccli_lsa_EnumTrustDom(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, struct policy_handle *handle, uint32_t *resume_handle, - uint32_t max_size, - struct lsa_DomainList *domains) + struct lsa_DomainList *domains, + uint32_t max_size) { struct lsa_EnumTrustDom r; NTSTATUS status; @@ -607,9 +609,9 @@ NTSTATUS rpccli_lsa_LookupNames(struct rpc_pipe_client *cli, struct policy_handle *handle, uint32_t num_names, struct lsa_String *names, - struct lsa_RefDomainList *domains, + struct lsa_RefDomainList **domains, struct lsa_TransSidArray *sids, - uint16_t level, + enum lsa_LookupNamesLevel level, uint32_t *count) { struct lsa_LookupNames r; @@ -647,9 +649,7 @@ NTSTATUS rpccli_lsa_LookupNames(struct rpc_pipe_client *cli, } /* Return variables */ - if (domains && r.out.domains) { - *domains = *r.out.domains; - } + *domains = *r.out.domains; *sids = *r.out.sids; *count = *r.out.count; @@ -661,7 +661,7 @@ NTSTATUS rpccli_lsa_LookupSids(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, struct policy_handle *handle, struct lsa_SidArray *sids, - struct lsa_RefDomainList *domains, + struct lsa_RefDomainList **domains, struct lsa_TransNameArray *names, uint16_t level, uint32_t *count) @@ -700,9 +700,7 @@ NTSTATUS rpccli_lsa_LookupSids(struct rpc_pipe_client *cli, } /* Return variables */ - if (domains && r.out.domains) { - *domains = *r.out.domains; - } + *domains = *r.out.domains; *names = *r.out.names; *count = *r.out.count; @@ -803,7 +801,7 @@ NTSTATUS rpccli_lsa_OpenAccount(struct rpc_pipe_client *cli, NTSTATUS rpccli_lsa_EnumPrivsAccount(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, struct policy_handle *handle, - struct lsa_PrivilegeSet *privs) + struct lsa_PrivilegeSet **privs) { struct lsa_EnumPrivsAccount r; NTSTATUS status; @@ -835,9 +833,7 @@ NTSTATUS rpccli_lsa_EnumPrivsAccount(struct rpc_pipe_client *cli, } /* Return variables */ - if (privs && r.out.privs) { - *privs = *r.out.privs; - } + *privs = *r.out.privs; /* Return result */ return r.out.result; @@ -1002,12 +998,15 @@ NTSTATUS rpccli_lsa_SetQuotasForAccount(struct rpc_pipe_client *cli, } NTSTATUS rpccli_lsa_GetSystemAccessAccount(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx) + TALLOC_CTX *mem_ctx, + struct policy_handle *handle, + uint32_t *access_mask) { struct lsa_GetSystemAccessAccount r; NTSTATUS status; /* In parameters */ + r.in.handle = handle; if (DEBUGLEVEL >= 10) { NDR_PRINT_IN_DEBUG(lsa_GetSystemAccessAccount, &r); @@ -1033,18 +1032,23 @@ NTSTATUS rpccli_lsa_GetSystemAccessAccount(struct rpc_pipe_client *cli, } /* Return variables */ + *access_mask = *r.out.access_mask; /* Return result */ return r.out.result; } NTSTATUS rpccli_lsa_SetSystemAccessAccount(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx) + TALLOC_CTX *mem_ctx, + struct policy_handle *handle, + uint32_t access_mask) { struct lsa_SetSystemAccessAccount r; NTSTATUS status; /* In parameters */ + r.in.handle = handle; + r.in.access_mask = access_mask; if (DEBUGLEVEL >= 10) { NDR_PRINT_IN_DEBUG(lsa_SetSystemAccessAccount, &r); @@ -1441,9 +1445,10 @@ NTSTATUS rpccli_lsa_LookupPrivDisplayName(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, struct policy_handle *handle, struct lsa_String *name, - struct lsa_StringLarge *disp_name, - uint16_t *language_id, - uint16_t unknown) + uint16_t language_id, + uint16_t language_id_sys, + struct lsa_StringLarge **disp_name, + uint16_t *returned_language_id) { struct lsa_LookupPrivDisplayName r; NTSTATUS status; @@ -1452,7 +1457,7 @@ NTSTATUS rpccli_lsa_LookupPrivDisplayName(struct rpc_pipe_client *cli, r.in.handle = handle; r.in.name = name; r.in.language_id = language_id; - r.in.unknown = unknown; + r.in.language_id_sys = language_id_sys; if (DEBUGLEVEL >= 10) { NDR_PRINT_IN_DEBUG(lsa_LookupPrivDisplayName, &r); @@ -1478,22 +1483,22 @@ NTSTATUS rpccli_lsa_LookupPrivDisplayName(struct rpc_pipe_client *cli, } /* Return variables */ - if (disp_name && r.out.disp_name) { - *disp_name = *r.out.disp_name; - } - *language_id = *r.out.language_id; + *disp_name = *r.out.disp_name; + *returned_language_id = *r.out.returned_language_id; /* Return result */ return r.out.result; } NTSTATUS rpccli_lsa_DeleteObject(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx) + TALLOC_CTX *mem_ctx, + struct policy_handle *handle) { struct lsa_DeleteObject r; NTSTATUS status; /* In parameters */ + r.in.handle = handle; if (DEBUGLEVEL >= 10) { NDR_PRINT_IN_DEBUG(lsa_DeleteObject, &r); @@ -1519,6 +1524,7 @@ NTSTATUS rpccli_lsa_DeleteObject(struct rpc_pipe_client *cli, } /* Return variables */ + *handle = *r.out.handle; /* Return result */ return r.out.result; @@ -1657,7 +1663,7 @@ NTSTATUS rpccli_lsa_RemoveAccountRights(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, struct policy_handle *handle, struct dom_sid2 *sid, - uint32_t unknown, + uint8_t remove_all, struct lsa_RightSet *rights) { struct lsa_RemoveAccountRights r; @@ -1666,7 +1672,7 @@ NTSTATUS rpccli_lsa_RemoveAccountRights(struct rpc_pipe_client *cli, /* In parameters */ r.in.handle = handle; r.in.sid = sid; - r.in.unknown = unknown; + r.in.remove_all = remove_all; r.in.rights = rights; if (DEBUGLEVEL >= 10) { @@ -1945,8 +1951,8 @@ NTSTATUS rpccli_lsa_OpenPolicy2(struct rpc_pipe_client *cli, NTSTATUS rpccli_lsa_GetUserName(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, const char *system_name, - struct lsa_String *account_name, - struct lsa_StringPointer *authority_name) + struct lsa_String **account_name, + struct lsa_String **authority_name) { struct lsa_GetUserName r; NTSTATUS status; @@ -1980,9 +1986,7 @@ NTSTATUS rpccli_lsa_GetUserName(struct rpc_pipe_client *cli, } /* Return variables */ - if (account_name && r.out.account_name) { - *account_name = *r.out.account_name; - } + *account_name = *r.out.account_name; if (authority_name && r.out.authority_name) { *authority_name = *r.out.authority_name; } @@ -1995,7 +1999,7 @@ NTSTATUS rpccli_lsa_QueryInfoPolicy2(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, struct policy_handle *handle, enum lsa_PolicyInfo level, - union lsa_PolicyInformation *info) + union lsa_PolicyInformation **info) { struct lsa_QueryInfoPolicy2 r; NTSTATUS status; @@ -2028,9 +2032,7 @@ NTSTATUS rpccli_lsa_QueryInfoPolicy2(struct rpc_pipe_client *cli, } /* Return variables */ - if (info && r.out.info) { - *info = *r.out.info; - } + *info = *r.out.info; /* Return result */ return r.out.result; @@ -2082,7 +2084,7 @@ NTSTATUS rpccli_lsa_SetInfoPolicy2(struct rpc_pipe_client *cli, NTSTATUS rpccli_lsa_QueryTrustedDomainInfoByName(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, struct policy_handle *handle, - struct lsa_String trusted_domain, + struct lsa_String *trusted_domain, enum lsa_TrustDomInfoEnum level, union lsa_TrustedDomainInfo *info) { @@ -2118,9 +2120,7 @@ NTSTATUS rpccli_lsa_QueryTrustedDomainInfoByName(struct rpc_pipe_client *cli, } /* Return variables */ - if (info && r.out.info) { - *info = *r.out.info; - } + *info = *r.out.info; /* Return result */ return r.out.result; @@ -2468,7 +2468,7 @@ NTSTATUS rpccli_lsa_LookupSids2(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, struct policy_handle *handle, struct lsa_SidArray *sids, - struct lsa_RefDomainList *domains, + struct lsa_RefDomainList **domains, struct lsa_TransNameArray2 *names, uint16_t level, uint32_t *count, @@ -2511,9 +2511,7 @@ NTSTATUS rpccli_lsa_LookupSids2(struct rpc_pipe_client *cli, } /* Return variables */ - if (domains && r.out.domains) { - *domains = *r.out.domains; - } + *domains = *r.out.domains; *names = *r.out.names; *count = *r.out.count; @@ -2526,9 +2524,9 @@ NTSTATUS rpccli_lsa_LookupNames2(struct rpc_pipe_client *cli, struct policy_handle *handle, uint32_t num_names, struct lsa_String *names, - struct lsa_RefDomainList *domains, + struct lsa_RefDomainList **domains, struct lsa_TransSidArray2 *sids, - uint16_t level, + enum lsa_LookupNamesLevel level, uint32_t *count, uint32_t unknown1, uint32_t unknown2) @@ -2570,9 +2568,7 @@ NTSTATUS rpccli_lsa_LookupNames2(struct rpc_pipe_client *cli, } /* Return variables */ - if (domains && r.out.domains) { - *domains = *r.out.domains; - } + *domains = *r.out.domains; *sids = *r.out.sids; *count = *r.out.count; @@ -2918,9 +2914,9 @@ NTSTATUS rpccli_lsa_LookupNames3(struct rpc_pipe_client *cli, struct policy_handle *handle, uint32_t num_names, struct lsa_String *names, - struct lsa_RefDomainList *domains, + struct lsa_RefDomainList **domains, struct lsa_TransSidArray3 *sids, - uint16_t level, + enum lsa_LookupNamesLevel level, uint32_t *count, uint32_t unknown1, uint32_t unknown2) @@ -2962,9 +2958,7 @@ NTSTATUS rpccli_lsa_LookupNames3(struct rpc_pipe_client *cli, } /* Return variables */ - if (domains && r.out.domains) { - *domains = *r.out.domains; - } + *domains = *r.out.domains; *sids = *r.out.sids; *count = *r.out.count; @@ -3120,16 +3114,23 @@ NTSTATUS rpccli_lsa_LSARUNREGISTERAUDITEVENT(struct rpc_pipe_client *cli, return r.out.result; } -NTSTATUS rpccli_lsa_LSARQUERYFORESTTRUSTINFORMATION(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx) +NTSTATUS rpccli_lsa_lsaRQueryForestTrustInformation(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle, + struct lsa_String *trusted_domain_name, + uint16_t unknown, + struct lsa_ForestTrustInformation **forest_trust_info) { - struct lsa_LSARQUERYFORESTTRUSTINFORMATION r; + struct lsa_lsaRQueryForestTrustInformation r; NTSTATUS status; /* In parameters */ + r.in.handle = handle; + r.in.trusted_domain_name = trusted_domain_name; + r.in.unknown = unknown; if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(lsa_LSARQUERYFORESTTRUSTINFORMATION, &r); + NDR_PRINT_IN_DEBUG(lsa_lsaRQueryForestTrustInformation, &r); } status = cli_do_rpc_ndr(cli, @@ -3144,7 +3145,7 @@ NTSTATUS rpccli_lsa_LSARQUERYFORESTTRUSTINFORMATION(struct rpc_pipe_client *cli, } if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(lsa_LSARQUERYFORESTTRUSTINFORMATION, &r); + NDR_PRINT_OUT_DEBUG(lsa_lsaRQueryForestTrustInformation, &r); } if (NT_STATUS_IS_ERR(status)) { @@ -3152,6 +3153,7 @@ NTSTATUS rpccli_lsa_LSARQUERYFORESTTRUSTINFORMATION(struct rpc_pipe_client *cli, } /* Return variables */ + *forest_trust_info = *r.out.forest_trust_info; /* Return result */ return r.out.result; @@ -3234,7 +3236,7 @@ NTSTATUS rpccli_lsa_CREDRRENAME(struct rpc_pipe_client *cli, NTSTATUS rpccli_lsa_LookupSids3(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, struct lsa_SidArray *sids, - struct lsa_RefDomainList *domains, + struct lsa_RefDomainList **domains, struct lsa_TransNameArray2 *names, uint16_t level, uint32_t *count, @@ -3276,9 +3278,7 @@ NTSTATUS rpccli_lsa_LookupSids3(struct rpc_pipe_client *cli, } /* Return variables */ - if (domains && r.out.domains) { - *domains = *r.out.domains; - } + *domains = *r.out.domains; *names = *r.out.names; *count = *r.out.count; @@ -3290,9 +3290,9 @@ NTSTATUS rpccli_lsa_LookupNames4(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, uint32_t num_names, struct lsa_String *names, - struct lsa_RefDomainList *domains, + struct lsa_RefDomainList **domains, struct lsa_TransSidArray3 *sids, - uint16_t level, + enum lsa_LookupNamesLevel level, uint32_t *count, uint32_t unknown1, uint32_t unknown2) @@ -3333,9 +3333,7 @@ NTSTATUS rpccli_lsa_LookupNames4(struct rpc_pipe_client *cli, } /* Return variables */ - if (domains && r.out.domains) { - *domains = *r.out.domains; - } + *domains = *r.out.domains; *sids = *r.out.sids; *count = *r.out.count; diff --git a/source3/librpc/gen_ndr/cli_lsa.h b/source3/librpc/gen_ndr/cli_lsa.h index 4ab8be9939..7d69926484 100644 --- a/source3/librpc/gen_ndr/cli_lsa.h +++ b/source3/librpc/gen_ndr/cli_lsa.h @@ -11,15 +11,18 @@ NTSTATUS rpccli_lsa_EnumPrivs(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, struct policy_handle *handle, uint32_t *resume_handle, - uint32_t max_count, - struct lsa_PrivArray *privs); + struct lsa_PrivArray *privs, + uint32_t max_count); NTSTATUS rpccli_lsa_QuerySecurity(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, struct policy_handle *handle, uint32_t sec_info, - struct sec_desc_buf *sdbuf); + struct sec_desc_buf **sdbuf); NTSTATUS rpccli_lsa_SetSecObj(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx); + TALLOC_CTX *mem_ctx, + struct policy_handle *handle, + uint32_t sec_info, + struct sec_desc_buf *sdbuf); NTSTATUS rpccli_lsa_ChangePassword(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx); NTSTATUS rpccli_lsa_OpenPolicy(struct rpc_pipe_client *cli, @@ -32,7 +35,7 @@ NTSTATUS rpccli_lsa_QueryInfoPolicy(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, struct policy_handle *handle, enum lsa_PolicyInfo level, - union lsa_PolicyInformation *info); + union lsa_PolicyInformation **info); NTSTATUS rpccli_lsa_SetInfoPolicy(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, struct policy_handle *handle, @@ -50,8 +53,8 @@ NTSTATUS rpccli_lsa_EnumAccounts(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, struct policy_handle *handle, uint32_t *resume_handle, - uint32_t num_entries, - struct lsa_SidArray *sids); + struct lsa_SidArray *sids, + uint32_t num_entries); NTSTATUS rpccli_lsa_CreateTrustedDomain(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, struct policy_handle *handle, @@ -62,22 +65,22 @@ NTSTATUS rpccli_lsa_EnumTrustDom(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, struct policy_handle *handle, uint32_t *resume_handle, - uint32_t max_size, - struct lsa_DomainList *domains); + struct lsa_DomainList *domains, + uint32_t max_size); NTSTATUS rpccli_lsa_LookupNames(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, struct policy_handle *handle, uint32_t num_names, struct lsa_String *names, - struct lsa_RefDomainList *domains, + struct lsa_RefDomainList **domains, struct lsa_TransSidArray *sids, - uint16_t level, + enum lsa_LookupNamesLevel level, uint32_t *count); NTSTATUS rpccli_lsa_LookupSids(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, struct policy_handle *handle, struct lsa_SidArray *sids, - struct lsa_RefDomainList *domains, + struct lsa_RefDomainList **domains, struct lsa_TransNameArray *names, uint16_t level, uint32_t *count); @@ -96,7 +99,7 @@ NTSTATUS rpccli_lsa_OpenAccount(struct rpc_pipe_client *cli, NTSTATUS rpccli_lsa_EnumPrivsAccount(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, struct policy_handle *handle, - struct lsa_PrivilegeSet *privs); + struct lsa_PrivilegeSet **privs); NTSTATUS rpccli_lsa_AddPrivilegesToAccount(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, struct policy_handle *handle, @@ -111,9 +114,13 @@ NTSTATUS rpccli_lsa_GetQuotasForAccount(struct rpc_pipe_client *cli, NTSTATUS rpccli_lsa_SetQuotasForAccount(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx); NTSTATUS rpccli_lsa_GetSystemAccessAccount(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx); + TALLOC_CTX *mem_ctx, + struct policy_handle *handle, + uint32_t *access_mask); NTSTATUS rpccli_lsa_SetSystemAccessAccount(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx); + TALLOC_CTX *mem_ctx, + struct policy_handle *handle, + uint32_t access_mask); NTSTATUS rpccli_lsa_OpenTrustedDomain(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, struct policy_handle *handle, @@ -159,11 +166,13 @@ NTSTATUS rpccli_lsa_LookupPrivDisplayName(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, struct policy_handle *handle, struct lsa_String *name, - struct lsa_StringLarge *disp_name, - uint16_t *language_id, - uint16_t unknown); + uint16_t language_id, + uint16_t language_id_sys, + struct lsa_StringLarge **disp_name, + uint16_t *returned_language_id); NTSTATUS rpccli_lsa_DeleteObject(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx); + TALLOC_CTX *mem_ctx, + struct policy_handle *handle); NTSTATUS rpccli_lsa_EnumAccountsWithUserRight(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, struct policy_handle *handle, @@ -183,7 +192,7 @@ NTSTATUS rpccli_lsa_RemoveAccountRights(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, struct policy_handle *handle, struct dom_sid2 *sid, - uint32_t unknown, + uint8_t remove_all, struct lsa_RightSet *rights); NTSTATUS rpccli_lsa_QueryTrustedDomainInfoBySid(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, @@ -210,13 +219,13 @@ NTSTATUS rpccli_lsa_OpenPolicy2(struct rpc_pipe_client *cli, NTSTATUS rpccli_lsa_GetUserName(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, const char *system_name, - struct lsa_String *account_name, - struct lsa_StringPointer *authority_name); + struct lsa_String **account_name, + struct lsa_String **authority_name); NTSTATUS rpccli_lsa_QueryInfoPolicy2(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, struct policy_handle *handle, enum lsa_PolicyInfo level, - union lsa_PolicyInformation *info); + union lsa_PolicyInformation **info); NTSTATUS rpccli_lsa_SetInfoPolicy2(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, struct policy_handle *handle, @@ -225,7 +234,7 @@ NTSTATUS rpccli_lsa_SetInfoPolicy2(struct rpc_pipe_client *cli, NTSTATUS rpccli_lsa_QueryTrustedDomainInfoByName(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, struct policy_handle *handle, - struct lsa_String trusted_domain, + struct lsa_String *trusted_domain, enum lsa_TrustDomInfoEnum level, union lsa_TrustedDomainInfo *info); NTSTATUS rpccli_lsa_SetTrustedDomainInfoByName(struct rpc_pipe_client *cli, @@ -267,7 +276,7 @@ NTSTATUS rpccli_lsa_LookupSids2(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, struct policy_handle *handle, struct lsa_SidArray *sids, - struct lsa_RefDomainList *domains, + struct lsa_RefDomainList **domains, struct lsa_TransNameArray2 *names, uint16_t level, uint32_t *count, @@ -278,9 +287,9 @@ NTSTATUS rpccli_lsa_LookupNames2(struct rpc_pipe_client *cli, struct policy_handle *handle, uint32_t num_names, struct lsa_String *names, - struct lsa_RefDomainList *domains, + struct lsa_RefDomainList **domains, struct lsa_TransSidArray2 *sids, - uint16_t level, + enum lsa_LookupNamesLevel level, uint32_t *count, uint32_t unknown1, uint32_t unknown2); @@ -307,9 +316,9 @@ NTSTATUS rpccli_lsa_LookupNames3(struct rpc_pipe_client *cli, struct policy_handle *handle, uint32_t num_names, struct lsa_String *names, - struct lsa_RefDomainList *domains, + struct lsa_RefDomainList **domains, struct lsa_TransSidArray3 *sids, - uint16_t level, + enum lsa_LookupNamesLevel level, uint32_t *count, uint32_t unknown1, uint32_t unknown2); @@ -321,8 +330,12 @@ NTSTATUS rpccli_lsa_LSARGENAUDITEVENT(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx); NTSTATUS rpccli_lsa_LSARUNREGISTERAUDITEVENT(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx); -NTSTATUS rpccli_lsa_LSARQUERYFORESTTRUSTINFORMATION(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx); +NTSTATUS rpccli_lsa_lsaRQueryForestTrustInformation(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle, + struct lsa_String *trusted_domain_name, + uint16_t unknown, + struct lsa_ForestTrustInformation **forest_trust_info); NTSTATUS rpccli_lsa_LSARSETFORESTTRUSTINFORMATION(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx); NTSTATUS rpccli_lsa_CREDRRENAME(struct rpc_pipe_client *cli, @@ -330,7 +343,7 @@ NTSTATUS rpccli_lsa_CREDRRENAME(struct rpc_pipe_client *cli, NTSTATUS rpccli_lsa_LookupSids3(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, struct lsa_SidArray *sids, - struct lsa_RefDomainList *domains, + struct lsa_RefDomainList **domains, struct lsa_TransNameArray2 *names, uint16_t level, uint32_t *count, @@ -340,9 +353,9 @@ NTSTATUS rpccli_lsa_LookupNames4(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, uint32_t num_names, struct lsa_String *names, - struct lsa_RefDomainList *domains, + struct lsa_RefDomainList **domains, struct lsa_TransSidArray3 *sids, - uint16_t level, + enum lsa_LookupNamesLevel level, uint32_t *count, uint32_t unknown1, uint32_t unknown2); diff --git a/source3/librpc/gen_ndr/cli_netlogon.c b/source3/librpc/gen_ndr/cli_netlogon.c index efabf2e08f..2937cc09b9 100644 --- a/source3/librpc/gen_ndr/cli_netlogon.c +++ b/source3/librpc/gen_ndr/cli_netlogon.c @@ -46,9 +46,7 @@ NTSTATUS rpccli_netr_LogonUasLogon(struct rpc_pipe_client *cli, } /* Return variables */ - if (info && r.out.info) { - *info = *r.out.info; - } + *info = *r.out.info; /* Return result */ if (werror) { @@ -115,7 +113,7 @@ NTSTATUS rpccli_netr_LogonSamLogon(struct rpc_pipe_client *cli, struct netr_Authenticator *credential, struct netr_Authenticator *return_authenticator, uint16_t logon_level, - union netr_LogonLevel logon, + union netr_LogonLevel *logon, uint16_t validation_level, union netr_Validation *validation, uint8_t *authoritative) @@ -222,7 +220,8 @@ NTSTATUS rpccli_netr_ServerReqChallenge(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, const char *server_name, const char *computer_name, - struct netr_Credential *credentials) + struct netr_Credential *credentials, + struct netr_Credential *return_credentials) { struct netr_ServerReqChallenge r; NTSTATUS status; @@ -256,7 +255,7 @@ NTSTATUS rpccli_netr_ServerReqChallenge(struct rpc_pipe_client *cli, } /* Return variables */ - *credentials = *r.out.credentials; + *return_credentials = *r.out.return_credentials; /* Return result */ return r.out.result; @@ -268,7 +267,8 @@ NTSTATUS rpccli_netr_ServerAuthenticate(struct rpc_pipe_client *cli, const char *account_name, enum netr_SchannelType secure_channel_type, const char *computer_name, - struct netr_Credential *credentials) + struct netr_Credential *credentials, + struct netr_Credential *return_credentials) { struct netr_ServerAuthenticate r; NTSTATUS status; @@ -304,7 +304,7 @@ NTSTATUS rpccli_netr_ServerAuthenticate(struct rpc_pipe_client *cli, } /* Return variables */ - *credentials = *r.out.credentials; + *return_credentials = *r.out.return_credentials; /* Return result */ return r.out.result; @@ -316,9 +316,9 @@ NTSTATUS rpccli_netr_ServerPasswordSet(struct rpc_pipe_client *cli, const char *account_name, enum netr_SchannelType secure_channel_type, const char *computer_name, - struct netr_Authenticator credential, - struct samr_Password new_password, - struct netr_Authenticator *return_authenticator) + struct netr_Authenticator *credential, + struct netr_Authenticator *return_authenticator, + struct samr_Password *new_password) { struct netr_ServerPasswordSet r; NTSTATUS status; @@ -365,12 +365,12 @@ NTSTATUS rpccli_netr_DatabaseDeltas(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, const char *logon_server, const char *computername, - struct netr_Authenticator credential, + struct netr_Authenticator *credential, struct netr_Authenticator *return_authenticator, enum netr_SamDatabaseID database_id, uint64_t *sequence_num, - uint32_t preferredmaximumlength, - struct netr_DELTA_ENUM_ARRAY *delta_enum_array) + struct netr_DELTA_ENUM_ARRAY **delta_enum_array, + uint32_t preferredmaximumlength) { struct netr_DatabaseDeltas r; NTSTATUS status; @@ -410,9 +410,7 @@ NTSTATUS rpccli_netr_DatabaseDeltas(struct rpc_pipe_client *cli, /* Return variables */ *return_authenticator = *r.out.return_authenticator; *sequence_num = *r.out.sequence_num; - if (delta_enum_array && r.out.delta_enum_array) { - *delta_enum_array = *r.out.delta_enum_array; - } + *delta_enum_array = *r.out.delta_enum_array; /* Return result */ return r.out.result; @@ -467,9 +465,7 @@ NTSTATUS rpccli_netr_DatabaseSync(struct rpc_pipe_client *cli, /* Return variables */ *return_authenticator = *r.out.return_authenticator; *sync_context = *r.out.sync_context; - if (delta_enum_array && r.out.delta_enum_array) { - *delta_enum_array = *r.out.delta_enum_array; - } + *delta_enum_array = *r.out.delta_enum_array; /* Return result */ return r.out.result; @@ -604,7 +600,8 @@ NTSTATUS rpccli_netr_GetDcName(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, const char *logon_server, const char *domainname, - const char **dcname) + const char **dcname, + WERROR *werror) { struct netr_GetDcName r; NTSTATUS status; @@ -640,7 +637,11 @@ NTSTATUS rpccli_netr_GetDcName(struct rpc_pipe_client *cli, *dcname = *r.out.dcname; /* Return result */ - return r.out.result; + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); } NTSTATUS rpccli_netr_LogonControl(struct rpc_pipe_client *cli, @@ -746,7 +747,7 @@ NTSTATUS rpccli_netr_LogonControl2(struct rpc_pipe_client *cli, const char *logon_server, uint32_t function_code, uint32_t level, - union netr_CONTROL_DATA_INFORMATION data, + union netr_CONTROL_DATA_INFORMATION *data, union netr_CONTROL_QUERY_INFORMATION *query, WERROR *werror) { @@ -800,6 +801,7 @@ NTSTATUS rpccli_netr_ServerAuthenticate2(struct rpc_pipe_client *cli, enum netr_SchannelType secure_channel_type, const char *computer_name, struct netr_Credential *credentials, + struct netr_Credential *return_credentials, uint32_t *negotiate_flags) { struct netr_ServerAuthenticate2 r; @@ -837,7 +839,7 @@ NTSTATUS rpccli_netr_ServerAuthenticate2(struct rpc_pipe_client *cli, } /* Return variables */ - *credentials = *r.out.credentials; + *return_credentials = *r.out.return_credentials; *negotiate_flags = *r.out.negotiate_flags; /* Return result */ @@ -848,13 +850,13 @@ NTSTATUS rpccli_netr_DatabaseSync2(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, const char *logon_server, const char *computername, - struct netr_Authenticator credential, + struct netr_Authenticator *credential, struct netr_Authenticator *return_authenticator, enum netr_SamDatabaseID database_id, uint16_t restart_state, uint32_t *sync_context, - uint32_t preferredmaximumlength, - struct netr_DELTA_ENUM_ARRAY *delta_enum_array) + struct netr_DELTA_ENUM_ARRAY **delta_enum_array, + uint32_t preferredmaximumlength) { struct netr_DatabaseSync2 r; NTSTATUS status; @@ -895,9 +897,7 @@ NTSTATUS rpccli_netr_DatabaseSync2(struct rpc_pipe_client *cli, /* Return variables */ *return_authenticator = *r.out.return_authenticator; *sync_context = *r.out.sync_context; - if (delta_enum_array && r.out.delta_enum_array) { - *delta_enum_array = *r.out.delta_enum_array; - } + *delta_enum_array = *r.out.delta_enum_array; /* Return result */ return r.out.result; @@ -949,9 +949,7 @@ NTSTATUS rpccli_netr_DatabaseRedo(struct rpc_pipe_client *cli, /* Return variables */ *return_authenticator = *r.out.return_authenticator; - if (delta_enum_array && r.out.delta_enum_array) { - *delta_enum_array = *r.out.delta_enum_array; - } + *delta_enum_array = *r.out.delta_enum_array; /* Return result */ return r.out.result; @@ -1009,17 +1007,20 @@ NTSTATUS rpccli_netr_LogonControl2Ex(struct rpc_pipe_client *cli, return werror_to_ntstatus(r.out.result); } -NTSTATUS rpccli_netr_NETRENUMERATETRUSTEDDOMAINS(struct rpc_pipe_client *cli, +NTSTATUS rpccli_netr_NetrEnumerateTrustedDomains(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, + const char *server_name, + struct netr_Blob *trusted_domains_blob, WERROR *werror) { - struct netr_NETRENUMERATETRUSTEDDOMAINS r; + struct netr_NetrEnumerateTrustedDomains r; NTSTATUS status; /* In parameters */ + r.in.server_name = server_name; if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(netr_NETRENUMERATETRUSTEDDOMAINS, &r); + NDR_PRINT_IN_DEBUG(netr_NetrEnumerateTrustedDomains, &r); } status = cli_do_rpc_ndr(cli, @@ -1034,7 +1035,7 @@ NTSTATUS rpccli_netr_NETRENUMERATETRUSTEDDOMAINS(struct rpc_pipe_client *cli, } if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(netr_NETRENUMERATETRUSTEDDOMAINS, &r); + NDR_PRINT_OUT_DEBUG(netr_NetrEnumerateTrustedDomains, &r); } if (NT_STATUS_IS_ERR(status)) { @@ -1042,6 +1043,7 @@ NTSTATUS rpccli_netr_NETRENUMERATETRUSTEDDOMAINS(struct rpc_pipe_client *cli, } /* Return variables */ + *trusted_domains_blob = *r.out.trusted_domains_blob; /* Return result */ if (werror) { @@ -1058,7 +1060,7 @@ NTSTATUS rpccli_netr_DsRGetDCName(struct rpc_pipe_client *cli, struct GUID *domain_guid, struct GUID *site_guid, uint32_t flags, - struct netr_DsRGetDCNameInfo *info, + struct netr_DsRGetDCNameInfo **info, WERROR *werror) { struct netr_DsRGetDCName r; @@ -1095,9 +1097,7 @@ NTSTATUS rpccli_netr_DsRGetDCName(struct rpc_pipe_client *cli, } /* Return variables */ - if (info && r.out.info) { - *info = *r.out.info; - } + *info = *r.out.info; /* Return result */ if (werror) { @@ -1191,24 +1191,29 @@ NTSTATUS rpccli_netr_NETRLOGONSETSERVICEBITS(struct rpc_pipe_client *cli, return werror_to_ntstatus(r.out.result); } -NTSTATUS rpccli_netr_NETRLOGONGETTRUSTRID(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror) +NTSTATUS rpccli_netr_LogonGetTrustRid(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_name, + const char *domain_name, + uint32_t *rid, + WERROR *werror) { - struct netr_NETRLOGONGETTRUSTRID r; + struct netr_LogonGetTrustRid r; NTSTATUS status; /* In parameters */ + r.in.server_name = server_name; + r.in.domain_name = domain_name; if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(netr_NETRLOGONGETTRUSTRID, &r); + NDR_PRINT_IN_DEBUG(netr_LogonGetTrustRid, &r); } status = cli_do_rpc_ndr(cli, mem_ctx, PI_NETLOGON, &ndr_table_netlogon, - NDR_NETR_NETRLOGONGETTRUSTRID, + NDR_NETR_LOGONGETTRUSTRID, &r); if (!NT_STATUS_IS_OK(status)) { @@ -1216,7 +1221,7 @@ NTSTATUS rpccli_netr_NETRLOGONGETTRUSTRID(struct rpc_pipe_client *cli, } if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(netr_NETRLOGONGETTRUSTRID, &r); + NDR_PRINT_OUT_DEBUG(netr_LogonGetTrustRid, &r); } if (NT_STATUS_IS_ERR(status)) { @@ -1224,6 +1229,7 @@ NTSTATUS rpccli_netr_NETRLOGONGETTRUSTRID(struct rpc_pipe_client *cli, } /* Return variables */ + *rid = *r.out.rid; /* Return result */ if (werror) { @@ -1377,7 +1383,7 @@ NTSTATUS rpccli_netr_DsRGetDCNameEx(struct rpc_pipe_client *cli, struct GUID *domain_guid, const char *site_name, uint32_t flags, - struct netr_DsRGetDCNameInfo *info, + struct netr_DsRGetDCNameInfo **info, WERROR *werror) { struct netr_DsRGetDCNameEx r; @@ -1414,9 +1420,7 @@ NTSTATUS rpccli_netr_DsRGetDCNameEx(struct rpc_pipe_client *cli, } /* Return variables */ - if (info && r.out.info) { - *info = *r.out.info; - } + *info = *r.out.info; /* Return result */ if (werror) { @@ -1575,24 +1579,36 @@ NTSTATUS rpccli_netr_ServerPasswordSet2(struct rpc_pipe_client *cli, return r.out.result; } -NTSTATUS rpccli_netr_NETRSERVERPASSWORDGET(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror) +NTSTATUS rpccli_netr_ServerPasswordGet(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_name, + const char *account_name, + enum netr_SchannelType secure_channel_type, + const char *computer_name, + struct netr_Authenticator *credential, + struct netr_Authenticator *return_authenticator, + struct samr_Password *password, + WERROR *werror) { - struct netr_NETRSERVERPASSWORDGET r; + struct netr_ServerPasswordGet r; NTSTATUS status; /* In parameters */ + r.in.server_name = server_name; + r.in.account_name = account_name; + r.in.secure_channel_type = secure_channel_type; + r.in.computer_name = computer_name; + r.in.credential = credential; if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(netr_NETRSERVERPASSWORDGET, &r); + NDR_PRINT_IN_DEBUG(netr_ServerPasswordGet, &r); } status = cli_do_rpc_ndr(cli, mem_ctx, PI_NETLOGON, &ndr_table_netlogon, - NDR_NETR_NETRSERVERPASSWORDGET, + NDR_NETR_SERVERPASSWORDGET, &r); if (!NT_STATUS_IS_OK(status)) { @@ -1600,7 +1616,7 @@ NTSTATUS rpccli_netr_NETRSERVERPASSWORDGET(struct rpc_pipe_client *cli, } if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(netr_NETRSERVERPASSWORDGET, &r); + NDR_PRINT_OUT_DEBUG(netr_ServerPasswordGet, &r); } if (NT_STATUS_IS_ERR(status)) { @@ -1608,6 +1624,8 @@ NTSTATUS rpccli_netr_NETRSERVERPASSWORDGET(struct rpc_pipe_client *cli, } /* Return variables */ + *return_authenticator = *r.out.return_authenticator; + *password = *r.out.password; /* Return result */ if (werror) { @@ -1659,17 +1677,24 @@ NTSTATUS rpccli_netr_NETRLOGONSENDTOSAM(struct rpc_pipe_client *cli, return werror_to_ntstatus(r.out.result); } -NTSTATUS rpccli_netr_DSRADDRESSTOSITENAMESW(struct rpc_pipe_client *cli, +NTSTATUS rpccli_netr_DsRAddressToSitenamesW(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, + const char *server_name, + uint32_t count, + struct netr_DsRAddress *addresses, + struct netr_DsRAddressToSitenamesWCtr **ctr, WERROR *werror) { - struct netr_DSRADDRESSTOSITENAMESW r; + struct netr_DsRAddressToSitenamesW r; NTSTATUS status; /* In parameters */ + r.in.server_name = server_name; + r.in.count = count; + r.in.addresses = addresses; if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(netr_DSRADDRESSTOSITENAMESW, &r); + NDR_PRINT_IN_DEBUG(netr_DsRAddressToSitenamesW, &r); } status = cli_do_rpc_ndr(cli, @@ -1684,7 +1709,7 @@ NTSTATUS rpccli_netr_DSRADDRESSTOSITENAMESW(struct rpc_pipe_client *cli, } if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(netr_DSRADDRESSTOSITENAMESW, &r); + NDR_PRINT_OUT_DEBUG(netr_DsRAddressToSitenamesW, &r); } if (NT_STATUS_IS_ERR(status)) { @@ -1692,6 +1717,7 @@ NTSTATUS rpccli_netr_DSRADDRESSTOSITENAMESW(struct rpc_pipe_client *cli, } /* Return variables */ + *ctr = *r.out.ctr; /* Return result */ if (werror) { @@ -1710,7 +1736,7 @@ NTSTATUS rpccli_netr_DsRGetDCNameEx2(struct rpc_pipe_client *cli, struct GUID *domain_guid, const char *site_name, uint32_t flags, - struct netr_DsRGetDCNameInfo *info, + struct netr_DsRGetDCNameInfo **info, WERROR *werror) { struct netr_DsRGetDCNameEx2 r; @@ -1749,9 +1775,7 @@ NTSTATUS rpccli_netr_DsRGetDCNameEx2(struct rpc_pipe_client *cli, } /* Return variables */ - if (info && r.out.info) { - *info = *r.out.info; - } + *info = *r.out.info; /* Return result */ if (werror) { @@ -1803,17 +1827,20 @@ NTSTATUS rpccli_netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN(struct rpc_pipe_client return werror_to_ntstatus(r.out.result); } -NTSTATUS rpccli_netr_NETRENUMERATETRUSTEDDOMAINSEX(struct rpc_pipe_client *cli, +NTSTATUS rpccli_netr_NetrEnumerateTrustedDomainsEx(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, + const char *server_name, + struct netr_DomainTrustList *dom_trust_list, WERROR *werror) { - struct netr_NETRENUMERATETRUSTEDDOMAINSEX r; + struct netr_NetrEnumerateTrustedDomainsEx r; NTSTATUS status; /* In parameters */ + r.in.server_name = server_name; if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(netr_NETRENUMERATETRUSTEDDOMAINSEX, &r); + NDR_PRINT_IN_DEBUG(netr_NetrEnumerateTrustedDomainsEx, &r); } status = cli_do_rpc_ndr(cli, @@ -1828,7 +1855,7 @@ NTSTATUS rpccli_netr_NETRENUMERATETRUSTEDDOMAINSEX(struct rpc_pipe_client *cli, } if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(netr_NETRENUMERATETRUSTEDDOMAINSEX, &r); + NDR_PRINT_OUT_DEBUG(netr_NetrEnumerateTrustedDomainsEx, &r); } if (NT_STATUS_IS_ERR(status)) { @@ -1836,6 +1863,7 @@ NTSTATUS rpccli_netr_NETRENUMERATETRUSTEDDOMAINSEX(struct rpc_pipe_client *cli, } /* Return variables */ + *dom_trust_list = *r.out.dom_trust_list; /* Return result */ if (werror) { @@ -1845,17 +1873,24 @@ NTSTATUS rpccli_netr_NETRENUMERATETRUSTEDDOMAINSEX(struct rpc_pipe_client *cli, return werror_to_ntstatus(r.out.result); } -NTSTATUS rpccli_netr_DSRADDRESSTOSITENAMESEXW(struct rpc_pipe_client *cli, +NTSTATUS rpccli_netr_DsRAddressToSitenamesExW(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, + const char *server_name, + uint32_t count, + struct netr_DsRAddress *addresses, + struct netr_DsRAddressToSitenamesExWCtr **ctr, WERROR *werror) { - struct netr_DSRADDRESSTOSITENAMESEXW r; + struct netr_DsRAddressToSitenamesExW r; NTSTATUS status; /* In parameters */ + r.in.server_name = server_name; + r.in.count = count; + r.in.addresses = addresses; if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(netr_DSRADDRESSTOSITENAMESEXW, &r); + NDR_PRINT_IN_DEBUG(netr_DsRAddressToSitenamesExW, &r); } status = cli_do_rpc_ndr(cli, @@ -1870,7 +1905,7 @@ NTSTATUS rpccli_netr_DSRADDRESSTOSITENAMESEXW(struct rpc_pipe_client *cli, } if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(netr_DSRADDRESSTOSITENAMESEXW, &r); + NDR_PRINT_OUT_DEBUG(netr_DsRAddressToSitenamesExW, &r); } if (NT_STATUS_IS_ERR(status)) { @@ -1878,6 +1913,7 @@ NTSTATUS rpccli_netr_DSRADDRESSTOSITENAMESEXW(struct rpc_pipe_client *cli, } /* Return variables */ + *ctr = *r.out.ctr; /* Return result */ if (werror) { @@ -1887,17 +1923,20 @@ NTSTATUS rpccli_netr_DSRADDRESSTOSITENAMESEXW(struct rpc_pipe_client *cli, return werror_to_ntstatus(r.out.result); } -NTSTATUS rpccli_netr_DSRGETDCSITECOVERAGEW(struct rpc_pipe_client *cli, +NTSTATUS rpccli_netr_DsrGetDcSiteCoverageW(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, + const char *server_name, + struct DcSitesCtr *ctr, WERROR *werror) { - struct netr_DSRGETDCSITECOVERAGEW r; + struct netr_DsrGetDcSiteCoverageW r; NTSTATUS status; /* In parameters */ + r.in.server_name = server_name; if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(netr_DSRGETDCSITECOVERAGEW, &r); + NDR_PRINT_IN_DEBUG(netr_DsrGetDcSiteCoverageW, &r); } status = cli_do_rpc_ndr(cli, @@ -1912,7 +1951,7 @@ NTSTATUS rpccli_netr_DSRGETDCSITECOVERAGEW(struct rpc_pipe_client *cli, } if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(netr_DSRGETDCSITECOVERAGEW, &r); + NDR_PRINT_OUT_DEBUG(netr_DsrGetDcSiteCoverageW, &r); } if (NT_STATUS_IS_ERR(status)) { @@ -1920,6 +1959,7 @@ NTSTATUS rpccli_netr_DSRGETDCSITECOVERAGEW(struct rpc_pipe_client *cli, } /* Return variables */ + *ctr = *r.out.ctr; /* Return result */ if (werror) { @@ -1934,7 +1974,7 @@ NTSTATUS rpccli_netr_LogonSamLogonEx(struct rpc_pipe_client *cli, const char *server_name, const char *computer_name, uint16_t logon_level, - union netr_LogonLevel logon, + union netr_LogonLevel *logon, uint16_t validation_level, union netr_Validation *validation, uint8_t *authoritative, @@ -1987,8 +2027,7 @@ NTSTATUS rpccli_netr_DsrEnumerateDomainTrusts(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, const char *server_name, uint32_t trust_flags, - uint32_t *count, - struct netr_DomainTrust **trusts, + struct netr_DomainTrustList *trusts, WERROR *werror) { struct netr_DsrEnumerateDomainTrusts r; @@ -2022,8 +2061,7 @@ NTSTATUS rpccli_netr_DsrEnumerateDomainTrusts(struct rpc_pipe_client *cli, } /* Return variables */ - *count = *r.out.count; - memcpy(trusts, r.out.trusts, count); + *trusts = *r.out.trusts; /* Return result */ if (werror) { @@ -2033,17 +2071,27 @@ NTSTATUS rpccli_netr_DsrEnumerateDomainTrusts(struct rpc_pipe_client *cli, return werror_to_ntstatus(r.out.result); } -NTSTATUS rpccli_netr_DSRDEREGISTERDNSHOSTRECORDS(struct rpc_pipe_client *cli, +NTSTATUS rpccli_netr_DsrDeregisterDNSHostRecords(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, + const char *server_name, + const char *domain, + struct GUID *domain_guid, + struct GUID *dsa_guid, + const char *dns_host, WERROR *werror) { - struct netr_DSRDEREGISTERDNSHOSTRECORDS r; + struct netr_DsrDeregisterDNSHostRecords r; NTSTATUS status; /* In parameters */ + r.in.server_name = server_name; + r.in.domain = domain; + r.in.domain_guid = domain_guid; + r.in.dsa_guid = dsa_guid; + r.in.dns_host = dns_host; if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(netr_DSRDEREGISTERDNSHOSTRECORDS, &r); + NDR_PRINT_IN_DEBUG(netr_DsrDeregisterDNSHostRecords, &r); } status = cli_do_rpc_ndr(cli, @@ -2058,7 +2106,7 @@ NTSTATUS rpccli_netr_DSRDEREGISTERDNSHOSTRECORDS(struct rpc_pipe_client *cli, } if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(netr_DSRDEREGISTERDNSHOSTRECORDS, &r); + NDR_PRINT_OUT_DEBUG(netr_DsrDeregisterDNSHostRecords, &r); } if (NT_STATUS_IS_ERR(status)) { @@ -2075,24 +2123,36 @@ NTSTATUS rpccli_netr_DSRDEREGISTERDNSHOSTRECORDS(struct rpc_pipe_client *cli, return werror_to_ntstatus(r.out.result); } -NTSTATUS rpccli_netr_NETRSERVERTRUSTPASSWORDSGET(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror) +NTSTATUS rpccli_netr_ServerTrustPasswordsGet(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_name, + const char *account_name, + enum netr_SchannelType secure_channel_type, + const char *computer_name, + struct netr_Authenticator *credential, + struct netr_Authenticator *return_authenticator, + struct samr_Password *password, + struct samr_Password *password2) { - struct netr_NETRSERVERTRUSTPASSWORDSGET r; + struct netr_ServerTrustPasswordsGet r; NTSTATUS status; /* In parameters */ + r.in.server_name = server_name; + r.in.account_name = account_name; + r.in.secure_channel_type = secure_channel_type; + r.in.computer_name = computer_name; + r.in.credential = credential; if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(netr_NETRSERVERTRUSTPASSWORDSGET, &r); + NDR_PRINT_IN_DEBUG(netr_ServerTrustPasswordsGet, &r); } status = cli_do_rpc_ndr(cli, mem_ctx, PI_NETLOGON, &ndr_table_netlogon, - NDR_NETR_NETRSERVERTRUSTPASSWORDSGET, + NDR_NETR_SERVERTRUSTPASSWORDSGET, &r); if (!NT_STATUS_IS_OK(status)) { @@ -2100,7 +2160,7 @@ NTSTATUS rpccli_netr_NETRSERVERTRUSTPASSWORDSGET(struct rpc_pipe_client *cli, } if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(netr_NETRSERVERTRUSTPASSWORDSGET, &r); + NDR_PRINT_OUT_DEBUG(netr_ServerTrustPasswordsGet, &r); } if (NT_STATUS_IS_ERR(status)) { @@ -2108,26 +2168,32 @@ NTSTATUS rpccli_netr_NETRSERVERTRUSTPASSWORDSGET(struct rpc_pipe_client *cli, } /* Return variables */ + *return_authenticator = *r.out.return_authenticator; + *password = *r.out.password; + *password2 = *r.out.password2; /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); + return r.out.result; } -NTSTATUS rpccli_netr_DSRGETFORESTTRUSTINFORMATION(struct rpc_pipe_client *cli, +NTSTATUS rpccli_netr_DsRGetForestTrustInformation(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, + const char *server_name, + const char *trusted_domain_name, + uint32_t flags, + struct lsa_ForestTrustInformation **forest_trust_info, WERROR *werror) { - struct netr_DSRGETFORESTTRUSTINFORMATION r; + struct netr_DsRGetForestTrustInformation r; NTSTATUS status; /* In parameters */ + r.in.server_name = server_name; + r.in.trusted_domain_name = trusted_domain_name; + r.in.flags = flags; if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(netr_DSRGETFORESTTRUSTINFORMATION, &r); + NDR_PRINT_IN_DEBUG(netr_DsRGetForestTrustInformation, &r); } status = cli_do_rpc_ndr(cli, @@ -2142,7 +2208,7 @@ NTSTATUS rpccli_netr_DSRGETFORESTTRUSTINFORMATION(struct rpc_pipe_client *cli, } if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(netr_DSRGETFORESTTRUSTINFORMATION, &r); + NDR_PRINT_OUT_DEBUG(netr_DsRGetForestTrustInformation, &r); } if (NT_STATUS_IS_ERR(status)) { @@ -2150,6 +2216,7 @@ NTSTATUS rpccli_netr_DSRGETFORESTTRUSTINFORMATION(struct rpc_pipe_client *cli, } /* Return variables */ + *forest_trust_info = *r.out.forest_trust_info; /* Return result */ if (werror) { @@ -2159,24 +2226,34 @@ NTSTATUS rpccli_netr_DSRGETFORESTTRUSTINFORMATION(struct rpc_pipe_client *cli, return werror_to_ntstatus(r.out.result); } -NTSTATUS rpccli_netr_NETRGETFORESTTRUSTINFORMATION(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror) +NTSTATUS rpccli_netr_GetForestTrustInformation(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_name, + const char *trusted_domain_name, + struct netr_Authenticator *credential, + struct netr_Authenticator *return_authenticator, + uint32_t flags, + struct lsa_ForestTrustInformation **forest_trust_info, + WERROR *werror) { - struct netr_NETRGETFORESTTRUSTINFORMATION r; + struct netr_GetForestTrustInformation r; NTSTATUS status; /* In parameters */ + r.in.server_name = server_name; + r.in.trusted_domain_name = trusted_domain_name; + r.in.credential = credential; + r.in.flags = flags; if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(netr_NETRGETFORESTTRUSTINFORMATION, &r); + NDR_PRINT_IN_DEBUG(netr_GetForestTrustInformation, &r); } status = cli_do_rpc_ndr(cli, mem_ctx, PI_NETLOGON, &ndr_table_netlogon, - NDR_NETR_NETRGETFORESTTRUSTINFORMATION, + NDR_NETR_GETFORESTTRUSTINFORMATION, &r); if (!NT_STATUS_IS_OK(status)) { @@ -2184,7 +2261,7 @@ NTSTATUS rpccli_netr_NETRGETFORESTTRUSTINFORMATION(struct rpc_pipe_client *cli, } if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(netr_NETRGETFORESTTRUSTINFORMATION, &r); + NDR_PRINT_OUT_DEBUG(netr_GetForestTrustInformation, &r); } if (NT_STATUS_IS_ERR(status)) { @@ -2192,6 +2269,8 @@ NTSTATUS rpccli_netr_NETRGETFORESTTRUSTINFORMATION(struct rpc_pipe_client *cli, } /* Return variables */ + *return_authenticator = *r.out.return_authenticator; + *forest_trust_info = *r.out.forest_trust_info; /* Return result */ if (werror) { diff --git a/source3/librpc/gen_ndr/cli_netlogon.h b/source3/librpc/gen_ndr/cli_netlogon.h index 9409077d09..1fdc1f6c46 100644 --- a/source3/librpc/gen_ndr/cli_netlogon.h +++ b/source3/librpc/gen_ndr/cli_netlogon.h @@ -22,7 +22,7 @@ NTSTATUS rpccli_netr_LogonSamLogon(struct rpc_pipe_client *cli, struct netr_Authenticator *credential, struct netr_Authenticator *return_authenticator, uint16_t logon_level, - union netr_LogonLevel logon, + union netr_LogonLevel *logon, uint16_t validation_level, union netr_Validation *validation, uint8_t *authoritative); @@ -38,33 +38,35 @@ NTSTATUS rpccli_netr_ServerReqChallenge(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, const char *server_name, const char *computer_name, - struct netr_Credential *credentials); + struct netr_Credential *credentials, + struct netr_Credential *return_credentials); NTSTATUS rpccli_netr_ServerAuthenticate(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, const char *server_name, const char *account_name, enum netr_SchannelType secure_channel_type, const char *computer_name, - struct netr_Credential *credentials); + struct netr_Credential *credentials, + struct netr_Credential *return_credentials); NTSTATUS rpccli_netr_ServerPasswordSet(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, const char *server_name, const char *account_name, enum netr_SchannelType secure_channel_type, const char *computer_name, - struct netr_Authenticator credential, - struct samr_Password new_password, - struct netr_Authenticator *return_authenticator); + struct netr_Authenticator *credential, + struct netr_Authenticator *return_authenticator, + struct samr_Password *new_password); NTSTATUS rpccli_netr_DatabaseDeltas(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, const char *logon_server, const char *computername, - struct netr_Authenticator credential, + struct netr_Authenticator *credential, struct netr_Authenticator *return_authenticator, enum netr_SamDatabaseID database_id, uint64_t *sequence_num, - uint32_t preferredmaximumlength, - struct netr_DELTA_ENUM_ARRAY *delta_enum_array); + struct netr_DELTA_ENUM_ARRAY **delta_enum_array, + uint32_t preferredmaximumlength); NTSTATUS rpccli_netr_DatabaseSync(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, const char *logon_server, @@ -107,7 +109,8 @@ NTSTATUS rpccli_netr_GetDcName(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, const char *logon_server, const char *domainname, - const char **dcname); + const char **dcname, + WERROR *werror); NTSTATUS rpccli_netr_LogonControl(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, const char *logon_server, @@ -126,7 +129,7 @@ NTSTATUS rpccli_netr_LogonControl2(struct rpc_pipe_client *cli, const char *logon_server, uint32_t function_code, uint32_t level, - union netr_CONTROL_DATA_INFORMATION data, + union netr_CONTROL_DATA_INFORMATION *data, union netr_CONTROL_QUERY_INFORMATION *query, WERROR *werror); NTSTATUS rpccli_netr_ServerAuthenticate2(struct rpc_pipe_client *cli, @@ -136,18 +139,19 @@ NTSTATUS rpccli_netr_ServerAuthenticate2(struct rpc_pipe_client *cli, enum netr_SchannelType secure_channel_type, const char *computer_name, struct netr_Credential *credentials, + struct netr_Credential *return_credentials, uint32_t *negotiate_flags); NTSTATUS rpccli_netr_DatabaseSync2(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, const char *logon_server, const char *computername, - struct netr_Authenticator credential, + struct netr_Authenticator *credential, struct netr_Authenticator *return_authenticator, enum netr_SamDatabaseID database_id, uint16_t restart_state, uint32_t *sync_context, - uint32_t preferredmaximumlength, - struct netr_DELTA_ENUM_ARRAY *delta_enum_array); + struct netr_DELTA_ENUM_ARRAY **delta_enum_array, + uint32_t preferredmaximumlength); NTSTATUS rpccli_netr_DatabaseRedo(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, const char *logon_server, @@ -165,8 +169,10 @@ NTSTATUS rpccli_netr_LogonControl2Ex(struct rpc_pipe_client *cli, union netr_CONTROL_DATA_INFORMATION data, union netr_CONTROL_QUERY_INFORMATION *query, WERROR *werror); -NTSTATUS rpccli_netr_NETRENUMERATETRUSTEDDOMAINS(struct rpc_pipe_client *cli, +NTSTATUS rpccli_netr_NetrEnumerateTrustedDomains(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, + const char *server_name, + struct netr_Blob *trusted_domains_blob, WERROR *werror); NTSTATUS rpccli_netr_DsRGetDCName(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, @@ -175,7 +181,7 @@ NTSTATUS rpccli_netr_DsRGetDCName(struct rpc_pipe_client *cli, struct GUID *domain_guid, struct GUID *site_guid, uint32_t flags, - struct netr_DsRGetDCNameInfo *info, + struct netr_DsRGetDCNameInfo **info, WERROR *werror); NTSTATUS rpccli_netr_NETRLOGONDUMMYROUTINE1(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, @@ -183,9 +189,12 @@ NTSTATUS rpccli_netr_NETRLOGONDUMMYROUTINE1(struct rpc_pipe_client *cli, NTSTATUS rpccli_netr_NETRLOGONSETSERVICEBITS(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, WERROR *werror); -NTSTATUS rpccli_netr_NETRLOGONGETTRUSTRID(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror); +NTSTATUS rpccli_netr_LogonGetTrustRid(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_name, + const char *domain_name, + uint32_t *rid, + WERROR *werror); NTSTATUS rpccli_netr_NETRLOGONCOMPUTESERVERDIGEST(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, WERROR *werror); @@ -208,7 +217,7 @@ NTSTATUS rpccli_netr_DsRGetDCNameEx(struct rpc_pipe_client *cli, struct GUID *domain_guid, const char *site_name, uint32_t flags, - struct netr_DsRGetDCNameInfo *info, + struct netr_DsRGetDCNameInfo **info, WERROR *werror); NTSTATUS rpccli_netr_DsRGetSiteName(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, @@ -233,14 +242,25 @@ NTSTATUS rpccli_netr_ServerPasswordSet2(struct rpc_pipe_client *cli, struct netr_Authenticator credential, struct netr_CryptPassword new_password, struct netr_Authenticator *return_authenticator); -NTSTATUS rpccli_netr_NETRSERVERPASSWORDGET(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror); +NTSTATUS rpccli_netr_ServerPasswordGet(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_name, + const char *account_name, + enum netr_SchannelType secure_channel_type, + const char *computer_name, + struct netr_Authenticator *credential, + struct netr_Authenticator *return_authenticator, + struct samr_Password *password, + WERROR *werror); NTSTATUS rpccli_netr_NETRLOGONSENDTOSAM(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, WERROR *werror); -NTSTATUS rpccli_netr_DSRADDRESSTOSITENAMESW(struct rpc_pipe_client *cli, +NTSTATUS rpccli_netr_DsRAddressToSitenamesW(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, + const char *server_name, + uint32_t count, + struct netr_DsRAddress *addresses, + struct netr_DsRAddressToSitenamesWCtr **ctr, WERROR *werror); NTSTATUS rpccli_netr_DsRGetDCNameEx2(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, @@ -251,26 +271,34 @@ NTSTATUS rpccli_netr_DsRGetDCNameEx2(struct rpc_pipe_client *cli, struct GUID *domain_guid, const char *site_name, uint32_t flags, - struct netr_DsRGetDCNameInfo *info, + struct netr_DsRGetDCNameInfo **info, WERROR *werror); NTSTATUS rpccli_netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, WERROR *werror); -NTSTATUS rpccli_netr_NETRENUMERATETRUSTEDDOMAINSEX(struct rpc_pipe_client *cli, +NTSTATUS rpccli_netr_NetrEnumerateTrustedDomainsEx(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, + const char *server_name, + struct netr_DomainTrustList *dom_trust_list, WERROR *werror); -NTSTATUS rpccli_netr_DSRADDRESSTOSITENAMESEXW(struct rpc_pipe_client *cli, +NTSTATUS rpccli_netr_DsRAddressToSitenamesExW(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, + const char *server_name, + uint32_t count, + struct netr_DsRAddress *addresses, + struct netr_DsRAddressToSitenamesExWCtr **ctr, WERROR *werror); -NTSTATUS rpccli_netr_DSRGETDCSITECOVERAGEW(struct rpc_pipe_client *cli, +NTSTATUS rpccli_netr_DsrGetDcSiteCoverageW(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, + const char *server_name, + struct DcSitesCtr *ctr, WERROR *werror); NTSTATUS rpccli_netr_LogonSamLogonEx(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, const char *server_name, const char *computer_name, uint16_t logon_level, - union netr_LogonLevel logon, + union netr_LogonLevel *logon, uint16_t validation_level, union netr_Validation *validation, uint8_t *authoritative, @@ -279,21 +307,42 @@ NTSTATUS rpccli_netr_DsrEnumerateDomainTrusts(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, const char *server_name, uint32_t trust_flags, - uint32_t *count, - struct netr_DomainTrust **trusts, + struct netr_DomainTrustList *trusts, WERROR *werror); -NTSTATUS rpccli_netr_DSRDEREGISTERDNSHOSTRECORDS(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror); -NTSTATUS rpccli_netr_NETRSERVERTRUSTPASSWORDSGET(struct rpc_pipe_client *cli, +NTSTATUS rpccli_netr_DsrDeregisterDNSHostRecords(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, + const char *server_name, + const char *domain, + struct GUID *domain_guid, + struct GUID *dsa_guid, + const char *dns_host, WERROR *werror); -NTSTATUS rpccli_netr_DSRGETFORESTTRUSTINFORMATION(struct rpc_pipe_client *cli, +NTSTATUS rpccli_netr_ServerTrustPasswordsGet(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_name, + const char *account_name, + enum netr_SchannelType secure_channel_type, + const char *computer_name, + struct netr_Authenticator *credential, + struct netr_Authenticator *return_authenticator, + struct samr_Password *password, + struct samr_Password *password2); +NTSTATUS rpccli_netr_DsRGetForestTrustInformation(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, + const char *server_name, + const char *trusted_domain_name, + uint32_t flags, + struct lsa_ForestTrustInformation **forest_trust_info, WERROR *werror); -NTSTATUS rpccli_netr_NETRGETFORESTTRUSTINFORMATION(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror); +NTSTATUS rpccli_netr_GetForestTrustInformation(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_name, + const char *trusted_domain_name, + struct netr_Authenticator *credential, + struct netr_Authenticator *return_authenticator, + uint32_t flags, + struct lsa_ForestTrustInformation **forest_trust_info, + WERROR *werror); NTSTATUS rpccli_netr_LogonSamLogonWithFlags(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, const char *server_name, diff --git a/source3/librpc/gen_ndr/cli_ntsvcs.c b/source3/librpc/gen_ndr/cli_ntsvcs.c new file mode 100644 index 0000000000..5597fccdb5 --- /dev/null +++ b/source3/librpc/gen_ndr/cli_ntsvcs.c @@ -0,0 +1,2783 @@ +/* + * Unix SMB/CIFS implementation. + * client auto-generated by pidl. DO NOT MODIFY! + */ + +#include "includes.h" +#include "librpc/gen_ndr/cli_ntsvcs.h" + +NTSTATUS rpccli_PNP_Disconnect(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror) +{ + struct PNP_Disconnect r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(PNP_Disconnect, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + PI_NTSVCS, + &ndr_table_ntsvcs, + NDR_PNP_DISCONNECT, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(PNP_Disconnect, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_PNP_Connect(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror) +{ + struct PNP_Connect r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(PNP_Connect, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + PI_NTSVCS, + &ndr_table_ntsvcs, + NDR_PNP_CONNECT, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(PNP_Connect, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_PNP_GetVersion(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + uint16_t *version, + WERROR *werror) +{ + struct PNP_GetVersion r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(PNP_GetVersion, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + PI_NTSVCS, + &ndr_table_ntsvcs, + NDR_PNP_GETVERSION, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(PNP_GetVersion, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *version = *r.out.version; + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_PNP_GetGlobalState(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror) +{ + struct PNP_GetGlobalState r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(PNP_GetGlobalState, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + PI_NTSVCS, + &ndr_table_ntsvcs, + NDR_PNP_GETGLOBALSTATE, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(PNP_GetGlobalState, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_PNP_InitDetection(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror) +{ + struct PNP_InitDetection r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(PNP_InitDetection, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + PI_NTSVCS, + &ndr_table_ntsvcs, + NDR_PNP_INITDETECTION, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(PNP_InitDetection, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_PNP_ReportLogOn(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror) +{ + struct PNP_ReportLogOn r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(PNP_ReportLogOn, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + PI_NTSVCS, + &ndr_table_ntsvcs, + NDR_PNP_REPORTLOGON, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(PNP_ReportLogOn, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_PNP_ValidateDeviceInstance(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *devicepath, + uint32_t flags, + WERROR *werror) +{ + struct PNP_ValidateDeviceInstance r; + NTSTATUS status; + + /* In parameters */ + r.in.devicepath = devicepath; + r.in.flags = flags; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(PNP_ValidateDeviceInstance, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + PI_NTSVCS, + &ndr_table_ntsvcs, + NDR_PNP_VALIDATEDEVICEINSTANCE, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(PNP_ValidateDeviceInstance, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_PNP_GetRootDeviceInstance(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror) +{ + struct PNP_GetRootDeviceInstance r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(PNP_GetRootDeviceInstance, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + PI_NTSVCS, + &ndr_table_ntsvcs, + NDR_PNP_GETROOTDEVICEINSTANCE, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(PNP_GetRootDeviceInstance, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_PNP_GetRelatedDeviceInstance(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror) +{ + struct PNP_GetRelatedDeviceInstance r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(PNP_GetRelatedDeviceInstance, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + PI_NTSVCS, + &ndr_table_ntsvcs, + NDR_PNP_GETRELATEDDEVICEINSTANCE, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(PNP_GetRelatedDeviceInstance, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_PNP_EnumerateSubKeys(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror) +{ + struct PNP_EnumerateSubKeys r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(PNP_EnumerateSubKeys, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + PI_NTSVCS, + &ndr_table_ntsvcs, + NDR_PNP_ENUMERATESUBKEYS, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(PNP_EnumerateSubKeys, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_PNP_GetDeviceList(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror) +{ + struct PNP_GetDeviceList r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(PNP_GetDeviceList, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + PI_NTSVCS, + &ndr_table_ntsvcs, + NDR_PNP_GETDEVICELIST, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(PNP_GetDeviceList, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_PNP_GetDeviceListSize(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *devicename, + uint32_t *size, + uint32_t flags, + WERROR *werror) +{ + struct PNP_GetDeviceListSize r; + NTSTATUS status; + + /* In parameters */ + r.in.devicename = devicename; + r.in.flags = flags; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(PNP_GetDeviceListSize, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + PI_NTSVCS, + &ndr_table_ntsvcs, + NDR_PNP_GETDEVICELISTSIZE, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(PNP_GetDeviceListSize, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *size = *r.out.size; + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_PNP_GetDepth(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror) +{ + struct PNP_GetDepth r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(PNP_GetDepth, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + PI_NTSVCS, + &ndr_table_ntsvcs, + NDR_PNP_GETDEPTH, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(PNP_GetDepth, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_PNP_GetDeviceRegProp(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror) +{ + struct PNP_GetDeviceRegProp r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(PNP_GetDeviceRegProp, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + PI_NTSVCS, + &ndr_table_ntsvcs, + NDR_PNP_GETDEVICEREGPROP, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(PNP_GetDeviceRegProp, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_PNP_SetDeviceRegProp(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror) +{ + struct PNP_SetDeviceRegProp r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(PNP_SetDeviceRegProp, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + PI_NTSVCS, + &ndr_table_ntsvcs, + NDR_PNP_SETDEVICEREGPROP, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(PNP_SetDeviceRegProp, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_PNP_GetClassInstance(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror) +{ + struct PNP_GetClassInstance r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(PNP_GetClassInstance, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + PI_NTSVCS, + &ndr_table_ntsvcs, + NDR_PNP_GETCLASSINSTANCE, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(PNP_GetClassInstance, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_PNP_CreateKey(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror) +{ + struct PNP_CreateKey r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(PNP_CreateKey, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + PI_NTSVCS, + &ndr_table_ntsvcs, + NDR_PNP_CREATEKEY, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(PNP_CreateKey, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_PNP_DeleteRegistryKey(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror) +{ + struct PNP_DeleteRegistryKey r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(PNP_DeleteRegistryKey, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + PI_NTSVCS, + &ndr_table_ntsvcs, + NDR_PNP_DELETEREGISTRYKEY, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(PNP_DeleteRegistryKey, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_PNP_GetClassCount(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror) +{ + struct PNP_GetClassCount r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(PNP_GetClassCount, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + PI_NTSVCS, + &ndr_table_ntsvcs, + NDR_PNP_GETCLASSCOUNT, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(PNP_GetClassCount, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_PNP_GetClassName(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror) +{ + struct PNP_GetClassName r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(PNP_GetClassName, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + PI_NTSVCS, + &ndr_table_ntsvcs, + NDR_PNP_GETCLASSNAME, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(PNP_GetClassName, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_PNP_DeleteClassKey(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror) +{ + struct PNP_DeleteClassKey r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(PNP_DeleteClassKey, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + PI_NTSVCS, + &ndr_table_ntsvcs, + NDR_PNP_DELETECLASSKEY, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(PNP_DeleteClassKey, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_PNP_GetInterfaceDeviceAlias(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror) +{ + struct PNP_GetInterfaceDeviceAlias r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(PNP_GetInterfaceDeviceAlias, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + PI_NTSVCS, + &ndr_table_ntsvcs, + NDR_PNP_GETINTERFACEDEVICEALIAS, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(PNP_GetInterfaceDeviceAlias, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_PNP_GetInterfaceDeviceList(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror) +{ + struct PNP_GetInterfaceDeviceList r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(PNP_GetInterfaceDeviceList, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + PI_NTSVCS, + &ndr_table_ntsvcs, + NDR_PNP_GETINTERFACEDEVICELIST, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(PNP_GetInterfaceDeviceList, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_PNP_GetInterfaceDeviceListSize(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror) +{ + struct PNP_GetInterfaceDeviceListSize r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(PNP_GetInterfaceDeviceListSize, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + PI_NTSVCS, + &ndr_table_ntsvcs, + NDR_PNP_GETINTERFACEDEVICELISTSIZE, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(PNP_GetInterfaceDeviceListSize, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_PNP_RegisterDeviceClassAssociation(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror) +{ + struct PNP_RegisterDeviceClassAssociation r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(PNP_RegisterDeviceClassAssociation, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + PI_NTSVCS, + &ndr_table_ntsvcs, + NDR_PNP_REGISTERDEVICECLASSASSOCIATION, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(PNP_RegisterDeviceClassAssociation, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_PNP_UnregisterDeviceClassAssociation(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror) +{ + struct PNP_UnregisterDeviceClassAssociation r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(PNP_UnregisterDeviceClassAssociation, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + PI_NTSVCS, + &ndr_table_ntsvcs, + NDR_PNP_UNREGISTERDEVICECLASSASSOCIATION, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(PNP_UnregisterDeviceClassAssociation, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_PNP_GetClassRegProp(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror) +{ + struct PNP_GetClassRegProp r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(PNP_GetClassRegProp, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + PI_NTSVCS, + &ndr_table_ntsvcs, + NDR_PNP_GETCLASSREGPROP, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(PNP_GetClassRegProp, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_PNP_SetClassRegProp(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror) +{ + struct PNP_SetClassRegProp r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(PNP_SetClassRegProp, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + PI_NTSVCS, + &ndr_table_ntsvcs, + NDR_PNP_SETCLASSREGPROP, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(PNP_SetClassRegProp, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_PNP_CreateDevInst(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror) +{ + struct PNP_CreateDevInst r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(PNP_CreateDevInst, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + PI_NTSVCS, + &ndr_table_ntsvcs, + NDR_PNP_CREATEDEVINST, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(PNP_CreateDevInst, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_PNP_DeviceInstanceAction(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror) +{ + struct PNP_DeviceInstanceAction r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(PNP_DeviceInstanceAction, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + PI_NTSVCS, + &ndr_table_ntsvcs, + NDR_PNP_DEVICEINSTANCEACTION, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(PNP_DeviceInstanceAction, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_PNP_GetDeviceStatus(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror) +{ + struct PNP_GetDeviceStatus r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(PNP_GetDeviceStatus, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + PI_NTSVCS, + &ndr_table_ntsvcs, + NDR_PNP_GETDEVICESTATUS, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(PNP_GetDeviceStatus, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_PNP_SetDeviceProblem(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror) +{ + struct PNP_SetDeviceProblem r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(PNP_SetDeviceProblem, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + PI_NTSVCS, + &ndr_table_ntsvcs, + NDR_PNP_SETDEVICEPROBLEM, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(PNP_SetDeviceProblem, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_PNP_DisableDevInst(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror) +{ + struct PNP_DisableDevInst r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(PNP_DisableDevInst, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + PI_NTSVCS, + &ndr_table_ntsvcs, + NDR_PNP_DISABLEDEVINST, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(PNP_DisableDevInst, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_PNP_UninstallDevInst(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror) +{ + struct PNP_UninstallDevInst r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(PNP_UninstallDevInst, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + PI_NTSVCS, + &ndr_table_ntsvcs, + NDR_PNP_UNINSTALLDEVINST, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(PNP_UninstallDevInst, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_PNP_AddID(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror) +{ + struct PNP_AddID r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(PNP_AddID, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + PI_NTSVCS, + &ndr_table_ntsvcs, + NDR_PNP_ADDID, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(PNP_AddID, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_PNP_RegisterDriver(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror) +{ + struct PNP_RegisterDriver r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(PNP_RegisterDriver, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + PI_NTSVCS, + &ndr_table_ntsvcs, + NDR_PNP_REGISTERDRIVER, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(PNP_RegisterDriver, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_PNP_QueryRemove(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror) +{ + struct PNP_QueryRemove r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(PNP_QueryRemove, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + PI_NTSVCS, + &ndr_table_ntsvcs, + NDR_PNP_QUERYREMOVE, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(PNP_QueryRemove, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_PNP_RequestDeviceEject(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror) +{ + struct PNP_RequestDeviceEject r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(PNP_RequestDeviceEject, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + PI_NTSVCS, + &ndr_table_ntsvcs, + NDR_PNP_REQUESTDEVICEEJECT, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(PNP_RequestDeviceEject, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_PNP_IsDockStationPresent(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror) +{ + struct PNP_IsDockStationPresent r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(PNP_IsDockStationPresent, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + PI_NTSVCS, + &ndr_table_ntsvcs, + NDR_PNP_ISDOCKSTATIONPRESENT, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(PNP_IsDockStationPresent, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_PNP_RequestEjectPC(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror) +{ + struct PNP_RequestEjectPC r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(PNP_RequestEjectPC, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + PI_NTSVCS, + &ndr_table_ntsvcs, + NDR_PNP_REQUESTEJECTPC, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(PNP_RequestEjectPC, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_PNP_HwProfFlags(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + uint32_t unknown1, + const char *devicepath, + uint32_t unknown2, + uint32_t *unknown3, + uint16_t *unknown4, + const char *unknown5, + const char **unknown5a, + uint32_t unknown6, + uint32_t unknown7, + WERROR *werror) +{ + struct PNP_HwProfFlags r; + NTSTATUS status; + + /* In parameters */ + r.in.unknown1 = unknown1; + r.in.devicepath = devicepath; + r.in.unknown2 = unknown2; + r.in.unknown3 = unknown3; + r.in.unknown4 = unknown4; + r.in.unknown5 = unknown5; + r.in.unknown6 = unknown6; + r.in.unknown7 = unknown7; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(PNP_HwProfFlags, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + PI_NTSVCS, + &ndr_table_ntsvcs, + NDR_PNP_HWPROFFLAGS, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(PNP_HwProfFlags, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *unknown3 = *r.out.unknown3; + if (unknown4 && r.out.unknown4) { + *unknown4 = *r.out.unknown4; + } + if (unknown5a && r.out.unknown5a) { + *unknown5a = *r.out.unknown5a; + } + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_PNP_GetHwProfInfo(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + uint32_t idx, + struct PNP_HwProfInfo *info, + uint32_t unknown1, + uint32_t unknown2, + WERROR *werror) +{ + struct PNP_GetHwProfInfo r; + NTSTATUS status; + + /* In parameters */ + r.in.idx = idx; + r.in.info = info; + r.in.unknown1 = unknown1; + r.in.unknown2 = unknown2; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(PNP_GetHwProfInfo, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + PI_NTSVCS, + &ndr_table_ntsvcs, + NDR_PNP_GETHWPROFINFO, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(PNP_GetHwProfInfo, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + *info = *r.out.info; + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_PNP_AddEmptyLogConf(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror) +{ + struct PNP_AddEmptyLogConf r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(PNP_AddEmptyLogConf, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + PI_NTSVCS, + &ndr_table_ntsvcs, + NDR_PNP_ADDEMPTYLOGCONF, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(PNP_AddEmptyLogConf, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_PNP_FreeLogConf(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror) +{ + struct PNP_FreeLogConf r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(PNP_FreeLogConf, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + PI_NTSVCS, + &ndr_table_ntsvcs, + NDR_PNP_FREELOGCONF, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(PNP_FreeLogConf, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_PNP_GetFirstLogConf(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror) +{ + struct PNP_GetFirstLogConf r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(PNP_GetFirstLogConf, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + PI_NTSVCS, + &ndr_table_ntsvcs, + NDR_PNP_GETFIRSTLOGCONF, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(PNP_GetFirstLogConf, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_PNP_GetNextLogConf(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror) +{ + struct PNP_GetNextLogConf r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(PNP_GetNextLogConf, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + PI_NTSVCS, + &ndr_table_ntsvcs, + NDR_PNP_GETNEXTLOGCONF, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(PNP_GetNextLogConf, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_PNP_GetLogConfPriority(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror) +{ + struct PNP_GetLogConfPriority r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(PNP_GetLogConfPriority, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + PI_NTSVCS, + &ndr_table_ntsvcs, + NDR_PNP_GETLOGCONFPRIORITY, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(PNP_GetLogConfPriority, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_PNP_AddResDes(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror) +{ + struct PNP_AddResDes r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(PNP_AddResDes, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + PI_NTSVCS, + &ndr_table_ntsvcs, + NDR_PNP_ADDRESDES, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(PNP_AddResDes, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_PNP_FreeResDes(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror) +{ + struct PNP_FreeResDes r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(PNP_FreeResDes, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + PI_NTSVCS, + &ndr_table_ntsvcs, + NDR_PNP_FREERESDES, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(PNP_FreeResDes, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_PNP_GetNextResDes(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror) +{ + struct PNP_GetNextResDes r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(PNP_GetNextResDes, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + PI_NTSVCS, + &ndr_table_ntsvcs, + NDR_PNP_GETNEXTRESDES, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(PNP_GetNextResDes, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_PNP_GetResDesData(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror) +{ + struct PNP_GetResDesData r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(PNP_GetResDesData, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + PI_NTSVCS, + &ndr_table_ntsvcs, + NDR_PNP_GETRESDESDATA, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(PNP_GetResDesData, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_PNP_GetResDesDataSize(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror) +{ + struct PNP_GetResDesDataSize r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(PNP_GetResDesDataSize, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + PI_NTSVCS, + &ndr_table_ntsvcs, + NDR_PNP_GETRESDESDATASIZE, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(PNP_GetResDesDataSize, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_PNP_ModifyResDes(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror) +{ + struct PNP_ModifyResDes r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(PNP_ModifyResDes, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + PI_NTSVCS, + &ndr_table_ntsvcs, + NDR_PNP_MODIFYRESDES, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(PNP_ModifyResDes, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_PNP_DetectResourceLimit(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror) +{ + struct PNP_DetectResourceLimit r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(PNP_DetectResourceLimit, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + PI_NTSVCS, + &ndr_table_ntsvcs, + NDR_PNP_DETECTRESOURCELIMIT, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(PNP_DetectResourceLimit, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_PNP_QueryResConfList(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror) +{ + struct PNP_QueryResConfList r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(PNP_QueryResConfList, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + PI_NTSVCS, + &ndr_table_ntsvcs, + NDR_PNP_QUERYRESCONFLIST, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(PNP_QueryResConfList, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_PNP_SetHwProf(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror) +{ + struct PNP_SetHwProf r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(PNP_SetHwProf, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + PI_NTSVCS, + &ndr_table_ntsvcs, + NDR_PNP_SETHWPROF, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(PNP_SetHwProf, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_PNP_QueryArbitratorFreeData(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror) +{ + struct PNP_QueryArbitratorFreeData r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(PNP_QueryArbitratorFreeData, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + PI_NTSVCS, + &ndr_table_ntsvcs, + NDR_PNP_QUERYARBITRATORFREEDATA, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(PNP_QueryArbitratorFreeData, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_PNP_QueryArbitratorFreeSize(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror) +{ + struct PNP_QueryArbitratorFreeSize r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(PNP_QueryArbitratorFreeSize, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + PI_NTSVCS, + &ndr_table_ntsvcs, + NDR_PNP_QUERYARBITRATORFREESIZE, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(PNP_QueryArbitratorFreeSize, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_PNP_RunDetection(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror) +{ + struct PNP_RunDetection r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(PNP_RunDetection, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + PI_NTSVCS, + &ndr_table_ntsvcs, + NDR_PNP_RUNDETECTION, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(PNP_RunDetection, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_PNP_RegisterNotification(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror) +{ + struct PNP_RegisterNotification r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(PNP_RegisterNotification, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + PI_NTSVCS, + &ndr_table_ntsvcs, + NDR_PNP_REGISTERNOTIFICATION, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(PNP_RegisterNotification, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_PNP_UnregisterNotification(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror) +{ + struct PNP_UnregisterNotification r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(PNP_UnregisterNotification, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + PI_NTSVCS, + &ndr_table_ntsvcs, + NDR_PNP_UNREGISTERNOTIFICATION, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(PNP_UnregisterNotification, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_PNP_GetCustomDevProp(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror) +{ + struct PNP_GetCustomDevProp r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(PNP_GetCustomDevProp, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + PI_NTSVCS, + &ndr_table_ntsvcs, + NDR_PNP_GETCUSTOMDEVPROP, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(PNP_GetCustomDevProp, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_PNP_GetVersionInternal(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror) +{ + struct PNP_GetVersionInternal r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(PNP_GetVersionInternal, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + PI_NTSVCS, + &ndr_table_ntsvcs, + NDR_PNP_GETVERSIONINTERNAL, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(PNP_GetVersionInternal, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_PNP_GetBlockedDriverInfo(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror) +{ + struct PNP_GetBlockedDriverInfo r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(PNP_GetBlockedDriverInfo, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + PI_NTSVCS, + &ndr_table_ntsvcs, + NDR_PNP_GETBLOCKEDDRIVERINFO, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(PNP_GetBlockedDriverInfo, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + +NTSTATUS rpccli_PNP_GetServerSideDeviceInstallFlags(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror) +{ + struct PNP_GetServerSideDeviceInstallFlags r; + NTSTATUS status; + + /* In parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(PNP_GetServerSideDeviceInstallFlags, &r); + } + + status = cli_do_rpc_ndr(cli, + mem_ctx, + PI_NTSVCS, + &ndr_table_ntsvcs, + NDR_PNP_GETSERVERSIDEDEVICEINSTALLFLAGS, + &r); + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(PNP_GetServerSideDeviceInstallFlags, &r); + } + + if (NT_STATUS_IS_ERR(status)) { + return status; + } + + /* Return variables */ + + /* Return result */ + if (werror) { + *werror = r.out.result; + } + + return werror_to_ntstatus(r.out.result); +} + diff --git a/source3/librpc/gen_ndr/cli_ntsvcs.h b/source3/librpc/gen_ndr/cli_ntsvcs.h new file mode 100644 index 0000000000..33df63ee5d --- /dev/null +++ b/source3/librpc/gen_ndr/cli_ntsvcs.h @@ -0,0 +1,218 @@ +#include "librpc/gen_ndr/ndr_ntsvcs.h" +#ifndef __CLI_NTSVCS__ +#define __CLI_NTSVCS__ +NTSTATUS rpccli_PNP_Disconnect(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror); +NTSTATUS rpccli_PNP_Connect(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror); +NTSTATUS rpccli_PNP_GetVersion(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + uint16_t *version, + WERROR *werror); +NTSTATUS rpccli_PNP_GetGlobalState(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror); +NTSTATUS rpccli_PNP_InitDetection(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror); +NTSTATUS rpccli_PNP_ReportLogOn(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror); +NTSTATUS rpccli_PNP_ValidateDeviceInstance(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *devicepath, + uint32_t flags, + WERROR *werror); +NTSTATUS rpccli_PNP_GetRootDeviceInstance(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror); +NTSTATUS rpccli_PNP_GetRelatedDeviceInstance(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror); +NTSTATUS rpccli_PNP_EnumerateSubKeys(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror); +NTSTATUS rpccli_PNP_GetDeviceList(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror); +NTSTATUS rpccli_PNP_GetDeviceListSize(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *devicename, + uint32_t *size, + uint32_t flags, + WERROR *werror); +NTSTATUS rpccli_PNP_GetDepth(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror); +NTSTATUS rpccli_PNP_GetDeviceRegProp(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror); +NTSTATUS rpccli_PNP_SetDeviceRegProp(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror); +NTSTATUS rpccli_PNP_GetClassInstance(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror); +NTSTATUS rpccli_PNP_CreateKey(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror); +NTSTATUS rpccli_PNP_DeleteRegistryKey(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror); +NTSTATUS rpccli_PNP_GetClassCount(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror); +NTSTATUS rpccli_PNP_GetClassName(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror); +NTSTATUS rpccli_PNP_DeleteClassKey(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror); +NTSTATUS rpccli_PNP_GetInterfaceDeviceAlias(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror); +NTSTATUS rpccli_PNP_GetInterfaceDeviceList(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror); +NTSTATUS rpccli_PNP_GetInterfaceDeviceListSize(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror); +NTSTATUS rpccli_PNP_RegisterDeviceClassAssociation(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror); +NTSTATUS rpccli_PNP_UnregisterDeviceClassAssociation(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror); +NTSTATUS rpccli_PNP_GetClassRegProp(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror); +NTSTATUS rpccli_PNP_SetClassRegProp(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror); +NTSTATUS rpccli_PNP_CreateDevInst(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror); +NTSTATUS rpccli_PNP_DeviceInstanceAction(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror); +NTSTATUS rpccli_PNP_GetDeviceStatus(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror); +NTSTATUS rpccli_PNP_SetDeviceProblem(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror); +NTSTATUS rpccli_PNP_DisableDevInst(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror); +NTSTATUS rpccli_PNP_UninstallDevInst(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror); +NTSTATUS rpccli_PNP_AddID(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror); +NTSTATUS rpccli_PNP_RegisterDriver(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror); +NTSTATUS rpccli_PNP_QueryRemove(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror); +NTSTATUS rpccli_PNP_RequestDeviceEject(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror); +NTSTATUS rpccli_PNP_IsDockStationPresent(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror); +NTSTATUS rpccli_PNP_RequestEjectPC(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror); +NTSTATUS rpccli_PNP_HwProfFlags(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + uint32_t unknown1, + const char *devicepath, + uint32_t unknown2, + uint32_t *unknown3, + uint16_t *unknown4, + const char *unknown5, + const char **unknown5a, + uint32_t unknown6, + uint32_t unknown7, + WERROR *werror); +NTSTATUS rpccli_PNP_GetHwProfInfo(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + uint32_t idx, + struct PNP_HwProfInfo *info, + uint32_t unknown1, + uint32_t unknown2, + WERROR *werror); +NTSTATUS rpccli_PNP_AddEmptyLogConf(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror); +NTSTATUS rpccli_PNP_FreeLogConf(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror); +NTSTATUS rpccli_PNP_GetFirstLogConf(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror); +NTSTATUS rpccli_PNP_GetNextLogConf(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror); +NTSTATUS rpccli_PNP_GetLogConfPriority(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror); +NTSTATUS rpccli_PNP_AddResDes(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror); +NTSTATUS rpccli_PNP_FreeResDes(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror); +NTSTATUS rpccli_PNP_GetNextResDes(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror); +NTSTATUS rpccli_PNP_GetResDesData(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror); +NTSTATUS rpccli_PNP_GetResDesDataSize(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror); +NTSTATUS rpccli_PNP_ModifyResDes(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror); +NTSTATUS rpccli_PNP_DetectResourceLimit(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror); +NTSTATUS rpccli_PNP_QueryResConfList(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror); +NTSTATUS rpccli_PNP_SetHwProf(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror); +NTSTATUS rpccli_PNP_QueryArbitratorFreeData(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror); +NTSTATUS rpccli_PNP_QueryArbitratorFreeSize(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror); +NTSTATUS rpccli_PNP_RunDetection(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror); +NTSTATUS rpccli_PNP_RegisterNotification(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror); +NTSTATUS rpccli_PNP_UnregisterNotification(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror); +NTSTATUS rpccli_PNP_GetCustomDevProp(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror); +NTSTATUS rpccli_PNP_GetVersionInternal(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror); +NTSTATUS rpccli_PNP_GetBlockedDriverInfo(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror); +NTSTATUS rpccli_PNP_GetServerSideDeviceInstallFlags(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + WERROR *werror); +#endif /* __CLI_NTSVCS__ */ diff --git a/source3/librpc/gen_ndr/cli_samr.c b/source3/librpc/gen_ndr/cli_samr.c new file mode 100644 index 0000000000..663d620d67 --- /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, + struct samr_SamArray **sam, + uint32_t buf_size, + 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, + struct samr_SamArray **sam, + uint32_t max_size, + 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, + struct samr_SamArray **sam, + uint32_t max_size, + 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, + struct samr_SamArray **sam, + uint32_t max_size, + 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.max_size = max_size; + + 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, + enum samr_ConnectVersion client_version, + 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.client_version = client_version; + 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..92fcf73536 --- /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, + struct samr_SamArray **sam, + uint32_t buf_size, + 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, + struct samr_SamArray **sam, + uint32_t max_size, + 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, + struct samr_SamArray **sam, + uint32_t max_size, + 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, + struct samr_SamArray **sam, + uint32_t max_size, + 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, + enum samr_ConnectVersion client_version, + 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/cli_svcctl.c b/source3/librpc/gen_ndr/cli_svcctl.c index 2a5d6badc6..b8f18afe1c 100644 --- a/source3/librpc/gen_ndr/cli_svcctl.c +++ b/source3/librpc/gen_ndr/cli_svcctl.c @@ -191,12 +191,20 @@ NTSTATUS rpccli_svcctl_LockServiceDatabase(struct rpc_pipe_client *cli, NTSTATUS rpccli_svcctl_QueryServiceObjectSecurity(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, + struct policy_handle *handle, + uint32_t security_flags, + uint8_t *buffer, + uint32_t buffer_size, + uint32_t *needed, WERROR *werror) { struct svcctl_QueryServiceObjectSecurity r; NTSTATUS status; /* In parameters */ + r.in.handle = handle; + r.in.security_flags = security_flags; + r.in.buffer_size = buffer_size; if (DEBUGLEVEL >= 10) { NDR_PRINT_IN_DEBUG(svcctl_QueryServiceObjectSecurity, &r); @@ -222,6 +230,8 @@ NTSTATUS rpccli_svcctl_QueryServiceObjectSecurity(struct rpc_pipe_client *cli, } /* Return variables */ + memcpy(buffer, r.out.buffer, r.in.buffer_size); + *needed = *r.out.needed; /* Return result */ if (werror) { @@ -233,12 +243,20 @@ NTSTATUS rpccli_svcctl_QueryServiceObjectSecurity(struct rpc_pipe_client *cli, NTSTATUS rpccli_svcctl_SetServiceObjectSecurity(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, + struct policy_handle *handle, + uint32_t security_flags, + uint8_t *buffer, + uint32_t buffer_size, WERROR *werror) { struct svcctl_SetServiceObjectSecurity r; NTSTATUS status; /* In parameters */ + r.in.handle = handle; + r.in.security_flags = security_flags; + r.in.buffer = buffer; + r.in.buffer_size = buffer_size; if (DEBUGLEVEL >= 10) { NDR_PRINT_IN_DEBUG(svcctl_SetServiceObjectSecurity, &r); diff --git a/source3/librpc/gen_ndr/cli_svcctl.h b/source3/librpc/gen_ndr/cli_svcctl.h index e9eeb2d9e2..7c62519187 100644 --- a/source3/librpc/gen_ndr/cli_svcctl.h +++ b/source3/librpc/gen_ndr/cli_svcctl.h @@ -22,9 +22,18 @@ NTSTATUS rpccli_svcctl_LockServiceDatabase(struct rpc_pipe_client *cli, WERROR *werror); NTSTATUS rpccli_svcctl_QueryServiceObjectSecurity(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, + struct policy_handle *handle, + uint32_t security_flags, + uint8_t *buffer, + uint32_t buffer_size, + uint32_t *needed, WERROR *werror); NTSTATUS rpccli_svcctl_SetServiceObjectSecurity(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, + struct policy_handle *handle, + uint32_t security_flags, + uint8_t *buffer, + uint32_t buffer_size, WERROR *werror); NTSTATUS rpccli_svcctl_QueryServiceStatus(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, diff --git a/source3/librpc/gen_ndr/cli_unixinfo.c b/source3/librpc/gen_ndr/cli_unixinfo.c deleted file mode 100644 index c8a6c926ef..0000000000 --- a/source3/librpc/gen_ndr/cli_unixinfo.c +++ /dev/null @@ -1,216 +0,0 @@ -/* - * Unix SMB/CIFS implementation. - * client auto-generated by pidl. DO NOT MODIFY! - */ - -#include "includes.h" -#include "librpc/gen_ndr/cli_unixinfo.h" - -NTSTATUS rpccli_unixinfo_SidToUid(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct dom_sid sid, - uint64_t *uid) -{ - struct unixinfo_SidToUid r; - NTSTATUS status; - - /* In parameters */ - r.in.sid = sid; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(unixinfo_SidToUid, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - PI_UNIXINFO, - &ndr_table_unixinfo, - NDR_UNIXINFO_SIDTOUID, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(unixinfo_SidToUid, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *uid = *r.out.uid; - - /* Return result */ - return r.out.result; -} - -NTSTATUS rpccli_unixinfo_UidToSid(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - uint64_t uid, - struct dom_sid *sid) -{ - struct unixinfo_UidToSid r; - NTSTATUS status; - - /* In parameters */ - r.in.uid = uid; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(unixinfo_UidToSid, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - PI_UNIXINFO, - &ndr_table_unixinfo, - NDR_UNIXINFO_UIDTOSID, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(unixinfo_UidToSid, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *sid = *r.out.sid; - - /* Return result */ - return r.out.result; -} - -NTSTATUS rpccli_unixinfo_SidToGid(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct dom_sid sid, - uint64_t *gid) -{ - struct unixinfo_SidToGid r; - NTSTATUS status; - - /* In parameters */ - r.in.sid = sid; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(unixinfo_SidToGid, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - PI_UNIXINFO, - &ndr_table_unixinfo, - NDR_UNIXINFO_SIDTOGID, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(unixinfo_SidToGid, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *gid = *r.out.gid; - - /* Return result */ - return r.out.result; -} - -NTSTATUS rpccli_unixinfo_GidToSid(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - uint64_t gid, - struct dom_sid *sid) -{ - struct unixinfo_GidToSid r; - NTSTATUS status; - - /* In parameters */ - r.in.gid = gid; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(unixinfo_GidToSid, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - PI_UNIXINFO, - &ndr_table_unixinfo, - NDR_UNIXINFO_GIDTOSID, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(unixinfo_GidToSid, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *sid = *r.out.sid; - - /* Return result */ - return r.out.result; -} - -NTSTATUS rpccli_unixinfo_GetPWUid(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - uint32_t *count, - uint64_t *uids, - struct unixinfo_GetPWUidInfo *infos) -{ - struct unixinfo_GetPWUid r; - NTSTATUS status; - - /* In parameters */ - r.in.count = count; - r.in.uids = uids; - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(unixinfo_GetPWUid, &r); - } - - status = cli_do_rpc_ndr(cli, - mem_ctx, - PI_UNIXINFO, - &ndr_table_unixinfo, - NDR_UNIXINFO_GETPWUID, - &r); - - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(unixinfo_GetPWUid, &r); - } - - if (NT_STATUS_IS_ERR(status)) { - return status; - } - - /* Return variables */ - *count = *r.out.count; - memcpy(infos, r.out.infos, *r.in.count); - - /* Return result */ - return r.out.result; -} - diff --git a/source3/librpc/gen_ndr/cli_unixinfo.h b/source3/librpc/gen_ndr/cli_unixinfo.h deleted file mode 100644 index fa084cc75d..0000000000 --- a/source3/librpc/gen_ndr/cli_unixinfo.h +++ /dev/null @@ -1,25 +0,0 @@ -#include "librpc/gen_ndr/ndr_unixinfo.h" -#ifndef __CLI_UNIXINFO__ -#define __CLI_UNIXINFO__ -NTSTATUS rpccli_unixinfo_SidToUid(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct dom_sid sid, - uint64_t *uid); -NTSTATUS rpccli_unixinfo_UidToSid(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - uint64_t uid, - struct dom_sid *sid); -NTSTATUS rpccli_unixinfo_SidToGid(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - struct dom_sid sid, - uint64_t *gid); -NTSTATUS rpccli_unixinfo_GidToSid(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - uint64_t gid, - struct dom_sid *sid); -NTSTATUS rpccli_unixinfo_GetPWUid(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - uint32_t *count, - uint64_t *uids, - struct unixinfo_GetPWUidInfo *infos); -#endif /* __CLI_UNIXINFO__ */ diff --git a/source3/librpc/gen_ndr/cli_wkssvc.c b/source3/librpc/gen_ndr/cli_wkssvc.c index 581a498146..adaa3dd7bd 100644 --- a/source3/librpc/gen_ndr/cli_wkssvc.c +++ b/source3/librpc/gen_ndr/cli_wkssvc.c @@ -1120,7 +1120,7 @@ NTSTATUS rpccli_wkssvc_NetrGetJoinableOus(struct rpc_pipe_client *cli, /* Return variables */ *num_ous = *r.out.num_ous; - memcpy(ous, r.out.ous, *r.in.num_ous); + *ous = *r.out.ous; /* Return result */ if (werror) { @@ -1383,7 +1383,7 @@ NTSTATUS rpccli_wkssvc_NetrGetJoinableOus2(struct rpc_pipe_client *cli, /* Return variables */ *num_ous = *r.out.num_ous; - memcpy(ous, r.out.ous, *r.in.num_ous); + *ous = *r.out.ous; /* Return result */ if (werror) { diff --git a/source3/librpc/gen_ndr/dfs.h b/source3/librpc/gen_ndr/dfs.h index 89f243b7dd..dc11e70b59 100644 --- a/source3/librpc/gen_ndr/dfs.h +++ b/source3/librpc/gen_ndr/dfs.h @@ -32,13 +32,11 @@ struct dfs_Info1 { /* bitmap dfs_VolumeState */ #define DFS_VOLUME_STATE_OK ( 0x1 ) #define DFS_VOLUME_STATE_INCONSISTENT ( 0x2 ) -#define DFS_VOLUME_STATE_OFFLINE ( 0x4 ) -#define DFS_VOLUME_STATE_ONLINE ( 0x8 ) +#define DFS_VOLUME_STATE_OFFLINE ( 0x3 ) +#define DFS_VOLUME_STATE_ONLINE ( 0x4 ) #define DFS_VOLUME_STATE_STANDALONE ( DFS_VOLUME_FLAVOR_STANDALONE ) #define DFS_VOLUME_STATE_AD_BLOB ( DFS_VOLUME_FLAVOR_AD_BLOB ) -; - struct dfs_Info2 { const char *path;/* [unique,charset(UTF16)] */ const char *comment;/* [unique,charset(UTF16)] */ @@ -51,8 +49,6 @@ struct dfs_Info2 { #define DFS_STORAGE_STATE_ONLINE ( 2 ) #define DFS_STORAGE_STATE_ACTIVE ( 4 ) -; - struct dfs_StorageInfo { uint32_t state; const char *server;/* [unique,charset(UTF16)] */ @@ -84,8 +80,6 @@ struct dfs_Info4 { #define DFS_PROPERTY_FLAG_TARGET_FAILBACK ( 0x08 ) #define DFS_PROPERTY_FLAG_CLUSTER_ENABLED ( 0x10 ) -; - struct dfs_Info5 { const char *path;/* [unique,charset(UTF16)] */ const char *comment;/* [unique,charset(UTF16)] */ @@ -238,6 +232,16 @@ struct dfs_EnumArray4 { struct dfs_Info4 *s;/* [unique,size_is(count)] */ }; +struct dfs_EnumArray5 { + uint32_t count; + struct dfs_Info5 *s;/* [unique,size_is(count)] */ +}; + +struct dfs_EnumArray6 { + uint32_t count; + struct dfs_Info6 *s;/* [unique,size_is(count)] */ +}; + struct dfs_EnumArray200 { uint32_t count; struct dfs_Info200 *s;/* [unique,size_is(count)] */ @@ -253,6 +257,8 @@ union dfs_EnumInfo { struct dfs_EnumArray2 *info2;/* [unique,case(2)] */ struct dfs_EnumArray3 *info3;/* [unique,case(3)] */ struct dfs_EnumArray4 *info4;/* [unique,case(4)] */ + struct dfs_EnumArray5 *info5;/* [unique,case(5)] */ + struct dfs_EnumArray6 *info6;/* [unique,case(6)] */ struct dfs_EnumArray200 *info200;/* [unique,case(200)] */ struct dfs_EnumArray300 *info300;/* [unique,case(300)] */ }; @@ -485,6 +491,16 @@ struct dfs_AddStdRootForced { struct dfs_GetDcAddress { struct { + const char *servername;/* [charset(UTF16)] */ + const char **server_fullname;/* [ref,charset(UTF16)] */ + uint8_t *is_root;/* [ref] */ + uint32_t *ttl;/* [ref] */ + } in; + + struct { + const char **server_fullname;/* [ref,charset(UTF16)] */ + uint8_t *is_root;/* [ref] */ + uint32_t *ttl;/* [ref] */ WERROR result; } out; @@ -493,6 +509,13 @@ struct dfs_GetDcAddress { struct dfs_SetDcAddress { struct { + const char *servername;/* [charset(UTF16)] */ + const char *server_fullname;/* [charset(UTF16)] */ + uint32_t flags; + uint32_t ttl; + } in; + + struct { WERROR result; } out; diff --git a/source3/librpc/gen_ndr/dssetup.h b/source3/librpc/gen_ndr/dssetup.h new file mode 100644 index 0000000000..d284a63375 --- /dev/null +++ b/source3/librpc/gen_ndr/dssetup.h @@ -0,0 +1,211 @@ +/* header auto-generated by pidl */ + +#include <stdint.h> + +#include "librpc/gen_ndr/misc.h" +#ifndef _HEADER_dssetup +#define _HEADER_dssetup + +enum dssetup_DsRole +#ifndef USE_UINT_ENUMS + { + DS_ROLE_STANDALONE_WORKSTATION=0, + DS_ROLE_MEMBER_WORKSTATION=1, + DS_ROLE_STANDALONE_SERVER=2, + DS_ROLE_MEMBER_SERVER=3, + DS_ROLE_BACKUP_DC=4, + DS_ROLE_PRIMARY_DC=5 +} +#else + { __donnot_use_enum_dssetup_DsRole=0x7FFFFFFF} +#define DS_ROLE_STANDALONE_WORKSTATION ( 0 ) +#define DS_ROLE_MEMBER_WORKSTATION ( 1 ) +#define DS_ROLE_STANDALONE_SERVER ( 2 ) +#define DS_ROLE_MEMBER_SERVER ( 3 ) +#define DS_ROLE_BACKUP_DC ( 4 ) +#define DS_ROLE_PRIMARY_DC ( 5 ) +#endif +; + +/* bitmap dssetup_DsRoleFlags */ +#define DS_ROLE_PRIMARY_DS_RUNNING ( 0x00000001 ) +#define DS_ROLE_PRIMARY_DS_MIXED_MODE ( 0x00000002 ) +#define DS_ROLE_UPGRADE_IN_PROGRESS ( 0x00000004 ) +#define DS_ROLE_PRIMARY_DOMAIN_GUID_PRESENT ( 0x01000000 ) + +struct dssetup_DsRolePrimaryDomInfoBasic { + enum dssetup_DsRole role; + uint32_t flags; + const char *domain;/* [unique,charset(UTF16)] */ + const char *dns_domain;/* [unique,charset(UTF16)] */ + const char *forest;/* [unique,charset(UTF16)] */ + struct GUID domain_guid; +}; + +enum dssetup_DsUpgrade +#ifndef USE_UINT_ENUMS + { + DS_ROLE_NOT_UPGRADING=0, + DS_ROLE_UPGRADING=1 +} +#else + { __donnot_use_enum_dssetup_DsUpgrade=0x7FFFFFFF} +#define DS_ROLE_NOT_UPGRADING ( 0 ) +#define DS_ROLE_UPGRADING ( 1 ) +#endif +; + +enum dssetup_DsPrevious +#ifndef USE_UINT_ENUMS + { + DS_ROLE_PREVIOUS_UNKNOWN=0, + DS_ROLE_PREVIOUS_PRIMARY=1, + DS_ROLE_PREVIOUS_BACKUP=2 +} +#else + { __donnot_use_enum_dssetup_DsPrevious=0x7FFFFFFF} +#define DS_ROLE_PREVIOUS_UNKNOWN ( 0 ) +#define DS_ROLE_PREVIOUS_PRIMARY ( 1 ) +#define DS_ROLE_PREVIOUS_BACKUP ( 2 ) +#endif +; + +struct dssetup_DsRoleUpgradeStatus { + enum dssetup_DsUpgrade upgrading; + enum dssetup_DsPrevious previous_role; +}; + +enum dssetup_DsRoleOp +#ifndef USE_UINT_ENUMS + { + DS_ROLE_OP_IDLE=0, + DS_ROLE_OP_ACTIVE=1, + DS_ROLE_OP_NEEDS_REBOOT=2 +} +#else + { __donnot_use_enum_dssetup_DsRoleOp=0x7FFFFFFF} +#define DS_ROLE_OP_IDLE ( 0 ) +#define DS_ROLE_OP_ACTIVE ( 1 ) +#define DS_ROLE_OP_NEEDS_REBOOT ( 2 ) +#endif +; + +struct dssetup_DsRoleOpStatus { + enum dssetup_DsRoleOp status; +}; + +enum dssetup_DsRoleInfoLevel +#ifndef USE_UINT_ENUMS + { + DS_ROLE_BASIC_INFORMATION=1, + DS_ROLE_UPGRADE_STATUS=2, + DS_ROLE_OP_STATUS=3 +} +#else + { __donnot_use_enum_dssetup_DsRoleInfoLevel=0x7FFFFFFF} +#define DS_ROLE_BASIC_INFORMATION ( 1 ) +#define DS_ROLE_UPGRADE_STATUS ( 2 ) +#define DS_ROLE_OP_STATUS ( 3 ) +#endif +; + +union dssetup_DsRoleInfo { + struct dssetup_DsRolePrimaryDomInfoBasic basic;/* [case(DS_ROLE_BASIC_INFORMATION)] */ + struct dssetup_DsRoleUpgradeStatus upgrade;/* [case(DS_ROLE_UPGRADE_STATUS)] */ + struct dssetup_DsRoleOpStatus opstatus;/* [case(DS_ROLE_OP_STATUS)] */ +}/* [switch_type(dssetup_DsRoleInfoLevel)] */; + + +struct dssetup_DsRoleGetPrimaryDomainInformation { + struct { + enum dssetup_DsRoleInfoLevel level; + } in; + + struct { + union dssetup_DsRoleInfo *info;/* [unique,switch_is(level)] */ + WERROR result; + } out; + +}; + + +struct dssetup_DsRoleDnsNameToFlatName { + struct { + WERROR result; + } out; + +}; + + +struct dssetup_DsRoleDcAsDc { + struct { + WERROR result; + } out; + +}; + + +struct dssetup_DsRoleDcAsReplica { + struct { + WERROR result; + } out; + +}; + + +struct dssetup_DsRoleDemoteDc { + struct { + WERROR result; + } out; + +}; + + +struct dssetup_DsRoleGetDcOperationProgress { + struct { + WERROR result; + } out; + +}; + + +struct dssetup_DsRoleGetDcOperationResults { + struct { + WERROR result; + } out; + +}; + + +struct dssetup_DsRoleCancel { + struct { + WERROR result; + } out; + +}; + + +struct dssetup_DsRoleServerSaveStateForUpgrade { + struct { + WERROR result; + } out; + +}; + + +struct dssetup_DsRoleUpgradeDownlevelServer { + struct { + WERROR result; + } out; + +}; + + +struct dssetup_DsRoleAbortDownlevelServerUpgrade { + struct { + WERROR result; + } out; + +}; + +#endif /* _HEADER_dssetup */ diff --git a/source3/librpc/gen_ndr/eventlog.h b/source3/librpc/gen_ndr/eventlog.h index e13fb50a5d..0fd929dd99 100644 --- a/source3/librpc/gen_ndr/eventlog.h +++ b/source3/librpc/gen_ndr/eventlog.h @@ -13,8 +13,6 @@ #define EVENTLOG_FORWARDS_READ ( 0x0004 ) #define EVENTLOG_BACKWARDS_READ ( 0x0008 ) -; - /* bitmap eventlogEventTypes */ #define EVENTLOG_SUCCESS ( 0x0000 ) #define EVENTLOG_ERROR_TYPE ( 0x0001 ) @@ -23,8 +21,6 @@ #define EVENTLOG_AUDIT_SUCCESS ( 0x0008 ) #define EVENTLOG_AUDIT_FAILURE ( 0x0010 ) -; - struct eventlog_OpenUnknown0 { uint16_t unknown0; uint16_t unknown1; @@ -57,7 +53,7 @@ struct eventlog_Record { struct eventlog_ClearEventLogW { struct { struct policy_handle *handle;/* [ref] */ - struct lsa_String *unknown;/* [unique] */ + struct lsa_String *backupfile;/* [unique] */ } in; struct { @@ -111,6 +107,11 @@ struct eventlog_GetNumRecords { struct eventlog_GetOldestRecord { struct { + struct policy_handle *handle;/* [ref] */ + } in; + + struct { + uint32_t *oldest_entry;/* [ref] */ NTSTATUS result; } out; @@ -128,8 +129,8 @@ struct eventlog_ChangeNotify { struct eventlog_OpenEventLogW { struct { struct eventlog_OpenUnknown0 *unknown0;/* [unique] */ - struct lsa_String logname; - struct lsa_String servername; + struct lsa_String *logname;/* [ref] */ + struct lsa_String *servername;/* [ref] */ uint32_t unknown2; uint32_t unknown3; } in; @@ -163,7 +164,7 @@ struct eventlog_ReadEventLogW { struct policy_handle *handle;/* [ref] */ uint32_t flags; uint32_t offset; - uint32_t number_of_bytes; + uint32_t number_of_bytes;/* [range(0,0x7FFFF)] */ } in; struct { diff --git a/source3/librpc/gen_ndr/initshutdown.h b/source3/librpc/gen_ndr/initshutdown.h index 665d435919..acfe98846f 100644 --- a/source3/librpc/gen_ndr/initshutdown.h +++ b/source3/librpc/gen_ndr/initshutdown.h @@ -11,8 +11,8 @@ struct initshutdown_String_sub { }; struct initshutdown_String { - uint16_t name_len;/* [value(strlen_m(r->name->name)*2)] */ - uint16_t name_size;/* [value(strlen_m_term(r->name->name)*2)] */ + uint16_t name_len;/* [value(strlen_m(name->name)*2)] */ + uint16_t name_size;/* [value(strlen_m_term(name->name)*2)] */ struct initshutdown_String_sub *name;/* [unique] */ }/* [public] */; diff --git a/source3/librpc/gen_ndr/krb5pac.h b/source3/librpc/gen_ndr/krb5pac.h new file mode 100644 index 0000000000..b8b9054bb6 --- /dev/null +++ b/source3/librpc/gen_ndr/krb5pac.h @@ -0,0 +1,121 @@ +/* header auto-generated by pidl */ + +#include <stdint.h> + +#include "librpc/gen_ndr/security.h" +#include "librpc/gen_ndr/netlogon.h" +#include "librpc/gen_ndr/samr.h" +#ifndef _HEADER_krb5pac +#define _HEADER_krb5pac + +struct PAC_LOGON_NAME { + NTTIME logon_time; + uint16_t size;/* [value(2*strlen_m(account_name))] */ + const char *account_name;/* [charset(UTF16)] */ +}; + +struct PAC_SIGNATURE_DATA { + uint32_t type; + DATA_BLOB signature;/* [flag(LIBNDR_FLAG_REMAINING)] */ +}/* [public,flag(LIBNDR_PRINT_ARRAY_HEX)] */; + +struct PAC_LOGON_INFO { + struct netr_SamInfo3 info3; + struct dom_sid2 *res_group_dom_sid;/* [unique] */ + struct samr_RidWithAttributeArray res_groups; +}/* [gensize] */; + +struct PAC_LOGON_INFO_CTR { + uint32_t unknown1;/* [value(0x00081001)] */ + uint32_t unknown2;/* [value(0xCCCCCCCC)] */ + uint32_t _ndr_size;/* [value(NDR_ROUND(ndr_size_PAC_LOGON_INFO(info,ndr->flags)+4,8))] */ + uint32_t unknown3;/* [value(0x00000000)] */ + struct PAC_LOGON_INFO *info;/* [unique] */ +}/* [public] */; + +enum PAC_TYPE +#ifndef USE_UINT_ENUMS + { + PAC_TYPE_LOGON_INFO=1, + PAC_TYPE_SRV_CHECKSUM=6, + PAC_TYPE_KDC_CHECKSUM=7, + PAC_TYPE_LOGON_NAME=10, + PAC_TYPE_CONSTRAINED_DELEGATION=11 +} +#else + { __donnot_use_enum_PAC_TYPE=0x7FFFFFFF} +#define PAC_TYPE_LOGON_INFO ( 1 ) +#define PAC_TYPE_SRV_CHECKSUM ( 6 ) +#define PAC_TYPE_KDC_CHECKSUM ( 7 ) +#define PAC_TYPE_LOGON_NAME ( 10 ) +#define PAC_TYPE_CONSTRAINED_DELEGATION ( 11 ) +#endif +; + +union PAC_INFO { + struct PAC_LOGON_INFO_CTR logon_info;/* [case(PAC_TYPE_LOGON_INFO)] */ + struct PAC_SIGNATURE_DATA srv_cksum;/* [case(PAC_TYPE_SRV_CHECKSUM)] */ + struct PAC_SIGNATURE_DATA kdc_cksum;/* [case(PAC_TYPE_KDC_CHECKSUM)] */ + struct PAC_LOGON_NAME logon_name;/* [case(PAC_TYPE_LOGON_NAME)] */ +}/* [gensize,nodiscriminant,public] */; + +struct PAC_BUFFER { + enum PAC_TYPE type; + uint32_t _ndr_size;/* [value(_ndr_size_PAC_INFO(info,type,0))] */ + union PAC_INFO *info;/* [relative,subcontext_size(_subcontext_size_PAC_INFO(r,ndr->flags)),subcontext(0),switch_is(type),flag(LIBNDR_FLAG_ALIGN8)] */ + uint32_t _pad;/* [value(0)] */ +}/* [noprint,nopull,public,nopush] */; + +struct PAC_DATA { + uint32_t num_buffers; + uint32_t version; + struct PAC_BUFFER *buffers; +}/* [public] */; + +struct DATA_BLOB_REM { + DATA_BLOB remaining;/* [flag(LIBNDR_FLAG_REMAINING)] */ +}; + +struct PAC_BUFFER_RAW { + enum PAC_TYPE type; + uint32_t ndr_size; + struct DATA_BLOB_REM *info;/* [relative,subcontext_size(NDR_ROUND(ndr_size,8)),subcontext(0),flag(LIBNDR_FLAG_ALIGN8)] */ + uint32_t _pad;/* [value(0)] */ +}/* [public] */; + +struct PAC_DATA_RAW { + uint32_t num_buffers; + uint32_t version; + struct PAC_BUFFER_RAW *buffers; +}/* [public] */; + +struct netsamlogoncache_entry { + time_t timestamp; + struct netr_SamInfo3 info3; +}/* [public] */; + + +struct decode_pac { + struct { + struct PAC_DATA pac; + } in; + +}; + + +struct decode_pac_raw { + struct { + struct PAC_DATA_RAW pac; + } in; + +}; + + +struct decode_login_info { + struct { + struct PAC_LOGON_INFO logon_info; + } in; + +}; + +#endif /* _HEADER_krb5pac */ diff --git a/source3/librpc/gen_ndr/libnet_join.h b/source3/librpc/gen_ndr/libnet_join.h index 40759cb489..8dbadcf0a2 100644 --- a/source3/librpc/gen_ndr/libnet_join.h +++ b/source3/librpc/gen_ndr/libnet_join.h @@ -7,8 +7,6 @@ #ifndef _HEADER_libnetjoin #define _HEADER_libnetjoin -; - struct libnet_JoinCtx { struct { @@ -65,6 +63,8 @@ struct libnet_UnjoinCtx { const char * dns_domain_name; uint8_t modified_config; const char * error_string; + uint8_t disabled_machine_account; + uint8_t deleted_machine_account; WERROR result; } out; diff --git a/source3/librpc/gen_ndr/lsa.h b/source3/librpc/gen_ndr/lsa.h index 513d17b5df..4fea08e99d 100644 --- a/source3/librpc/gen_ndr/lsa.h +++ b/source3/librpc/gen_ndr/lsa.h @@ -8,9 +8,9 @@ #define LSA_ENUM_TRUST_DOMAIN_MULTIPLIER ( 60 ) #define LSA_REF_DOMAIN_LIST_MULTIPLIER ( 32 ) +#define MAX_REF_DOMAINS ( LSA_REF_DOMAIN_LIST_MULTIPLIER ) +#define MAX_LOOKUP_SIDS ( 0x5000 ) #define LSA_ENUM_TRUST_DOMAIN_EX_MULTIPLIER ( 82 ) -; - struct lsa_String { uint16_t length;/* [value(2*strlen_m(string))] */ uint16_t size;/* [value(2*strlen_m(string))] */ @@ -19,7 +19,7 @@ struct lsa_String { struct lsa_StringLarge { uint16_t length;/* [value(2*strlen_m(string))] */ - uint16_t size;/* [value(2*(strlen_m(string)+1))] */ + uint16_t size;/* [value(2*strlen_m_term(string))] */ const char *string;/* [unique,charset(UTF16),length_is(length/2),size_is(size/2)] */ }/* [public] */; @@ -31,7 +31,13 @@ struct lsa_Strings { struct lsa_AsciiString { uint16_t length;/* [value(strlen_m(string))] */ uint16_t size;/* [value(strlen_m(string))] */ - const char * string;/* [unique,flag(LIBNDR_FLAG_STR_NOTERM|LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_SIZE4|LIBNDR_FLAG_STR_LEN4)] */ + const char *string;/* [unique,charset(DOS),length_is(length),size_is(size)] */ +}/* [public] */; + +struct lsa_AsciiStringLarge { + uint16_t length;/* [value(strlen_m(string))] */ + uint16_t size;/* [value(strlen_m_term(string))] */ + const char *string;/* [unique,charset(DOS),length_is(length),size_is(size)] */ }/* [public] */; struct lsa_LUID { @@ -65,6 +71,20 @@ struct lsa_ObjectAttribute { struct lsa_QosInfo *sec_qos;/* [unique] */ }; +/* bitmap lsa_PolicyAccessMask */ +#define LSA_POLICY_VIEW_LOCAL_INFORMATION ( 0x00000001 ) +#define LSA_POLICY_VIEW_AUDIT_INFORMATION ( 0x00000002 ) +#define LSA_POLICY_GET_PRIVATE_INFORMATION ( 0x00000004 ) +#define LSA_POLICY_TRUST_ADMIN ( 0x00000008 ) +#define LSA_POLICY_CREATE_ACCOUNT ( 0x00000010 ) +#define LSA_POLICY_CREATE_SECRET ( 0x00000020 ) +#define LSA_POLICY_CREATE_PRIVILEGE ( 0x00000040 ) +#define LSA_POLICY_SET_DEFAULT_QUOTA_LIMITS ( 0x00000080 ) +#define LSA_POLICY_SET_AUDIT_REQUIREMENTS ( 0x00000100 ) +#define LSA_POLICY_AUDIT_LOG_ADMIN ( 0x00000200 ) +#define LSA_POLICY_SERVER_ADMIN ( 0x00000400 ) +#define LSA_POLICY_LOOKUP_NAMES ( 0x00000800 ) + struct lsa_AuditLogInfo { uint32_t percent_full; uint32_t log_size; @@ -75,9 +95,55 @@ struct lsa_AuditLogInfo { uint32_t unknown; }; +enum lsa_PolicyAuditPolicy +#ifndef USE_UINT_ENUMS + { + LSA_AUDIT_POLICY_NONE=0, + LSA_AUDIT_POLICY_SUCCESS=1, + LSA_AUDIT_POLICY_FAILURE=2, + LSA_AUDIT_POLICY_ALL=(LSA_AUDIT_POLICY_SUCCESS|LSA_AUDIT_POLICY_FAILURE), + LSA_AUDIT_POLICY_CLEAR=4 +} +#else + { __donnot_use_enum_lsa_PolicyAuditPolicy=0x7FFFFFFF} +#define LSA_AUDIT_POLICY_NONE ( 0 ) +#define LSA_AUDIT_POLICY_SUCCESS ( 1 ) +#define LSA_AUDIT_POLICY_FAILURE ( 2 ) +#define LSA_AUDIT_POLICY_ALL ( (LSA_AUDIT_POLICY_SUCCESS|LSA_AUDIT_POLICY_FAILURE) ) +#define LSA_AUDIT_POLICY_CLEAR ( 4 ) +#endif +; + +enum lsa_PolicyAuditEventType +#ifndef USE_UINT_ENUMS + { + LSA_AUDIT_CATEGORY_SYSTEM=0, + LSA_AUDIT_CATEGORY_LOGON=1, + LSA_AUDIT_CATEGORY_FILE_AND_OBJECT_ACCESS=2, + LSA_AUDIT_CATEGORY_USE_OF_USER_RIGHTS=3, + LSA_AUDIT_CATEGORY_PROCCESS_TRACKING=4, + LSA_AUDIT_CATEGORY_SECURITY_POLICY_CHANGES=5, + LSA_AUDIT_CATEGORY_ACCOUNT_MANAGEMENT=6, + LSA_AUDIT_CATEGORY_DIRECTORY_SERVICE_ACCESS=7, + LSA_AUDIT_CATEGORY_ACCOUNT_LOGON=8 +} +#else + { __donnot_use_enum_lsa_PolicyAuditEventType=0x7FFFFFFF} +#define LSA_AUDIT_CATEGORY_SYSTEM ( 0 ) +#define LSA_AUDIT_CATEGORY_LOGON ( 1 ) +#define LSA_AUDIT_CATEGORY_FILE_AND_OBJECT_ACCESS ( 2 ) +#define LSA_AUDIT_CATEGORY_USE_OF_USER_RIGHTS ( 3 ) +#define LSA_AUDIT_CATEGORY_PROCCESS_TRACKING ( 4 ) +#define LSA_AUDIT_CATEGORY_SECURITY_POLICY_CHANGES ( 5 ) +#define LSA_AUDIT_CATEGORY_ACCOUNT_MANAGEMENT ( 6 ) +#define LSA_AUDIT_CATEGORY_DIRECTORY_SERVICE_ACCESS ( 7 ) +#define LSA_AUDIT_CATEGORY_ACCOUNT_LOGON ( 8 ) +#endif +; + struct lsa_AuditEventsInfo { uint32_t auditing_mode; - uint32_t *settings;/* [unique,size_is(count)] */ + enum lsa_PolicyAuditPolicy *settings;/* [unique,size_is(count)] */ uint32_t count; }; @@ -185,7 +251,7 @@ struct lsa_SidPtr { }; struct lsa_SidArray { - uint32_t num_sids;/* [range(0 1000)] */ + uint32_t num_sids;/* [range(0,1000)] */ struct lsa_SidPtr *sids;/* [unique,size_is(num_sids)] */ }/* [public] */; @@ -230,16 +296,37 @@ struct lsa_TranslatedSid { }; struct lsa_TransSidArray { - uint32_t count;/* [range(0 1000)] */ + uint32_t count;/* [range(0,1000)] */ struct lsa_TranslatedSid *sids;/* [unique,size_is(count)] */ }; struct lsa_RefDomainList { - uint32_t count;/* [range(0 1000)] */ + uint32_t count;/* [range(0,1000)] */ struct lsa_DomainInfo *domains;/* [unique,size_is(count)] */ uint32_t max_size; }; +enum lsa_LookupNamesLevel +#ifndef USE_UINT_ENUMS + { + LSA_LOOKUP_NAMES_ALL=1, + LSA_LOOKUP_NAMES_DOMAINS_ONLY=2, + LSA_LOOKUP_NAMES_PRIMARY_DOMAIN_ONLY=3, + LSA_LOOKUP_NAMES_UPLEVEL_TRUSTS_ONLY=4, + LSA_LOOKUP_NAMES_FOREST_TRUSTS_ONLY=5, + LSA_LOOKUP_NAMES_UPLEVEL_TRUSTS_ONLY2=6 +} +#else + { __donnot_use_enum_lsa_LookupNamesLevel=0x7FFFFFFF} +#define LSA_LOOKUP_NAMES_ALL ( 1 ) +#define LSA_LOOKUP_NAMES_DOMAINS_ONLY ( 2 ) +#define LSA_LOOKUP_NAMES_PRIMARY_DOMAIN_ONLY ( 3 ) +#define LSA_LOOKUP_NAMES_UPLEVEL_TRUSTS_ONLY ( 4 ) +#define LSA_LOOKUP_NAMES_FOREST_TRUSTS_ONLY ( 5 ) +#define LSA_LOOKUP_NAMES_UPLEVEL_TRUSTS_ONLY2 ( 6 ) +#endif +; + struct lsa_TranslatedName { enum lsa_SidType sid_type; struct lsa_String name; @@ -247,7 +334,7 @@ struct lsa_TranslatedName { }; struct lsa_TransNameArray { - uint32_t count;/* [range(0 1000)] */ + uint32_t count;/* [range(0,1000)] */ struct lsa_TranslatedName *names;/* [unique,size_is(count)] */ }; @@ -257,7 +344,7 @@ struct lsa_LUIDAttribute { }; struct lsa_PrivilegeSet { - uint32_t count;/* [range(0 1000)] */ + uint32_t count;/* [range(0,1000)] */ uint32_t unknown; struct lsa_LUIDAttribute *set;/* [size_is(count)] */ }; @@ -269,7 +356,7 @@ struct lsa_DATA_BUF { }/* [flag(LIBNDR_PRINT_ARRAY_HEX)] */; struct lsa_DATA_BUF2 { - uint32_t size;/* [range(0 65536)] */ + uint32_t size;/* [range(0,65536)] */ uint8_t *data;/* [unique,size_is(size)] */ }/* [flag(LIBNDR_PRINT_ARRAY_HEX)] */; @@ -383,14 +470,10 @@ struct lsa_RightAttribute { }; struct lsa_RightSet { - uint32_t count; + uint32_t count;/* [range(0,256)] */ struct lsa_StringLarge *names;/* [unique,size_is(count)] */ }; -struct lsa_StringPointer { - struct lsa_String *string;/* [unique] */ -}; - struct lsa_DomainListEx { uint32_t count; struct lsa_TrustDomainInfoInfoEx *domains;/* [unique,size_is(count)] */ @@ -436,7 +519,7 @@ struct lsa_TranslatedName2 { }; struct lsa_TransNameArray2 { - uint32_t count;/* [range(0 1000)] */ + uint32_t count;/* [range(0,1000)] */ struct lsa_TranslatedName2 *names;/* [unique,size_is(count)] */ }; @@ -448,7 +531,7 @@ struct lsa_TranslatedSid2 { }; struct lsa_TransSidArray2 { - uint32_t count;/* [range(0 1000)] */ + uint32_t count;/* [range(0,1000)] */ struct lsa_TranslatedSid2 *sids;/* [unique,size_is(count)] */ }; @@ -460,10 +543,57 @@ struct lsa_TranslatedSid3 { }; struct lsa_TransSidArray3 { - uint32_t count;/* [range(0 1000)] */ + uint32_t count;/* [range(0,1000)] */ struct lsa_TranslatedSid3 *sids;/* [unique,size_is(count)] */ }; +struct lsa_ForestTrustBinaryData { + uint32_t length;/* [range(0,131072)] */ + uint8_t *data;/* [unique,size_is(length)] */ +}; + +struct lsa_ForestTrustDomainInfo { + struct dom_sid2 *domain_sid;/* [unique] */ + struct lsa_StringLarge dns_domain_name; + struct lsa_StringLarge netbios_domain_name; +}; + +union lsa_ForestTrustData { + struct lsa_String top_level_name;/* [case(LSA_FOREST_TRUST_TOP_LEVEL_NAME)] */ + struct lsa_StringLarge top_level_name_ex;/* [case(LSA_FOREST_TRUST_TOP_LEVEL_NAME_EX)] */ + struct lsa_ForestTrustDomainInfo domain_info;/* [case(LSA_FOREST_TRUST_DOMAIN_INFO)] */ + struct lsa_ForestTrustBinaryData data;/* [default] */ +}/* [switch_type(uint32)] */; + +enum lsa_ForestTrustRecordType +#ifndef USE_UINT_ENUMS + { + LSA_FOREST_TRUST_TOP_LEVEL_NAME=0, + LSA_FOREST_TRUST_TOP_LEVEL_NAME_EX=1, + LSA_FOREST_TRUST_DOMAIN_INFO=2, + LSA_FOREST_TRUST_RECORD_TYPE_LAST=3 +} +#else + { __donnot_use_enum_lsa_ForestTrustRecordType=0x7FFFFFFF} +#define LSA_FOREST_TRUST_TOP_LEVEL_NAME ( 0 ) +#define LSA_FOREST_TRUST_TOP_LEVEL_NAME_EX ( 1 ) +#define LSA_FOREST_TRUST_DOMAIN_INFO ( 2 ) +#define LSA_FOREST_TRUST_RECORD_TYPE_LAST ( 3 ) +#endif +; + +struct lsa_ForestTrustRecord { + uint32_t flags; + enum lsa_ForestTrustRecordType level; + uint64_t unknown; + union lsa_ForestTrustData forest_trust_data;/* [switch_is(level)] */ +}; + +struct lsa_ForestTrustInformation { + uint32_t count;/* [range(0,4000)] */ + struct lsa_ForestTrustRecord **entries;/* [unique,size_is(count)] */ +}/* [public] */; + struct lsa_Close { struct { @@ -513,7 +643,7 @@ struct lsa_QuerySecurity { } in; struct { - struct sec_desc_buf *sdbuf;/* [unique] */ + struct sec_desc_buf **sdbuf;/* [ref] */ NTSTATUS result; } out; @@ -522,6 +652,12 @@ struct lsa_QuerySecurity { struct lsa_SetSecObj { struct { + struct policy_handle *handle;/* [ref] */ + uint32_t sec_info; + struct sec_desc_buf *sdbuf;/* [ref] */ + } in; + + struct { NTSTATUS result; } out; @@ -558,7 +694,7 @@ struct lsa_QueryInfoPolicy { } in; struct { - union lsa_PolicyInformation *info;/* [unique,switch_is(level)] */ + union lsa_PolicyInformation **info;/* [ref,switch_is(level)] */ NTSTATUS result; } out; @@ -605,7 +741,7 @@ struct lsa_CreateAccount { struct lsa_EnumAccounts { struct { struct policy_handle *handle;/* [ref] */ - uint32_t num_entries;/* [range(0 8192)] */ + uint32_t num_entries;/* [range(0,8192)] */ uint32_t *resume_handle;/* [ref] */ } in; @@ -636,7 +772,7 @@ struct lsa_CreateTrustedDomain { struct lsa_EnumTrustDom { struct { struct policy_handle *handle;/* [ref] */ - uint32_t max_size;/* [range(0 1000)] */ + uint32_t max_size; uint32_t *resume_handle;/* [ref] */ } in; @@ -652,15 +788,15 @@ struct lsa_EnumTrustDom { struct lsa_LookupNames { struct { struct policy_handle *handle;/* [ref] */ - uint32_t num_names;/* [range(0 1000)] */ + uint32_t num_names;/* [range(0,1000)] */ struct lsa_String *names;/* [size_is(num_names)] */ - uint16_t level; + enum lsa_LookupNamesLevel level; struct lsa_TransSidArray *sids;/* [ref] */ uint32_t *count;/* [ref] */ } in; struct { - struct lsa_RefDomainList *domains;/* [unique] */ + struct lsa_RefDomainList **domains;/* [ref] */ struct lsa_TransSidArray *sids;/* [ref] */ uint32_t *count;/* [ref] */ NTSTATUS result; @@ -679,7 +815,7 @@ struct lsa_LookupSids { } in; struct { - struct lsa_RefDomainList *domains;/* [unique] */ + struct lsa_RefDomainList **domains;/* [ref] */ struct lsa_TransNameArray *names;/* [ref] */ uint32_t *count;/* [ref] */ NTSTATUS result; @@ -724,7 +860,7 @@ struct lsa_EnumPrivsAccount { } in; struct { - struct lsa_PrivilegeSet *privs;/* [unique] */ + struct lsa_PrivilegeSet **privs;/* [ref] */ NTSTATUS result; } out; @@ -776,6 +912,11 @@ struct lsa_SetQuotasForAccount { struct lsa_GetSystemAccessAccount { struct { + struct policy_handle *handle;/* [ref] */ + } in; + + struct { + uint32_t *access_mask;/* [ref] */ NTSTATUS result; } out; @@ -784,6 +925,11 @@ struct lsa_GetSystemAccessAccount { struct lsa_SetSystemAccessAccount { struct { + struct policy_handle *handle;/* [ref] */ + uint32_t access_mask; + } in; + + struct { NTSTATUS result; } out; @@ -908,13 +1054,13 @@ struct lsa_LookupPrivDisplayName { struct { struct policy_handle *handle;/* [ref] */ struct lsa_String *name;/* [ref] */ - uint16_t unknown; - uint16_t *language_id;/* [ref] */ + uint16_t language_id; + uint16_t language_id_sys; } in; struct { - struct lsa_StringLarge *disp_name;/* [unique] */ - uint16_t *language_id;/* [ref] */ + struct lsa_StringLarge **disp_name;/* [ref] */ + uint16_t *returned_language_id;/* [ref] */ NTSTATUS result; } out; @@ -923,6 +1069,11 @@ struct lsa_LookupPrivDisplayName { struct lsa_DeleteObject { struct { + struct policy_handle *handle;/* [ref] */ + } in; + + struct { + struct policy_handle *handle;/* [ref] */ NTSTATUS result; } out; @@ -975,7 +1126,7 @@ struct lsa_RemoveAccountRights { struct { struct policy_handle *handle;/* [ref] */ struct dom_sid2 *sid;/* [ref] */ - uint32_t unknown; + uint8_t remove_all; struct lsa_RightSet *rights;/* [ref] */ } in; @@ -1056,13 +1207,13 @@ struct lsa_OpenPolicy2 { struct lsa_GetUserName { struct { const char *system_name;/* [unique,charset(UTF16)] */ - struct lsa_String *account_name;/* [unique] */ - struct lsa_StringPointer *authority_name;/* [unique] */ + struct lsa_String **account_name;/* [ref] */ + struct lsa_String **authority_name;/* [unique] */ } in; struct { - struct lsa_String *account_name;/* [unique] */ - struct lsa_StringPointer *authority_name;/* [unique] */ + struct lsa_String **account_name;/* [ref] */ + struct lsa_String **authority_name;/* [unique] */ NTSTATUS result; } out; @@ -1076,7 +1227,7 @@ struct lsa_QueryInfoPolicy2 { } in; struct { - union lsa_PolicyInformation *info;/* [unique,switch_is(level)] */ + union lsa_PolicyInformation **info;/* [ref,switch_is(level)] */ NTSTATUS result; } out; @@ -1100,12 +1251,12 @@ struct lsa_SetInfoPolicy2 { struct lsa_QueryTrustedDomainInfoByName { struct { struct policy_handle *handle;/* [ref] */ - struct lsa_String trusted_domain; + struct lsa_String *trusted_domain;/* [ref] */ enum lsa_TrustDomInfoEnum level; } in; struct { - union lsa_TrustedDomainInfo *info;/* [unique,switch_is(level)] */ + union lsa_TrustedDomainInfo *info;/* [ref,switch_is(level)] */ NTSTATUS result; } out; @@ -1227,7 +1378,7 @@ struct lsa_LookupSids2 { } in; struct { - struct lsa_RefDomainList *domains;/* [unique] */ + struct lsa_RefDomainList **domains;/* [ref] */ struct lsa_TransNameArray2 *names;/* [ref] */ uint32_t *count;/* [ref] */ NTSTATUS result; @@ -1239,9 +1390,9 @@ struct lsa_LookupSids2 { struct lsa_LookupNames2 { struct { struct policy_handle *handle;/* [ref] */ - uint32_t num_names;/* [range(0 1000)] */ + uint32_t num_names;/* [range(0,1000)] */ struct lsa_String *names;/* [size_is(num_names)] */ - uint16_t level; + enum lsa_LookupNamesLevel level; uint32_t unknown1; uint32_t unknown2; struct lsa_TransSidArray2 *sids;/* [ref] */ @@ -1249,7 +1400,7 @@ struct lsa_LookupNames2 { } in; struct { - struct lsa_RefDomainList *domains;/* [unique] */ + struct lsa_RefDomainList **domains;/* [ref] */ struct lsa_TransSidArray2 *sids;/* [ref] */ uint32_t *count;/* [ref] */ NTSTATUS result; @@ -1333,9 +1484,9 @@ struct lsa_CREDRPROFILELOADED { struct lsa_LookupNames3 { struct { struct policy_handle *handle;/* [ref] */ - uint32_t num_names;/* [range(0 1000)] */ + uint32_t num_names;/* [range(0,1000)] */ struct lsa_String *names;/* [size_is(num_names)] */ - uint16_t level; + enum lsa_LookupNamesLevel level; uint32_t unknown1; uint32_t unknown2; struct lsa_TransSidArray3 *sids;/* [ref] */ @@ -1343,7 +1494,7 @@ struct lsa_LookupNames3 { } in; struct { - struct lsa_RefDomainList *domains;/* [unique] */ + struct lsa_RefDomainList **domains;/* [ref] */ struct lsa_TransSidArray3 *sids;/* [ref] */ uint32_t *count;/* [ref] */ NTSTATUS result; @@ -1384,8 +1535,15 @@ struct lsa_LSARUNREGISTERAUDITEVENT { }; -struct lsa_LSARQUERYFORESTTRUSTINFORMATION { +struct lsa_lsaRQueryForestTrustInformation { + struct { + struct policy_handle *handle;/* [ref] */ + struct lsa_String *trusted_domain_name;/* [ref] */ + uint16_t unknown; + } in; + struct { + struct lsa_ForestTrustInformation **forest_trust_info;/* [ref] */ NTSTATUS result; } out; @@ -1419,7 +1577,7 @@ struct lsa_LookupSids3 { } in; struct { - struct lsa_RefDomainList *domains;/* [unique] */ + struct lsa_RefDomainList **domains;/* [ref] */ struct lsa_TransNameArray2 *names;/* [ref] */ uint32_t *count;/* [ref] */ NTSTATUS result; @@ -1430,9 +1588,9 @@ struct lsa_LookupSids3 { struct lsa_LookupNames4 { struct { - uint32_t num_names;/* [range(0 1000)] */ + uint32_t num_names;/* [range(0,1000)] */ struct lsa_String *names;/* [size_is(num_names)] */ - uint16_t level; + enum lsa_LookupNamesLevel level; uint32_t unknown1; uint32_t unknown2; struct lsa_TransSidArray3 *sids;/* [ref] */ @@ -1440,7 +1598,7 @@ struct lsa_LookupNames4 { } in; struct { - struct lsa_RefDomainList *domains;/* [unique] */ + struct lsa_RefDomainList **domains;/* [ref] */ struct lsa_TransSidArray3 *sids;/* [ref] */ uint32_t *count;/* [ref] */ NTSTATUS result; diff --git a/source3/librpc/gen_ndr/misc.h b/source3/librpc/gen_ndr/misc.h new file mode 100644 index 0000000000..4fa7415db7 --- /dev/null +++ b/source3/librpc/gen_ndr/misc.h @@ -0,0 +1,73 @@ +/* header auto-generated by pidl */ + +#include <stdint.h> + +#ifndef _HEADER_misc +#define _HEADER_misc + +struct GUID { + uint32_t time_low; + uint16_t time_mid; + uint16_t time_hi_and_version; + uint8_t clock_seq[2]; + uint8_t node[6]; +}/* [noprint,gensize,public,noejs] */; + +struct ndr_syntax_id { + struct GUID uuid; + uint32_t if_version; +}/* [public] */; + +struct policy_handle { + uint32_t handle_type; + struct GUID uuid; +}/* [public] */; + +enum netr_SchannelType +#ifndef USE_UINT_ENUMS + { + SEC_CHAN_WKSTA=2, + SEC_CHAN_DOMAIN=4, + SEC_CHAN_BDC=6 +} +#else + { __donnot_use_enum_netr_SchannelType=0x7FFFFFFF} +#define SEC_CHAN_WKSTA ( 2 ) +#define SEC_CHAN_DOMAIN ( 4 ) +#define SEC_CHAN_BDC ( 6 ) +#endif +; + +enum netr_SamDatabaseID +#ifndef USE_UINT_ENUMS + { + SAM_DATABASE_DOMAIN=0, + SAM_DATABASE_BUILTIN=1, + SAM_DATABASE_PRIVS=2 +} +#else + { __donnot_use_enum_netr_SamDatabaseID=0x7FFFFFFF} +#define SAM_DATABASE_DOMAIN ( 0 ) +#define SAM_DATABASE_BUILTIN ( 1 ) +#define SAM_DATABASE_PRIVS ( 2 ) +#endif +; + +enum samr_RejectReason +#ifndef USE_UINT_ENUMS + { + SAMR_REJECT_OTHER=0, + SAMR_REJECT_TOO_SHORT=1, + SAMR_REJECT_IN_HISTORY=2, + SAMR_REJECT_COMPLEXITY=5 +} +#else + { __donnot_use_enum_samr_RejectReason=0x7FFFFFFF} +#define SAMR_REJECT_OTHER ( 0 ) +#define SAMR_REJECT_TOO_SHORT ( 1 ) +#define SAMR_REJECT_IN_HISTORY ( 2 ) +#define SAMR_REJECT_COMPLEXITY ( 5 ) +#endif +; + +#endif /* _HEADER_misc */ diff --git a/source3/librpc/gen_ndr/ndr_dfs.c b/source3/librpc/gen_ndr/ndr_dfs.c index 4b26487a0d..2e9873e929 100644 --- a/source3/librpc/gen_ndr/ndr_dfs.c +++ b/source3/librpc/gen_ndr/ndr_dfs.c @@ -506,8 +506,7 @@ _PUBLIC_ void ndr_print_dfs_Info3(struct ndr_print *ndr, const char *name, const ndr->depth++; for (cntr_stores_1=0;cntr_stores_1<r->num_stores;cntr_stores_1++) { char *idx_1=NULL; - asprintf(&idx_1, "[%d]", cntr_stores_1); - if (idx_1) { + if (asprintf(&idx_1, "[%d]", cntr_stores_1) != -1) { ndr_print_dfs_StorageInfo(ndr, "stores", &r->stores[cntr_stores_1]); free(idx_1); } @@ -670,8 +669,7 @@ _PUBLIC_ void ndr_print_dfs_Info4(struct ndr_print *ndr, const char *name, const ndr->depth++; for (cntr_stores_1=0;cntr_stores_1<r->num_stores;cntr_stores_1++) { char *idx_1=NULL; - asprintf(&idx_1, "[%d]", cntr_stores_1); - if (idx_1) { + if (asprintf(&idx_1, "[%d]", cntr_stores_1) != -1) { ndr_print_dfs_StorageInfo(ndr, "stores", &r->stores[cntr_stores_1]); free(idx_1); } @@ -1079,8 +1077,7 @@ _PUBLIC_ void ndr_print_dfs_Info6(struct ndr_print *ndr, const char *name, const ndr->depth++; for (cntr_stores_1=0;cntr_stores_1<r->num_stores;cntr_stores_1++) { char *idx_1=NULL; - asprintf(&idx_1, "[%d]", cntr_stores_1); - if (idx_1) { + if (asprintf(&idx_1, "[%d]", cntr_stores_1) != -1) { ndr_print_dfs_StorageInfo2(ndr, "stores", &r->stores[cntr_stores_1]); free(idx_1); } @@ -1562,65 +1559,65 @@ static enum ndr_err_code ndr_push_dfs_Info(struct ndr_push *ndr, int ndr_flags, int level = ndr_push_get_switch_value(ndr, r); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, level)); switch (level) { - case 0: + case 0: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->info0)); - break; + break; } - case 1: + case 1: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1)); - break; + break; } - case 2: + case 2: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->info2)); - break; + break; } - case 3: + case 3: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->info3)); - break; + break; } - case 4: + case 4: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->info4)); - break; + break; } - case 5: + case 5: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->info5)); - break; + break; } - case 6: + case 6: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->info6)); - break; + break; } - case 7: + case 7: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->info7)); - break; + break; } - case 100: + case 100: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->info100)); - break; + break; } - case 101: + case 101: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->info101)); - break; + break; } - case 102: + case 102: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->info102)); - break; + break; } - case 103: + case 103: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->info103)); - break; + break; } - case 104: + case 104: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->info104)); - break; + break; } - case 105: + case 105: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->info105)); - break; + break; } - case 106: + case 106: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->info106)); - break; + break; } default: return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); @@ -2271,8 +2268,7 @@ _PUBLIC_ void ndr_print_dfs_EnumArray1(struct ndr_print *ndr, const char *name, ndr->depth++; for (cntr_s_1=0;cntr_s_1<r->count;cntr_s_1++) { char *idx_1=NULL; - asprintf(&idx_1, "[%d]", cntr_s_1); - if (idx_1) { + if (asprintf(&idx_1, "[%d]", cntr_s_1) != -1) { ndr_print_dfs_Info1(ndr, "s", &r->s[cntr_s_1]); free(idx_1); } @@ -2358,8 +2354,7 @@ _PUBLIC_ void ndr_print_dfs_EnumArray2(struct ndr_print *ndr, const char *name, ndr->depth++; for (cntr_s_1=0;cntr_s_1<r->count;cntr_s_1++) { char *idx_1=NULL; - asprintf(&idx_1, "[%d]", cntr_s_1); - if (idx_1) { + if (asprintf(&idx_1, "[%d]", cntr_s_1) != -1) { ndr_print_dfs_Info2(ndr, "s", &r->s[cntr_s_1]); free(idx_1); } @@ -2445,8 +2440,7 @@ _PUBLIC_ void ndr_print_dfs_EnumArray3(struct ndr_print *ndr, const char *name, ndr->depth++; for (cntr_s_1=0;cntr_s_1<r->count;cntr_s_1++) { char *idx_1=NULL; - asprintf(&idx_1, "[%d]", cntr_s_1); - if (idx_1) { + if (asprintf(&idx_1, "[%d]", cntr_s_1) != -1) { ndr_print_dfs_Info3(ndr, "s", &r->s[cntr_s_1]); free(idx_1); } @@ -2532,8 +2526,7 @@ _PUBLIC_ void ndr_print_dfs_EnumArray4(struct ndr_print *ndr, const char *name, ndr->depth++; for (cntr_s_1=0;cntr_s_1<r->count;cntr_s_1++) { char *idx_1=NULL; - asprintf(&idx_1, "[%d]", cntr_s_1); - if (idx_1) { + if (asprintf(&idx_1, "[%d]", cntr_s_1) != -1) { ndr_print_dfs_Info4(ndr, "s", &r->s[cntr_s_1]); free(idx_1); } @@ -2544,6 +2537,178 @@ _PUBLIC_ void ndr_print_dfs_EnumArray4(struct ndr_print *ndr, const char *name, ndr->depth--; } +static enum ndr_err_code ndr_push_dfs_EnumArray5(struct ndr_push *ndr, int ndr_flags, const struct dfs_EnumArray5 *r) +{ + uint32_t cntr_s_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->s)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->s) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + for (cntr_s_1 = 0; cntr_s_1 < r->count; cntr_s_1++) { + NDR_CHECK(ndr_push_dfs_Info5(ndr, NDR_SCALARS, &r->s[cntr_s_1])); + } + for (cntr_s_1 = 0; cntr_s_1 < r->count; cntr_s_1++) { + NDR_CHECK(ndr_push_dfs_Info5(ndr, NDR_BUFFERS, &r->s[cntr_s_1])); + } + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_dfs_EnumArray5(struct ndr_pull *ndr, int ndr_flags, struct dfs_EnumArray5 *r) +{ + uint32_t _ptr_s; + uint32_t cntr_s_1; + TALLOC_CTX *_mem_save_s_0; + TALLOC_CTX *_mem_save_s_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_s)); + if (_ptr_s) { + NDR_PULL_ALLOC(ndr, r->s); + } else { + r->s = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->s) { + _mem_save_s_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->s, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->s)); + NDR_PULL_ALLOC_N(ndr, r->s, ndr_get_array_size(ndr, &r->s)); + _mem_save_s_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->s, 0); + for (cntr_s_1 = 0; cntr_s_1 < r->count; cntr_s_1++) { + NDR_CHECK(ndr_pull_dfs_Info5(ndr, NDR_SCALARS, &r->s[cntr_s_1])); + } + for (cntr_s_1 = 0; cntr_s_1 < r->count; cntr_s_1++) { + NDR_CHECK(ndr_pull_dfs_Info5(ndr, NDR_BUFFERS, &r->s[cntr_s_1])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_s_1, 0); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_s_0, 0); + } + if (r->s) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->s, r->count)); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_dfs_EnumArray5(struct ndr_print *ndr, const char *name, const struct dfs_EnumArray5 *r) +{ + uint32_t cntr_s_1; + ndr_print_struct(ndr, name, "dfs_EnumArray5"); + ndr->depth++; + ndr_print_uint32(ndr, "count", r->count); + ndr_print_ptr(ndr, "s", r->s); + ndr->depth++; + if (r->s) { + ndr->print(ndr, "%s: ARRAY(%d)", "s", r->count); + ndr->depth++; + for (cntr_s_1=0;cntr_s_1<r->count;cntr_s_1++) { + char *idx_1=NULL; + if (asprintf(&idx_1, "[%d]", cntr_s_1) != -1) { + ndr_print_dfs_Info5(ndr, "s", &r->s[cntr_s_1]); + free(idx_1); + } + } + ndr->depth--; + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_dfs_EnumArray6(struct ndr_push *ndr, int ndr_flags, const struct dfs_EnumArray6 *r) +{ + uint32_t cntr_s_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->s)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->s) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + for (cntr_s_1 = 0; cntr_s_1 < r->count; cntr_s_1++) { + NDR_CHECK(ndr_push_dfs_Info6(ndr, NDR_SCALARS, &r->s[cntr_s_1])); + } + for (cntr_s_1 = 0; cntr_s_1 < r->count; cntr_s_1++) { + NDR_CHECK(ndr_push_dfs_Info6(ndr, NDR_BUFFERS, &r->s[cntr_s_1])); + } + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_dfs_EnumArray6(struct ndr_pull *ndr, int ndr_flags, struct dfs_EnumArray6 *r) +{ + uint32_t _ptr_s; + uint32_t cntr_s_1; + TALLOC_CTX *_mem_save_s_0; + TALLOC_CTX *_mem_save_s_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_s)); + if (_ptr_s) { + NDR_PULL_ALLOC(ndr, r->s); + } else { + r->s = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->s) { + _mem_save_s_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->s, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->s)); + NDR_PULL_ALLOC_N(ndr, r->s, ndr_get_array_size(ndr, &r->s)); + _mem_save_s_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->s, 0); + for (cntr_s_1 = 0; cntr_s_1 < r->count; cntr_s_1++) { + NDR_CHECK(ndr_pull_dfs_Info6(ndr, NDR_SCALARS, &r->s[cntr_s_1])); + } + for (cntr_s_1 = 0; cntr_s_1 < r->count; cntr_s_1++) { + NDR_CHECK(ndr_pull_dfs_Info6(ndr, NDR_BUFFERS, &r->s[cntr_s_1])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_s_1, 0); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_s_0, 0); + } + if (r->s) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->s, r->count)); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_dfs_EnumArray6(struct ndr_print *ndr, const char *name, const struct dfs_EnumArray6 *r) +{ + uint32_t cntr_s_1; + ndr_print_struct(ndr, name, "dfs_EnumArray6"); + ndr->depth++; + ndr_print_uint32(ndr, "count", r->count); + ndr_print_ptr(ndr, "s", r->s); + ndr->depth++; + if (r->s) { + ndr->print(ndr, "%s: ARRAY(%d)", "s", r->count); + ndr->depth++; + for (cntr_s_1=0;cntr_s_1<r->count;cntr_s_1++) { + char *idx_1=NULL; + if (asprintf(&idx_1, "[%d]", cntr_s_1) != -1) { + ndr_print_dfs_Info6(ndr, "s", &r->s[cntr_s_1]); + free(idx_1); + } + } + ndr->depth--; + } + ndr->depth--; + ndr->depth--; +} + static enum ndr_err_code ndr_push_dfs_EnumArray200(struct ndr_push *ndr, int ndr_flags, const struct dfs_EnumArray200 *r) { uint32_t cntr_s_1; @@ -2619,8 +2784,7 @@ _PUBLIC_ void ndr_print_dfs_EnumArray200(struct ndr_print *ndr, const char *name ndr->depth++; for (cntr_s_1=0;cntr_s_1<r->count;cntr_s_1++) { char *idx_1=NULL; - asprintf(&idx_1, "[%d]", cntr_s_1); - if (idx_1) { + if (asprintf(&idx_1, "[%d]", cntr_s_1) != -1) { ndr_print_dfs_Info200(ndr, "s", &r->s[cntr_s_1]); free(idx_1); } @@ -2706,8 +2870,7 @@ _PUBLIC_ void ndr_print_dfs_EnumArray300(struct ndr_print *ndr, const char *name ndr->depth++; for (cntr_s_1=0;cntr_s_1<r->count;cntr_s_1++) { char *idx_1=NULL; - asprintf(&idx_1, "[%d]", cntr_s_1); - if (idx_1) { + if (asprintf(&idx_1, "[%d]", cntr_s_1) != -1) { ndr_print_dfs_Info300(ndr, "s", &r->s[cntr_s_1]); free(idx_1); } @@ -2724,29 +2887,37 @@ static enum ndr_err_code ndr_push_dfs_EnumInfo(struct ndr_push *ndr, int ndr_fla int level = ndr_push_get_switch_value(ndr, r); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, level)); switch (level) { - case 1: + case 1: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1)); - break; + break; } - case 2: + case 2: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->info2)); - break; + break; } - case 3: + case 3: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->info3)); - break; + break; } - case 4: + case 4: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->info4)); - break; + break; } - case 200: + case 5: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->info5)); + break; } + + case 6: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->info6)); + break; } + + case 200: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->info200)); - break; + break; } - case 300: + case 300: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->info300)); - break; + break; } default: return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); @@ -2779,6 +2950,18 @@ static enum ndr_err_code ndr_push_dfs_EnumInfo(struct ndr_push *ndr, int ndr_fla } break; + case 5: + if (r->info5) { + NDR_CHECK(ndr_push_dfs_EnumArray5(ndr, NDR_SCALARS|NDR_BUFFERS, r->info5)); + } + break; + + case 6: + if (r->info6) { + NDR_CHECK(ndr_push_dfs_EnumArray6(ndr, NDR_SCALARS|NDR_BUFFERS, r->info6)); + } + break; + case 200: if (r->info200) { NDR_CHECK(ndr_push_dfs_EnumArray200(ndr, NDR_SCALARS|NDR_BUFFERS, r->info200)); @@ -2806,6 +2989,8 @@ static enum ndr_err_code ndr_pull_dfs_EnumInfo(struct ndr_pull *ndr, int ndr_fla TALLOC_CTX *_mem_save_info2_0; TALLOC_CTX *_mem_save_info3_0; TALLOC_CTX *_mem_save_info4_0; + TALLOC_CTX *_mem_save_info5_0; + TALLOC_CTX *_mem_save_info6_0; TALLOC_CTX *_mem_save_info200_0; TALLOC_CTX *_mem_save_info300_0; level = ndr_pull_get_switch_value(ndr, r); @@ -2855,6 +3040,26 @@ static enum ndr_err_code ndr_pull_dfs_EnumInfo(struct ndr_pull *ndr, int ndr_fla } break; } + case 5: { + uint32_t _ptr_info5; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info5)); + if (_ptr_info5) { + NDR_PULL_ALLOC(ndr, r->info5); + } else { + r->info5 = NULL; + } + break; } + + case 6: { + uint32_t _ptr_info6; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info6)); + if (_ptr_info6) { + NDR_PULL_ALLOC(ndr, r->info6); + } else { + r->info6 = NULL; + } + break; } + case 200: { uint32_t _ptr_info200; NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info200)); @@ -2917,6 +3122,24 @@ static enum ndr_err_code ndr_pull_dfs_EnumInfo(struct ndr_pull *ndr, int ndr_fla } break; + case 5: + if (r->info5) { + _mem_save_info5_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->info5, 0); + NDR_CHECK(ndr_pull_dfs_EnumArray5(ndr, NDR_SCALARS|NDR_BUFFERS, r->info5)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info5_0, 0); + } + break; + + case 6: + if (r->info6) { + _mem_save_info6_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->info6, 0); + NDR_CHECK(ndr_pull_dfs_EnumArray6(ndr, NDR_SCALARS|NDR_BUFFERS, r->info6)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info6_0, 0); + } + break; + case 200: if (r->info200) { _mem_save_info200_0 = NDR_PULL_GET_MEM_CTX(ndr); @@ -2984,6 +3207,24 @@ _PUBLIC_ void ndr_print_dfs_EnumInfo(struct ndr_print *ndr, const char *name, co ndr->depth--; break; + case 5: + ndr_print_ptr(ndr, "info5", r->info5); + ndr->depth++; + if (r->info5) { + ndr_print_dfs_EnumArray5(ndr, "info5", r->info5); + } + ndr->depth--; + break; + + case 6: + ndr_print_ptr(ndr, "info6", r->info6); + ndr->depth++; + if (r->info6) { + ndr_print_dfs_EnumArray6(ndr, "info6", r->info6); + } + ndr->depth--; + break; + case 200: ndr_print_ptr(ndr, "info200", r->info200); ndr->depth++; @@ -4715,8 +4956,48 @@ _PUBLIC_ void ndr_print_dfs_AddStdRootForced(struct ndr_print *ndr, const char * static enum ndr_err_code ndr_push_dfs_GetDcAddress(struct ndr_push *ndr, int flags, const struct dfs_GetDcAddress *r) { if (flags & NDR_IN) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.servername, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.servername, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.servername, ndr_charset_length(r->in.servername, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + if (r->in.server_fullname == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, *r->in.server_fullname)); + if (*r->in.server_fullname) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(*r->in.server_fullname, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(*r->in.server_fullname, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, *r->in.server_fullname, ndr_charset_length(*r->in.server_fullname, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + if (r->in.is_root == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, *r->in.is_root)); + if (r->in.ttl == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.ttl)); } if (flags & NDR_OUT) { + if (r->out.server_fullname == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.server_fullname)); + if (*r->out.server_fullname) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(*r->out.server_fullname, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(*r->out.server_fullname, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, *r->out.server_fullname, ndr_charset_length(*r->out.server_fullname, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + if (r->out.is_root == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, *r->out.is_root)); + if (r->out.ttl == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.ttl)); NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); } return NDR_ERR_SUCCESS; @@ -4724,9 +5005,105 @@ static enum ndr_err_code ndr_push_dfs_GetDcAddress(struct ndr_push *ndr, int fla static enum ndr_err_code ndr_pull_dfs_GetDcAddress(struct ndr_pull *ndr, int flags, struct dfs_GetDcAddress *r) { + uint32_t _ptr_server_fullname; + TALLOC_CTX *_mem_save_server_fullname_0; + TALLOC_CTX *_mem_save_server_fullname_1; + TALLOC_CTX *_mem_save_is_root_0; + TALLOC_CTX *_mem_save_ttl_0; if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.servername)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.servername)); + if (ndr_get_array_length(ndr, &r->in.servername) > ndr_get_array_size(ndr, &r->in.servername)) { + 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.servername), ndr_get_array_length(ndr, &r->in.servername)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.servername), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.servername, ndr_get_array_length(ndr, &r->in.servername), sizeof(uint16_t), CH_UTF16)); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.server_fullname); + } + _mem_save_server_fullname_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.server_fullname, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_fullname)); + if (_ptr_server_fullname) { + NDR_PULL_ALLOC(ndr, *r->in.server_fullname); + } else { + *r->in.server_fullname = NULL; + } + if (*r->in.server_fullname) { + _mem_save_server_fullname_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, *r->in.server_fullname, 0); + NDR_CHECK(ndr_pull_array_size(ndr, r->in.server_fullname)); + NDR_CHECK(ndr_pull_array_length(ndr, r->in.server_fullname)); + if (ndr_get_array_length(ndr, r->in.server_fullname) > ndr_get_array_size(ndr, r->in.server_fullname)) { + 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.server_fullname), ndr_get_array_length(ndr, r->in.server_fullname)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, r->in.server_fullname), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, r->in.server_fullname, ndr_get_array_length(ndr, r->in.server_fullname), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_fullname_1, 0); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_fullname_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.is_root); + } + _mem_save_is_root_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.is_root, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, r->in.is_root)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_is_root_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.ttl); + } + _mem_save_ttl_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.ttl, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->in.ttl)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ttl_0, LIBNDR_FLAG_REF_ALLOC); + NDR_PULL_ALLOC(ndr, r->out.server_fullname); + *r->out.server_fullname = *r->in.server_fullname; + NDR_PULL_ALLOC(ndr, r->out.is_root); + *r->out.is_root = *r->in.is_root; + NDR_PULL_ALLOC(ndr, r->out.ttl); + *r->out.ttl = *r->in.ttl; } if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.server_fullname); + } + _mem_save_server_fullname_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.server_fullname, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_fullname)); + if (_ptr_server_fullname) { + NDR_PULL_ALLOC(ndr, *r->out.server_fullname); + } else { + *r->out.server_fullname = NULL; + } + if (*r->out.server_fullname) { + _mem_save_server_fullname_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, *r->out.server_fullname, 0); + NDR_CHECK(ndr_pull_array_size(ndr, r->out.server_fullname)); + NDR_CHECK(ndr_pull_array_length(ndr, r->out.server_fullname)); + if (ndr_get_array_length(ndr, r->out.server_fullname) > ndr_get_array_size(ndr, r->out.server_fullname)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, r->out.server_fullname), ndr_get_array_length(ndr, r->out.server_fullname)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, r->out.server_fullname), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, r->out.server_fullname, ndr_get_array_length(ndr, r->out.server_fullname), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_fullname_1, 0); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_fullname_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.is_root); + } + _mem_save_is_root_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.is_root, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, r->out.is_root)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_is_root_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.ttl); + } + _mem_save_ttl_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.ttl, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.ttl)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ttl_0, LIBNDR_FLAG_REF_ALLOC); NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); } return NDR_ERR_SUCCESS; @@ -4742,11 +5119,46 @@ _PUBLIC_ void ndr_print_dfs_GetDcAddress(struct ndr_print *ndr, const char *name if (flags & NDR_IN) { ndr_print_struct(ndr, "in", "dfs_GetDcAddress"); ndr->depth++; + ndr_print_string(ndr, "servername", r->in.servername); + ndr_print_ptr(ndr, "server_fullname", r->in.server_fullname); + ndr->depth++; + ndr_print_ptr(ndr, "server_fullname", *r->in.server_fullname); + ndr->depth++; + if (*r->in.server_fullname) { + ndr_print_string(ndr, "server_fullname", *r->in.server_fullname); + } + ndr->depth--; + ndr->depth--; + ndr_print_ptr(ndr, "is_root", r->in.is_root); + ndr->depth++; + ndr_print_uint8(ndr, "is_root", *r->in.is_root); + ndr->depth--; + ndr_print_ptr(ndr, "ttl", r->in.ttl); + ndr->depth++; + ndr_print_uint32(ndr, "ttl", *r->in.ttl); + ndr->depth--; ndr->depth--; } if (flags & NDR_OUT) { ndr_print_struct(ndr, "out", "dfs_GetDcAddress"); ndr->depth++; + ndr_print_ptr(ndr, "server_fullname", r->out.server_fullname); + ndr->depth++; + ndr_print_ptr(ndr, "server_fullname", *r->out.server_fullname); + ndr->depth++; + if (*r->out.server_fullname) { + ndr_print_string(ndr, "server_fullname", *r->out.server_fullname); + } + ndr->depth--; + ndr->depth--; + ndr_print_ptr(ndr, "is_root", r->out.is_root); + ndr->depth++; + ndr_print_uint8(ndr, "is_root", *r->out.is_root); + ndr->depth--; + ndr_print_ptr(ndr, "ttl", r->out.ttl); + ndr->depth++; + ndr_print_uint32(ndr, "ttl", *r->out.ttl); + ndr->depth--; ndr_print_WERROR(ndr, "result", r->out.result); ndr->depth--; } @@ -4756,6 +5168,16 @@ _PUBLIC_ void ndr_print_dfs_GetDcAddress(struct ndr_print *ndr, const char *name static enum ndr_err_code ndr_push_dfs_SetDcAddress(struct ndr_push *ndr, int flags, const struct dfs_SetDcAddress *r) { if (flags & NDR_IN) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.servername, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.servername, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.servername, ndr_charset_length(r->in.servername, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_fullname, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_fullname, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.server_fullname, ndr_charset_length(r->in.server_fullname, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.flags)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.ttl)); } if (flags & NDR_OUT) { NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); @@ -4766,6 +5188,22 @@ static enum ndr_err_code ndr_push_dfs_SetDcAddress(struct ndr_push *ndr, int fla static enum ndr_err_code ndr_pull_dfs_SetDcAddress(struct ndr_pull *ndr, int flags, struct dfs_SetDcAddress *r) { if (flags & NDR_IN) { + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.servername)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.servername)); + if (ndr_get_array_length(ndr, &r->in.servername) > ndr_get_array_size(ndr, &r->in.servername)) { + 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.servername), ndr_get_array_length(ndr, &r->in.servername)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.servername), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.servername, ndr_get_array_length(ndr, &r->in.servername), sizeof(uint16_t), CH_UTF16)); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_fullname)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_fullname)); + if (ndr_get_array_length(ndr, &r->in.server_fullname) > ndr_get_array_size(ndr, &r->in.server_fullname)) { + 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.server_fullname), ndr_get_array_length(ndr, &r->in.server_fullname)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_fullname), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_fullname, ndr_get_array_length(ndr, &r->in.server_fullname), sizeof(uint16_t), CH_UTF16)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.flags)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.ttl)); } if (flags & NDR_OUT) { NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); @@ -4783,6 +5221,10 @@ _PUBLIC_ void ndr_print_dfs_SetDcAddress(struct ndr_print *ndr, const char *name if (flags & NDR_IN) { ndr_print_struct(ndr, "in", "dfs_SetDcAddress"); ndr->depth++; + ndr_print_string(ndr, "servername", r->in.servername); + ndr_print_string(ndr, "server_fullname", r->in.server_fullname); + ndr_print_uint32(ndr, "flags", r->in.flags); + ndr_print_uint32(ndr, "ttl", r->in.ttl); ndr->depth--; } if (flags & NDR_OUT) { @@ -5325,10 +5767,12 @@ static const struct ndr_interface_call netdfs_calls[] = { static const char * const netdfs_endpoint_strings[] = { "ncacn_np:[\\pipe\\netdfs]", + "ncacn_ip_tcp:", + "ncalrpc:", }; static const struct ndr_interface_string_array netdfs_endpoints = { - .count = 1, + .count = 3, .names = netdfs_endpoint_strings }; @@ -5337,7 +5781,7 @@ static const char * const netdfs_authservice_strings[] = { }; static const struct ndr_interface_string_array netdfs_authservices = { - .count = 1, + .count = 3, .names = netdfs_authservice_strings }; diff --git a/source3/librpc/gen_ndr/ndr_dfs.h b/source3/librpc/gen_ndr/ndr_dfs.h index e4b00f322a..a7c66f9693 100644 --- a/source3/librpc/gen_ndr/ndr_dfs.h +++ b/source3/librpc/gen_ndr/ndr_dfs.h @@ -95,6 +95,8 @@ void ndr_print_dfs_EnumArray1(struct ndr_print *ndr, const char *name, const str void ndr_print_dfs_EnumArray2(struct ndr_print *ndr, const char *name, const struct dfs_EnumArray2 *r); void ndr_print_dfs_EnumArray3(struct ndr_print *ndr, const char *name, const struct dfs_EnumArray3 *r); void ndr_print_dfs_EnumArray4(struct ndr_print *ndr, const char *name, const struct dfs_EnumArray4 *r); +void ndr_print_dfs_EnumArray5(struct ndr_print *ndr, const char *name, const struct dfs_EnumArray5 *r); +void ndr_print_dfs_EnumArray6(struct ndr_print *ndr, const char *name, const struct dfs_EnumArray6 *r); void ndr_print_dfs_EnumArray200(struct ndr_print *ndr, const char *name, const struct dfs_EnumArray200 *r); void ndr_print_dfs_EnumArray300(struct ndr_print *ndr, const char *name, const struct dfs_EnumArray300 *r); void ndr_print_dfs_EnumInfo(struct ndr_print *ndr, const char *name, const union dfs_EnumInfo *r); diff --git a/source3/librpc/gen_ndr/ndr_dssetup.c b/source3/librpc/gen_ndr/ndr_dssetup.c new file mode 100644 index 0000000000..bdad3c44f6 --- /dev/null +++ b/source3/librpc/gen_ndr/ndr_dssetup.c @@ -0,0 +1,1082 @@ +/* parser auto-generated by pidl */ + +#include "includes.h" +#include "librpc/gen_ndr/ndr_dssetup.h" + +#include "librpc/gen_ndr/ndr_misc.h" +static enum ndr_err_code ndr_push_dssetup_DsRole(struct ndr_push *ndr, int ndr_flags, enum dssetup_DsRole r) +{ + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r)); + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_dssetup_DsRole(struct ndr_pull *ndr, int ndr_flags, enum dssetup_DsRole *r) +{ + uint16_t v; + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &v)); + *r = v; + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_dssetup_DsRole(struct ndr_print *ndr, const char *name, enum dssetup_DsRole r) +{ + const char *val = NULL; + + switch (r) { + case DS_ROLE_STANDALONE_WORKSTATION: val = "DS_ROLE_STANDALONE_WORKSTATION"; break; + case DS_ROLE_MEMBER_WORKSTATION: val = "DS_ROLE_MEMBER_WORKSTATION"; break; + case DS_ROLE_STANDALONE_SERVER: val = "DS_ROLE_STANDALONE_SERVER"; break; + case DS_ROLE_MEMBER_SERVER: val = "DS_ROLE_MEMBER_SERVER"; break; + case DS_ROLE_BACKUP_DC: val = "DS_ROLE_BACKUP_DC"; break; + case DS_ROLE_PRIMARY_DC: val = "DS_ROLE_PRIMARY_DC"; break; + } + ndr_print_enum(ndr, name, "ENUM", val, r); +} + +static enum ndr_err_code ndr_push_dssetup_DsRoleFlags(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_dssetup_DsRoleFlags(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_dssetup_DsRoleFlags(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), "DS_ROLE_PRIMARY_DS_RUNNING", DS_ROLE_PRIMARY_DS_RUNNING, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_ROLE_PRIMARY_DS_MIXED_MODE", DS_ROLE_PRIMARY_DS_MIXED_MODE, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_ROLE_UPGRADE_IN_PROGRESS", DS_ROLE_UPGRADE_IN_PROGRESS, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_ROLE_PRIMARY_DOMAIN_GUID_PRESENT", DS_ROLE_PRIMARY_DOMAIN_GUID_PRESENT, r); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_dssetup_DsRolePrimaryDomInfoBasic(struct ndr_push *ndr, int ndr_flags, const struct dssetup_DsRolePrimaryDomInfoBasic *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_dssetup_DsRole(ndr, NDR_SCALARS, r->role)); + NDR_CHECK(ndr_push_dssetup_DsRoleFlags(ndr, NDR_SCALARS, r->flags)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->domain)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->dns_domain)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->forest)); + NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->domain_guid)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->domain) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->domain, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->domain, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->domain, ndr_charset_length(r->domain, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + if (r->dns_domain) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->dns_domain, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->dns_domain, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->dns_domain, ndr_charset_length(r->dns_domain, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + if (r->forest) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->forest, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->forest, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->forest, ndr_charset_length(r->forest, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_dssetup_DsRolePrimaryDomInfoBasic(struct ndr_pull *ndr, int ndr_flags, struct dssetup_DsRolePrimaryDomInfoBasic *r) +{ + uint32_t _ptr_domain; + TALLOC_CTX *_mem_save_domain_0; + uint32_t _ptr_dns_domain; + TALLOC_CTX *_mem_save_dns_domain_0; + uint32_t _ptr_forest; + TALLOC_CTX *_mem_save_forest_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_dssetup_DsRole(ndr, NDR_SCALARS, &r->role)); + NDR_CHECK(ndr_pull_dssetup_DsRoleFlags(ndr, NDR_SCALARS, &r->flags)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_domain)); + if (_ptr_domain) { + NDR_PULL_ALLOC(ndr, r->domain); + } else { + r->domain = NULL; + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_dns_domain)); + if (_ptr_dns_domain) { + NDR_PULL_ALLOC(ndr, r->dns_domain); + } else { + r->dns_domain = NULL; + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_forest)); + if (_ptr_forest) { + NDR_PULL_ALLOC(ndr, r->forest); + } else { + r->forest = NULL; + } + NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->domain_guid)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->domain) { + _mem_save_domain_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->domain, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->domain)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->domain)); + if (ndr_get_array_length(ndr, &r->domain) > ndr_get_array_size(ndr, &r->domain)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->domain), ndr_get_array_length(ndr, &r->domain)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->domain), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->domain, ndr_get_array_length(ndr, &r->domain), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_0, 0); + } + if (r->dns_domain) { + _mem_save_dns_domain_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->dns_domain, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->dns_domain)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->dns_domain)); + if (ndr_get_array_length(ndr, &r->dns_domain) > ndr_get_array_size(ndr, &r->dns_domain)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->dns_domain), ndr_get_array_length(ndr, &r->dns_domain)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->dns_domain), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->dns_domain, ndr_get_array_length(ndr, &r->dns_domain), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_dns_domain_0, 0); + } + if (r->forest) { + _mem_save_forest_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->forest, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->forest)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->forest)); + if (ndr_get_array_length(ndr, &r->forest) > ndr_get_array_size(ndr, &r->forest)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->forest), ndr_get_array_length(ndr, &r->forest)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->forest), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->forest, ndr_get_array_length(ndr, &r->forest), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_forest_0, 0); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_dssetup_DsRolePrimaryDomInfoBasic(struct ndr_print *ndr, const char *name, const struct dssetup_DsRolePrimaryDomInfoBasic *r) +{ + ndr_print_struct(ndr, name, "dssetup_DsRolePrimaryDomInfoBasic"); + ndr->depth++; + ndr_print_dssetup_DsRole(ndr, "role", r->role); + ndr_print_dssetup_DsRoleFlags(ndr, "flags", r->flags); + ndr_print_ptr(ndr, "domain", r->domain); + ndr->depth++; + if (r->domain) { + ndr_print_string(ndr, "domain", r->domain); + } + ndr->depth--; + ndr_print_ptr(ndr, "dns_domain", r->dns_domain); + ndr->depth++; + if (r->dns_domain) { + ndr_print_string(ndr, "dns_domain", r->dns_domain); + } + ndr->depth--; + ndr_print_ptr(ndr, "forest", r->forest); + ndr->depth++; + if (r->forest) { + ndr_print_string(ndr, "forest", r->forest); + } + ndr->depth--; + ndr_print_GUID(ndr, "domain_guid", &r->domain_guid); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_dssetup_DsUpgrade(struct ndr_push *ndr, int ndr_flags, enum dssetup_DsUpgrade r) +{ + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_dssetup_DsUpgrade(struct ndr_pull *ndr, int ndr_flags, enum dssetup_DsUpgrade *r) +{ + uint32_t v; + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); + *r = v; + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_dssetup_DsUpgrade(struct ndr_print *ndr, const char *name, enum dssetup_DsUpgrade r) +{ + const char *val = NULL; + + switch (r) { + case DS_ROLE_NOT_UPGRADING: val = "DS_ROLE_NOT_UPGRADING"; break; + case DS_ROLE_UPGRADING: val = "DS_ROLE_UPGRADING"; break; + } + ndr_print_enum(ndr, name, "ENUM", val, r); +} + +static enum ndr_err_code ndr_push_dssetup_DsPrevious(struct ndr_push *ndr, int ndr_flags, enum dssetup_DsPrevious r) +{ + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r)); + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_dssetup_DsPrevious(struct ndr_pull *ndr, int ndr_flags, enum dssetup_DsPrevious *r) +{ + uint16_t v; + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &v)); + *r = v; + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_dssetup_DsPrevious(struct ndr_print *ndr, const char *name, enum dssetup_DsPrevious r) +{ + const char *val = NULL; + + switch (r) { + case DS_ROLE_PREVIOUS_UNKNOWN: val = "DS_ROLE_PREVIOUS_UNKNOWN"; break; + case DS_ROLE_PREVIOUS_PRIMARY: val = "DS_ROLE_PREVIOUS_PRIMARY"; break; + case DS_ROLE_PREVIOUS_BACKUP: val = "DS_ROLE_PREVIOUS_BACKUP"; break; + } + ndr_print_enum(ndr, name, "ENUM", val, r); +} + +static enum ndr_err_code ndr_push_dssetup_DsRoleUpgradeStatus(struct ndr_push *ndr, int ndr_flags, const struct dssetup_DsRoleUpgradeStatus *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_dssetup_DsUpgrade(ndr, NDR_SCALARS, r->upgrading)); + NDR_CHECK(ndr_push_dssetup_DsPrevious(ndr, NDR_SCALARS, r->previous_role)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_dssetup_DsRoleUpgradeStatus(struct ndr_pull *ndr, int ndr_flags, struct dssetup_DsRoleUpgradeStatus *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_dssetup_DsUpgrade(ndr, NDR_SCALARS, &r->upgrading)); + NDR_CHECK(ndr_pull_dssetup_DsPrevious(ndr, NDR_SCALARS, &r->previous_role)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_dssetup_DsRoleUpgradeStatus(struct ndr_print *ndr, const char *name, const struct dssetup_DsRoleUpgradeStatus *r) +{ + ndr_print_struct(ndr, name, "dssetup_DsRoleUpgradeStatus"); + ndr->depth++; + ndr_print_dssetup_DsUpgrade(ndr, "upgrading", r->upgrading); + ndr_print_dssetup_DsPrevious(ndr, "previous_role", r->previous_role); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_dssetup_DsRoleOp(struct ndr_push *ndr, int ndr_flags, enum dssetup_DsRoleOp r) +{ + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r)); + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_dssetup_DsRoleOp(struct ndr_pull *ndr, int ndr_flags, enum dssetup_DsRoleOp *r) +{ + uint16_t v; + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &v)); + *r = v; + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_dssetup_DsRoleOp(struct ndr_print *ndr, const char *name, enum dssetup_DsRoleOp r) +{ + const char *val = NULL; + + switch (r) { + case DS_ROLE_OP_IDLE: val = "DS_ROLE_OP_IDLE"; break; + case DS_ROLE_OP_ACTIVE: val = "DS_ROLE_OP_ACTIVE"; break; + case DS_ROLE_OP_NEEDS_REBOOT: val = "DS_ROLE_OP_NEEDS_REBOOT"; break; + } + ndr_print_enum(ndr, name, "ENUM", val, r); +} + +static enum ndr_err_code ndr_push_dssetup_DsRoleOpStatus(struct ndr_push *ndr, int ndr_flags, const struct dssetup_DsRoleOpStatus *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 2)); + NDR_CHECK(ndr_push_dssetup_DsRoleOp(ndr, NDR_SCALARS, r->status)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_dssetup_DsRoleOpStatus(struct ndr_pull *ndr, int ndr_flags, struct dssetup_DsRoleOpStatus *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 2)); + NDR_CHECK(ndr_pull_dssetup_DsRoleOp(ndr, NDR_SCALARS, &r->status)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_dssetup_DsRoleOpStatus(struct ndr_print *ndr, const char *name, const struct dssetup_DsRoleOpStatus *r) +{ + ndr_print_struct(ndr, name, "dssetup_DsRoleOpStatus"); + ndr->depth++; + ndr_print_dssetup_DsRoleOp(ndr, "status", r->status); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_dssetup_DsRoleInfoLevel(struct ndr_push *ndr, int ndr_flags, enum dssetup_DsRoleInfoLevel r) +{ + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r)); + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_dssetup_DsRoleInfoLevel(struct ndr_pull *ndr, int ndr_flags, enum dssetup_DsRoleInfoLevel *r) +{ + uint16_t v; + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &v)); + *r = v; + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_dssetup_DsRoleInfoLevel(struct ndr_print *ndr, const char *name, enum dssetup_DsRoleInfoLevel r) +{ + const char *val = NULL; + + switch (r) { + case DS_ROLE_BASIC_INFORMATION: val = "DS_ROLE_BASIC_INFORMATION"; break; + case DS_ROLE_UPGRADE_STATUS: val = "DS_ROLE_UPGRADE_STATUS"; break; + case DS_ROLE_OP_STATUS: val = "DS_ROLE_OP_STATUS"; break; + } + ndr_print_enum(ndr, name, "ENUM", val, r); +} + +static enum ndr_err_code ndr_push_dssetup_DsRoleInfo(struct ndr_push *ndr, int ndr_flags, const union dssetup_DsRoleInfo *r) +{ + if (ndr_flags & NDR_SCALARS) { + int level = ndr_push_get_switch_value(ndr, r); + NDR_CHECK(ndr_push_dssetup_DsRoleInfoLevel(ndr, NDR_SCALARS, level)); + switch (level) { + case DS_ROLE_BASIC_INFORMATION: { + NDR_CHECK(ndr_push_dssetup_DsRolePrimaryDomInfoBasic(ndr, NDR_SCALARS, &r->basic)); + break; } + + case DS_ROLE_UPGRADE_STATUS: { + NDR_CHECK(ndr_push_dssetup_DsRoleUpgradeStatus(ndr, NDR_SCALARS, &r->upgrade)); + break; } + + case DS_ROLE_OP_STATUS: { + NDR_CHECK(ndr_push_dssetup_DsRoleOpStatus(ndr, NDR_SCALARS, &r->opstatus)); + 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 DS_ROLE_BASIC_INFORMATION: + NDR_CHECK(ndr_push_dssetup_DsRolePrimaryDomInfoBasic(ndr, NDR_BUFFERS, &r->basic)); + break; + + case DS_ROLE_UPGRADE_STATUS: + break; + + case DS_ROLE_OP_STATUS: + 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_dssetup_DsRoleInfo(struct ndr_pull *ndr, int ndr_flags, union dssetup_DsRoleInfo *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 DS_ROLE_BASIC_INFORMATION: { + NDR_CHECK(ndr_pull_dssetup_DsRolePrimaryDomInfoBasic(ndr, NDR_SCALARS, &r->basic)); + break; } + + case DS_ROLE_UPGRADE_STATUS: { + NDR_CHECK(ndr_pull_dssetup_DsRoleUpgradeStatus(ndr, NDR_SCALARS, &r->upgrade)); + break; } + + case DS_ROLE_OP_STATUS: { + NDR_CHECK(ndr_pull_dssetup_DsRoleOpStatus(ndr, NDR_SCALARS, &r->opstatus)); + break; } + + default: + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + if (ndr_flags & NDR_BUFFERS) { + switch (level) { + case DS_ROLE_BASIC_INFORMATION: + NDR_CHECK(ndr_pull_dssetup_DsRolePrimaryDomInfoBasic(ndr, NDR_BUFFERS, &r->basic)); + break; + + case DS_ROLE_UPGRADE_STATUS: + break; + + case DS_ROLE_OP_STATUS: + break; + + default: + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_dssetup_DsRoleInfo(struct ndr_print *ndr, const char *name, const union dssetup_DsRoleInfo *r) +{ + int level; + level = ndr_print_get_switch_value(ndr, r); + ndr_print_union(ndr, name, level, "dssetup_DsRoleInfo"); + switch (level) { + case DS_ROLE_BASIC_INFORMATION: + ndr_print_dssetup_DsRolePrimaryDomInfoBasic(ndr, "basic", &r->basic); + break; + + case DS_ROLE_UPGRADE_STATUS: + ndr_print_dssetup_DsRoleUpgradeStatus(ndr, "upgrade", &r->upgrade); + break; + + case DS_ROLE_OP_STATUS: + ndr_print_dssetup_DsRoleOpStatus(ndr, "opstatus", &r->opstatus); + break; + + default: + ndr_print_bad_level(ndr, name, level); + } +} + +static enum ndr_err_code ndr_push_dssetup_DsRoleGetPrimaryDomainInformation(struct ndr_push *ndr, int flags, const struct dssetup_DsRoleGetPrimaryDomainInformation *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_dssetup_DsRoleInfoLevel(ndr, NDR_SCALARS, r->in.level)); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.info)); + if (r->out.info) { + NDR_CHECK(ndr_push_set_switch_value(ndr, r->out.info, r->in.level)); + NDR_CHECK(ndr_push_dssetup_DsRoleInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.info)); + } + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_dssetup_DsRoleGetPrimaryDomainInformation(struct ndr_pull *ndr, int flags, struct dssetup_DsRoleGetPrimaryDomainInformation *r) +{ + uint32_t _ptr_info; + TALLOC_CTX *_mem_save_info_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + NDR_CHECK(ndr_pull_dssetup_DsRoleInfoLevel(ndr, NDR_SCALARS, &r->in.level)); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info)); + if (_ptr_info) { + NDR_PULL_ALLOC(ndr, r->out.info); + } else { + r->out.info = NULL; + } + if (r->out.info) { + _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.info, 0); + NDR_CHECK(ndr_pull_set_switch_value(ndr, r->out.info, r->in.level)); + NDR_CHECK(ndr_pull_dssetup_DsRoleInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.info)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, 0); + } + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_dssetup_DsRoleGetPrimaryDomainInformation(struct ndr_print *ndr, const char *name, int flags, const struct dssetup_DsRoleGetPrimaryDomainInformation *r) +{ + ndr_print_struct(ndr, name, "dssetup_DsRoleGetPrimaryDomainInformation"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "dssetup_DsRoleGetPrimaryDomainInformation"); + ndr->depth++; + ndr_print_dssetup_DsRoleInfoLevel(ndr, "level", r->in.level); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "dssetup_DsRoleGetPrimaryDomainInformation"); + ndr->depth++; + ndr_print_ptr(ndr, "info", r->out.info); + ndr->depth++; + if (r->out.info) { + ndr_print_set_switch_value(ndr, r->out.info, r->in.level); + ndr_print_dssetup_DsRoleInfo(ndr, "info", r->out.info); + } + ndr->depth--; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_dssetup_DsRoleDnsNameToFlatName(struct ndr_push *ndr, int flags, const struct dssetup_DsRoleDnsNameToFlatName *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_dssetup_DsRoleDnsNameToFlatName(struct ndr_pull *ndr, int flags, struct dssetup_DsRoleDnsNameToFlatName *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_dssetup_DsRoleDnsNameToFlatName(struct ndr_print *ndr, const char *name, int flags, const struct dssetup_DsRoleDnsNameToFlatName *r) +{ + ndr_print_struct(ndr, name, "dssetup_DsRoleDnsNameToFlatName"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "dssetup_DsRoleDnsNameToFlatName"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "dssetup_DsRoleDnsNameToFlatName"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_dssetup_DsRoleDcAsDc(struct ndr_push *ndr, int flags, const struct dssetup_DsRoleDcAsDc *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_dssetup_DsRoleDcAsDc(struct ndr_pull *ndr, int flags, struct dssetup_DsRoleDcAsDc *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_dssetup_DsRoleDcAsDc(struct ndr_print *ndr, const char *name, int flags, const struct dssetup_DsRoleDcAsDc *r) +{ + ndr_print_struct(ndr, name, "dssetup_DsRoleDcAsDc"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "dssetup_DsRoleDcAsDc"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "dssetup_DsRoleDcAsDc"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_dssetup_DsRoleDcAsReplica(struct ndr_push *ndr, int flags, const struct dssetup_DsRoleDcAsReplica *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_dssetup_DsRoleDcAsReplica(struct ndr_pull *ndr, int flags, struct dssetup_DsRoleDcAsReplica *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_dssetup_DsRoleDcAsReplica(struct ndr_print *ndr, const char *name, int flags, const struct dssetup_DsRoleDcAsReplica *r) +{ + ndr_print_struct(ndr, name, "dssetup_DsRoleDcAsReplica"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "dssetup_DsRoleDcAsReplica"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "dssetup_DsRoleDcAsReplica"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_dssetup_DsRoleDemoteDc(struct ndr_push *ndr, int flags, const struct dssetup_DsRoleDemoteDc *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_dssetup_DsRoleDemoteDc(struct ndr_pull *ndr, int flags, struct dssetup_DsRoleDemoteDc *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_dssetup_DsRoleDemoteDc(struct ndr_print *ndr, const char *name, int flags, const struct dssetup_DsRoleDemoteDc *r) +{ + ndr_print_struct(ndr, name, "dssetup_DsRoleDemoteDc"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "dssetup_DsRoleDemoteDc"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "dssetup_DsRoleDemoteDc"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_dssetup_DsRoleGetDcOperationProgress(struct ndr_push *ndr, int flags, const struct dssetup_DsRoleGetDcOperationProgress *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_dssetup_DsRoleGetDcOperationProgress(struct ndr_pull *ndr, int flags, struct dssetup_DsRoleGetDcOperationProgress *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_dssetup_DsRoleGetDcOperationProgress(struct ndr_print *ndr, const char *name, int flags, const struct dssetup_DsRoleGetDcOperationProgress *r) +{ + ndr_print_struct(ndr, name, "dssetup_DsRoleGetDcOperationProgress"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "dssetup_DsRoleGetDcOperationProgress"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "dssetup_DsRoleGetDcOperationProgress"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_dssetup_DsRoleGetDcOperationResults(struct ndr_push *ndr, int flags, const struct dssetup_DsRoleGetDcOperationResults *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_dssetup_DsRoleGetDcOperationResults(struct ndr_pull *ndr, int flags, struct dssetup_DsRoleGetDcOperationResults *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_dssetup_DsRoleGetDcOperationResults(struct ndr_print *ndr, const char *name, int flags, const struct dssetup_DsRoleGetDcOperationResults *r) +{ + ndr_print_struct(ndr, name, "dssetup_DsRoleGetDcOperationResults"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "dssetup_DsRoleGetDcOperationResults"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "dssetup_DsRoleGetDcOperationResults"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_dssetup_DsRoleCancel(struct ndr_push *ndr, int flags, const struct dssetup_DsRoleCancel *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_dssetup_DsRoleCancel(struct ndr_pull *ndr, int flags, struct dssetup_DsRoleCancel *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_dssetup_DsRoleCancel(struct ndr_print *ndr, const char *name, int flags, const struct dssetup_DsRoleCancel *r) +{ + ndr_print_struct(ndr, name, "dssetup_DsRoleCancel"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "dssetup_DsRoleCancel"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "dssetup_DsRoleCancel"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_dssetup_DsRoleServerSaveStateForUpgrade(struct ndr_push *ndr, int flags, const struct dssetup_DsRoleServerSaveStateForUpgrade *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_dssetup_DsRoleServerSaveStateForUpgrade(struct ndr_pull *ndr, int flags, struct dssetup_DsRoleServerSaveStateForUpgrade *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_dssetup_DsRoleServerSaveStateForUpgrade(struct ndr_print *ndr, const char *name, int flags, const struct dssetup_DsRoleServerSaveStateForUpgrade *r) +{ + ndr_print_struct(ndr, name, "dssetup_DsRoleServerSaveStateForUpgrade"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "dssetup_DsRoleServerSaveStateForUpgrade"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "dssetup_DsRoleServerSaveStateForUpgrade"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_dssetup_DsRoleUpgradeDownlevelServer(struct ndr_push *ndr, int flags, const struct dssetup_DsRoleUpgradeDownlevelServer *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_dssetup_DsRoleUpgradeDownlevelServer(struct ndr_pull *ndr, int flags, struct dssetup_DsRoleUpgradeDownlevelServer *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_dssetup_DsRoleUpgradeDownlevelServer(struct ndr_print *ndr, const char *name, int flags, const struct dssetup_DsRoleUpgradeDownlevelServer *r) +{ + ndr_print_struct(ndr, name, "dssetup_DsRoleUpgradeDownlevelServer"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "dssetup_DsRoleUpgradeDownlevelServer"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "dssetup_DsRoleUpgradeDownlevelServer"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_dssetup_DsRoleAbortDownlevelServerUpgrade(struct ndr_push *ndr, int flags, const struct dssetup_DsRoleAbortDownlevelServerUpgrade *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_dssetup_DsRoleAbortDownlevelServerUpgrade(struct ndr_pull *ndr, int flags, struct dssetup_DsRoleAbortDownlevelServerUpgrade *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_dssetup_DsRoleAbortDownlevelServerUpgrade(struct ndr_print *ndr, const char *name, int flags, const struct dssetup_DsRoleAbortDownlevelServerUpgrade *r) +{ + ndr_print_struct(ndr, name, "dssetup_DsRoleAbortDownlevelServerUpgrade"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "dssetup_DsRoleAbortDownlevelServerUpgrade"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "dssetup_DsRoleAbortDownlevelServerUpgrade"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static const struct ndr_interface_call dssetup_calls[] = { + { + "dssetup_DsRoleGetPrimaryDomainInformation", + sizeof(struct dssetup_DsRoleGetPrimaryDomainInformation), + (ndr_push_flags_fn_t) ndr_push_dssetup_DsRoleGetPrimaryDomainInformation, + (ndr_pull_flags_fn_t) ndr_pull_dssetup_DsRoleGetPrimaryDomainInformation, + (ndr_print_function_t) ndr_print_dssetup_DsRoleGetPrimaryDomainInformation, + false, + }, + { + "dssetup_DsRoleDnsNameToFlatName", + sizeof(struct dssetup_DsRoleDnsNameToFlatName), + (ndr_push_flags_fn_t) ndr_push_dssetup_DsRoleDnsNameToFlatName, + (ndr_pull_flags_fn_t) ndr_pull_dssetup_DsRoleDnsNameToFlatName, + (ndr_print_function_t) ndr_print_dssetup_DsRoleDnsNameToFlatName, + false, + }, + { + "dssetup_DsRoleDcAsDc", + sizeof(struct dssetup_DsRoleDcAsDc), + (ndr_push_flags_fn_t) ndr_push_dssetup_DsRoleDcAsDc, + (ndr_pull_flags_fn_t) ndr_pull_dssetup_DsRoleDcAsDc, + (ndr_print_function_t) ndr_print_dssetup_DsRoleDcAsDc, + false, + }, + { + "dssetup_DsRoleDcAsReplica", + sizeof(struct dssetup_DsRoleDcAsReplica), + (ndr_push_flags_fn_t) ndr_push_dssetup_DsRoleDcAsReplica, + (ndr_pull_flags_fn_t) ndr_pull_dssetup_DsRoleDcAsReplica, + (ndr_print_function_t) ndr_print_dssetup_DsRoleDcAsReplica, + false, + }, + { + "dssetup_DsRoleDemoteDc", + sizeof(struct dssetup_DsRoleDemoteDc), + (ndr_push_flags_fn_t) ndr_push_dssetup_DsRoleDemoteDc, + (ndr_pull_flags_fn_t) ndr_pull_dssetup_DsRoleDemoteDc, + (ndr_print_function_t) ndr_print_dssetup_DsRoleDemoteDc, + false, + }, + { + "dssetup_DsRoleGetDcOperationProgress", + sizeof(struct dssetup_DsRoleGetDcOperationProgress), + (ndr_push_flags_fn_t) ndr_push_dssetup_DsRoleGetDcOperationProgress, + (ndr_pull_flags_fn_t) ndr_pull_dssetup_DsRoleGetDcOperationProgress, + (ndr_print_function_t) ndr_print_dssetup_DsRoleGetDcOperationProgress, + false, + }, + { + "dssetup_DsRoleGetDcOperationResults", + sizeof(struct dssetup_DsRoleGetDcOperationResults), + (ndr_push_flags_fn_t) ndr_push_dssetup_DsRoleGetDcOperationResults, + (ndr_pull_flags_fn_t) ndr_pull_dssetup_DsRoleGetDcOperationResults, + (ndr_print_function_t) ndr_print_dssetup_DsRoleGetDcOperationResults, + false, + }, + { + "dssetup_DsRoleCancel", + sizeof(struct dssetup_DsRoleCancel), + (ndr_push_flags_fn_t) ndr_push_dssetup_DsRoleCancel, + (ndr_pull_flags_fn_t) ndr_pull_dssetup_DsRoleCancel, + (ndr_print_function_t) ndr_print_dssetup_DsRoleCancel, + false, + }, + { + "dssetup_DsRoleServerSaveStateForUpgrade", + sizeof(struct dssetup_DsRoleServerSaveStateForUpgrade), + (ndr_push_flags_fn_t) ndr_push_dssetup_DsRoleServerSaveStateForUpgrade, + (ndr_pull_flags_fn_t) ndr_pull_dssetup_DsRoleServerSaveStateForUpgrade, + (ndr_print_function_t) ndr_print_dssetup_DsRoleServerSaveStateForUpgrade, + false, + }, + { + "dssetup_DsRoleUpgradeDownlevelServer", + sizeof(struct dssetup_DsRoleUpgradeDownlevelServer), + (ndr_push_flags_fn_t) ndr_push_dssetup_DsRoleUpgradeDownlevelServer, + (ndr_pull_flags_fn_t) ndr_pull_dssetup_DsRoleUpgradeDownlevelServer, + (ndr_print_function_t) ndr_print_dssetup_DsRoleUpgradeDownlevelServer, + false, + }, + { + "dssetup_DsRoleAbortDownlevelServerUpgrade", + sizeof(struct dssetup_DsRoleAbortDownlevelServerUpgrade), + (ndr_push_flags_fn_t) ndr_push_dssetup_DsRoleAbortDownlevelServerUpgrade, + (ndr_pull_flags_fn_t) ndr_pull_dssetup_DsRoleAbortDownlevelServerUpgrade, + (ndr_print_function_t) ndr_print_dssetup_DsRoleAbortDownlevelServerUpgrade, + false, + }, + { NULL, 0, NULL, NULL, NULL, false } +}; + +static const char * const dssetup_endpoint_strings[] = { + "ncacn_np:[\\pipe\\lsarpc]", + "ncacn_np:[\\pipe\\lsass]", + "ncacn_ip_tcp:", + "ncalrpc:", +}; + +static const struct ndr_interface_string_array dssetup_endpoints = { + .count = 4, + .names = dssetup_endpoint_strings +}; + +static const char * const dssetup_authservice_strings[] = { + "host", +}; + +static const struct ndr_interface_string_array dssetup_authservices = { + .count = 4, + .names = dssetup_authservice_strings +}; + + +const struct ndr_interface_table ndr_table_dssetup = { + .name = "dssetup", + .syntax_id = { + {0x3919286a,0xb10c,0x11d0,{0x9b,0xa8},{0x00,0xc0,0x4f,0xd9,0x2e,0xf5}}, + NDR_DSSETUP_VERSION + }, + .helpstring = NDR_DSSETUP_HELPSTRING, + .num_calls = 11, + .calls = dssetup_calls, + .endpoints = &dssetup_endpoints, + .authservices = &dssetup_authservices +}; + diff --git a/source3/librpc/gen_ndr/ndr_dssetup.h b/source3/librpc/gen_ndr/ndr_dssetup.h new file mode 100644 index 0000000000..103ad116a3 --- /dev/null +++ b/source3/librpc/gen_ndr/ndr_dssetup.h @@ -0,0 +1,58 @@ +/* header auto-generated by pidl */ + +#include "librpc/ndr/libndr.h" +#include "librpc/gen_ndr/dssetup.h" + +#ifndef _HEADER_NDR_dssetup +#define _HEADER_NDR_dssetup + +#define NDR_DSSETUP_UUID "3919286a-b10c-11d0-9ba8-00c04fd92ef5" +#define NDR_DSSETUP_VERSION 0.0 +#define NDR_DSSETUP_NAME "dssetup" +#define NDR_DSSETUP_HELPSTRING "Active Directory Setup" +extern const struct ndr_interface_table ndr_table_dssetup; +#define NDR_DSSETUP_DSROLEGETPRIMARYDOMAININFORMATION (0x00) + +#define NDR_DSSETUP_DSROLEDNSNAMETOFLATNAME (0x01) + +#define NDR_DSSETUP_DSROLEDCASDC (0x02) + +#define NDR_DSSETUP_DSROLEDCASREPLICA (0x03) + +#define NDR_DSSETUP_DSROLEDEMOTEDC (0x04) + +#define NDR_DSSETUP_DSROLEGETDCOPERATIONPROGRESS (0x05) + +#define NDR_DSSETUP_DSROLEGETDCOPERATIONRESULTS (0x06) + +#define NDR_DSSETUP_DSROLECANCEL (0x07) + +#define NDR_DSSETUP_DSROLESERVERSAVESTATEFORUPGRADE (0x08) + +#define NDR_DSSETUP_DSROLEUPGRADEDOWNLEVELSERVER (0x09) + +#define NDR_DSSETUP_DSROLEABORTDOWNLEVELSERVERUPGRADE (0x0a) + +#define NDR_DSSETUP_CALL_COUNT (11) +void ndr_print_dssetup_DsRole(struct ndr_print *ndr, const char *name, enum dssetup_DsRole r); +void ndr_print_dssetup_DsRoleFlags(struct ndr_print *ndr, const char *name, uint32_t r); +void ndr_print_dssetup_DsRolePrimaryDomInfoBasic(struct ndr_print *ndr, const char *name, const struct dssetup_DsRolePrimaryDomInfoBasic *r); +void ndr_print_dssetup_DsUpgrade(struct ndr_print *ndr, const char *name, enum dssetup_DsUpgrade r); +void ndr_print_dssetup_DsPrevious(struct ndr_print *ndr, const char *name, enum dssetup_DsPrevious r); +void ndr_print_dssetup_DsRoleUpgradeStatus(struct ndr_print *ndr, const char *name, const struct dssetup_DsRoleUpgradeStatus *r); +void ndr_print_dssetup_DsRoleOp(struct ndr_print *ndr, const char *name, enum dssetup_DsRoleOp r); +void ndr_print_dssetup_DsRoleOpStatus(struct ndr_print *ndr, const char *name, const struct dssetup_DsRoleOpStatus *r); +void ndr_print_dssetup_DsRoleInfoLevel(struct ndr_print *ndr, const char *name, enum dssetup_DsRoleInfoLevel r); +void ndr_print_dssetup_DsRoleInfo(struct ndr_print *ndr, const char *name, const union dssetup_DsRoleInfo *r); +void ndr_print_dssetup_DsRoleGetPrimaryDomainInformation(struct ndr_print *ndr, const char *name, int flags, const struct dssetup_DsRoleGetPrimaryDomainInformation *r); +void ndr_print_dssetup_DsRoleDnsNameToFlatName(struct ndr_print *ndr, const char *name, int flags, const struct dssetup_DsRoleDnsNameToFlatName *r); +void ndr_print_dssetup_DsRoleDcAsDc(struct ndr_print *ndr, const char *name, int flags, const struct dssetup_DsRoleDcAsDc *r); +void ndr_print_dssetup_DsRoleDcAsReplica(struct ndr_print *ndr, const char *name, int flags, const struct dssetup_DsRoleDcAsReplica *r); +void ndr_print_dssetup_DsRoleDemoteDc(struct ndr_print *ndr, const char *name, int flags, const struct dssetup_DsRoleDemoteDc *r); +void ndr_print_dssetup_DsRoleGetDcOperationProgress(struct ndr_print *ndr, const char *name, int flags, const struct dssetup_DsRoleGetDcOperationProgress *r); +void ndr_print_dssetup_DsRoleGetDcOperationResults(struct ndr_print *ndr, const char *name, int flags, const struct dssetup_DsRoleGetDcOperationResults *r); +void ndr_print_dssetup_DsRoleCancel(struct ndr_print *ndr, const char *name, int flags, const struct dssetup_DsRoleCancel *r); +void ndr_print_dssetup_DsRoleServerSaveStateForUpgrade(struct ndr_print *ndr, const char *name, int flags, const struct dssetup_DsRoleServerSaveStateForUpgrade *r); +void ndr_print_dssetup_DsRoleUpgradeDownlevelServer(struct ndr_print *ndr, const char *name, int flags, const struct dssetup_DsRoleUpgradeDownlevelServer *r); +void ndr_print_dssetup_DsRoleAbortDownlevelServerUpgrade(struct ndr_print *ndr, const char *name, int flags, const struct dssetup_DsRoleAbortDownlevelServerUpgrade *r); +#endif /* _HEADER_NDR_dssetup */ diff --git a/source3/librpc/gen_ndr/ndr_echo.c b/source3/librpc/gen_ndr/ndr_echo.c index 01b1d10fac..340167cf73 100644 --- a/source3/librpc/gen_ndr/ndr_echo.c +++ b/source3/librpc/gen_ndr/ndr_echo.c @@ -93,7 +93,7 @@ _PUBLIC_ void ndr_print_echo_info3(struct ndr_print *ndr, const char *name, cons ndr->depth--; } -static enum ndr_err_code ndr_push_echo_info4(struct ndr_push *ndr, int ndr_flags, const struct echo_info4 *r) +static enum ndr_err_code ndr_push_STRUCT_echo_info4(struct ndr_push *ndr, int ndr_flags, const struct echo_info4 *r) { if (ndr_flags & NDR_SCALARS) { NDR_CHECK(ndr_push_align(ndr, 8)); @@ -104,7 +104,7 @@ static enum ndr_err_code ndr_push_echo_info4(struct ndr_push *ndr, int ndr_flags return NDR_ERR_SUCCESS; } -static enum ndr_err_code ndr_pull_echo_info4(struct ndr_pull *ndr, int ndr_flags, struct echo_info4 *r) +static enum ndr_err_code ndr_pull_STRUCT_echo_info4(struct ndr_pull *ndr, int ndr_flags, struct echo_info4 *r) { if (ndr_flags & NDR_SCALARS) { NDR_CHECK(ndr_pull_align(ndr, 8)); @@ -115,7 +115,7 @@ static enum ndr_err_code ndr_pull_echo_info4(struct ndr_pull *ndr, int ndr_flags return NDR_ERR_SUCCESS; } -_PUBLIC_ void ndr_print_echo_info4(struct ndr_print *ndr, const char *name, const struct echo_info4 *r) +_PUBLIC_ void ndr_print_STRUCT_echo_info4(struct ndr_print *ndr, const char *name, const struct echo_info4 *r) { ndr_print_struct(ndr, name, "echo_info4"); ndr->depth++; @@ -194,7 +194,7 @@ static enum ndr_err_code ndr_push_echo_info7(struct ndr_push *ndr, int ndr_flags if (ndr_flags & NDR_SCALARS) { NDR_CHECK(ndr_push_align(ndr, 8)); NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->v1)); - NDR_CHECK(ndr_push_echo_info4(ndr, NDR_SCALARS, &r->info4)); + NDR_CHECK(ndr_push_STRUCT_echo_info4(ndr, NDR_SCALARS, &r->info4)); } if (ndr_flags & NDR_BUFFERS) { } @@ -206,7 +206,7 @@ static enum ndr_err_code ndr_pull_echo_info7(struct ndr_pull *ndr, int ndr_flags if (ndr_flags & NDR_SCALARS) { NDR_CHECK(ndr_pull_align(ndr, 8)); NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->v1)); - NDR_CHECK(ndr_pull_echo_info4(ndr, NDR_SCALARS, &r->info4)); + NDR_CHECK(ndr_pull_STRUCT_echo_info4(ndr, NDR_SCALARS, &r->info4)); } if (ndr_flags & NDR_BUFFERS) { } @@ -218,7 +218,7 @@ _PUBLIC_ void ndr_print_echo_info7(struct ndr_print *ndr, const char *name, cons ndr_print_struct(ndr, name, "echo_info7"); ndr->depth++; ndr_print_uint8(ndr, "v1", r->v1); - ndr_print_echo_info4(ndr, "info4", &r->info4); + ndr_print_STRUCT_echo_info4(ndr, "info4", &r->info4); ndr->depth--; } @@ -228,33 +228,33 @@ static enum ndr_err_code ndr_push_echo_Info(struct ndr_push *ndr, int ndr_flags, int level = ndr_push_get_switch_value(ndr, r); NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, level)); switch (level) { - case 1: + case 1: { NDR_CHECK(ndr_push_echo_info1(ndr, NDR_SCALARS, &r->info1)); - break; + break; } - case 2: + case 2: { NDR_CHECK(ndr_push_echo_info2(ndr, NDR_SCALARS, &r->info2)); - break; + break; } - case 3: + case 3: { NDR_CHECK(ndr_push_echo_info3(ndr, NDR_SCALARS, &r->info3)); - break; + break; } - case 4: - NDR_CHECK(ndr_push_echo_info4(ndr, NDR_SCALARS, &r->info4)); - break; + case 4: { + NDR_CHECK(ndr_push_STRUCT_echo_info4(ndr, NDR_SCALARS, &r->info4)); + break; } - case 5: + case 5: { NDR_CHECK(ndr_push_echo_info5(ndr, NDR_SCALARS, &r->info5)); - break; + break; } - case 6: + case 6: { NDR_CHECK(ndr_push_echo_info6(ndr, NDR_SCALARS, &r->info6)); - break; + break; } - case 7: + case 7: { NDR_CHECK(ndr_push_echo_info7(ndr, NDR_SCALARS, &r->info7)); - break; + break; } default: return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); @@ -315,7 +315,7 @@ static enum ndr_err_code ndr_pull_echo_Info(struct ndr_pull *ndr, int ndr_flags, break; } case 4: { - NDR_CHECK(ndr_pull_echo_info4(ndr, NDR_SCALARS, &r->info4)); + NDR_CHECK(ndr_pull_STRUCT_echo_info4(ndr, NDR_SCALARS, &r->info4)); break; } case 5: { @@ -383,7 +383,7 @@ _PUBLIC_ void ndr_print_echo_Info(struct ndr_print *ndr, const char *name, const break; case 4: - ndr_print_echo_info4(ndr, "info4", &r->info4); + ndr_print_STRUCT_echo_info4(ndr, "info4", &r->info4); break; case 5: @@ -492,13 +492,13 @@ static enum ndr_err_code ndr_push_echo_Enum3(struct ndr_push *ndr, int ndr_flags int level = ndr_push_get_switch_value(ndr, r); NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, level)); switch (level) { - case ECHO_ENUM1: + case ECHO_ENUM1: { NDR_CHECK(ndr_push_echo_Enum1(ndr, NDR_SCALARS, r->e1)); - break; + break; } - case ECHO_ENUM2: + case ECHO_ENUM2: { NDR_CHECK(ndr_push_echo_Enum2(ndr, NDR_SCALARS, &r->e2)); - break; + break; } default: return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); @@ -627,8 +627,7 @@ _PUBLIC_ void ndr_print_echo_Surrounding(struct ndr_print *ndr, const char *name ndr->depth++; for (cntr_surrounding_0=0;cntr_surrounding_0<r->x;cntr_surrounding_0++) { char *idx_0=NULL; - asprintf(&idx_0, "[%d]", cntr_surrounding_0); - if (idx_0) { + if (asprintf(&idx_0, "[%d]", cntr_surrounding_0) != -1) { ndr_print_uint16(ndr, "surrounding", r->surrounding[cntr_surrounding_0]); free(idx_0); } @@ -876,14 +875,13 @@ static enum ndr_err_code ndr_push_echo_TestCall(struct ndr_push *ndr, int flags, if (r->out.s2 == NULL) { return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); } - if (*r->out.s2 == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.s2)); + if (*r->out.s2) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(*r->out.s2, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(*r->out.s2, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, *r->out.s2, ndr_charset_length(*r->out.s2, CH_UTF16), sizeof(uint16_t), CH_UTF16)); } - NDR_CHECK(ndr_push_ref_ptr(ndr)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(*r->out.s2, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(*r->out.s2, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, *r->out.s2, ndr_charset_length(*r->out.s2, CH_UTF16), sizeof(uint16_t), CH_UTF16)); } return NDR_ERR_SUCCESS; } @@ -892,6 +890,7 @@ static enum ndr_err_code ndr_pull_echo_TestCall(struct ndr_pull *ndr, int flags, { uint32_t _ptr_s2; TALLOC_CTX *_mem_save_s2_0; + TALLOC_CTX *_mem_save_s2_1; if (flags & NDR_IN) { ZERO_STRUCT(r->out); @@ -911,14 +910,24 @@ static enum ndr_err_code ndr_pull_echo_TestCall(struct ndr_pull *ndr, int flags, } _mem_save_s2_0 = NDR_PULL_GET_MEM_CTX(ndr); NDR_PULL_SET_MEM_CTX(ndr, r->out.s2, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_ref_ptr(ndr, &_ptr_s2)); - NDR_CHECK(ndr_pull_array_size(ndr, r->out.s2)); - NDR_CHECK(ndr_pull_array_length(ndr, r->out.s2)); - if (ndr_get_array_length(ndr, r->out.s2) > ndr_get_array_size(ndr, r->out.s2)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, r->out.s2), ndr_get_array_length(ndr, r->out.s2)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_s2)); + if (_ptr_s2) { + NDR_PULL_ALLOC(ndr, *r->out.s2); + } else { + *r->out.s2 = NULL; + } + if (*r->out.s2) { + _mem_save_s2_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, *r->out.s2, 0); + NDR_CHECK(ndr_pull_array_size(ndr, r->out.s2)); + NDR_CHECK(ndr_pull_array_length(ndr, r->out.s2)); + if (ndr_get_array_length(ndr, r->out.s2) > ndr_get_array_size(ndr, r->out.s2)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, r->out.s2), ndr_get_array_length(ndr, r->out.s2)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, r->out.s2), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, r->out.s2, ndr_get_array_length(ndr, r->out.s2), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_s2_1, 0); } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, r->out.s2), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, r->out.s2, ndr_get_array_length(ndr, r->out.s2), sizeof(uint16_t), CH_UTF16)); NDR_PULL_SET_MEM_CTX(ndr, _mem_save_s2_0, LIBNDR_FLAG_REF_ALLOC); } return NDR_ERR_SUCCESS; @@ -947,7 +956,9 @@ _PUBLIC_ void ndr_print_echo_TestCall(struct ndr_print *ndr, const char *name, i ndr->depth++; ndr_print_ptr(ndr, "s2", *r->out.s2); ndr->depth++; - ndr_print_string(ndr, "s2", *r->out.s2); + if (*r->out.s2) { + ndr_print_string(ndr, "s2", *r->out.s2); + } ndr->depth--; ndr->depth--; ndr->depth--; @@ -1290,15 +1301,13 @@ static enum ndr_err_code ndr_push_echo_TestDoublePointer(struct ndr_push *ndr, i if (r->in.data == NULL) { return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); } - if (*r->in.data == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_ref_ptr(ndr)); - if (**r->in.data == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + NDR_CHECK(ndr_push_unique_ptr(ndr, *r->in.data)); + if (*r->in.data) { + NDR_CHECK(ndr_push_unique_ptr(ndr, **r->in.data)); + if (**r->in.data) { + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, ***r->in.data)); + } } - NDR_CHECK(ndr_push_ref_ptr(ndr)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, ***r->in.data)); } if (flags & NDR_OUT) { NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->out.result)); @@ -1318,21 +1327,29 @@ static enum ndr_err_code ndr_pull_echo_TestDoublePointer(struct ndr_pull *ndr, i } _mem_save_data_0 = NDR_PULL_GET_MEM_CTX(ndr); NDR_PULL_SET_MEM_CTX(ndr, r->in.data, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_ref_ptr(ndr, &_ptr_data)); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_data)); + if (_ptr_data) { NDR_PULL_ALLOC(ndr, *r->in.data); + } else { + *r->in.data = NULL; } - _mem_save_data_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, *r->in.data, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_ref_ptr(ndr, &_ptr_data)); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, **r->in.data); + if (*r->in.data) { + _mem_save_data_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, *r->in.data, 0); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_data)); + if (_ptr_data) { + NDR_PULL_ALLOC(ndr, **r->in.data); + } else { + **r->in.data = NULL; + } + if (**r->in.data) { + _mem_save_data_2 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, **r->in.data, 0); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, **r->in.data)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_data_2, 0); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_data_1, 0); } - _mem_save_data_2 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, **r->in.data, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, **r->in.data)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_data_2, LIBNDR_FLAG_REF_ALLOC); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_data_1, LIBNDR_FLAG_REF_ALLOC); NDR_PULL_SET_MEM_CTX(ndr, _mem_save_data_0, LIBNDR_FLAG_REF_ALLOC); } if (flags & NDR_OUT) { @@ -1355,10 +1372,14 @@ _PUBLIC_ void ndr_print_echo_TestDoublePointer(struct ndr_print *ndr, const char ndr->depth++; ndr_print_ptr(ndr, "data", *r->in.data); ndr->depth++; - ndr_print_ptr(ndr, "data", **r->in.data); - ndr->depth++; - ndr_print_uint16(ndr, "data", ***r->in.data); - ndr->depth--; + if (*r->in.data) { + ndr_print_ptr(ndr, "data", **r->in.data); + ndr->depth++; + if (**r->in.data) { + ndr_print_uint16(ndr, "data", ***r->in.data); + } + ndr->depth--; + } ndr->depth--; ndr->depth--; ndr->depth--; diff --git a/source3/librpc/gen_ndr/ndr_echo.h b/source3/librpc/gen_ndr/ndr_echo.h index 65989ccd1c..7af1c7446b 100644 --- a/source3/librpc/gen_ndr/ndr_echo.h +++ b/source3/librpc/gen_ndr/ndr_echo.h @@ -35,7 +35,7 @@ extern const struct ndr_interface_table ndr_table_rpcecho; void ndr_print_echo_info1(struct ndr_print *ndr, const char *name, const struct echo_info1 *r); void ndr_print_echo_info2(struct ndr_print *ndr, const char *name, const struct echo_info2 *r); void ndr_print_echo_info3(struct ndr_print *ndr, const char *name, const struct echo_info3 *r); -void ndr_print_echo_info4(struct ndr_print *ndr, const char *name, const struct echo_info4 *r); +void ndr_print_STRUCT_echo_info4(struct ndr_print *ndr, const char *name, const struct echo_info4 *r); void ndr_print_echo_info5(struct ndr_print *ndr, const char *name, const struct echo_info5 *r); void ndr_print_echo_info6(struct ndr_print *ndr, const char *name, const struct echo_info6 *r); void ndr_print_echo_info7(struct ndr_print *ndr, const char *name, const struct echo_info7 *r); diff --git a/source3/librpc/gen_ndr/ndr_epmapper.c b/source3/librpc/gen_ndr/ndr_epmapper.c index 17f4426279..2e709e11e0 100644 --- a/source3/librpc/gen_ndr/ndr_epmapper.c +++ b/source3/librpc/gen_ndr/ndr_epmapper.c @@ -867,118 +867,118 @@ static enum ndr_err_code ndr_push_epm_rhs(struct ndr_push *ndr, int ndr_flags, c if (ndr_flags & NDR_SCALARS) { int level = ndr_push_get_switch_value(ndr, r); switch (level) { - case EPM_PROTOCOL_DNET_NSP: + case EPM_PROTOCOL_DNET_NSP: { NDR_CHECK(ndr_push_epm_rhs_dnet_nsp(ndr, NDR_SCALARS, &r->dnet_nsp)); - break; + break; } - case EPM_PROTOCOL_OSI_TP4: + case EPM_PROTOCOL_OSI_TP4: { NDR_CHECK(ndr_push_epm_rhs_osi_tp4(ndr, NDR_SCALARS, &r->osi_tp4)); - break; + break; } - case EPM_PROTOCOL_OSI_CLNS: + case EPM_PROTOCOL_OSI_CLNS: { NDR_CHECK(ndr_push_epm_rhs_osi_clns(ndr, NDR_SCALARS, &r->osi_clns)); - break; + break; } - case EPM_PROTOCOL_TCP: + case EPM_PROTOCOL_TCP: { NDR_CHECK(ndr_push_epm_rhs_tcp(ndr, NDR_SCALARS, &r->tcp)); - break; + break; } - case EPM_PROTOCOL_UDP: + case EPM_PROTOCOL_UDP: { NDR_CHECK(ndr_push_epm_rhs_udp(ndr, NDR_SCALARS, &r->udp)); - break; + break; } - case EPM_PROTOCOL_IP: + case EPM_PROTOCOL_IP: { NDR_CHECK(ndr_push_epm_rhs_ip(ndr, NDR_SCALARS, &r->ip)); - break; + break; } - case EPM_PROTOCOL_NCADG: + case EPM_PROTOCOL_NCADG: { NDR_CHECK(ndr_push_epm_rhs_ncadg(ndr, NDR_SCALARS, &r->ncadg)); - break; + break; } - case EPM_PROTOCOL_NCACN: + case EPM_PROTOCOL_NCACN: { NDR_CHECK(ndr_push_epm_rhs_ncacn(ndr, NDR_SCALARS, &r->ncacn)); - break; + break; } - case EPM_PROTOCOL_NCALRPC: + case EPM_PROTOCOL_NCALRPC: { NDR_CHECK(ndr_push_epm_rhs_ncalrpc(ndr, NDR_SCALARS, &r->ncalrpc)); - break; + break; } - case EPM_PROTOCOL_UUID: + case EPM_PROTOCOL_UUID: { NDR_CHECK(ndr_push_epm_rhs_uuid(ndr, NDR_SCALARS, &r->uuid)); - break; + break; } - case EPM_PROTOCOL_IPX: + case EPM_PROTOCOL_IPX: { NDR_CHECK(ndr_push_epm_rhs_ipx(ndr, NDR_SCALARS, &r->ipx)); - break; + break; } - case EPM_PROTOCOL_SMB: + case EPM_PROTOCOL_SMB: { NDR_CHECK(ndr_push_epm_rhs_smb(ndr, NDR_SCALARS, &r->smb)); - break; + break; } - case EPM_PROTOCOL_PIPE: + case EPM_PROTOCOL_PIPE: { NDR_CHECK(ndr_push_epm_rhs_pipe(ndr, NDR_SCALARS, &r->pipe)); - break; + break; } - case EPM_PROTOCOL_NETBIOS: + case EPM_PROTOCOL_NETBIOS: { NDR_CHECK(ndr_push_epm_rhs_netbios(ndr, NDR_SCALARS, &r->netbios)); - break; + break; } - case EPM_PROTOCOL_NETBEUI: + case EPM_PROTOCOL_NETBEUI: { NDR_CHECK(ndr_push_epm_rhs_netbeui(ndr, NDR_SCALARS, &r->netbeui)); - break; + break; } - case EPM_PROTOCOL_SPX: + case EPM_PROTOCOL_SPX: { NDR_CHECK(ndr_push_epm_rhs_spx(ndr, NDR_SCALARS, &r->spx)); - break; + break; } - case EPM_PROTOCOL_NB_IPX: + case EPM_PROTOCOL_NB_IPX: { NDR_CHECK(ndr_push_epm_rhs_nb_ipx(ndr, NDR_SCALARS, &r->nb_ipx)); - break; + break; } - case EPM_PROTOCOL_DSP: + case EPM_PROTOCOL_DSP: { NDR_CHECK(ndr_push_epm_rhs_atalk_stream(ndr, NDR_SCALARS, &r->atalk_stream)); - break; + break; } - case EPM_PROTOCOL_DDP: + case EPM_PROTOCOL_DDP: { NDR_CHECK(ndr_push_epm_rhs_atalk_datagram(ndr, NDR_SCALARS, &r->atalk_datagram)); - break; + break; } - case EPM_PROTOCOL_APPLETALK: + case EPM_PROTOCOL_APPLETALK: { NDR_CHECK(ndr_push_epm_rhs_appletalk(ndr, NDR_SCALARS, &r->appletalk)); - break; + break; } - case EPM_PROTOCOL_VINES_SPP: + case EPM_PROTOCOL_VINES_SPP: { NDR_CHECK(ndr_push_epm_rhs_vines_spp(ndr, NDR_SCALARS, &r->vines_spp)); - break; + break; } - case EPM_PROTOCOL_VINES_IPC: + case EPM_PROTOCOL_VINES_IPC: { NDR_CHECK(ndr_push_epm_rhs_vines_ipc(ndr, NDR_SCALARS, &r->vines_ipc)); - break; + break; } - case EPM_PROTOCOL_STREETTALK: + case EPM_PROTOCOL_STREETTALK: { NDR_CHECK(ndr_push_epm_rhs_streettalk(ndr, NDR_SCALARS, &r->streettalk)); - break; + break; } - case EPM_PROTOCOL_HTTP: + case EPM_PROTOCOL_HTTP: { NDR_CHECK(ndr_push_epm_rhs_http(ndr, NDR_SCALARS, &r->http)); - break; + break; } - case EPM_PROTOCOL_UNIX_DS: + case EPM_PROTOCOL_UNIX_DS: { NDR_CHECK(ndr_push_epm_rhs_unix_ds(ndr, NDR_SCALARS, &r->unix_ds)); - break; + break; } - case EPM_PROTOCOL_NULL: + case EPM_PROTOCOL_NULL: { NDR_CHECK(ndr_push_epm_rhs_null(ndr, NDR_SCALARS, &r->null)); - break; + break; } - default: + default: { { uint32_t _flags_save_DATA_BLOB = ndr->flags; ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING); NDR_CHECK(ndr_push_DATA_BLOB(ndr, NDR_SCALARS, r->unknown)); ndr->flags = _flags_save_DATA_BLOB; } - break; + break; } } } @@ -1566,8 +1566,7 @@ _PUBLIC_ void ndr_print_epm_tower(struct ndr_print *ndr, const char *name, const ndr->depth++; for (cntr_floors_0=0;cntr_floors_0<r->num_floors;cntr_floors_0++) { char *idx_0=NULL; - asprintf(&idx_0, "[%d]", cntr_floors_0); - if (idx_0) { + if (asprintf(&idx_0, "[%d]", cntr_floors_0) != -1) { ndr_print_epm_floor(ndr, "floors", &r->floors[cntr_floors_0]); free(idx_0); } @@ -1849,8 +1848,7 @@ _PUBLIC_ void ndr_print_epm_Insert(struct ndr_print *ndr, const char *name, int ndr->depth++; for (cntr_entries_0=0;cntr_entries_0<r->in.num_ents;cntr_entries_0++) { char *idx_0=NULL; - asprintf(&idx_0, "[%d]", cntr_entries_0); - if (idx_0) { + if (asprintf(&idx_0, "[%d]", cntr_entries_0) != -1) { ndr_print_epm_entry_t(ndr, "entries", &r->in.entries[cntr_entries_0]); free(idx_0); } @@ -1930,8 +1928,7 @@ _PUBLIC_ void ndr_print_epm_Delete(struct ndr_print *ndr, const char *name, int ndr->depth++; for (cntr_entries_0=0;cntr_entries_0<r->in.num_ents;cntr_entries_0++) { char *idx_0=NULL; - asprintf(&idx_0, "[%d]", cntr_entries_0); - if (idx_0) { + if (asprintf(&idx_0, "[%d]", cntr_entries_0) != -1) { ndr_print_epm_entry_t(ndr, "entries", &r->in.entries[cntr_entries_0]); free(idx_0); } @@ -2131,8 +2128,7 @@ _PUBLIC_ void ndr_print_epm_Lookup(struct ndr_print *ndr, const char *name, int ndr->depth++; for (cntr_entries_0=0;cntr_entries_0<*r->out.num_ents;cntr_entries_0++) { char *idx_0=NULL; - asprintf(&idx_0, "[%d]", cntr_entries_0); - if (idx_0) { + if (asprintf(&idx_0, "[%d]", cntr_entries_0) != -1) { ndr_print_epm_entry_t(ndr, "entries", &r->out.entries[cntr_entries_0]); free(idx_0); } @@ -2321,8 +2317,7 @@ _PUBLIC_ void ndr_print_epm_Map(struct ndr_print *ndr, const char *name, int fla ndr->depth++; for (cntr_towers_0=0;cntr_towers_0<*r->out.num_towers;cntr_towers_0++) { char *idx_0=NULL; - asprintf(&idx_0, "[%d]", cntr_towers_0); - if (idx_0) { + if (asprintf(&idx_0, "[%d]", cntr_towers_0) != -1) { ndr_print_epm_twr_p_t(ndr, "towers", &r->out.towers[cntr_towers_0]); free(idx_0); } diff --git a/source3/librpc/gen_ndr/ndr_eventlog.c b/source3/librpc/gen_ndr/ndr_eventlog.c index ebd76515ff..c5461d99ab 100644 --- a/source3/librpc/gen_ndr/ndr_eventlog.c +++ b/source3/librpc/gen_ndr/ndr_eventlog.c @@ -130,7 +130,7 @@ _PUBLIC_ enum ndr_err_code ndr_pull_eventlog_Record(struct ndr_pull *ndr, int nd ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); NDR_PULL_ALLOC_N(ndr, r->strings, r->num_of_strings); _mem_save_strings_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, *r->strings, 0); + NDR_PULL_SET_MEM_CTX(ndr, r->strings, 0); for (cntr_strings_0 = 0; cntr_strings_0 < r->num_of_strings; cntr_strings_0++) { NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->strings[cntr_strings_0])); } @@ -176,8 +176,7 @@ _PUBLIC_ void ndr_print_eventlog_Record(struct ndr_print *ndr, const char *name, ndr->depth++; for (cntr_strings_0=0;cntr_strings_0<r->num_of_strings;cntr_strings_0++) { char *idx_0=NULL; - asprintf(&idx_0, "[%d]", cntr_strings_0); - if (idx_0) { + if (asprintf(&idx_0, "[%d]", cntr_strings_0) != -1) { ndr_print_string(ndr, "strings", r->strings[cntr_strings_0]); free(idx_0); } @@ -194,9 +193,9 @@ static enum ndr_err_code ndr_push_eventlog_ClearEventLogW(struct ndr_push *ndr, return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); } NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.handle)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.unknown)); - if (r->in.unknown) { - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.unknown)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.backupfile)); + if (r->in.backupfile) { + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.backupfile)); } } if (flags & NDR_OUT) { @@ -207,9 +206,9 @@ static enum ndr_err_code ndr_push_eventlog_ClearEventLogW(struct ndr_push *ndr, static enum ndr_err_code ndr_pull_eventlog_ClearEventLogW(struct ndr_pull *ndr, int flags, struct eventlog_ClearEventLogW *r) { - uint32_t _ptr_unknown; + uint32_t _ptr_backupfile; TALLOC_CTX *_mem_save_handle_0; - TALLOC_CTX *_mem_save_unknown_0; + TALLOC_CTX *_mem_save_backupfile_0; if (flags & NDR_IN) { if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { NDR_PULL_ALLOC(ndr, r->in.handle); @@ -218,17 +217,17 @@ static enum ndr_err_code ndr_pull_eventlog_ClearEventLogW(struct ndr_pull *ndr, NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.handle)); NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_unknown)); - if (_ptr_unknown) { - NDR_PULL_ALLOC(ndr, r->in.unknown); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_backupfile)); + if (_ptr_backupfile) { + NDR_PULL_ALLOC(ndr, r->in.backupfile); } else { - r->in.unknown = NULL; + r->in.backupfile = NULL; } - if (r->in.unknown) { - _mem_save_unknown_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.unknown, 0); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.unknown)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_unknown_0, 0); + if (r->in.backupfile) { + _mem_save_backupfile_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.backupfile, 0); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.backupfile)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_backupfile_0, 0); } } if (flags & NDR_OUT) { @@ -251,10 +250,10 @@ _PUBLIC_ void ndr_print_eventlog_ClearEventLogW(struct ndr_print *ndr, const cha ndr->depth++; ndr_print_policy_handle(ndr, "handle", r->in.handle); ndr->depth--; - ndr_print_ptr(ndr, "unknown", r->in.unknown); + ndr_print_ptr(ndr, "backupfile", r->in.backupfile); ndr->depth++; - if (r->in.unknown) { - ndr_print_lsa_String(ndr, "unknown", r->in.unknown); + if (r->in.backupfile) { + ndr_print_lsa_String(ndr, "backupfile", r->in.backupfile); } ndr->depth--; ndr->depth--; @@ -506,8 +505,16 @@ _PUBLIC_ void ndr_print_eventlog_GetNumRecords(struct ndr_print *ndr, const char static enum ndr_err_code ndr_push_eventlog_GetOldestRecord(struct ndr_push *ndr, int flags, const struct eventlog_GetOldestRecord *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|NDR_BUFFERS, r->in.handle)); } if (flags & NDR_OUT) { + if (r->out.oldest_entry == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.oldest_entry)); NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); } return NDR_ERR_SUCCESS; @@ -515,9 +522,29 @@ static enum ndr_err_code ndr_push_eventlog_GetOldestRecord(struct ndr_push *ndr, static enum ndr_err_code ndr_pull_eventlog_GetOldestRecord(struct ndr_pull *ndr, int flags, struct eventlog_GetOldestRecord *r) { + TALLOC_CTX *_mem_save_handle_0; + TALLOC_CTX *_mem_save_oldest_entry_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|NDR_BUFFERS, r->in.handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_PULL_ALLOC(ndr, r->out.oldest_entry); + ZERO_STRUCTP(r->out.oldest_entry); } if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.oldest_entry); + } + _mem_save_oldest_entry_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.oldest_entry, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.oldest_entry)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_oldest_entry_0, LIBNDR_FLAG_REF_ALLOC); NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); } return NDR_ERR_SUCCESS; @@ -533,11 +560,19 @@ _PUBLIC_ void ndr_print_eventlog_GetOldestRecord(struct ndr_print *ndr, const ch if (flags & NDR_IN) { ndr_print_struct(ndr, "in", "eventlog_GetOldestRecord"); 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", "eventlog_GetOldestRecord"); ndr->depth++; + ndr_print_ptr(ndr, "oldest_entry", r->out.oldest_entry); + ndr->depth++; + ndr_print_uint32(ndr, "oldest_entry", *r->out.oldest_entry); + ndr->depth--; ndr_print_NTSTATUS(ndr, "result", r->out.result); ndr->depth--; } @@ -592,8 +627,14 @@ static enum ndr_err_code ndr_push_eventlog_OpenEventLogW(struct ndr_push *ndr, i if (r->in.unknown0) { NDR_CHECK(ndr_push_eventlog_OpenUnknown0(ndr, NDR_SCALARS, r->in.unknown0)); } - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.logname)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.servername)); + if (r->in.logname == 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.logname)); + if (r->in.servername == 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.servername)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.unknown2)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.unknown3)); } @@ -611,6 +652,8 @@ static enum ndr_err_code ndr_pull_eventlog_OpenEventLogW(struct ndr_pull *ndr, i { uint32_t _ptr_unknown0; TALLOC_CTX *_mem_save_unknown0_0; + TALLOC_CTX *_mem_save_logname_0; + TALLOC_CTX *_mem_save_servername_0; TALLOC_CTX *_mem_save_handle_0; if (flags & NDR_IN) { ZERO_STRUCT(r->out); @@ -627,8 +670,20 @@ static enum ndr_err_code ndr_pull_eventlog_OpenEventLogW(struct ndr_pull *ndr, i NDR_CHECK(ndr_pull_eventlog_OpenUnknown0(ndr, NDR_SCALARS, r->in.unknown0)); NDR_PULL_SET_MEM_CTX(ndr, _mem_save_unknown0_0, 0); } - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.logname)); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.servername)); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.logname); + } + _mem_save_logname_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.logname, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.logname)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_logname_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.servername); + } + _mem_save_servername_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.servername, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.servername)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_servername_0, LIBNDR_FLAG_REF_ALLOC); NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.unknown2)); NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.unknown3)); NDR_PULL_ALLOC(ndr, r->out.handle); @@ -663,8 +718,14 @@ _PUBLIC_ void ndr_print_eventlog_OpenEventLogW(struct ndr_print *ndr, const char ndr_print_eventlog_OpenUnknown0(ndr, "unknown0", r->in.unknown0); } ndr->depth--; - ndr_print_lsa_String(ndr, "logname", &r->in.logname); - ndr_print_lsa_String(ndr, "servername", &r->in.servername); + ndr_print_ptr(ndr, "logname", r->in.logname); + ndr->depth++; + ndr_print_lsa_String(ndr, "logname", r->in.logname); + ndr->depth--; + ndr_print_ptr(ndr, "servername", r->in.servername); + ndr->depth++; + ndr_print_lsa_String(ndr, "servername", r->in.servername); + ndr->depth--; ndr_print_uint32(ndr, "unknown2", r->in.unknown2); ndr_print_uint32(ndr, "unknown3", r->in.unknown3); ndr->depth--; @@ -812,8 +873,11 @@ static enum ndr_err_code ndr_pull_eventlog_ReadEventLogW(struct ndr_pull *ndr, i NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.flags)); NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.offset)); NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.number_of_bytes)); + if (r->in.number_of_bytes < 0 || r->in.number_of_bytes > 0x7FFFF) { + return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range"); + } NDR_PULL_ALLOC_N(ndr, r->out.data, r->in.number_of_bytes); - memset(r->out.data, 0, r->in.number_of_bytes * sizeof(*r->out.data)); + memset(r->out.data, 0, (r->in.number_of_bytes) * sizeof(*r->out.data)); NDR_PULL_ALLOC(ndr, r->out.sent_size); ZERO_STRUCTP(r->out.sent_size); NDR_PULL_ALLOC(ndr, r->out.real_size); diff --git a/source3/librpc/gen_ndr/ndr_krb5pac.c b/source3/librpc/gen_ndr/ndr_krb5pac.c new file mode 100644 index 0000000000..7c4dba0b0a --- /dev/null +++ b/source3/librpc/gen_ndr/ndr_krb5pac.c @@ -0,0 +1,873 @@ +/* parser auto-generated by pidl */ + +#include "includes.h" +#include "librpc/gen_ndr/ndr_krb5pac.h" + +#include "librpc/gen_ndr/ndr_security.h" +#include "librpc/gen_ndr/ndr_netlogon.h" +#include "librpc/gen_ndr/ndr_samr.h" +static enum ndr_err_code ndr_push_PAC_LOGON_NAME(struct ndr_push *ndr, int ndr_flags, const struct PAC_LOGON_NAME *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->logon_time)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, 2 * strlen_m(r->account_name))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->account_name, 2 * strlen_m(r->account_name), sizeof(uint8_t), CH_UTF16)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_PAC_LOGON_NAME(struct ndr_pull *ndr, int ndr_flags, struct PAC_LOGON_NAME *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->logon_time)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->size)); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->account_name, r->size, sizeof(uint8_t), CH_UTF16)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_PAC_LOGON_NAME(struct ndr_print *ndr, const char *name, const struct PAC_LOGON_NAME *r) +{ + ndr_print_struct(ndr, name, "PAC_LOGON_NAME"); + ndr->depth++; + ndr_print_NTTIME(ndr, "logon_time", r->logon_time); + ndr_print_uint16(ndr, "size", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?2 * strlen_m(r->account_name):r->size); + ndr_print_string(ndr, "account_name", r->account_name); + ndr->depth--; +} + +_PUBLIC_ enum ndr_err_code ndr_push_PAC_SIGNATURE_DATA(struct ndr_push *ndr, int ndr_flags, const struct PAC_SIGNATURE_DATA *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_uint32(ndr, NDR_SCALARS, r->type)); + { + uint32_t _flags_save_DATA_BLOB = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING); + NDR_CHECK(ndr_push_DATA_BLOB(ndr, NDR_SCALARS, r->signature)); + ndr->flags = _flags_save_DATA_BLOB; + } + } + if (ndr_flags & NDR_BUFFERS) { + } + ndr->flags = _flags_save_STRUCT; + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_PAC_SIGNATURE_DATA(struct ndr_pull *ndr, int ndr_flags, struct PAC_SIGNATURE_DATA *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, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->type)); + { + uint32_t _flags_save_DATA_BLOB = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING); + NDR_CHECK(ndr_pull_DATA_BLOB(ndr, NDR_SCALARS, &r->signature)); + ndr->flags = _flags_save_DATA_BLOB; + } + } + if (ndr_flags & NDR_BUFFERS) { + } + ndr->flags = _flags_save_STRUCT; + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_PAC_SIGNATURE_DATA(struct ndr_print *ndr, const char *name, const struct PAC_SIGNATURE_DATA *r) +{ + ndr_print_struct(ndr, name, "PAC_SIGNATURE_DATA"); + { + uint32_t _flags_save_STRUCT = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); + ndr->depth++; + ndr_print_uint32(ndr, "type", r->type); + ndr_print_DATA_BLOB(ndr, "signature", r->signature); + ndr->depth--; + ndr->flags = _flags_save_STRUCT; + } +} + +static enum ndr_err_code ndr_push_PAC_LOGON_INFO(struct ndr_push *ndr, int ndr_flags, const struct PAC_LOGON_INFO *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_netr_SamInfo3(ndr, NDR_SCALARS, &r->info3)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->res_group_dom_sid)); + NDR_CHECK(ndr_push_samr_RidWithAttributeArray(ndr, NDR_SCALARS, &r->res_groups)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_push_netr_SamInfo3(ndr, NDR_BUFFERS, &r->info3)); + if (r->res_group_dom_sid) { + NDR_CHECK(ndr_push_dom_sid2(ndr, NDR_SCALARS|NDR_BUFFERS, r->res_group_dom_sid)); + } + NDR_CHECK(ndr_push_samr_RidWithAttributeArray(ndr, NDR_BUFFERS, &r->res_groups)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_PAC_LOGON_INFO(struct ndr_pull *ndr, int ndr_flags, struct PAC_LOGON_INFO *r) +{ + uint32_t _ptr_res_group_dom_sid; + TALLOC_CTX *_mem_save_res_group_dom_sid_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_netr_SamInfo3(ndr, NDR_SCALARS, &r->info3)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_res_group_dom_sid)); + if (_ptr_res_group_dom_sid) { + NDR_PULL_ALLOC(ndr, r->res_group_dom_sid); + } else { + r->res_group_dom_sid = NULL; + } + NDR_CHECK(ndr_pull_samr_RidWithAttributeArray(ndr, NDR_SCALARS, &r->res_groups)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_pull_netr_SamInfo3(ndr, NDR_BUFFERS, &r->info3)); + if (r->res_group_dom_sid) { + _mem_save_res_group_dom_sid_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->res_group_dom_sid, 0); + NDR_CHECK(ndr_pull_dom_sid2(ndr, NDR_SCALARS|NDR_BUFFERS, r->res_group_dom_sid)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_res_group_dom_sid_0, 0); + } + NDR_CHECK(ndr_pull_samr_RidWithAttributeArray(ndr, NDR_BUFFERS, &r->res_groups)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_PAC_LOGON_INFO(struct ndr_print *ndr, const char *name, const struct PAC_LOGON_INFO *r) +{ + ndr_print_struct(ndr, name, "PAC_LOGON_INFO"); + ndr->depth++; + ndr_print_netr_SamInfo3(ndr, "info3", &r->info3); + ndr_print_ptr(ndr, "res_group_dom_sid", r->res_group_dom_sid); + ndr->depth++; + if (r->res_group_dom_sid) { + ndr_print_dom_sid2(ndr, "res_group_dom_sid", r->res_group_dom_sid); + } + ndr->depth--; + ndr_print_samr_RidWithAttributeArray(ndr, "res_groups", &r->res_groups); + ndr->depth--; +} + +static size_t ndr_size_PAC_LOGON_INFO(const struct PAC_LOGON_INFO *r, int flags) +{ + return ndr_size_struct(r, flags, (ndr_push_flags_fn_t)ndr_push_PAC_LOGON_INFO); +} + +_PUBLIC_ enum ndr_err_code ndr_push_PAC_LOGON_INFO_CTR(struct ndr_push *ndr, int ndr_flags, const struct PAC_LOGON_INFO_CTR *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0x00081001)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0xCCCCCCCC)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, NDR_ROUND(ndr_size_PAC_LOGON_INFO(r->info, ndr->flags) + 4, 8))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0x00000000)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->info)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->info) { + NDR_CHECK(ndr_push_PAC_LOGON_INFO(ndr, NDR_SCALARS|NDR_BUFFERS, r->info)); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_PAC_LOGON_INFO_CTR(struct ndr_pull *ndr, int ndr_flags, struct PAC_LOGON_INFO_CTR *r) +{ + uint32_t _ptr_info; + TALLOC_CTX *_mem_save_info_0; + 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)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->_ndr_size)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown3)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info)); + if (_ptr_info) { + NDR_PULL_ALLOC(ndr, r->info); + } else { + r->info = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->info) { + _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->info, 0); + NDR_CHECK(ndr_pull_PAC_LOGON_INFO(ndr, NDR_SCALARS|NDR_BUFFERS, r->info)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, 0); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_PAC_LOGON_INFO_CTR(struct ndr_print *ndr, const char *name, const struct PAC_LOGON_INFO_CTR *r) +{ + ndr_print_struct(ndr, name, "PAC_LOGON_INFO_CTR"); + ndr->depth++; + ndr_print_uint32(ndr, "unknown1", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?0x00081001:r->unknown1); + ndr_print_uint32(ndr, "unknown2", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?0xCCCCCCCC:r->unknown2); + ndr_print_uint32(ndr, "_ndr_size", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?NDR_ROUND(ndr_size_PAC_LOGON_INFO(r->info, ndr->flags) + 4, 8):r->_ndr_size); + ndr_print_uint32(ndr, "unknown3", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?0x00000000:r->unknown3); + ndr_print_ptr(ndr, "info", r->info); + ndr->depth++; + if (r->info) { + ndr_print_PAC_LOGON_INFO(ndr, "info", r->info); + } + ndr->depth--; + ndr->depth--; +} + +_PUBLIC_ enum ndr_err_code ndr_push_PAC_TYPE(struct ndr_push *ndr, int ndr_flags, enum PAC_TYPE r) +{ + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_PAC_TYPE(struct ndr_pull *ndr, int ndr_flags, enum PAC_TYPE *r) +{ + uint32_t v; + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); + *r = v; + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_PAC_TYPE(struct ndr_print *ndr, const char *name, enum PAC_TYPE r) +{ + const char *val = NULL; + + switch (r) { + case PAC_TYPE_LOGON_INFO: val = "PAC_TYPE_LOGON_INFO"; break; + case PAC_TYPE_SRV_CHECKSUM: val = "PAC_TYPE_SRV_CHECKSUM"; break; + case PAC_TYPE_KDC_CHECKSUM: val = "PAC_TYPE_KDC_CHECKSUM"; break; + case PAC_TYPE_LOGON_NAME: val = "PAC_TYPE_LOGON_NAME"; break; + case PAC_TYPE_CONSTRAINED_DELEGATION: val = "PAC_TYPE_CONSTRAINED_DELEGATION"; break; + } + ndr_print_enum(ndr, name, "ENUM", val, r); +} + +_PUBLIC_ enum ndr_err_code ndr_push_PAC_INFO(struct ndr_push *ndr, int ndr_flags, const union PAC_INFO *r) +{ + if (ndr_flags & NDR_SCALARS) { + int level = ndr_push_get_switch_value(ndr, r); + switch (level) { + case PAC_TYPE_LOGON_INFO: { + NDR_CHECK(ndr_push_PAC_LOGON_INFO_CTR(ndr, NDR_SCALARS, &r->logon_info)); + break; } + + case PAC_TYPE_SRV_CHECKSUM: { + NDR_CHECK(ndr_push_PAC_SIGNATURE_DATA(ndr, NDR_SCALARS, &r->srv_cksum)); + break; } + + case PAC_TYPE_KDC_CHECKSUM: { + NDR_CHECK(ndr_push_PAC_SIGNATURE_DATA(ndr, NDR_SCALARS, &r->kdc_cksum)); + break; } + + case PAC_TYPE_LOGON_NAME: { + NDR_CHECK(ndr_push_PAC_LOGON_NAME(ndr, NDR_SCALARS, &r->logon_name)); + 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 PAC_TYPE_LOGON_INFO: + NDR_CHECK(ndr_push_PAC_LOGON_INFO_CTR(ndr, NDR_BUFFERS, &r->logon_info)); + break; + + case PAC_TYPE_SRV_CHECKSUM: + break; + + case PAC_TYPE_KDC_CHECKSUM: + break; + + case PAC_TYPE_LOGON_NAME: + break; + + default: + return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_PAC_INFO(struct ndr_pull *ndr, int ndr_flags, union PAC_INFO *r) +{ + int level; + level = ndr_pull_get_switch_value(ndr, r); + if (ndr_flags & NDR_SCALARS) { + switch (level) { + case PAC_TYPE_LOGON_INFO: { + NDR_CHECK(ndr_pull_PAC_LOGON_INFO_CTR(ndr, NDR_SCALARS, &r->logon_info)); + break; } + + case PAC_TYPE_SRV_CHECKSUM: { + NDR_CHECK(ndr_pull_PAC_SIGNATURE_DATA(ndr, NDR_SCALARS, &r->srv_cksum)); + break; } + + case PAC_TYPE_KDC_CHECKSUM: { + NDR_CHECK(ndr_pull_PAC_SIGNATURE_DATA(ndr, NDR_SCALARS, &r->kdc_cksum)); + break; } + + case PAC_TYPE_LOGON_NAME: { + NDR_CHECK(ndr_pull_PAC_LOGON_NAME(ndr, NDR_SCALARS, &r->logon_name)); + break; } + + default: + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + if (ndr_flags & NDR_BUFFERS) { + switch (level) { + case PAC_TYPE_LOGON_INFO: + NDR_CHECK(ndr_pull_PAC_LOGON_INFO_CTR(ndr, NDR_BUFFERS, &r->logon_info)); + break; + + case PAC_TYPE_SRV_CHECKSUM: + break; + + case PAC_TYPE_KDC_CHECKSUM: + break; + + case PAC_TYPE_LOGON_NAME: + break; + + default: + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_PAC_INFO(struct ndr_print *ndr, const char *name, const union PAC_INFO *r) +{ + int level; + level = ndr_print_get_switch_value(ndr, r); + ndr_print_union(ndr, name, level, "PAC_INFO"); + switch (level) { + case PAC_TYPE_LOGON_INFO: + ndr_print_PAC_LOGON_INFO_CTR(ndr, "logon_info", &r->logon_info); + break; + + case PAC_TYPE_SRV_CHECKSUM: + ndr_print_PAC_SIGNATURE_DATA(ndr, "srv_cksum", &r->srv_cksum); + break; + + case PAC_TYPE_KDC_CHECKSUM: + ndr_print_PAC_SIGNATURE_DATA(ndr, "kdc_cksum", &r->kdc_cksum); + break; + + case PAC_TYPE_LOGON_NAME: + ndr_print_PAC_LOGON_NAME(ndr, "logon_name", &r->logon_name); + break; + + default: + ndr_print_bad_level(ndr, name, level); + } +} + +_PUBLIC_ size_t ndr_size_PAC_INFO(const union PAC_INFO *r, uint32_t level, int flags) +{ + return ndr_size_union(r, flags, level, (ndr_push_flags_fn_t)ndr_push_PAC_INFO); +} + +_PUBLIC_ enum ndr_err_code ndr_push_PAC_DATA(struct ndr_push *ndr, int ndr_flags, const struct PAC_DATA *r) +{ + uint32_t cntr_buffers_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_buffers)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->version)); + for (cntr_buffers_0 = 0; cntr_buffers_0 < r->num_buffers; cntr_buffers_0++) { + NDR_CHECK(ndr_push_PAC_BUFFER(ndr, NDR_SCALARS, &r->buffers[cntr_buffers_0])); + } + } + if (ndr_flags & NDR_BUFFERS) { + for (cntr_buffers_0 = 0; cntr_buffers_0 < r->num_buffers; cntr_buffers_0++) { + NDR_CHECK(ndr_push_PAC_BUFFER(ndr, NDR_BUFFERS, &r->buffers[cntr_buffers_0])); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_PAC_DATA(struct ndr_pull *ndr, int ndr_flags, struct PAC_DATA *r) +{ + uint32_t cntr_buffers_0; + TALLOC_CTX *_mem_save_buffers_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->num_buffers)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->version)); + NDR_PULL_ALLOC_N(ndr, r->buffers, r->num_buffers); + _mem_save_buffers_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->buffers, 0); + for (cntr_buffers_0 = 0; cntr_buffers_0 < r->num_buffers; cntr_buffers_0++) { + NDR_CHECK(ndr_pull_PAC_BUFFER(ndr, NDR_SCALARS, &r->buffers[cntr_buffers_0])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_buffers_0, 0); + } + if (ndr_flags & NDR_BUFFERS) { + _mem_save_buffers_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->buffers, 0); + for (cntr_buffers_0 = 0; cntr_buffers_0 < r->num_buffers; cntr_buffers_0++) { + NDR_CHECK(ndr_pull_PAC_BUFFER(ndr, NDR_BUFFERS, &r->buffers[cntr_buffers_0])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_buffers_0, 0); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_PAC_DATA(struct ndr_print *ndr, const char *name, const struct PAC_DATA *r) +{ + uint32_t cntr_buffers_0; + ndr_print_struct(ndr, name, "PAC_DATA"); + ndr->depth++; + ndr_print_uint32(ndr, "num_buffers", r->num_buffers); + ndr_print_uint32(ndr, "version", r->version); + ndr->print(ndr, "%s: ARRAY(%d)", "buffers", r->num_buffers); + ndr->depth++; + for (cntr_buffers_0=0;cntr_buffers_0<r->num_buffers;cntr_buffers_0++) { + char *idx_0=NULL; + if (asprintf(&idx_0, "[%d]", cntr_buffers_0) != -1) { + ndr_print_PAC_BUFFER(ndr, "buffers", &r->buffers[cntr_buffers_0]); + free(idx_0); + } + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_DATA_BLOB_REM(struct ndr_push *ndr, int ndr_flags, const struct DATA_BLOB_REM *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + { + uint32_t _flags_save_DATA_BLOB = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING); + NDR_CHECK(ndr_push_DATA_BLOB(ndr, NDR_SCALARS, r->remaining)); + ndr->flags = _flags_save_DATA_BLOB; + } + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_DATA_BLOB_REM(struct ndr_pull *ndr, int ndr_flags, struct DATA_BLOB_REM *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + { + uint32_t _flags_save_DATA_BLOB = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING); + NDR_CHECK(ndr_pull_DATA_BLOB(ndr, NDR_SCALARS, &r->remaining)); + ndr->flags = _flags_save_DATA_BLOB; + } + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_DATA_BLOB_REM(struct ndr_print *ndr, const char *name, const struct DATA_BLOB_REM *r) +{ + ndr_print_struct(ndr, name, "DATA_BLOB_REM"); + ndr->depth++; + ndr_print_DATA_BLOB(ndr, "remaining", r->remaining); + ndr->depth--; +} + +_PUBLIC_ enum ndr_err_code ndr_push_PAC_BUFFER_RAW(struct ndr_push *ndr, int ndr_flags, const struct PAC_BUFFER_RAW *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_PAC_TYPE(ndr, NDR_SCALARS, r->type)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->ndr_size)); + { + uint32_t _flags_save_DATA_BLOB_REM = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_ALIGN8); + NDR_CHECK(ndr_push_relative_ptr1(ndr, r->info)); + ndr->flags = _flags_save_DATA_BLOB_REM; + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + } + if (ndr_flags & NDR_BUFFERS) { + { + uint32_t _flags_save_DATA_BLOB_REM = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_ALIGN8); + if (r->info) { + NDR_CHECK(ndr_push_relative_ptr2(ndr, r->info)); + { + struct ndr_push *_ndr_info; + NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_info, 0, NDR_ROUND(r->ndr_size, 8))); + NDR_CHECK(ndr_push_DATA_BLOB_REM(_ndr_info, NDR_SCALARS, r->info)); + NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_info, 0, NDR_ROUND(r->ndr_size, 8))); + } + } + ndr->flags = _flags_save_DATA_BLOB_REM; + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_PAC_BUFFER_RAW(struct ndr_pull *ndr, int ndr_flags, struct PAC_BUFFER_RAW *r) +{ + uint32_t _ptr_info; + TALLOC_CTX *_mem_save_info_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_PAC_TYPE(ndr, NDR_SCALARS, &r->type)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->ndr_size)); + { + uint32_t _flags_save_DATA_BLOB_REM = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_ALIGN8); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info)); + if (_ptr_info) { + NDR_PULL_ALLOC(ndr, r->info); + NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->info, _ptr_info)); + } else { + r->info = NULL; + } + ndr->flags = _flags_save_DATA_BLOB_REM; + } + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->_pad)); + } + if (ndr_flags & NDR_BUFFERS) { + { + uint32_t _flags_save_DATA_BLOB_REM = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_ALIGN8); + if (r->info) { + uint32_t _relative_save_offset; + _relative_save_offset = ndr->offset; + NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->info)); + _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->info, 0); + { + struct ndr_pull *_ndr_info; + NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_info, 0, NDR_ROUND(r->ndr_size, 8))); + NDR_CHECK(ndr_pull_DATA_BLOB_REM(_ndr_info, NDR_SCALARS, r->info)); + NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_info, 0, NDR_ROUND(r->ndr_size, 8))); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, 0); + ndr->offset = _relative_save_offset; + } + ndr->flags = _flags_save_DATA_BLOB_REM; + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_PAC_BUFFER_RAW(struct ndr_print *ndr, const char *name, const struct PAC_BUFFER_RAW *r) +{ + ndr_print_struct(ndr, name, "PAC_BUFFER_RAW"); + ndr->depth++; + ndr_print_PAC_TYPE(ndr, "type", r->type); + ndr_print_uint32(ndr, "ndr_size", r->ndr_size); + ndr_print_ptr(ndr, "info", r->info); + ndr->depth++; + if (r->info) { + ndr_print_DATA_BLOB_REM(ndr, "info", r->info); + } + ndr->depth--; + ndr_print_uint32(ndr, "_pad", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?0:r->_pad); + ndr->depth--; +} + +_PUBLIC_ enum ndr_err_code ndr_push_PAC_DATA_RAW(struct ndr_push *ndr, int ndr_flags, const struct PAC_DATA_RAW *r) +{ + uint32_t cntr_buffers_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_buffers)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->version)); + for (cntr_buffers_0 = 0; cntr_buffers_0 < r->num_buffers; cntr_buffers_0++) { + NDR_CHECK(ndr_push_PAC_BUFFER_RAW(ndr, NDR_SCALARS, &r->buffers[cntr_buffers_0])); + } + } + if (ndr_flags & NDR_BUFFERS) { + for (cntr_buffers_0 = 0; cntr_buffers_0 < r->num_buffers; cntr_buffers_0++) { + NDR_CHECK(ndr_push_PAC_BUFFER_RAW(ndr, NDR_BUFFERS, &r->buffers[cntr_buffers_0])); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_PAC_DATA_RAW(struct ndr_pull *ndr, int ndr_flags, struct PAC_DATA_RAW *r) +{ + uint32_t cntr_buffers_0; + TALLOC_CTX *_mem_save_buffers_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->num_buffers)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->version)); + NDR_PULL_ALLOC_N(ndr, r->buffers, r->num_buffers); + _mem_save_buffers_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->buffers, 0); + for (cntr_buffers_0 = 0; cntr_buffers_0 < r->num_buffers; cntr_buffers_0++) { + NDR_CHECK(ndr_pull_PAC_BUFFER_RAW(ndr, NDR_SCALARS, &r->buffers[cntr_buffers_0])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_buffers_0, 0); + } + if (ndr_flags & NDR_BUFFERS) { + _mem_save_buffers_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->buffers, 0); + for (cntr_buffers_0 = 0; cntr_buffers_0 < r->num_buffers; cntr_buffers_0++) { + NDR_CHECK(ndr_pull_PAC_BUFFER_RAW(ndr, NDR_BUFFERS, &r->buffers[cntr_buffers_0])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_buffers_0, 0); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_PAC_DATA_RAW(struct ndr_print *ndr, const char *name, const struct PAC_DATA_RAW *r) +{ + uint32_t cntr_buffers_0; + ndr_print_struct(ndr, name, "PAC_DATA_RAW"); + ndr->depth++; + ndr_print_uint32(ndr, "num_buffers", r->num_buffers); + ndr_print_uint32(ndr, "version", r->version); + ndr->print(ndr, "%s: ARRAY(%d)", "buffers", r->num_buffers); + ndr->depth++; + for (cntr_buffers_0=0;cntr_buffers_0<r->num_buffers;cntr_buffers_0++) { + char *idx_0=NULL; + if (asprintf(&idx_0, "[%d]", cntr_buffers_0) != -1) { + ndr_print_PAC_BUFFER_RAW(ndr, "buffers", &r->buffers[cntr_buffers_0]); + free(idx_0); + } + } + ndr->depth--; + ndr->depth--; +} + +_PUBLIC_ enum ndr_err_code ndr_push_netsamlogoncache_entry(struct ndr_push *ndr, int ndr_flags, const struct netsamlogoncache_entry *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_time_t(ndr, NDR_SCALARS, r->timestamp)); + NDR_CHECK(ndr_push_netr_SamInfo3(ndr, NDR_SCALARS, &r->info3)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_push_netr_SamInfo3(ndr, NDR_BUFFERS, &r->info3)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_netsamlogoncache_entry(struct ndr_pull *ndr, int ndr_flags, struct netsamlogoncache_entry *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_time_t(ndr, NDR_SCALARS, &r->timestamp)); + NDR_CHECK(ndr_pull_netr_SamInfo3(ndr, NDR_SCALARS, &r->info3)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_pull_netr_SamInfo3(ndr, NDR_BUFFERS, &r->info3)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_netsamlogoncache_entry(struct ndr_print *ndr, const char *name, const struct netsamlogoncache_entry *r) +{ + ndr_print_struct(ndr, name, "netsamlogoncache_entry"); + ndr->depth++; + ndr_print_time_t(ndr, "timestamp", r->timestamp); + ndr_print_netr_SamInfo3(ndr, "info3", &r->info3); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_decode_pac(struct ndr_push *ndr, int flags, const struct decode_pac *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_PAC_DATA(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.pac)); + } + if (flags & NDR_OUT) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_decode_pac(struct ndr_pull *ndr, int flags, struct decode_pac *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_pull_PAC_DATA(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.pac)); + } + if (flags & NDR_OUT) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_decode_pac(struct ndr_print *ndr, const char *name, int flags, const struct decode_pac *r) +{ + ndr_print_struct(ndr, name, "decode_pac"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "decode_pac"); + ndr->depth++; + ndr_print_PAC_DATA(ndr, "pac", &r->in.pac); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "decode_pac"); + ndr->depth++; + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_decode_pac_raw(struct ndr_push *ndr, int flags, const struct decode_pac_raw *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_PAC_DATA_RAW(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.pac)); + } + if (flags & NDR_OUT) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_decode_pac_raw(struct ndr_pull *ndr, int flags, struct decode_pac_raw *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_pull_PAC_DATA_RAW(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.pac)); + } + if (flags & NDR_OUT) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_decode_pac_raw(struct ndr_print *ndr, const char *name, int flags, const struct decode_pac_raw *r) +{ + ndr_print_struct(ndr, name, "decode_pac_raw"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "decode_pac_raw"); + ndr->depth++; + ndr_print_PAC_DATA_RAW(ndr, "pac", &r->in.pac); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "decode_pac_raw"); + ndr->depth++; + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_decode_login_info(struct ndr_push *ndr, int flags, const struct decode_login_info *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_PAC_LOGON_INFO(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.logon_info)); + } + if (flags & NDR_OUT) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_decode_login_info(struct ndr_pull *ndr, int flags, struct decode_login_info *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_pull_PAC_LOGON_INFO(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.logon_info)); + } + if (flags & NDR_OUT) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_decode_login_info(struct ndr_print *ndr, const char *name, int flags, const struct decode_login_info *r) +{ + ndr_print_struct(ndr, name, "decode_login_info"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "decode_login_info"); + ndr->depth++; + ndr_print_PAC_LOGON_INFO(ndr, "logon_info", &r->in.logon_info); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "decode_login_info"); + ndr->depth++; + ndr->depth--; + } + ndr->depth--; +} + +static const struct ndr_interface_call krb5pac_calls[] = { + { + "decode_pac", + sizeof(struct decode_pac), + (ndr_push_flags_fn_t) ndr_push_decode_pac, + (ndr_pull_flags_fn_t) ndr_pull_decode_pac, + (ndr_print_function_t) ndr_print_decode_pac, + false, + }, + { + "decode_pac_raw", + sizeof(struct decode_pac_raw), + (ndr_push_flags_fn_t) ndr_push_decode_pac_raw, + (ndr_pull_flags_fn_t) ndr_pull_decode_pac_raw, + (ndr_print_function_t) ndr_print_decode_pac_raw, + false, + }, + { + "decode_login_info", + sizeof(struct decode_login_info), + (ndr_push_flags_fn_t) ndr_push_decode_login_info, + (ndr_pull_flags_fn_t) ndr_pull_decode_login_info, + (ndr_print_function_t) ndr_print_decode_login_info, + false, + }, + { NULL, 0, NULL, NULL, NULL, false } +}; + +static const char * const krb5pac_endpoint_strings[] = { + "ncacn_np:[\\pipe\\krb5pac]", +}; + +static const struct ndr_interface_string_array krb5pac_endpoints = { + .count = 1, + .names = krb5pac_endpoint_strings +}; + +static const char * const krb5pac_authservice_strings[] = { + "host", +}; + +static const struct ndr_interface_string_array krb5pac_authservices = { + .count = 1, + .names = krb5pac_authservice_strings +}; + + +const struct ndr_interface_table ndr_table_krb5pac = { + .name = "krb5pac", + .syntax_id = { + {0x12345778,0x1234,0xabcd,{0x00,0x00},{0x00,0x00,0x00,0x00}}, + NDR_KRB5PAC_VERSION + }, + .helpstring = NDR_KRB5PAC_HELPSTRING, + .num_calls = 3, + .calls = krb5pac_calls, + .endpoints = &krb5pac_endpoints, + .authservices = &krb5pac_authservices +}; + diff --git a/source3/librpc/gen_ndr/ndr_krb5pac.h b/source3/librpc/gen_ndr/ndr_krb5pac.h new file mode 100644 index 0000000000..f23505d4f0 --- /dev/null +++ b/source3/librpc/gen_ndr/ndr_krb5pac.h @@ -0,0 +1,55 @@ +/* header auto-generated by pidl */ + +#include "librpc/ndr/libndr.h" +#include "librpc/gen_ndr/krb5pac.h" + +#ifndef _HEADER_NDR_krb5pac +#define _HEADER_NDR_krb5pac + +#define NDR_KRB5PAC_UUID "12345778-1234-abcd-0000-00000000" +#define NDR_KRB5PAC_VERSION 0.0 +#define NDR_KRB5PAC_NAME "krb5pac" +#define NDR_KRB5PAC_HELPSTRING "Active Directory KRB5 PAC" +extern const struct ndr_interface_table ndr_table_krb5pac; +#define NDR_DECODE_PAC (0x00) + +#define NDR_DECODE_PAC_RAW (0x01) + +#define NDR_DECODE_LOGIN_INFO (0x02) + +#define NDR_KRB5PAC_CALL_COUNT (3) +void ndr_print_PAC_LOGON_NAME(struct ndr_print *ndr, const char *name, const struct PAC_LOGON_NAME *r); +enum ndr_err_code ndr_push_PAC_SIGNATURE_DATA(struct ndr_push *ndr, int ndr_flags, const struct PAC_SIGNATURE_DATA *r); +enum ndr_err_code ndr_pull_PAC_SIGNATURE_DATA(struct ndr_pull *ndr, int ndr_flags, struct PAC_SIGNATURE_DATA *r); +void ndr_print_PAC_SIGNATURE_DATA(struct ndr_print *ndr, const char *name, const struct PAC_SIGNATURE_DATA *r); +void ndr_print_PAC_LOGON_INFO(struct ndr_print *ndr, const char *name, const struct PAC_LOGON_INFO *r); +enum ndr_err_code ndr_push_PAC_LOGON_INFO_CTR(struct ndr_push *ndr, int ndr_flags, const struct PAC_LOGON_INFO_CTR *r); +enum ndr_err_code ndr_pull_PAC_LOGON_INFO_CTR(struct ndr_pull *ndr, int ndr_flags, struct PAC_LOGON_INFO_CTR *r); +void ndr_print_PAC_LOGON_INFO_CTR(struct ndr_print *ndr, const char *name, const struct PAC_LOGON_INFO_CTR *r); +enum ndr_err_code ndr_push_PAC_TYPE(struct ndr_push *ndr, int ndr_flags, enum PAC_TYPE r); +enum ndr_err_code ndr_pull_PAC_TYPE(struct ndr_pull *ndr, int ndr_flags, enum PAC_TYPE *r); +void ndr_print_PAC_TYPE(struct ndr_print *ndr, const char *name, enum PAC_TYPE r); +enum ndr_err_code ndr_push_PAC_INFO(struct ndr_push *ndr, int ndr_flags, const union PAC_INFO *r); +enum ndr_err_code ndr_pull_PAC_INFO(struct ndr_pull *ndr, int ndr_flags, union PAC_INFO *r); +void ndr_print_PAC_INFO(struct ndr_print *ndr, const char *name, const union PAC_INFO *r); +size_t ndr_size_PAC_INFO(const union PAC_INFO *r, uint32_t level, int flags); +enum ndr_err_code ndr_push_PAC_BUFFER(struct ndr_push *ndr, int ndr_flags, const struct PAC_BUFFER *r); +enum ndr_err_code ndr_pull_PAC_BUFFER(struct ndr_pull *ndr, int ndr_flags, struct PAC_BUFFER *r); +void ndr_print_PAC_BUFFER(struct ndr_print *ndr, const char *name, const struct PAC_BUFFER *r); +enum ndr_err_code ndr_push_PAC_DATA(struct ndr_push *ndr, int ndr_flags, const struct PAC_DATA *r); +enum ndr_err_code ndr_pull_PAC_DATA(struct ndr_pull *ndr, int ndr_flags, struct PAC_DATA *r); +void ndr_print_PAC_DATA(struct ndr_print *ndr, const char *name, const struct PAC_DATA *r); +void ndr_print_DATA_BLOB_REM(struct ndr_print *ndr, const char *name, const struct DATA_BLOB_REM *r); +enum ndr_err_code ndr_push_PAC_BUFFER_RAW(struct ndr_push *ndr, int ndr_flags, const struct PAC_BUFFER_RAW *r); +enum ndr_err_code ndr_pull_PAC_BUFFER_RAW(struct ndr_pull *ndr, int ndr_flags, struct PAC_BUFFER_RAW *r); +void ndr_print_PAC_BUFFER_RAW(struct ndr_print *ndr, const char *name, const struct PAC_BUFFER_RAW *r); +enum ndr_err_code ndr_push_PAC_DATA_RAW(struct ndr_push *ndr, int ndr_flags, const struct PAC_DATA_RAW *r); +enum ndr_err_code ndr_pull_PAC_DATA_RAW(struct ndr_pull *ndr, int ndr_flags, struct PAC_DATA_RAW *r); +void ndr_print_PAC_DATA_RAW(struct ndr_print *ndr, const char *name, const struct PAC_DATA_RAW *r); +enum ndr_err_code ndr_push_netsamlogoncache_entry(struct ndr_push *ndr, int ndr_flags, const struct netsamlogoncache_entry *r); +enum ndr_err_code ndr_pull_netsamlogoncache_entry(struct ndr_pull *ndr, int ndr_flags, struct netsamlogoncache_entry *r); +void ndr_print_netsamlogoncache_entry(struct ndr_print *ndr, const char *name, const struct netsamlogoncache_entry *r); +void ndr_print_decode_pac(struct ndr_print *ndr, const char *name, int flags, const struct decode_pac *r); +void ndr_print_decode_pac_raw(struct ndr_print *ndr, const char *name, int flags, const struct decode_pac_raw *r); +void ndr_print_decode_login_info(struct ndr_print *ndr, const char *name, int flags, const struct decode_login_info *r); +#endif /* _HEADER_NDR_krb5pac */ diff --git a/source3/librpc/gen_ndr/ndr_libnet_join.c b/source3/librpc/gen_ndr/ndr_libnet_join.c index 5345bc0ad4..6e65d03977 100644 --- a/source3/librpc/gen_ndr/ndr_libnet_join.c +++ b/source3/librpc/gen_ndr/ndr_libnet_join.c @@ -95,6 +95,8 @@ _PUBLIC_ void ndr_print_libnet_UnjoinCtx(struct ndr_print *ndr, const char *name ndr_print_string(ndr, "dns_domain_name", r->out.dns_domain_name); ndr_print_uint8(ndr, "modified_config", r->out.modified_config); ndr_print_string(ndr, "error_string", r->out.error_string); + ndr_print_uint8(ndr, "disabled_machine_account", r->out.disabled_machine_account); + ndr_print_uint8(ndr, "deleted_machine_account", r->out.deleted_machine_account); ndr_print_WERROR(ndr, "result", r->out.result); ndr->depth--; } diff --git a/source3/librpc/gen_ndr/ndr_libnet_join.h b/source3/librpc/gen_ndr/ndr_libnet_join.h index 4a5fdf0d50..14c8a863aa 100644 --- a/source3/librpc/gen_ndr/ndr_libnet_join.h +++ b/source3/librpc/gen_ndr/ndr_libnet_join.h @@ -6,11 +6,7 @@ #ifndef _HEADER_NDR_libnetjoin #define _HEADER_NDR_libnetjoin -#define NDR_LIBNET_JOINCTX (0x00) - -#define NDR_LIBNET_UNJOINCTX (0x01) - -#define NDR_LIBNETJOIN_CALL_COUNT (2) +#define NDR_LIBNETJOIN_CALL_COUNT (0) enum ndr_err_code ndr_push_libnet_JoinCtx(struct ndr_push *ndr, int flags, const struct libnet_JoinCtx *r); enum ndr_err_code ndr_pull_libnet_JoinCtx(struct ndr_pull *ndr, int flags, struct libnet_JoinCtx *r); void ndr_print_libnet_JoinCtx(struct ndr_print *ndr, const char *name, int flags, const struct libnet_JoinCtx *r); diff --git a/source3/librpc/gen_ndr/ndr_lsa.c b/source3/librpc/gen_ndr/ndr_lsa.c index eed2a8e0e3..03e1c21e55 100644 --- a/source3/librpc/gen_ndr/ndr_lsa.c +++ b/source3/librpc/gen_ndr/ndr_lsa.c @@ -80,12 +80,12 @@ _PUBLIC_ enum ndr_err_code ndr_push_lsa_StringLarge(struct ndr_push *ndr, int nd if (ndr_flags & NDR_SCALARS) { NDR_CHECK(ndr_push_align(ndr, 4)); NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, 2 * strlen_m(r->string))); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, 2 * (strlen_m(r->string) + 1))); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, 2 * strlen_m_term(r->string))); NDR_CHECK(ndr_push_unique_ptr(ndr, r->string)); } if (ndr_flags & NDR_BUFFERS) { if (r->string) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 2 * (strlen_m(r->string) + 1) / 2)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 2 * strlen_m_term(r->string) / 2)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 2 * strlen_m(r->string) / 2)); NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->string, 2 * strlen_m(r->string) / 2, sizeof(uint16_t), CH_UTF16)); @@ -136,7 +136,7 @@ _PUBLIC_ void ndr_print_lsa_StringLarge(struct ndr_print *ndr, const char *name, ndr_print_struct(ndr, name, "lsa_StringLarge"); ndr->depth++; ndr_print_uint16(ndr, "length", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?2 * strlen_m(r->string):r->length); - ndr_print_uint16(ndr, "size", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?2 * (strlen_m(r->string) + 1):r->size); + ndr_print_uint16(ndr, "size", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?2 * strlen_m_term(r->string):r->size); ndr_print_ptr(ndr, "string", r->string); ndr->depth++; if (r->string) { @@ -221,8 +221,7 @@ _PUBLIC_ void ndr_print_lsa_Strings(struct ndr_print *ndr, const char *name, con ndr->depth++; for (cntr_names_1=0;cntr_names_1<r->count;cntr_names_1++) { char *idx_1=NULL; - asprintf(&idx_1, "[%d]", cntr_names_1); - if (idx_1) { + if (asprintf(&idx_1, "[%d]", cntr_names_1) != -1) { ndr_print_lsa_String(ndr, "names", &r->names[cntr_names_1]); free(idx_1); } @@ -239,21 +238,14 @@ _PUBLIC_ enum ndr_err_code ndr_push_lsa_AsciiString(struct ndr_push *ndr, int nd NDR_CHECK(ndr_push_align(ndr, 4)); NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, strlen_m(r->string))); NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, strlen_m(r->string))); - { - uint32_t _flags_save_string = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NOTERM|LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_SIZE4|LIBNDR_FLAG_STR_LEN4); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->string)); - ndr->flags = _flags_save_string; - } + NDR_CHECK(ndr_push_unique_ptr(ndr, r->string)); } if (ndr_flags & NDR_BUFFERS) { - { - uint32_t _flags_save_string = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NOTERM|LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_SIZE4|LIBNDR_FLAG_STR_LEN4); - if (r->string) { - NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->string)); - } - ndr->flags = _flags_save_string; + if (r->string) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, strlen_m(r->string))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, strlen_m(r->string))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->string, strlen_m(r->string), sizeof(uint8_t), CH_DOS)); } } return NDR_ERR_SUCCESS; @@ -267,29 +259,30 @@ _PUBLIC_ enum ndr_err_code ndr_pull_lsa_AsciiString(struct ndr_pull *ndr, int nd NDR_CHECK(ndr_pull_align(ndr, 4)); NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->length)); NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->size)); - { - uint32_t _flags_save_string = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NOTERM|LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_SIZE4|LIBNDR_FLAG_STR_LEN4); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_string)); - if (_ptr_string) { - NDR_PULL_ALLOC(ndr, r->string); - } else { - r->string = NULL; - } - ndr->flags = _flags_save_string; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_string)); + if (_ptr_string) { + NDR_PULL_ALLOC(ndr, r->string); + } else { + r->string = NULL; } } if (ndr_flags & NDR_BUFFERS) { - { - uint32_t _flags_save_string = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NOTERM|LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_SIZE4|LIBNDR_FLAG_STR_LEN4); - if (r->string) { - _mem_save_string_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->string, 0); - NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->string)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_string_0, 0); + if (r->string) { + _mem_save_string_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->string, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->string)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->string)); + if (ndr_get_array_length(ndr, &r->string) > ndr_get_array_size(ndr, &r->string)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->string), ndr_get_array_length(ndr, &r->string)); } - ndr->flags = _flags_save_string; + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->string, ndr_get_array_length(ndr, &r->string), sizeof(uint8_t), CH_DOS)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_string_0, 0); + } + if (r->string) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->string, r->size)); + } + if (r->string) { + NDR_CHECK(ndr_check_array_length(ndr, (void*)&r->string, r->length)); } } return NDR_ERR_SUCCESS; @@ -310,6 +303,77 @@ _PUBLIC_ void ndr_print_lsa_AsciiString(struct ndr_print *ndr, const char *name, ndr->depth--; } +_PUBLIC_ enum ndr_err_code ndr_push_lsa_AsciiStringLarge(struct ndr_push *ndr, int ndr_flags, const struct lsa_AsciiStringLarge *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, strlen_m(r->string))); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, strlen_m_term(r->string))); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->string)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->string) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, strlen_m_term(r->string))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, strlen_m(r->string))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->string, strlen_m(r->string), sizeof(uint8_t), CH_DOS)); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_lsa_AsciiStringLarge(struct ndr_pull *ndr, int ndr_flags, struct lsa_AsciiStringLarge *r) +{ + uint32_t _ptr_string; + TALLOC_CTX *_mem_save_string_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->length)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->size)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_string)); + if (_ptr_string) { + NDR_PULL_ALLOC(ndr, r->string); + } else { + r->string = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->string) { + _mem_save_string_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->string, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->string)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->string)); + if (ndr_get_array_length(ndr, &r->string) > ndr_get_array_size(ndr, &r->string)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->string), ndr_get_array_length(ndr, &r->string)); + } + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->string, ndr_get_array_length(ndr, &r->string), sizeof(uint8_t), CH_DOS)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_string_0, 0); + } + if (r->string) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->string, r->size)); + } + if (r->string) { + NDR_CHECK(ndr_check_array_length(ndr, (void*)&r->string, r->length)); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_lsa_AsciiStringLarge(struct ndr_print *ndr, const char *name, const struct lsa_AsciiStringLarge *r) +{ + ndr_print_struct(ndr, name, "lsa_AsciiStringLarge"); + ndr->depth++; + ndr_print_uint16(ndr, "length", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?strlen_m(r->string):r->length); + ndr_print_uint16(ndr, "size", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?strlen_m_term(r->string):r->size); + ndr_print_ptr(ndr, "string", r->string); + ndr->depth++; + if (r->string) { + ndr_print_string(ndr, "string", r->string); + } + ndr->depth--; + ndr->depth--; +} + static enum ndr_err_code ndr_push_lsa_LUID(struct ndr_push *ndr, int ndr_flags, const struct lsa_LUID *r) { if (ndr_flags & NDR_SCALARS) { @@ -453,8 +517,7 @@ _PUBLIC_ void ndr_print_lsa_PrivArray(struct ndr_print *ndr, const char *name, c ndr->depth++; for (cntr_privs_1=0;cntr_privs_1<r->count;cntr_privs_1++) { char *idx_1=NULL; - asprintf(&idx_1, "[%d]", cntr_privs_1); - if (idx_1) { + if (asprintf(&idx_1, "[%d]", cntr_privs_1) != -1) { ndr_print_lsa_PrivEntry(ndr, "privs", &r->privs[cntr_privs_1]); free(idx_1); } @@ -642,6 +705,39 @@ _PUBLIC_ void ndr_print_lsa_ObjectAttribute(struct ndr_print *ndr, const char *n ndr->depth--; } +_PUBLIC_ enum ndr_err_code ndr_push_lsa_PolicyAccessMask(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_lsa_PolicyAccessMask(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_lsa_PolicyAccessMask(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), "LSA_POLICY_VIEW_LOCAL_INFORMATION", LSA_POLICY_VIEW_LOCAL_INFORMATION, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "LSA_POLICY_VIEW_AUDIT_INFORMATION", LSA_POLICY_VIEW_AUDIT_INFORMATION, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "LSA_POLICY_GET_PRIVATE_INFORMATION", LSA_POLICY_GET_PRIVATE_INFORMATION, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "LSA_POLICY_TRUST_ADMIN", LSA_POLICY_TRUST_ADMIN, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "LSA_POLICY_CREATE_ACCOUNT", LSA_POLICY_CREATE_ACCOUNT, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "LSA_POLICY_CREATE_SECRET", LSA_POLICY_CREATE_SECRET, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "LSA_POLICY_CREATE_PRIVILEGE", LSA_POLICY_CREATE_PRIVILEGE, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "LSA_POLICY_SET_DEFAULT_QUOTA_LIMITS", LSA_POLICY_SET_DEFAULT_QUOTA_LIMITS, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "LSA_POLICY_SET_AUDIT_REQUIREMENTS", LSA_POLICY_SET_AUDIT_REQUIREMENTS, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "LSA_POLICY_AUDIT_LOG_ADMIN", LSA_POLICY_AUDIT_LOG_ADMIN, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "LSA_POLICY_SERVER_ADMIN", LSA_POLICY_SERVER_ADMIN, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "LSA_POLICY_LOOKUP_NAMES", LSA_POLICY_LOOKUP_NAMES, r); + ndr->depth--; +} + static enum ndr_err_code ndr_push_lsa_AuditLogInfo(struct ndr_push *ndr, int ndr_flags, const struct lsa_AuditLogInfo *r) { if (ndr_flags & NDR_SCALARS) { @@ -690,6 +786,34 @@ _PUBLIC_ void ndr_print_lsa_AuditLogInfo(struct ndr_print *ndr, const char *name ndr->depth--; } +static enum ndr_err_code ndr_push_lsa_PolicyAuditPolicy(struct ndr_push *ndr, int ndr_flags, enum lsa_PolicyAuditPolicy r) +{ + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_lsa_PolicyAuditPolicy(struct ndr_pull *ndr, int ndr_flags, enum lsa_PolicyAuditPolicy *r) +{ + uint32_t v; + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); + *r = v; + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_lsa_PolicyAuditPolicy(struct ndr_print *ndr, const char *name, enum lsa_PolicyAuditPolicy r) +{ + const char *val = NULL; + + switch (r) { + case LSA_AUDIT_POLICY_NONE: val = "LSA_AUDIT_POLICY_NONE"; break; + case LSA_AUDIT_POLICY_SUCCESS: val = "LSA_AUDIT_POLICY_SUCCESS"; break; + case LSA_AUDIT_POLICY_FAILURE: val = "LSA_AUDIT_POLICY_FAILURE"; break; + case LSA_AUDIT_POLICY_ALL: val = "LSA_AUDIT_POLICY_ALL"; break; + case LSA_AUDIT_POLICY_CLEAR: val = "LSA_AUDIT_POLICY_CLEAR"; break; + } + ndr_print_enum(ndr, name, "ENUM", val, r); +} + static enum ndr_err_code ndr_push_lsa_AuditEventsInfo(struct ndr_push *ndr, int ndr_flags, const struct lsa_AuditEventsInfo *r) { uint32_t cntr_settings_1; @@ -703,7 +827,7 @@ static enum ndr_err_code ndr_push_lsa_AuditEventsInfo(struct ndr_push *ndr, int if (r->settings) { NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); for (cntr_settings_1 = 0; cntr_settings_1 < r->count; cntr_settings_1++) { - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->settings[cntr_settings_1])); + NDR_CHECK(ndr_push_lsa_PolicyAuditPolicy(ndr, NDR_SCALARS, r->settings[cntr_settings_1])); } } } @@ -736,7 +860,7 @@ static enum ndr_err_code ndr_pull_lsa_AuditEventsInfo(struct ndr_pull *ndr, int _mem_save_settings_1 = NDR_PULL_GET_MEM_CTX(ndr); NDR_PULL_SET_MEM_CTX(ndr, r->settings, 0); for (cntr_settings_1 = 0; cntr_settings_1 < r->count; cntr_settings_1++) { - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->settings[cntr_settings_1])); + NDR_CHECK(ndr_pull_lsa_PolicyAuditPolicy(ndr, NDR_SCALARS, &r->settings[cntr_settings_1])); } NDR_PULL_SET_MEM_CTX(ndr, _mem_save_settings_1, 0); NDR_PULL_SET_MEM_CTX(ndr, _mem_save_settings_0, 0); @@ -761,9 +885,8 @@ _PUBLIC_ void ndr_print_lsa_AuditEventsInfo(struct ndr_print *ndr, const char *n ndr->depth++; for (cntr_settings_1=0;cntr_settings_1<r->count;cntr_settings_1++) { char *idx_1=NULL; - asprintf(&idx_1, "[%d]", cntr_settings_1); - if (idx_1) { - ndr_print_uint32(ndr, "settings", r->settings[cntr_settings_1]); + if (asprintf(&idx_1, "[%d]", cntr_settings_1) != -1) { + ndr_print_lsa_PolicyAuditPolicy(ndr, "settings", r->settings[cntr_settings_1]); free(idx_1); } } @@ -1188,53 +1311,53 @@ static enum ndr_err_code ndr_push_lsa_PolicyInformation(struct ndr_push *ndr, in int level = ndr_push_get_switch_value(ndr, r); NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, level)); switch (level) { - case LSA_POLICY_INFO_AUDIT_LOG: + case LSA_POLICY_INFO_AUDIT_LOG: { NDR_CHECK(ndr_push_lsa_AuditLogInfo(ndr, NDR_SCALARS, &r->audit_log)); - break; + break; } - case LSA_POLICY_INFO_AUDIT_EVENTS: + case LSA_POLICY_INFO_AUDIT_EVENTS: { NDR_CHECK(ndr_push_lsa_AuditEventsInfo(ndr, NDR_SCALARS, &r->audit_events)); - break; + break; } - case LSA_POLICY_INFO_DOMAIN: + case LSA_POLICY_INFO_DOMAIN: { NDR_CHECK(ndr_push_lsa_DomainInfo(ndr, NDR_SCALARS, &r->domain)); - break; + break; } - case LSA_POLICY_INFO_PD: + case LSA_POLICY_INFO_PD: { NDR_CHECK(ndr_push_lsa_PDAccountInfo(ndr, NDR_SCALARS, &r->pd)); - break; + break; } - case LSA_POLICY_INFO_ACCOUNT_DOMAIN: + case LSA_POLICY_INFO_ACCOUNT_DOMAIN: { NDR_CHECK(ndr_push_lsa_DomainInfo(ndr, NDR_SCALARS, &r->account_domain)); - break; + break; } - case LSA_POLICY_INFO_ROLE: + case LSA_POLICY_INFO_ROLE: { NDR_CHECK(ndr_push_lsa_ServerRole(ndr, NDR_SCALARS, &r->role)); - break; + break; } - case LSA_POLICY_INFO_REPLICA: + case LSA_POLICY_INFO_REPLICA: { NDR_CHECK(ndr_push_lsa_ReplicaSourceInfo(ndr, NDR_SCALARS, &r->replica)); - break; + break; } - case LSA_POLICY_INFO_QUOTA: + case LSA_POLICY_INFO_QUOTA: { NDR_CHECK(ndr_push_lsa_DefaultQuotaInfo(ndr, NDR_SCALARS, &r->quota)); - break; + break; } - case LSA_POLICY_INFO_DB: + case LSA_POLICY_INFO_DB: { NDR_CHECK(ndr_push_lsa_ModificationInfo(ndr, NDR_SCALARS, &r->db)); - break; + break; } - case LSA_POLICY_INFO_AUDIT_FULL_SET: + case LSA_POLICY_INFO_AUDIT_FULL_SET: { NDR_CHECK(ndr_push_lsa_AuditFullSetInfo(ndr, NDR_SCALARS, &r->auditfullset)); - break; + break; } - case LSA_POLICY_INFO_AUDIT_FULL_QUERY: + case LSA_POLICY_INFO_AUDIT_FULL_QUERY: { NDR_CHECK(ndr_push_lsa_AuditFullQueryInfo(ndr, NDR_SCALARS, &r->auditfullquery)); - break; + break; } - case LSA_POLICY_INFO_DNS: + case LSA_POLICY_INFO_DNS: { NDR_CHECK(ndr_push_lsa_DnsDomainInfo(ndr, NDR_SCALARS, &r->dns)); - break; + break; } default: return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); @@ -1594,8 +1717,7 @@ _PUBLIC_ void ndr_print_lsa_SidArray(struct ndr_print *ndr, const char *name, co ndr->depth++; for (cntr_sids_1=0;cntr_sids_1<r->num_sids;cntr_sids_1++) { char *idx_1=NULL; - asprintf(&idx_1, "[%d]", cntr_sids_1); - if (idx_1) { + if (asprintf(&idx_1, "[%d]", cntr_sids_1) != -1) { ndr_print_lsa_SidPtr(ndr, "sids", &r->sids[cntr_sids_1]); free(idx_1); } @@ -1681,8 +1803,7 @@ _PUBLIC_ void ndr_print_lsa_DomainList(struct ndr_print *ndr, const char *name, ndr->depth++; for (cntr_domains_1=0;cntr_domains_1<r->count;cntr_domains_1++) { char *idx_1=NULL; - asprintf(&idx_1, "[%d]", cntr_domains_1); - if (idx_1) { + if (asprintf(&idx_1, "[%d]", cntr_domains_1) != -1) { ndr_print_lsa_DomainInfo(ndr, "domains", &r->domains[cntr_domains_1]); free(idx_1); } @@ -1834,8 +1955,7 @@ _PUBLIC_ void ndr_print_lsa_TransSidArray(struct ndr_print *ndr, const char *nam ndr->depth++; for (cntr_sids_1=0;cntr_sids_1<r->count;cntr_sids_1++) { char *idx_1=NULL; - asprintf(&idx_1, "[%d]", cntr_sids_1); - if (idx_1) { + if (asprintf(&idx_1, "[%d]", cntr_sids_1) != -1) { ndr_print_lsa_TranslatedSid(ndr, "sids", &r->sids[cntr_sids_1]); free(idx_1); } @@ -1926,8 +2046,7 @@ _PUBLIC_ void ndr_print_lsa_RefDomainList(struct ndr_print *ndr, const char *nam ndr->depth++; for (cntr_domains_1=0;cntr_domains_1<r->count;cntr_domains_1++) { char *idx_1=NULL; - asprintf(&idx_1, "[%d]", cntr_domains_1); - if (idx_1) { + if (asprintf(&idx_1, "[%d]", cntr_domains_1) != -1) { ndr_print_lsa_DomainInfo(ndr, "domains", &r->domains[cntr_domains_1]); free(idx_1); } @@ -1939,6 +2058,35 @@ _PUBLIC_ void ndr_print_lsa_RefDomainList(struct ndr_print *ndr, const char *nam ndr->depth--; } +static enum ndr_err_code ndr_push_lsa_LookupNamesLevel(struct ndr_push *ndr, int ndr_flags, enum lsa_LookupNamesLevel r) +{ + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r)); + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_lsa_LookupNamesLevel(struct ndr_pull *ndr, int ndr_flags, enum lsa_LookupNamesLevel *r) +{ + uint16_t v; + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &v)); + *r = v; + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_lsa_LookupNamesLevel(struct ndr_print *ndr, const char *name, enum lsa_LookupNamesLevel r) +{ + const char *val = NULL; + + switch (r) { + case LSA_LOOKUP_NAMES_ALL: val = "LSA_LOOKUP_NAMES_ALL"; break; + case LSA_LOOKUP_NAMES_DOMAINS_ONLY: val = "LSA_LOOKUP_NAMES_DOMAINS_ONLY"; break; + case LSA_LOOKUP_NAMES_PRIMARY_DOMAIN_ONLY: val = "LSA_LOOKUP_NAMES_PRIMARY_DOMAIN_ONLY"; break; + case LSA_LOOKUP_NAMES_UPLEVEL_TRUSTS_ONLY: val = "LSA_LOOKUP_NAMES_UPLEVEL_TRUSTS_ONLY"; break; + case LSA_LOOKUP_NAMES_FOREST_TRUSTS_ONLY: val = "LSA_LOOKUP_NAMES_FOREST_TRUSTS_ONLY"; break; + case LSA_LOOKUP_NAMES_UPLEVEL_TRUSTS_ONLY2: val = "LSA_LOOKUP_NAMES_UPLEVEL_TRUSTS_ONLY2"; break; + } + ndr_print_enum(ndr, name, "ENUM", val, r); +} + static enum ndr_err_code ndr_push_lsa_TranslatedName(struct ndr_push *ndr, int ndr_flags, const struct lsa_TranslatedName *r) { if (ndr_flags & NDR_SCALARS) { @@ -2055,8 +2203,7 @@ _PUBLIC_ void ndr_print_lsa_TransNameArray(struct ndr_print *ndr, const char *na ndr->depth++; for (cntr_names_1=0;cntr_names_1<r->count;cntr_names_1++) { char *idx_1=NULL; - asprintf(&idx_1, "[%d]", cntr_names_1); - if (idx_1) { + if (asprintf(&idx_1, "[%d]", cntr_names_1) != -1) { ndr_print_lsa_TranslatedName(ndr, "names", &r->names[cntr_names_1]); free(idx_1); } @@ -2156,8 +2303,7 @@ _PUBLIC_ void ndr_print_lsa_PrivilegeSet(struct ndr_print *ndr, const char *name ndr->depth++; for (cntr_set_0=0;cntr_set_0<r->count;cntr_set_0++) { char *idx_0=NULL; - asprintf(&idx_0, "[%d]", cntr_set_0); - if (idx_0) { + if (asprintf(&idx_0, "[%d]", cntr_set_0) != -1) { ndr_print_lsa_LUIDAttribute(ndr, "set", &r->set[cntr_set_0]); free(idx_0); } @@ -2922,41 +3068,41 @@ static enum ndr_err_code ndr_push_lsa_TrustedDomainInfo(struct ndr_push *ndr, in int level = ndr_push_get_switch_value(ndr, r); NDR_CHECK(ndr_push_lsa_TrustDomInfoEnum(ndr, NDR_SCALARS, level)); switch (level) { - case LSA_TRUSTED_DOMAIN_INFO_NAME: + case LSA_TRUSTED_DOMAIN_INFO_NAME: { NDR_CHECK(ndr_push_lsa_TrustDomainInfoName(ndr, NDR_SCALARS, &r->name)); - break; + break; } - case LSA_TRUSTED_DOMAIN_INFO_POSIX_OFFSET: + case LSA_TRUSTED_DOMAIN_INFO_POSIX_OFFSET: { NDR_CHECK(ndr_push_lsa_TrustDomainInfoPosixOffset(ndr, NDR_SCALARS, &r->posix_offset)); - break; + break; } - case LSA_TRUSTED_DOMAIN_INFO_PASSWORD: + case LSA_TRUSTED_DOMAIN_INFO_PASSWORD: { NDR_CHECK(ndr_push_lsa_TrustDomainInfoPassword(ndr, NDR_SCALARS, &r->password)); - break; + break; } - case LSA_TRUSTED_DOMAIN_INFO_BASIC: + case LSA_TRUSTED_DOMAIN_INFO_BASIC: { NDR_CHECK(ndr_push_lsa_TrustDomainInfoBasic(ndr, NDR_SCALARS, &r->info_basic)); - break; + break; } - case LSA_TRUSTED_DOMAIN_INFO_INFO_EX: + case LSA_TRUSTED_DOMAIN_INFO_INFO_EX: { NDR_CHECK(ndr_push_lsa_TrustDomainInfoInfoEx(ndr, NDR_SCALARS, &r->info_ex)); - break; + break; } - case LSA_TRUSTED_DOMAIN_INFO_AUTH_INFO: + case LSA_TRUSTED_DOMAIN_INFO_AUTH_INFO: { NDR_CHECK(ndr_push_lsa_TrustDomainInfoAuthInfo(ndr, NDR_SCALARS, &r->auth_info)); - break; + break; } - case LSA_TRUSTED_DOMAIN_INFO_FULL_INFO: + case LSA_TRUSTED_DOMAIN_INFO_FULL_INFO: { NDR_CHECK(ndr_push_lsa_TrustDomainInfoFullInfo(ndr, NDR_SCALARS, &r->full_info)); - break; + break; } - case LSA_TRUSTED_DOMAIN_INFO_11: + case LSA_TRUSTED_DOMAIN_INFO_11: { NDR_CHECK(ndr_push_lsa_TrustDomainInfo11(ndr, NDR_SCALARS, &r->info11)); - break; + break; } - case LSA_TRUSTED_DOMAIN_INFO_INFO_ALL: + case LSA_TRUSTED_DOMAIN_INFO_INFO_ALL: { NDR_CHECK(ndr_push_lsa_TrustDomainInfoInfoAll(ndr, NDR_SCALARS, &r->info_all)); - break; + break; } default: return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); @@ -3231,6 +3377,9 @@ static enum ndr_err_code ndr_pull_lsa_RightSet(struct ndr_pull *ndr, int ndr_fla 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 > 256) { + return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range"); + } NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_names)); if (_ptr_names) { NDR_PULL_ALLOC(ndr, r->names); @@ -3275,8 +3424,7 @@ _PUBLIC_ void ndr_print_lsa_RightSet(struct ndr_print *ndr, const char *name, co ndr->depth++; for (cntr_names_1=0;cntr_names_1<r->count;cntr_names_1++) { char *idx_1=NULL; - asprintf(&idx_1, "[%d]", cntr_names_1); - if (idx_1) { + if (asprintf(&idx_1, "[%d]", cntr_names_1) != -1) { ndr_print_lsa_StringLarge(ndr, "names", &r->names[cntr_names_1]); free(idx_1); } @@ -3287,57 +3435,6 @@ _PUBLIC_ void ndr_print_lsa_RightSet(struct ndr_print *ndr, const char *name, co ndr->depth--; } -static enum ndr_err_code ndr_push_lsa_StringPointer(struct ndr_push *ndr, int ndr_flags, const struct lsa_StringPointer *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->string)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->string) { - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS|NDR_BUFFERS, r->string)); - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_lsa_StringPointer(struct ndr_pull *ndr, int ndr_flags, struct lsa_StringPointer *r) -{ - uint32_t _ptr_string; - TALLOC_CTX *_mem_save_string_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_string)); - if (_ptr_string) { - NDR_PULL_ALLOC(ndr, r->string); - } else { - r->string = NULL; - } - } - if (ndr_flags & NDR_BUFFERS) { - if (r->string) { - _mem_save_string_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->string, 0); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS|NDR_BUFFERS, r->string)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_string_0, 0); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_lsa_StringPointer(struct ndr_print *ndr, const char *name, const struct lsa_StringPointer *r) -{ - ndr_print_struct(ndr, name, "lsa_StringPointer"); - ndr->depth++; - ndr_print_ptr(ndr, "string", r->string); - ndr->depth++; - if (r->string) { - ndr_print_lsa_String(ndr, "string", r->string); - } - ndr->depth--; - ndr->depth--; -} - static enum ndr_err_code ndr_push_lsa_DomainListEx(struct ndr_push *ndr, int ndr_flags, const struct lsa_DomainListEx *r) { uint32_t cntr_domains_1; @@ -3413,8 +3510,7 @@ _PUBLIC_ void ndr_print_lsa_DomainListEx(struct ndr_print *ndr, const char *name ndr->depth++; for (cntr_domains_1=0;cntr_domains_1<r->count;cntr_domains_1++) { char *idx_1=NULL; - asprintf(&idx_1, "[%d]", cntr_domains_1); - if (idx_1) { + if (asprintf(&idx_1, "[%d]", cntr_domains_1) != -1) { ndr_print_lsa_TrustDomainInfoInfoEx(ndr, "domains", &r->domains[cntr_domains_1]); free(idx_1); } @@ -3536,13 +3632,13 @@ static enum ndr_err_code ndr_push_lsa_DomainInformationPolicy(struct ndr_push *n int level = ndr_push_get_switch_value(ndr, r); NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, level)); switch (level) { - case LSA_DOMAIN_INFO_POLICY_EFS: + case LSA_DOMAIN_INFO_POLICY_EFS: { NDR_CHECK(ndr_push_lsa_DomainInfoEfs(ndr, NDR_SCALARS, &r->efs_info)); - break; + break; } - case LSA_DOMAIN_INFO_POLICY_KERBEROS: + case LSA_DOMAIN_INFO_POLICY_KERBEROS: { NDR_CHECK(ndr_push_lsa_DomainInfoKerberos(ndr, NDR_SCALARS, &r->kerberos_info)); - break; + break; } default: return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); @@ -3742,8 +3838,7 @@ _PUBLIC_ void ndr_print_lsa_TransNameArray2(struct ndr_print *ndr, const char *n ndr->depth++; for (cntr_names_1=0;cntr_names_1<r->count;cntr_names_1++) { char *idx_1=NULL; - asprintf(&idx_1, "[%d]", cntr_names_1); - if (idx_1) { + if (asprintf(&idx_1, "[%d]", cntr_names_1) != -1) { ndr_print_lsa_TranslatedName2(ndr, "names", &r->names[cntr_names_1]); free(idx_1); } @@ -3865,8 +3960,7 @@ _PUBLIC_ void ndr_print_lsa_TransSidArray2(struct ndr_print *ndr, const char *na ndr->depth++; for (cntr_sids_1=0;cntr_sids_1<r->count;cntr_sids_1++) { char *idx_1=NULL; - asprintf(&idx_1, "[%d]", cntr_sids_1); - if (idx_1) { + if (asprintf(&idx_1, "[%d]", cntr_sids_1) != -1) { ndr_print_lsa_TranslatedSid2(ndr, "sids", &r->sids[cntr_sids_1]); free(idx_1); } @@ -4015,8 +4109,7 @@ _PUBLIC_ void ndr_print_lsa_TransSidArray3(struct ndr_print *ndr, const char *na ndr->depth++; for (cntr_sids_1=0;cntr_sids_1<r->count;cntr_sids_1++) { char *idx_1=NULL; - asprintf(&idx_1, "[%d]", cntr_sids_1); - if (idx_1) { + if (asprintf(&idx_1, "[%d]", cntr_sids_1) != -1) { ndr_print_lsa_TranslatedSid3(ndr, "sids", &r->sids[cntr_sids_1]); free(idx_1); } @@ -4027,6 +4120,433 @@ _PUBLIC_ void ndr_print_lsa_TransSidArray3(struct ndr_print *ndr, const char *na ndr->depth--; } +static enum ndr_err_code ndr_push_lsa_ForestTrustBinaryData(struct ndr_push *ndr, int ndr_flags, const struct lsa_ForestTrustBinaryData *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_lsa_ForestTrustBinaryData(struct ndr_pull *ndr, int ndr_flags, struct lsa_ForestTrustBinaryData *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)); + if (r->length < 0 || r->length > 131072) { + return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range"); + } + 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_lsa_ForestTrustBinaryData(struct ndr_print *ndr, const char *name, const struct lsa_ForestTrustBinaryData *r) +{ + ndr_print_struct(ndr, name, "lsa_ForestTrustBinaryData"); + 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_lsa_ForestTrustDomainInfo(struct ndr_push *ndr, int ndr_flags, const struct lsa_ForestTrustDomainInfo *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->domain_sid)); + NDR_CHECK(ndr_push_lsa_StringLarge(ndr, NDR_SCALARS, &r->dns_domain_name)); + NDR_CHECK(ndr_push_lsa_StringLarge(ndr, NDR_SCALARS, &r->netbios_domain_name)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->domain_sid) { + NDR_CHECK(ndr_push_dom_sid2(ndr, NDR_SCALARS|NDR_BUFFERS, r->domain_sid)); + } + NDR_CHECK(ndr_push_lsa_StringLarge(ndr, NDR_BUFFERS, &r->dns_domain_name)); + NDR_CHECK(ndr_push_lsa_StringLarge(ndr, NDR_BUFFERS, &r->netbios_domain_name)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_lsa_ForestTrustDomainInfo(struct ndr_pull *ndr, int ndr_flags, struct lsa_ForestTrustDomainInfo *r) +{ + uint32_t _ptr_domain_sid; + TALLOC_CTX *_mem_save_domain_sid_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_domain_sid)); + if (_ptr_domain_sid) { + NDR_PULL_ALLOC(ndr, r->domain_sid); + } else { + r->domain_sid = NULL; + } + NDR_CHECK(ndr_pull_lsa_StringLarge(ndr, NDR_SCALARS, &r->dns_domain_name)); + NDR_CHECK(ndr_pull_lsa_StringLarge(ndr, NDR_SCALARS, &r->netbios_domain_name)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->domain_sid) { + _mem_save_domain_sid_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->domain_sid, 0); + NDR_CHECK(ndr_pull_dom_sid2(ndr, NDR_SCALARS|NDR_BUFFERS, r->domain_sid)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_sid_0, 0); + } + NDR_CHECK(ndr_pull_lsa_StringLarge(ndr, NDR_BUFFERS, &r->dns_domain_name)); + NDR_CHECK(ndr_pull_lsa_StringLarge(ndr, NDR_BUFFERS, &r->netbios_domain_name)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_lsa_ForestTrustDomainInfo(struct ndr_print *ndr, const char *name, const struct lsa_ForestTrustDomainInfo *r) +{ + ndr_print_struct(ndr, name, "lsa_ForestTrustDomainInfo"); + ndr->depth++; + ndr_print_ptr(ndr, "domain_sid", r->domain_sid); + ndr->depth++; + if (r->domain_sid) { + ndr_print_dom_sid2(ndr, "domain_sid", r->domain_sid); + } + ndr->depth--; + ndr_print_lsa_StringLarge(ndr, "dns_domain_name", &r->dns_domain_name); + ndr_print_lsa_StringLarge(ndr, "netbios_domain_name", &r->netbios_domain_name); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_lsa_ForestTrustData(struct ndr_push *ndr, int ndr_flags, const union lsa_ForestTrustData *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 LSA_FOREST_TRUST_TOP_LEVEL_NAME: { + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->top_level_name)); + break; } + + case LSA_FOREST_TRUST_TOP_LEVEL_NAME_EX: { + NDR_CHECK(ndr_push_lsa_StringLarge(ndr, NDR_SCALARS, &r->top_level_name_ex)); + break; } + + case LSA_FOREST_TRUST_DOMAIN_INFO: { + NDR_CHECK(ndr_push_lsa_ForestTrustDomainInfo(ndr, NDR_SCALARS, &r->domain_info)); + break; } + + default: { + NDR_CHECK(ndr_push_lsa_ForestTrustBinaryData(ndr, NDR_SCALARS, &r->data)); + break; } + + } + } + if (ndr_flags & NDR_BUFFERS) { + int level = ndr_push_get_switch_value(ndr, r); + switch (level) { + case LSA_FOREST_TRUST_TOP_LEVEL_NAME: + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->top_level_name)); + break; + + case LSA_FOREST_TRUST_TOP_LEVEL_NAME_EX: + NDR_CHECK(ndr_push_lsa_StringLarge(ndr, NDR_BUFFERS, &r->top_level_name_ex)); + break; + + case LSA_FOREST_TRUST_DOMAIN_INFO: + NDR_CHECK(ndr_push_lsa_ForestTrustDomainInfo(ndr, NDR_BUFFERS, &r->domain_info)); + break; + + default: + NDR_CHECK(ndr_push_lsa_ForestTrustBinaryData(ndr, NDR_BUFFERS, &r->data)); + break; + + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_lsa_ForestTrustData(struct ndr_pull *ndr, int ndr_flags, union lsa_ForestTrustData *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 LSA_FOREST_TRUST_TOP_LEVEL_NAME: { + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->top_level_name)); + break; } + + case LSA_FOREST_TRUST_TOP_LEVEL_NAME_EX: { + NDR_CHECK(ndr_pull_lsa_StringLarge(ndr, NDR_SCALARS, &r->top_level_name_ex)); + break; } + + case LSA_FOREST_TRUST_DOMAIN_INFO: { + NDR_CHECK(ndr_pull_lsa_ForestTrustDomainInfo(ndr, NDR_SCALARS, &r->domain_info)); + break; } + + default: { + NDR_CHECK(ndr_pull_lsa_ForestTrustBinaryData(ndr, NDR_SCALARS, &r->data)); + break; } + + } + } + if (ndr_flags & NDR_BUFFERS) { + switch (level) { + case LSA_FOREST_TRUST_TOP_LEVEL_NAME: + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->top_level_name)); + break; + + case LSA_FOREST_TRUST_TOP_LEVEL_NAME_EX: + NDR_CHECK(ndr_pull_lsa_StringLarge(ndr, NDR_BUFFERS, &r->top_level_name_ex)); + break; + + case LSA_FOREST_TRUST_DOMAIN_INFO: + NDR_CHECK(ndr_pull_lsa_ForestTrustDomainInfo(ndr, NDR_BUFFERS, &r->domain_info)); + break; + + default: + NDR_CHECK(ndr_pull_lsa_ForestTrustBinaryData(ndr, NDR_BUFFERS, &r->data)); + break; + + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_lsa_ForestTrustData(struct ndr_print *ndr, const char *name, const union lsa_ForestTrustData *r) +{ + int level; + level = ndr_print_get_switch_value(ndr, r); + ndr_print_union(ndr, name, level, "lsa_ForestTrustData"); + switch (level) { + case LSA_FOREST_TRUST_TOP_LEVEL_NAME: + ndr_print_lsa_String(ndr, "top_level_name", &r->top_level_name); + break; + + case LSA_FOREST_TRUST_TOP_LEVEL_NAME_EX: + ndr_print_lsa_StringLarge(ndr, "top_level_name_ex", &r->top_level_name_ex); + break; + + case LSA_FOREST_TRUST_DOMAIN_INFO: + ndr_print_lsa_ForestTrustDomainInfo(ndr, "domain_info", &r->domain_info); + break; + + default: + ndr_print_lsa_ForestTrustBinaryData(ndr, "data", &r->data); + break; + + } +} + +static enum ndr_err_code ndr_push_lsa_ForestTrustRecordType(struct ndr_push *ndr, int ndr_flags, enum lsa_ForestTrustRecordType r) +{ + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_lsa_ForestTrustRecordType(struct ndr_pull *ndr, int ndr_flags, enum lsa_ForestTrustRecordType *r) +{ + uint32_t v; + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); + *r = v; + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_lsa_ForestTrustRecordType(struct ndr_print *ndr, const char *name, enum lsa_ForestTrustRecordType r) +{ + const char *val = NULL; + + switch (r) { + case LSA_FOREST_TRUST_TOP_LEVEL_NAME: val = "LSA_FOREST_TRUST_TOP_LEVEL_NAME"; break; + case LSA_FOREST_TRUST_TOP_LEVEL_NAME_EX: val = "LSA_FOREST_TRUST_TOP_LEVEL_NAME_EX"; break; + case LSA_FOREST_TRUST_DOMAIN_INFO: val = "LSA_FOREST_TRUST_DOMAIN_INFO"; break; + case LSA_FOREST_TRUST_RECORD_TYPE_LAST: val = "LSA_FOREST_TRUST_RECORD_TYPE_LAST"; break; + } + ndr_print_enum(ndr, name, "ENUM", val, r); +} + +static enum ndr_err_code ndr_push_lsa_ForestTrustRecord(struct ndr_push *ndr, int ndr_flags, const struct lsa_ForestTrustRecord *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 8)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->flags)); + NDR_CHECK(ndr_push_lsa_ForestTrustRecordType(ndr, NDR_SCALARS, r->level)); + NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->unknown)); + NDR_CHECK(ndr_push_set_switch_value(ndr, &r->forest_trust_data, r->level)); + NDR_CHECK(ndr_push_lsa_ForestTrustData(ndr, NDR_SCALARS, &r->forest_trust_data)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_push_lsa_ForestTrustData(ndr, NDR_BUFFERS, &r->forest_trust_data)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_lsa_ForestTrustRecord(struct ndr_pull *ndr, int ndr_flags, struct lsa_ForestTrustRecord *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 8)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->flags)); + NDR_CHECK(ndr_pull_lsa_ForestTrustRecordType(ndr, NDR_SCALARS, &r->level)); + NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->unknown)); + NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->forest_trust_data, r->level)); + NDR_CHECK(ndr_pull_lsa_ForestTrustData(ndr, NDR_SCALARS, &r->forest_trust_data)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_pull_lsa_ForestTrustData(ndr, NDR_BUFFERS, &r->forest_trust_data)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_lsa_ForestTrustRecord(struct ndr_print *ndr, const char *name, const struct lsa_ForestTrustRecord *r) +{ + ndr_print_struct(ndr, name, "lsa_ForestTrustRecord"); + ndr->depth++; + ndr_print_uint32(ndr, "flags", r->flags); + ndr_print_lsa_ForestTrustRecordType(ndr, "level", r->level); + ndr_print_hyper(ndr, "unknown", r->unknown); + ndr_print_set_switch_value(ndr, &r->forest_trust_data, r->level); + ndr_print_lsa_ForestTrustData(ndr, "forest_trust_data", &r->forest_trust_data); + ndr->depth--; +} + +_PUBLIC_ enum ndr_err_code ndr_push_lsa_ForestTrustInformation(struct ndr_push *ndr, int ndr_flags, const struct lsa_ForestTrustInformation *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_unique_ptr(ndr, r->entries[cntr_entries_1])); + } + for (cntr_entries_1 = 0; cntr_entries_1 < r->count; cntr_entries_1++) { + if (r->entries[cntr_entries_1]) { + NDR_CHECK(ndr_push_lsa_ForestTrustRecord(ndr, NDR_SCALARS|NDR_BUFFERS, r->entries[cntr_entries_1])); + } + } + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_lsa_ForestTrustInformation(struct ndr_pull *ndr, int ndr_flags, struct lsa_ForestTrustInformation *r) +{ + uint32_t _ptr_entries; + uint32_t cntr_entries_1; + TALLOC_CTX *_mem_save_entries_0; + TALLOC_CTX *_mem_save_entries_1; + TALLOC_CTX *_mem_save_entries_2; + 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 > 4000) { + return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range"); + } + 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_generic_ptr(ndr, &_ptr_entries)); + if (_ptr_entries) { + NDR_PULL_ALLOC(ndr, r->entries[cntr_entries_1]); + } else { + r->entries[cntr_entries_1] = NULL; + } + } + for (cntr_entries_1 = 0; cntr_entries_1 < r->count; cntr_entries_1++) { + if (r->entries[cntr_entries_1]) { + _mem_save_entries_2 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->entries[cntr_entries_1], 0); + NDR_CHECK(ndr_pull_lsa_ForestTrustRecord(ndr, NDR_SCALARS|NDR_BUFFERS, r->entries[cntr_entries_1])); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_entries_2, 0); + } + } + 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_lsa_ForestTrustInformation(struct ndr_print *ndr, const char *name, const struct lsa_ForestTrustInformation *r) +{ + uint32_t cntr_entries_1; + ndr_print_struct(ndr, name, "lsa_ForestTrustInformation"); + 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; + if (asprintf(&idx_1, "[%d]", cntr_entries_1) != -1) { + ndr_print_ptr(ndr, "entries", r->entries[cntr_entries_1]); + ndr->depth++; + if (r->entries[cntr_entries_1]) { + ndr_print_lsa_ForestTrustRecord(ndr, "entries", r->entries[cntr_entries_1]); + } + ndr->depth--; + free(idx_1); + } + } + ndr->depth--; + } + ndr->depth--; + ndr->depth--; +} + static enum ndr_err_code ndr_push_lsa_Close(struct ndr_push *ndr, int flags, const struct lsa_Close *r) { if (flags & NDR_IN) { @@ -4103,7 +4623,7 @@ _PUBLIC_ void ndr_print_lsa_Close(struct ndr_print *ndr, const char *name, int f ndr->depth--; } -static enum ndr_err_code ndr_push_lsa_Delete(struct ndr_push *ndr, int flags, const struct lsa_Delete *r) +_PUBLIC_ enum ndr_err_code ndr_push_lsa_Delete(struct ndr_push *ndr, int flags, const struct lsa_Delete *r) { if (flags & NDR_IN) { if (r->in.handle == NULL) { @@ -4117,7 +4637,7 @@ static enum ndr_err_code ndr_push_lsa_Delete(struct ndr_push *ndr, int flags, co return NDR_ERR_SUCCESS; } -static enum ndr_err_code ndr_pull_lsa_Delete(struct ndr_pull *ndr, int flags, struct lsa_Delete *r) +_PUBLIC_ enum ndr_err_code ndr_pull_lsa_Delete(struct ndr_pull *ndr, int flags, struct lsa_Delete *r) { TALLOC_CTX *_mem_save_handle_0; if (flags & NDR_IN) { @@ -4160,7 +4680,7 @@ _PUBLIC_ void ndr_print_lsa_Delete(struct ndr_print *ndr, const char *name, int ndr->depth--; } -static enum ndr_err_code ndr_push_lsa_EnumPrivs(struct ndr_push *ndr, int flags, const struct lsa_EnumPrivs *r) +_PUBLIC_ enum ndr_err_code ndr_push_lsa_EnumPrivs(struct ndr_push *ndr, int flags, const struct lsa_EnumPrivs *r) { if (flags & NDR_IN) { if (r->in.handle == NULL) { @@ -4187,7 +4707,7 @@ static enum ndr_err_code ndr_push_lsa_EnumPrivs(struct ndr_push *ndr, int flags, return NDR_ERR_SUCCESS; } -static enum ndr_err_code ndr_pull_lsa_EnumPrivs(struct ndr_pull *ndr, int flags, struct lsa_EnumPrivs *r) +_PUBLIC_ enum ndr_err_code ndr_pull_lsa_EnumPrivs(struct ndr_pull *ndr, int flags, struct lsa_EnumPrivs *r) { TALLOC_CTX *_mem_save_handle_0; TALLOC_CTX *_mem_save_resume_handle_0; @@ -4283,9 +4803,12 @@ static enum ndr_err_code ndr_push_lsa_QuerySecurity(struct ndr_push *ndr, int fl NDR_CHECK(ndr_push_security_secinfo(ndr, NDR_SCALARS, r->in.sec_info)); } if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.sdbuf)); - if (r->out.sdbuf) { - NDR_CHECK(ndr_push_sec_desc_buf(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.sdbuf)); + if (r->out.sdbuf == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.sdbuf)); + if (*r->out.sdbuf) { + 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)); } @@ -4297,6 +4820,7 @@ static enum ndr_err_code ndr_pull_lsa_QuerySecurity(struct ndr_pull *ndr, int fl uint32_t _ptr_sdbuf; TALLOC_CTX *_mem_save_handle_0; TALLOC_CTX *_mem_save_sdbuf_0; + TALLOC_CTX *_mem_save_sdbuf_1; if (flags & NDR_IN) { ZERO_STRUCT(r->out); @@ -4308,20 +4832,28 @@ static enum ndr_err_code ndr_pull_lsa_QuerySecurity(struct ndr_pull *ndr, int fl NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, 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_generic_ptr(ndr, &_ptr_sdbuf)); if (_ptr_sdbuf) { - NDR_PULL_ALLOC(ndr, r->out.sdbuf); + NDR_PULL_ALLOC(ndr, *r->out.sdbuf); } else { - r->out.sdbuf = NULL; + *r->out.sdbuf = NULL; } - if (r->out.sdbuf) { - _mem_save_sdbuf_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.sdbuf, 0); - 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, 0); + if (*r->out.sdbuf) { + _mem_save_sdbuf_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, *r->out.sdbuf, 0); + NDR_CHECK(ndr_pull_sec_desc_buf(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.sdbuf)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sdbuf_1, 0); } + 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; @@ -4349,10 +4881,13 @@ _PUBLIC_ void ndr_print_lsa_QuerySecurity(struct ndr_print *ndr, const char *nam ndr->depth++; ndr_print_ptr(ndr, "sdbuf", r->out.sdbuf); ndr->depth++; - if (r->out.sdbuf) { - ndr_print_sec_desc_buf(ndr, "sdbuf", r->out.sdbuf); + ndr_print_ptr(ndr, "sdbuf", *r->out.sdbuf); + ndr->depth++; + if (*r->out.sdbuf) { + ndr_print_sec_desc_buf(ndr, "sdbuf", *r->out.sdbuf); } ndr->depth--; + ndr->depth--; ndr_print_NTSTATUS(ndr, "result", r->out.result); ndr->depth--; } @@ -4362,6 +4897,15 @@ _PUBLIC_ void ndr_print_lsa_QuerySecurity(struct ndr_print *ndr, const char *nam static enum ndr_err_code ndr_push_lsa_SetSecObj(struct ndr_push *ndr, int flags, const struct lsa_SetSecObj *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|NDR_BUFFERS, 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)); @@ -4371,7 +4915,24 @@ static enum ndr_err_code ndr_push_lsa_SetSecObj(struct ndr_push *ndr, int flags, static enum ndr_err_code ndr_pull_lsa_SetSecObj(struct ndr_pull *ndr, int flags, struct lsa_SetSecObj *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|NDR_BUFFERS, 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)); @@ -4389,6 +4950,15 @@ _PUBLIC_ void ndr_print_lsa_SetSecObj(struct ndr_print *ndr, const char *name, i if (flags & NDR_IN) { ndr_print_struct(ndr, "in", "lsa_SetSecObj"); 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) { @@ -4441,7 +5011,7 @@ _PUBLIC_ void ndr_print_lsa_ChangePassword(struct ndr_print *ndr, const char *na ndr->depth--; } -static enum ndr_err_code ndr_push_lsa_OpenPolicy(struct ndr_push *ndr, int flags, const struct lsa_OpenPolicy *r) +_PUBLIC_ enum ndr_err_code ndr_push_lsa_OpenPolicy(struct ndr_push *ndr, int flags, const struct lsa_OpenPolicy *r) { if (flags & NDR_IN) { NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.system_name)); @@ -4452,7 +5022,7 @@ static enum ndr_err_code ndr_push_lsa_OpenPolicy(struct ndr_push *ndr, int flags return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); } NDR_CHECK(ndr_push_lsa_ObjectAttribute(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.attr)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.access_mask)); + NDR_CHECK(ndr_push_lsa_PolicyAccessMask(ndr, NDR_SCALARS, r->in.access_mask)); } if (flags & NDR_OUT) { if (r->out.handle == NULL) { @@ -4464,7 +5034,7 @@ static enum ndr_err_code ndr_push_lsa_OpenPolicy(struct ndr_push *ndr, int flags return NDR_ERR_SUCCESS; } -static enum ndr_err_code ndr_pull_lsa_OpenPolicy(struct ndr_pull *ndr, int flags, struct lsa_OpenPolicy *r) +_PUBLIC_ enum ndr_err_code ndr_pull_lsa_OpenPolicy(struct ndr_pull *ndr, int flags, struct lsa_OpenPolicy *r) { uint32_t _ptr_system_name; TALLOC_CTX *_mem_save_system_name_0; @@ -4492,7 +5062,7 @@ static enum ndr_err_code ndr_pull_lsa_OpenPolicy(struct ndr_pull *ndr, int flags NDR_PULL_SET_MEM_CTX(ndr, r->in.attr, LIBNDR_FLAG_REF_ALLOC); NDR_CHECK(ndr_pull_lsa_ObjectAttribute(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.attr)); NDR_PULL_SET_MEM_CTX(ndr, _mem_save_attr_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.access_mask)); + NDR_CHECK(ndr_pull_lsa_PolicyAccessMask(ndr, NDR_SCALARS, &r->in.access_mask)); NDR_PULL_ALLOC(ndr, r->out.handle); ZERO_STRUCTP(r->out.handle); } @@ -4529,7 +5099,7 @@ _PUBLIC_ void ndr_print_lsa_OpenPolicy(struct ndr_print *ndr, const char *name, ndr->depth++; ndr_print_lsa_ObjectAttribute(ndr, "attr", r->in.attr); ndr->depth--; - ndr_print_uint32(ndr, "access_mask", r->in.access_mask); + ndr_print_lsa_PolicyAccessMask(ndr, "access_mask", r->in.access_mask); ndr->depth--; } if (flags & NDR_OUT) { @@ -4555,10 +5125,13 @@ static enum ndr_err_code ndr_push_lsa_QueryInfoPolicy(struct ndr_push *ndr, int NDR_CHECK(ndr_push_lsa_PolicyInfo(ndr, NDR_SCALARS, r->in.level)); } if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.info)); - if (r->out.info) { - NDR_CHECK(ndr_push_set_switch_value(ndr, r->out.info, r->in.level)); - NDR_CHECK(ndr_push_lsa_PolicyInformation(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.info)); + if (r->out.info == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.info)); + if (*r->out.info) { + NDR_CHECK(ndr_push_set_switch_value(ndr, *r->out.info, r->in.level)); + NDR_CHECK(ndr_push_lsa_PolicyInformation(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.info)); } NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); } @@ -4570,6 +5143,7 @@ static enum ndr_err_code ndr_pull_lsa_QueryInfoPolicy(struct ndr_pull *ndr, int uint32_t _ptr_info; TALLOC_CTX *_mem_save_handle_0; TALLOC_CTX *_mem_save_info_0; + TALLOC_CTX *_mem_save_info_1; if (flags & NDR_IN) { ZERO_STRUCT(r->out); @@ -4581,21 +5155,29 @@ static enum ndr_err_code ndr_pull_lsa_QueryInfoPolicy(struct ndr_pull *ndr, int NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.handle)); NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); NDR_CHECK(ndr_pull_lsa_PolicyInfo(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_generic_ptr(ndr, &_ptr_info)); if (_ptr_info) { - NDR_PULL_ALLOC(ndr, r->out.info); + NDR_PULL_ALLOC(ndr, *r->out.info); } else { - r->out.info = NULL; + *r->out.info = NULL; } - if (r->out.info) { - _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.info, 0); - NDR_CHECK(ndr_pull_set_switch_value(ndr, r->out.info, r->in.level)); - NDR_CHECK(ndr_pull_lsa_PolicyInformation(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.info)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, 0); + if (*r->out.info) { + _mem_save_info_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, *r->out.info, 0); + NDR_CHECK(ndr_pull_set_switch_value(ndr, *r->out.info, r->in.level)); + NDR_CHECK(ndr_pull_lsa_PolicyInformation(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.info)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_1, 0); } + 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; @@ -4623,11 +5205,14 @@ _PUBLIC_ void ndr_print_lsa_QueryInfoPolicy(struct ndr_print *ndr, const char *n ndr->depth++; ndr_print_ptr(ndr, "info", r->out.info); ndr->depth++; - if (r->out.info) { - ndr_print_set_switch_value(ndr, r->out.info, r->in.level); - ndr_print_lsa_PolicyInformation(ndr, "info", r->out.info); + ndr_print_ptr(ndr, "info", *r->out.info); + ndr->depth++; + if (*r->out.info) { + ndr_print_set_switch_value(ndr, *r->out.info, r->in.level); + ndr_print_lsa_PolicyInformation(ndr, "info", *r->out.info); } ndr->depth--; + ndr->depth--; ndr_print_NTSTATUS(ndr, "result", r->out.result); ndr->depth--; } @@ -4754,7 +5339,7 @@ _PUBLIC_ void ndr_print_lsa_ClearAuditLog(struct ndr_print *ndr, const char *nam ndr->depth--; } -static enum ndr_err_code ndr_push_lsa_CreateAccount(struct ndr_push *ndr, int flags, const struct lsa_CreateAccount *r) +_PUBLIC_ enum ndr_err_code ndr_push_lsa_CreateAccount(struct ndr_push *ndr, int flags, const struct lsa_CreateAccount *r) { if (flags & NDR_IN) { if (r->in.handle == NULL) { @@ -4777,7 +5362,7 @@ static enum ndr_err_code ndr_push_lsa_CreateAccount(struct ndr_push *ndr, int fl return NDR_ERR_SUCCESS; } -static enum ndr_err_code ndr_pull_lsa_CreateAccount(struct ndr_pull *ndr, int flags, struct lsa_CreateAccount *r) +_PUBLIC_ enum ndr_err_code ndr_pull_lsa_CreateAccount(struct ndr_pull *ndr, int flags, struct lsa_CreateAccount *r) { TALLOC_CTX *_mem_save_handle_0; TALLOC_CTX *_mem_save_sid_0; @@ -4850,7 +5435,7 @@ _PUBLIC_ void ndr_print_lsa_CreateAccount(struct ndr_print *ndr, const char *nam ndr->depth--; } -static enum ndr_err_code ndr_push_lsa_EnumAccounts(struct ndr_push *ndr, int flags, const struct lsa_EnumAccounts *r) +_PUBLIC_ enum ndr_err_code ndr_push_lsa_EnumAccounts(struct ndr_push *ndr, int flags, const struct lsa_EnumAccounts *r) { if (flags & NDR_IN) { if (r->in.handle == NULL) { @@ -4877,7 +5462,7 @@ static enum ndr_err_code ndr_push_lsa_EnumAccounts(struct ndr_push *ndr, int fla return NDR_ERR_SUCCESS; } -static enum ndr_err_code ndr_pull_lsa_EnumAccounts(struct ndr_pull *ndr, int flags, struct lsa_EnumAccounts *r) +_PUBLIC_ enum ndr_err_code ndr_pull_lsa_EnumAccounts(struct ndr_pull *ndr, int flags, struct lsa_EnumAccounts *r) { TALLOC_CTX *_mem_save_handle_0; TALLOC_CTX *_mem_save_resume_handle_0; @@ -4966,7 +5551,7 @@ _PUBLIC_ void ndr_print_lsa_EnumAccounts(struct ndr_print *ndr, const char *name ndr->depth--; } -static enum ndr_err_code ndr_push_lsa_CreateTrustedDomain(struct ndr_push *ndr, int flags, const struct lsa_CreateTrustedDomain *r) +_PUBLIC_ enum ndr_err_code ndr_push_lsa_CreateTrustedDomain(struct ndr_push *ndr, int flags, const struct lsa_CreateTrustedDomain *r) { if (flags & NDR_IN) { if (r->in.handle == NULL) { @@ -4989,7 +5574,7 @@ static enum ndr_err_code ndr_push_lsa_CreateTrustedDomain(struct ndr_push *ndr, return NDR_ERR_SUCCESS; } -static enum ndr_err_code ndr_pull_lsa_CreateTrustedDomain(struct ndr_pull *ndr, int flags, struct lsa_CreateTrustedDomain *r) +_PUBLIC_ enum ndr_err_code ndr_pull_lsa_CreateTrustedDomain(struct ndr_pull *ndr, int flags, struct lsa_CreateTrustedDomain *r) { TALLOC_CTX *_mem_save_handle_0; TALLOC_CTX *_mem_save_info_0; @@ -5112,9 +5697,6 @@ static enum ndr_err_code ndr_pull_lsa_EnumTrustDom(struct ndr_pull *ndr, int fla 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)); - if (r->in.max_size < 0 || r->in.max_size > 1000) { - return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range"); - } NDR_PULL_ALLOC(ndr, r->out.resume_handle); *r->out.resume_handle = *r->in.resume_handle; NDR_PULL_ALLOC(ndr, r->out.domains); @@ -5178,7 +5760,7 @@ _PUBLIC_ void ndr_print_lsa_EnumTrustDom(struct ndr_print *ndr, const char *name ndr->depth--; } -static enum ndr_err_code ndr_push_lsa_LookupNames(struct ndr_push *ndr, int flags, const struct lsa_LookupNames *r) +_PUBLIC_ enum ndr_err_code ndr_push_lsa_LookupNames(struct ndr_push *ndr, int flags, const struct lsa_LookupNames *r) { uint32_t cntr_names_0; if (flags & NDR_IN) { @@ -5198,16 +5780,19 @@ static enum ndr_err_code ndr_push_lsa_LookupNames(struct ndr_push *ndr, int flag return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); } NDR_CHECK(ndr_push_lsa_TransSidArray(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.sids)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->in.level)); + NDR_CHECK(ndr_push_lsa_LookupNamesLevel(ndr, NDR_SCALARS, r->in.level)); if (r->in.count == NULL) { return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); } NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.count)); } if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.domains)); - if (r->out.domains) { - NDR_CHECK(ndr_push_lsa_RefDomainList(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.domains)); + if (r->out.domains == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.domains)); + if (*r->out.domains) { + NDR_CHECK(ndr_push_lsa_RefDomainList(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.domains)); } if (r->out.sids == NULL) { return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); @@ -5222,13 +5807,14 @@ static enum ndr_err_code ndr_push_lsa_LookupNames(struct ndr_push *ndr, int flag return NDR_ERR_SUCCESS; } -static enum ndr_err_code ndr_pull_lsa_LookupNames(struct ndr_pull *ndr, int flags, struct lsa_LookupNames *r) +_PUBLIC_ enum ndr_err_code ndr_pull_lsa_LookupNames(struct ndr_pull *ndr, int flags, struct lsa_LookupNames *r) { uint32_t cntr_names_0; uint32_t _ptr_domains; TALLOC_CTX *_mem_save_handle_0; TALLOC_CTX *_mem_save_names_0; TALLOC_CTX *_mem_save_domains_0; + TALLOC_CTX *_mem_save_domains_1; TALLOC_CTX *_mem_save_sids_0; TALLOC_CTX *_mem_save_count_0; if (flags & NDR_IN) { @@ -5263,7 +5849,7 @@ static enum ndr_err_code ndr_pull_lsa_LookupNames(struct ndr_pull *ndr, int flag NDR_PULL_SET_MEM_CTX(ndr, r->in.sids, LIBNDR_FLAG_REF_ALLOC); NDR_CHECK(ndr_pull_lsa_TransSidArray(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.sids)); NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sids_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->in.level)); + NDR_CHECK(ndr_pull_lsa_LookupNamesLevel(ndr, NDR_SCALARS, &r->in.level)); if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { NDR_PULL_ALLOC(ndr, r->in.count); } @@ -5271,6 +5857,8 @@ static enum ndr_err_code ndr_pull_lsa_LookupNames(struct ndr_pull *ndr, int flag NDR_PULL_SET_MEM_CTX(ndr, r->in.count, LIBNDR_FLAG_REF_ALLOC); NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->in.count)); NDR_PULL_SET_MEM_CTX(ndr, _mem_save_count_0, LIBNDR_FLAG_REF_ALLOC); + NDR_PULL_ALLOC(ndr, r->out.domains); + ZERO_STRUCTP(r->out.domains); NDR_PULL_ALLOC(ndr, r->out.sids); *r->out.sids = *r->in.sids; NDR_PULL_ALLOC(ndr, r->out.count); @@ -5280,18 +5868,24 @@ static enum ndr_err_code ndr_pull_lsa_LookupNames(struct ndr_pull *ndr, int flag } } if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.domains); + } + _mem_save_domains_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.domains, LIBNDR_FLAG_REF_ALLOC); NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_domains)); if (_ptr_domains) { - NDR_PULL_ALLOC(ndr, r->out.domains); + NDR_PULL_ALLOC(ndr, *r->out.domains); } else { - r->out.domains = NULL; + *r->out.domains = NULL; } - if (r->out.domains) { - _mem_save_domains_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.domains, 0); - NDR_CHECK(ndr_pull_lsa_RefDomainList(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.domains)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domains_0, 0); + if (*r->out.domains) { + _mem_save_domains_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, *r->out.domains, 0); + NDR_CHECK(ndr_pull_lsa_RefDomainList(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.domains)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domains_1, 0); } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domains_0, LIBNDR_FLAG_REF_ALLOC); if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { NDR_PULL_ALLOC(ndr, r->out.sids); } @@ -5331,8 +5925,7 @@ _PUBLIC_ void ndr_print_lsa_LookupNames(struct ndr_print *ndr, const char *name, 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) { + if (asprintf(&idx_0, "[%d]", cntr_names_0) != -1) { ndr_print_lsa_String(ndr, "names", &r->in.names[cntr_names_0]); free(idx_0); } @@ -5342,7 +5935,7 @@ _PUBLIC_ void ndr_print_lsa_LookupNames(struct ndr_print *ndr, const char *name, ndr->depth++; ndr_print_lsa_TransSidArray(ndr, "sids", r->in.sids); ndr->depth--; - ndr_print_uint16(ndr, "level", r->in.level); + ndr_print_lsa_LookupNamesLevel(ndr, "level", r->in.level); ndr_print_ptr(ndr, "count", r->in.count); ndr->depth++; ndr_print_uint32(ndr, "count", *r->in.count); @@ -5354,10 +5947,13 @@ _PUBLIC_ void ndr_print_lsa_LookupNames(struct ndr_print *ndr, const char *name, ndr->depth++; ndr_print_ptr(ndr, "domains", r->out.domains); ndr->depth++; - if (r->out.domains) { - ndr_print_lsa_RefDomainList(ndr, "domains", r->out.domains); + ndr_print_ptr(ndr, "domains", *r->out.domains); + ndr->depth++; + if (*r->out.domains) { + ndr_print_lsa_RefDomainList(ndr, "domains", *r->out.domains); } ndr->depth--; + ndr->depth--; ndr_print_ptr(ndr, "sids", r->out.sids); ndr->depth++; ndr_print_lsa_TransSidArray(ndr, "sids", r->out.sids); @@ -5372,7 +5968,7 @@ _PUBLIC_ void ndr_print_lsa_LookupNames(struct ndr_print *ndr, const char *name, ndr->depth--; } -static enum ndr_err_code ndr_push_lsa_LookupSids(struct ndr_push *ndr, int flags, const struct lsa_LookupSids *r) +_PUBLIC_ enum ndr_err_code ndr_push_lsa_LookupSids(struct ndr_push *ndr, int flags, const struct lsa_LookupSids *r) { if (flags & NDR_IN) { if (r->in.handle == NULL) { @@ -5394,9 +5990,12 @@ static enum ndr_err_code ndr_push_lsa_LookupSids(struct ndr_push *ndr, int flags NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.count)); } if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.domains)); - if (r->out.domains) { - NDR_CHECK(ndr_push_lsa_RefDomainList(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.domains)); + if (r->out.domains == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.domains)); + if (*r->out.domains) { + NDR_CHECK(ndr_push_lsa_RefDomainList(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.domains)); } if (r->out.names == NULL) { return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); @@ -5411,12 +6010,13 @@ static enum ndr_err_code ndr_push_lsa_LookupSids(struct ndr_push *ndr, int flags return NDR_ERR_SUCCESS; } -static enum ndr_err_code ndr_pull_lsa_LookupSids(struct ndr_pull *ndr, int flags, struct lsa_LookupSids *r) +_PUBLIC_ enum ndr_err_code ndr_pull_lsa_LookupSids(struct ndr_pull *ndr, int flags, struct lsa_LookupSids *r) { uint32_t _ptr_domains; TALLOC_CTX *_mem_save_handle_0; TALLOC_CTX *_mem_save_sids_0; TALLOC_CTX *_mem_save_domains_0; + TALLOC_CTX *_mem_save_domains_1; TALLOC_CTX *_mem_save_names_0; TALLOC_CTX *_mem_save_count_0; if (flags & NDR_IN) { @@ -5451,24 +6051,32 @@ static enum ndr_err_code ndr_pull_lsa_LookupSids(struct ndr_pull *ndr, int flags NDR_PULL_SET_MEM_CTX(ndr, r->in.count, LIBNDR_FLAG_REF_ALLOC); NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->in.count)); NDR_PULL_SET_MEM_CTX(ndr, _mem_save_count_0, LIBNDR_FLAG_REF_ALLOC); + NDR_PULL_ALLOC(ndr, r->out.domains); + ZERO_STRUCTP(r->out.domains); NDR_PULL_ALLOC(ndr, r->out.names); *r->out.names = *r->in.names; NDR_PULL_ALLOC(ndr, r->out.count); *r->out.count = *r->in.count; } if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.domains); + } + _mem_save_domains_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.domains, LIBNDR_FLAG_REF_ALLOC); NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_domains)); if (_ptr_domains) { - NDR_PULL_ALLOC(ndr, r->out.domains); + NDR_PULL_ALLOC(ndr, *r->out.domains); } else { - r->out.domains = NULL; + *r->out.domains = NULL; } - if (r->out.domains) { - _mem_save_domains_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.domains, 0); - NDR_CHECK(ndr_pull_lsa_RefDomainList(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.domains)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domains_0, 0); + if (*r->out.domains) { + _mem_save_domains_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, *r->out.domains, 0); + NDR_CHECK(ndr_pull_lsa_RefDomainList(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.domains)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domains_1, 0); } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domains_0, LIBNDR_FLAG_REF_ALLOC); if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { NDR_PULL_ALLOC(ndr, r->out.names); } @@ -5522,10 +6130,13 @@ _PUBLIC_ void ndr_print_lsa_LookupSids(struct ndr_print *ndr, const char *name, ndr->depth++; ndr_print_ptr(ndr, "domains", r->out.domains); ndr->depth++; - if (r->out.domains) { - ndr_print_lsa_RefDomainList(ndr, "domains", r->out.domains); + ndr_print_ptr(ndr, "domains", *r->out.domains); + ndr->depth++; + if (*r->out.domains) { + ndr_print_lsa_RefDomainList(ndr, "domains", *r->out.domains); } ndr->depth--; + ndr->depth--; ndr_print_ptr(ndr, "names", r->out.names); ndr->depth++; ndr_print_lsa_TransNameArray(ndr, "names", r->out.names); @@ -5540,7 +6151,7 @@ _PUBLIC_ void ndr_print_lsa_LookupSids(struct ndr_print *ndr, const char *name, ndr->depth--; } -static enum ndr_err_code ndr_push_lsa_CreateSecret(struct ndr_push *ndr, int flags, const struct lsa_CreateSecret *r) +_PUBLIC_ enum ndr_err_code ndr_push_lsa_CreateSecret(struct ndr_push *ndr, int flags, const struct lsa_CreateSecret *r) { if (flags & NDR_IN) { if (r->in.handle == NULL) { @@ -5560,7 +6171,7 @@ static enum ndr_err_code ndr_push_lsa_CreateSecret(struct ndr_push *ndr, int fla return NDR_ERR_SUCCESS; } -static enum ndr_err_code ndr_pull_lsa_CreateSecret(struct ndr_pull *ndr, int flags, struct lsa_CreateSecret *r) +_PUBLIC_ enum ndr_err_code ndr_pull_lsa_CreateSecret(struct ndr_pull *ndr, int flags, struct lsa_CreateSecret *r) { TALLOC_CTX *_mem_save_handle_0; TALLOC_CTX *_mem_save_sec_handle_0; @@ -5728,9 +6339,12 @@ static enum ndr_err_code ndr_push_lsa_EnumPrivsAccount(struct ndr_push *ndr, int NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.handle)); } if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.privs)); - if (r->out.privs) { - NDR_CHECK(ndr_push_lsa_PrivilegeSet(ndr, NDR_SCALARS, r->out.privs)); + if (r->out.privs == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.privs)); + if (*r->out.privs) { + NDR_CHECK(ndr_push_lsa_PrivilegeSet(ndr, NDR_SCALARS, *r->out.privs)); } NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); } @@ -5742,6 +6356,7 @@ static enum ndr_err_code ndr_pull_lsa_EnumPrivsAccount(struct ndr_pull *ndr, int uint32_t _ptr_privs; TALLOC_CTX *_mem_save_handle_0; TALLOC_CTX *_mem_save_privs_0; + TALLOC_CTX *_mem_save_privs_1; if (flags & NDR_IN) { ZERO_STRUCT(r->out); @@ -5752,20 +6367,28 @@ static enum ndr_err_code ndr_pull_lsa_EnumPrivsAccount(struct ndr_pull *ndr, int NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.handle)); NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_PULL_ALLOC(ndr, r->out.privs); + ZERO_STRUCTP(r->out.privs); } if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.privs); + } + _mem_save_privs_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.privs, LIBNDR_FLAG_REF_ALLOC); NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_privs)); if (_ptr_privs) { - NDR_PULL_ALLOC(ndr, r->out.privs); + NDR_PULL_ALLOC(ndr, *r->out.privs); } else { - r->out.privs = NULL; + *r->out.privs = NULL; } - if (r->out.privs) { - _mem_save_privs_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.privs, 0); - NDR_CHECK(ndr_pull_lsa_PrivilegeSet(ndr, NDR_SCALARS, r->out.privs)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_privs_0, 0); + if (*r->out.privs) { + _mem_save_privs_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, *r->out.privs, 0); + NDR_CHECK(ndr_pull_lsa_PrivilegeSet(ndr, NDR_SCALARS, *r->out.privs)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_privs_1, 0); } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_privs_0, LIBNDR_FLAG_REF_ALLOC); NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); } return NDR_ERR_SUCCESS; @@ -5792,10 +6415,13 @@ _PUBLIC_ void ndr_print_lsa_EnumPrivsAccount(struct ndr_print *ndr, const char * ndr->depth++; ndr_print_ptr(ndr, "privs", r->out.privs); ndr->depth++; - if (r->out.privs) { - ndr_print_lsa_PrivilegeSet(ndr, "privs", r->out.privs); + ndr_print_ptr(ndr, "privs", *r->out.privs); + ndr->depth++; + if (*r->out.privs) { + ndr_print_lsa_PrivilegeSet(ndr, "privs", *r->out.privs); } ndr->depth--; + ndr->depth--; ndr_print_NTSTATUS(ndr, "result", r->out.result); ndr->depth--; } @@ -6044,8 +6670,16 @@ _PUBLIC_ void ndr_print_lsa_SetQuotasForAccount(struct ndr_print *ndr, const cha static enum ndr_err_code ndr_push_lsa_GetSystemAccessAccount(struct ndr_push *ndr, int flags, const struct lsa_GetSystemAccessAccount *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|NDR_BUFFERS, r->in.handle)); } if (flags & NDR_OUT) { + if (r->out.access_mask == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.access_mask)); NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); } return NDR_ERR_SUCCESS; @@ -6053,9 +6687,29 @@ static enum ndr_err_code ndr_push_lsa_GetSystemAccessAccount(struct ndr_push *nd static enum ndr_err_code ndr_pull_lsa_GetSystemAccessAccount(struct ndr_pull *ndr, int flags, struct lsa_GetSystemAccessAccount *r) { + TALLOC_CTX *_mem_save_handle_0; + TALLOC_CTX *_mem_save_access_mask_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|NDR_BUFFERS, r->in.handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_PULL_ALLOC(ndr, r->out.access_mask); + ZERO_STRUCTP(r->out.access_mask); } if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.access_mask); + } + _mem_save_access_mask_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.access_mask, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.access_mask)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_access_mask_0, LIBNDR_FLAG_REF_ALLOC); NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); } return NDR_ERR_SUCCESS; @@ -6071,11 +6725,19 @@ _PUBLIC_ void ndr_print_lsa_GetSystemAccessAccount(struct ndr_print *ndr, const if (flags & NDR_IN) { ndr_print_struct(ndr, "in", "lsa_GetSystemAccessAccount"); 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", "lsa_GetSystemAccessAccount"); ndr->depth++; + ndr_print_ptr(ndr, "access_mask", r->out.access_mask); + ndr->depth++; + ndr_print_uint32(ndr, "access_mask", *r->out.access_mask); + ndr->depth--; ndr_print_NTSTATUS(ndr, "result", r->out.result); ndr->depth--; } @@ -6085,6 +6747,11 @@ _PUBLIC_ void ndr_print_lsa_GetSystemAccessAccount(struct ndr_print *ndr, const static enum ndr_err_code ndr_push_lsa_SetSystemAccessAccount(struct ndr_push *ndr, int flags, const struct lsa_SetSystemAccessAccount *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|NDR_BUFFERS, r->in.handle)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.access_mask)); } if (flags & NDR_OUT) { NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); @@ -6094,7 +6761,16 @@ static enum ndr_err_code ndr_push_lsa_SetSystemAccessAccount(struct ndr_push *nd static enum ndr_err_code ndr_pull_lsa_SetSystemAccessAccount(struct ndr_pull *ndr, int flags, struct lsa_SetSystemAccessAccount *r) { + TALLOC_CTX *_mem_save_handle_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|NDR_BUFFERS, r->in.handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.access_mask)); } if (flags & NDR_OUT) { NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); @@ -6112,6 +6788,11 @@ _PUBLIC_ void ndr_print_lsa_SetSystemAccessAccount(struct ndr_print *ndr, const if (flags & NDR_IN) { ndr_print_struct(ndr, "in", "lsa_SetSystemAccessAccount"); 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_uint32(ndr, "access_mask", r->in.access_mask); ndr->depth--; } if (flags & NDR_OUT) { @@ -6349,7 +7030,7 @@ _PUBLIC_ void ndr_print_lsa_SetInformationTrustedDomain(struct ndr_print *ndr, c ndr->depth--; } -static enum ndr_err_code ndr_push_lsa_OpenSecret(struct ndr_push *ndr, int flags, const struct lsa_OpenSecret *r) +_PUBLIC_ enum ndr_err_code ndr_push_lsa_OpenSecret(struct ndr_push *ndr, int flags, const struct lsa_OpenSecret *r) { if (flags & NDR_IN) { if (r->in.handle == NULL) { @@ -6369,7 +7050,7 @@ static enum ndr_err_code ndr_push_lsa_OpenSecret(struct ndr_push *ndr, int flags return NDR_ERR_SUCCESS; } -static enum ndr_err_code ndr_pull_lsa_OpenSecret(struct ndr_pull *ndr, int flags, struct lsa_OpenSecret *r) +_PUBLIC_ enum ndr_err_code ndr_pull_lsa_OpenSecret(struct ndr_pull *ndr, int flags, struct lsa_OpenSecret *r) { TALLOC_CTX *_mem_save_handle_0; TALLOC_CTX *_mem_save_sec_handle_0; @@ -6432,7 +7113,7 @@ _PUBLIC_ void ndr_print_lsa_OpenSecret(struct ndr_print *ndr, const char *name, ndr->depth--; } -static enum ndr_err_code ndr_push_lsa_SetSecret(struct ndr_push *ndr, int flags, const struct lsa_SetSecret *r) +_PUBLIC_ enum ndr_err_code ndr_push_lsa_SetSecret(struct ndr_push *ndr, int flags, const struct lsa_SetSecret *r) { if (flags & NDR_IN) { if (r->in.sec_handle == NULL) { @@ -6454,7 +7135,7 @@ static enum ndr_err_code ndr_push_lsa_SetSecret(struct ndr_push *ndr, int flags, return NDR_ERR_SUCCESS; } -static enum ndr_err_code ndr_pull_lsa_SetSecret(struct ndr_pull *ndr, int flags, struct lsa_SetSecret *r) +_PUBLIC_ enum ndr_err_code ndr_pull_lsa_SetSecret(struct ndr_pull *ndr, int flags, struct lsa_SetSecret *r) { uint32_t _ptr_new_val; uint32_t _ptr_old_val; @@ -6537,7 +7218,7 @@ _PUBLIC_ void ndr_print_lsa_SetSecret(struct ndr_print *ndr, const char *name, i ndr->depth--; } -static enum ndr_err_code ndr_push_lsa_QuerySecret(struct ndr_push *ndr, int flags, const struct lsa_QuerySecret *r) +_PUBLIC_ enum ndr_err_code ndr_push_lsa_QuerySecret(struct ndr_push *ndr, int flags, const struct lsa_QuerySecret *r) { if (flags & NDR_IN) { if (r->in.sec_handle == NULL) { @@ -6583,7 +7264,7 @@ static enum ndr_err_code ndr_push_lsa_QuerySecret(struct ndr_push *ndr, int flag return NDR_ERR_SUCCESS; } -static enum ndr_err_code ndr_pull_lsa_QuerySecret(struct ndr_pull *ndr, int flags, struct lsa_QuerySecret *r) +_PUBLIC_ enum ndr_err_code ndr_pull_lsa_QuerySecret(struct ndr_pull *ndr, int flags, struct lsa_QuerySecret *r) { uint32_t _ptr_new_val; uint32_t _ptr_new_mtime; @@ -6983,21 +7664,21 @@ static enum ndr_err_code ndr_push_lsa_LookupPrivDisplayName(struct ndr_push *ndr 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)); - if (r->in.language_id == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, *r->in.language_id)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->in.unknown)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->in.language_id)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->in.language_id_sys)); } if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.disp_name)); - if (r->out.disp_name) { - NDR_CHECK(ndr_push_lsa_StringLarge(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.disp_name)); + if (r->out.disp_name == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.disp_name)); + if (*r->out.disp_name) { + NDR_CHECK(ndr_push_lsa_StringLarge(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.disp_name)); } - if (r->out.language_id == NULL) { + if (r->out.returned_language_id == NULL) { return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); } - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, *r->out.language_id)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, *r->out.returned_language_id)); NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); } return NDR_ERR_SUCCESS; @@ -7009,7 +7690,8 @@ static enum ndr_err_code ndr_pull_lsa_LookupPrivDisplayName(struct ndr_pull *ndr TALLOC_CTX *_mem_save_handle_0; TALLOC_CTX *_mem_save_name_0; TALLOC_CTX *_mem_save_disp_name_0; - TALLOC_CTX *_mem_save_language_id_0; + TALLOC_CTX *_mem_save_disp_name_1; + TALLOC_CTX *_mem_save_returned_language_id_0; if (flags & NDR_IN) { ZERO_STRUCT(r->out); @@ -7027,37 +7709,39 @@ static enum ndr_err_code ndr_pull_lsa_LookupPrivDisplayName(struct ndr_pull *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); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.language_id); - } - _mem_save_language_id_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.language_id, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, r->in.language_id)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_language_id_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->in.unknown)); - NDR_PULL_ALLOC(ndr, r->out.language_id); - *r->out.language_id = *r->in.language_id; + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->in.language_id)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->in.language_id_sys)); + NDR_PULL_ALLOC(ndr, r->out.disp_name); + ZERO_STRUCTP(r->out.disp_name); + NDR_PULL_ALLOC(ndr, r->out.returned_language_id); + ZERO_STRUCTP(r->out.returned_language_id); } if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.disp_name); + } + _mem_save_disp_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.disp_name, LIBNDR_FLAG_REF_ALLOC); NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_disp_name)); if (_ptr_disp_name) { - NDR_PULL_ALLOC(ndr, r->out.disp_name); + NDR_PULL_ALLOC(ndr, *r->out.disp_name); } else { - r->out.disp_name = NULL; + *r->out.disp_name = NULL; } - if (r->out.disp_name) { - _mem_save_disp_name_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.disp_name, 0); - NDR_CHECK(ndr_pull_lsa_StringLarge(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.disp_name)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_disp_name_0, 0); + if (*r->out.disp_name) { + _mem_save_disp_name_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, *r->out.disp_name, 0); + NDR_CHECK(ndr_pull_lsa_StringLarge(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.disp_name)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_disp_name_1, 0); } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_disp_name_0, LIBNDR_FLAG_REF_ALLOC); if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.language_id); + NDR_PULL_ALLOC(ndr, r->out.returned_language_id); } - _mem_save_language_id_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.language_id, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, r->out.language_id)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_language_id_0, LIBNDR_FLAG_REF_ALLOC); + _mem_save_returned_language_id_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.returned_language_id, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, r->out.returned_language_id)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_returned_language_id_0, LIBNDR_FLAG_REF_ALLOC); NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); } return NDR_ERR_SUCCESS; @@ -7081,11 +7765,8 @@ _PUBLIC_ void ndr_print_lsa_LookupPrivDisplayName(struct ndr_print *ndr, const c ndr->depth++; ndr_print_lsa_String(ndr, "name", r->in.name); ndr->depth--; - ndr_print_ptr(ndr, "language_id", r->in.language_id); - ndr->depth++; - ndr_print_uint16(ndr, "language_id", *r->in.language_id); - ndr->depth--; - ndr_print_uint16(ndr, "unknown", r->in.unknown); + ndr_print_uint16(ndr, "language_id", r->in.language_id); + ndr_print_uint16(ndr, "language_id_sys", r->in.language_id_sys); ndr->depth--; } if (flags & NDR_OUT) { @@ -7093,13 +7774,16 @@ _PUBLIC_ void ndr_print_lsa_LookupPrivDisplayName(struct ndr_print *ndr, const c ndr->depth++; ndr_print_ptr(ndr, "disp_name", r->out.disp_name); ndr->depth++; - if (r->out.disp_name) { - ndr_print_lsa_StringLarge(ndr, "disp_name", r->out.disp_name); + ndr_print_ptr(ndr, "disp_name", *r->out.disp_name); + ndr->depth++; + if (*r->out.disp_name) { + ndr_print_lsa_StringLarge(ndr, "disp_name", *r->out.disp_name); } ndr->depth--; - ndr_print_ptr(ndr, "language_id", r->out.language_id); + ndr->depth--; + ndr_print_ptr(ndr, "returned_language_id", r->out.returned_language_id); ndr->depth++; - ndr_print_uint16(ndr, "language_id", *r->out.language_id); + ndr_print_uint16(ndr, "returned_language_id", *r->out.returned_language_id); ndr->depth--; ndr_print_NTSTATUS(ndr, "result", r->out.result); ndr->depth--; @@ -7110,8 +7794,16 @@ _PUBLIC_ void ndr_print_lsa_LookupPrivDisplayName(struct ndr_print *ndr, const c static enum ndr_err_code ndr_push_lsa_DeleteObject(struct ndr_push *ndr, int flags, const struct lsa_DeleteObject *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|NDR_BUFFERS, 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|NDR_BUFFERS, r->out.handle)); NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); } return NDR_ERR_SUCCESS; @@ -7119,9 +7811,28 @@ static enum ndr_err_code ndr_push_lsa_DeleteObject(struct ndr_push *ndr, int fla static enum ndr_err_code ndr_pull_lsa_DeleteObject(struct ndr_pull *ndr, int flags, struct lsa_DeleteObject *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|NDR_BUFFERS, 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|NDR_BUFFERS, 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; @@ -7137,11 +7848,19 @@ _PUBLIC_ void ndr_print_lsa_DeleteObject(struct ndr_print *ndr, const char *name if (flags & NDR_IN) { ndr_print_struct(ndr, "in", "lsa_DeleteObject"); 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", "lsa_DeleteObject"); 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--; } @@ -7442,7 +8161,7 @@ static enum ndr_err_code ndr_push_lsa_RemoveAccountRights(struct ndr_push *ndr, 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)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.unknown)); + NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->in.remove_all)); if (r->in.rights == NULL) { return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); } @@ -7474,7 +8193,7 @@ static enum ndr_err_code ndr_pull_lsa_RemoveAccountRights(struct ndr_pull *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_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.unknown)); + NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->in.remove_all)); if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { NDR_PULL_ALLOC(ndr, r->in.rights); } @@ -7507,7 +8226,7 @@ _PUBLIC_ void ndr_print_lsa_RemoveAccountRights(struct ndr_print *ndr, const cha ndr->depth++; ndr_print_dom_sid2(ndr, "sid", r->in.sid); ndr->depth--; - ndr_print_uint32(ndr, "unknown", r->in.unknown); + ndr_print_uint8(ndr, "remove_all", r->in.remove_all); ndr_print_ptr(ndr, "rights", r->in.rights); ndr->depth++; ndr_print_lsa_RightSet(ndr, "rights", r->in.rights); @@ -7824,7 +8543,7 @@ _PUBLIC_ void ndr_print_lsa_RetrievePrivateData(struct ndr_print *ndr, const cha ndr->depth--; } -static enum ndr_err_code ndr_push_lsa_OpenPolicy2(struct ndr_push *ndr, int flags, const struct lsa_OpenPolicy2 *r) +_PUBLIC_ enum ndr_err_code ndr_push_lsa_OpenPolicy2(struct ndr_push *ndr, int flags, const struct lsa_OpenPolicy2 *r) { if (flags & NDR_IN) { NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.system_name)); @@ -7838,7 +8557,7 @@ static enum ndr_err_code ndr_push_lsa_OpenPolicy2(struct ndr_push *ndr, int flag return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); } NDR_CHECK(ndr_push_lsa_ObjectAttribute(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.attr)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.access_mask)); + NDR_CHECK(ndr_push_lsa_PolicyAccessMask(ndr, NDR_SCALARS, r->in.access_mask)); } if (flags & NDR_OUT) { if (r->out.handle == NULL) { @@ -7850,7 +8569,7 @@ static enum ndr_err_code ndr_push_lsa_OpenPolicy2(struct ndr_push *ndr, int flag return NDR_ERR_SUCCESS; } -static enum ndr_err_code ndr_pull_lsa_OpenPolicy2(struct ndr_pull *ndr, int flags, struct lsa_OpenPolicy2 *r) +_PUBLIC_ enum ndr_err_code ndr_pull_lsa_OpenPolicy2(struct ndr_pull *ndr, int flags, struct lsa_OpenPolicy2 *r) { uint32_t _ptr_system_name; TALLOC_CTX *_mem_save_system_name_0; @@ -7884,7 +8603,7 @@ static enum ndr_err_code ndr_pull_lsa_OpenPolicy2(struct ndr_pull *ndr, int flag NDR_PULL_SET_MEM_CTX(ndr, r->in.attr, LIBNDR_FLAG_REF_ALLOC); NDR_CHECK(ndr_pull_lsa_ObjectAttribute(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.attr)); NDR_PULL_SET_MEM_CTX(ndr, _mem_save_attr_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.access_mask)); + NDR_CHECK(ndr_pull_lsa_PolicyAccessMask(ndr, NDR_SCALARS, &r->in.access_mask)); NDR_PULL_ALLOC(ndr, r->out.handle); ZERO_STRUCTP(r->out.handle); } @@ -7921,7 +8640,7 @@ _PUBLIC_ void ndr_print_lsa_OpenPolicy2(struct ndr_print *ndr, const char *name, ndr->depth++; ndr_print_lsa_ObjectAttribute(ndr, "attr", r->in.attr); ndr->depth--; - ndr_print_uint32(ndr, "access_mask", r->in.access_mask); + ndr_print_lsa_PolicyAccessMask(ndr, "access_mask", r->in.access_mask); ndr->depth--; } if (flags & NDR_OUT) { @@ -7947,23 +8666,35 @@ static enum ndr_err_code ndr_push_lsa_GetUserName(struct ndr_push *ndr, int flag 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_unique_ptr(ndr, r->in.account_name)); - if (r->in.account_name) { - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.account_name)); + if (r->in.account_name == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, *r->in.account_name)); + if (*r->in.account_name) { + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS|NDR_BUFFERS, *r->in.account_name)); } NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.authority_name)); if (r->in.authority_name) { - NDR_CHECK(ndr_push_lsa_StringPointer(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.authority_name)); + NDR_CHECK(ndr_push_unique_ptr(ndr, *r->in.authority_name)); + if (*r->in.authority_name) { + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS|NDR_BUFFERS, *r->in.authority_name)); + } } } if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.account_name)); - if (r->out.account_name) { - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.account_name)); + if (r->out.account_name == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.account_name)); + if (*r->out.account_name) { + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.account_name)); } NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.authority_name)); if (r->out.authority_name) { - NDR_CHECK(ndr_push_lsa_StringPointer(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.authority_name)); + NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.authority_name)); + if (*r->out.authority_name) { + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.authority_name)); + } } NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); } @@ -7977,7 +8708,9 @@ static enum ndr_err_code ndr_pull_lsa_GetUserName(struct ndr_pull *ndr, int flag uint32_t _ptr_authority_name; TALLOC_CTX *_mem_save_system_name_0; TALLOC_CTX *_mem_save_account_name_0; + TALLOC_CTX *_mem_save_account_name_1; TALLOC_CTX *_mem_save_authority_name_0; + TALLOC_CTX *_mem_save_authority_name_1; if (flags & NDR_IN) { ZERO_STRUCT(r->out); @@ -7999,18 +8732,24 @@ static enum ndr_err_code ndr_pull_lsa_GetUserName(struct ndr_pull *ndr, int flag 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); } + 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_generic_ptr(ndr, &_ptr_account_name)); if (_ptr_account_name) { - NDR_PULL_ALLOC(ndr, r->in.account_name); + NDR_PULL_ALLOC(ndr, *r->in.account_name); } else { - r->in.account_name = NULL; + *r->in.account_name = NULL; } - if (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, 0); - 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, 0); + if (*r->in.account_name) { + _mem_save_account_name_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, *r->in.account_name, 0); + 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_1, 0); } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_account_name_0, LIBNDR_FLAG_REF_ALLOC); NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_authority_name)); if (_ptr_authority_name) { NDR_PULL_ALLOC(ndr, r->in.authority_name); @@ -8020,23 +8759,42 @@ static enum ndr_err_code ndr_pull_lsa_GetUserName(struct ndr_pull *ndr, int flag if (r->in.authority_name) { _mem_save_authority_name_0 = NDR_PULL_GET_MEM_CTX(ndr); NDR_PULL_SET_MEM_CTX(ndr, r->in.authority_name, 0); - NDR_CHECK(ndr_pull_lsa_StringPointer(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.authority_name)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_authority_name)); + if (_ptr_authority_name) { + NDR_PULL_ALLOC(ndr, *r->in.authority_name); + } else { + *r->in.authority_name = NULL; + } + if (*r->in.authority_name) { + _mem_save_authority_name_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, *r->in.authority_name, 0); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS|NDR_BUFFERS, *r->in.authority_name)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_authority_name_1, 0); + } NDR_PULL_SET_MEM_CTX(ndr, _mem_save_authority_name_0, 0); } + NDR_PULL_ALLOC(ndr, r->out.account_name); + *r->out.account_name = *r->in.account_name; } if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.account_name); + } + _mem_save_account_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.account_name, LIBNDR_FLAG_REF_ALLOC); NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_account_name)); if (_ptr_account_name) { - NDR_PULL_ALLOC(ndr, r->out.account_name); + NDR_PULL_ALLOC(ndr, *r->out.account_name); } else { - r->out.account_name = NULL; + *r->out.account_name = NULL; } - if (r->out.account_name) { - _mem_save_account_name_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.account_name, 0); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.account_name)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_account_name_0, 0); + if (*r->out.account_name) { + _mem_save_account_name_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, *r->out.account_name, 0); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.account_name)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_account_name_1, 0); } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_account_name_0, LIBNDR_FLAG_REF_ALLOC); NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_authority_name)); if (_ptr_authority_name) { NDR_PULL_ALLOC(ndr, r->out.authority_name); @@ -8046,7 +8804,18 @@ static enum ndr_err_code ndr_pull_lsa_GetUserName(struct ndr_pull *ndr, int flag if (r->out.authority_name) { _mem_save_authority_name_0 = NDR_PULL_GET_MEM_CTX(ndr); NDR_PULL_SET_MEM_CTX(ndr, r->out.authority_name, 0); - NDR_CHECK(ndr_pull_lsa_StringPointer(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.authority_name)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_authority_name)); + if (_ptr_authority_name) { + NDR_PULL_ALLOC(ndr, *r->out.authority_name); + } else { + *r->out.authority_name = NULL; + } + if (*r->out.authority_name) { + _mem_save_authority_name_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, *r->out.authority_name, 0); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.authority_name)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_authority_name_1, 0); + } NDR_PULL_SET_MEM_CTX(ndr, _mem_save_authority_name_0, 0); } NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); @@ -8072,14 +8841,22 @@ _PUBLIC_ void ndr_print_lsa_GetUserName(struct ndr_print *ndr, const char *name, ndr->depth--; ndr_print_ptr(ndr, "account_name", r->in.account_name); ndr->depth++; - if (r->in.account_name) { - ndr_print_lsa_String(ndr, "account_name", r->in.account_name); + ndr_print_ptr(ndr, "account_name", *r->in.account_name); + ndr->depth++; + if (*r->in.account_name) { + ndr_print_lsa_String(ndr, "account_name", *r->in.account_name); } ndr->depth--; + ndr->depth--; ndr_print_ptr(ndr, "authority_name", r->in.authority_name); ndr->depth++; if (r->in.authority_name) { - ndr_print_lsa_StringPointer(ndr, "authority_name", r->in.authority_name); + ndr_print_ptr(ndr, "authority_name", *r->in.authority_name); + ndr->depth++; + if (*r->in.authority_name) { + ndr_print_lsa_String(ndr, "authority_name", *r->in.authority_name); + } + ndr->depth--; } ndr->depth--; ndr->depth--; @@ -8089,14 +8866,22 @@ _PUBLIC_ void ndr_print_lsa_GetUserName(struct ndr_print *ndr, const char *name, ndr->depth++; ndr_print_ptr(ndr, "account_name", r->out.account_name); ndr->depth++; - if (r->out.account_name) { - ndr_print_lsa_String(ndr, "account_name", r->out.account_name); + ndr_print_ptr(ndr, "account_name", *r->out.account_name); + ndr->depth++; + if (*r->out.account_name) { + ndr_print_lsa_String(ndr, "account_name", *r->out.account_name); } ndr->depth--; + ndr->depth--; ndr_print_ptr(ndr, "authority_name", r->out.authority_name); ndr->depth++; if (r->out.authority_name) { - ndr_print_lsa_StringPointer(ndr, "authority_name", r->out.authority_name); + ndr_print_ptr(ndr, "authority_name", *r->out.authority_name); + ndr->depth++; + if (*r->out.authority_name) { + ndr_print_lsa_String(ndr, "authority_name", *r->out.authority_name); + } + ndr->depth--; } ndr->depth--; ndr_print_NTSTATUS(ndr, "result", r->out.result); @@ -8115,10 +8900,13 @@ static enum ndr_err_code ndr_push_lsa_QueryInfoPolicy2(struct ndr_push *ndr, int NDR_CHECK(ndr_push_lsa_PolicyInfo(ndr, NDR_SCALARS, r->in.level)); } if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.info)); - if (r->out.info) { - NDR_CHECK(ndr_push_set_switch_value(ndr, r->out.info, r->in.level)); - NDR_CHECK(ndr_push_lsa_PolicyInformation(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.info)); + if (r->out.info == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.info)); + if (*r->out.info) { + NDR_CHECK(ndr_push_set_switch_value(ndr, *r->out.info, r->in.level)); + NDR_CHECK(ndr_push_lsa_PolicyInformation(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.info)); } NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); } @@ -8130,6 +8918,7 @@ static enum ndr_err_code ndr_pull_lsa_QueryInfoPolicy2(struct ndr_pull *ndr, int uint32_t _ptr_info; TALLOC_CTX *_mem_save_handle_0; TALLOC_CTX *_mem_save_info_0; + TALLOC_CTX *_mem_save_info_1; if (flags & NDR_IN) { ZERO_STRUCT(r->out); @@ -8141,21 +8930,29 @@ static enum ndr_err_code ndr_pull_lsa_QueryInfoPolicy2(struct ndr_pull *ndr, int NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.handle)); NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); NDR_CHECK(ndr_pull_lsa_PolicyInfo(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_generic_ptr(ndr, &_ptr_info)); if (_ptr_info) { - NDR_PULL_ALLOC(ndr, r->out.info); + NDR_PULL_ALLOC(ndr, *r->out.info); } else { - r->out.info = NULL; + *r->out.info = NULL; } - if (r->out.info) { - _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.info, 0); - NDR_CHECK(ndr_pull_set_switch_value(ndr, r->out.info, r->in.level)); - NDR_CHECK(ndr_pull_lsa_PolicyInformation(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.info)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, 0); + if (*r->out.info) { + _mem_save_info_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, *r->out.info, 0); + NDR_CHECK(ndr_pull_set_switch_value(ndr, *r->out.info, r->in.level)); + NDR_CHECK(ndr_pull_lsa_PolicyInformation(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.info)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_1, 0); } + 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; @@ -8183,11 +8980,14 @@ _PUBLIC_ void ndr_print_lsa_QueryInfoPolicy2(struct ndr_print *ndr, const char * ndr->depth++; ndr_print_ptr(ndr, "info", r->out.info); ndr->depth++; - if (r->out.info) { - ndr_print_set_switch_value(ndr, r->out.info, r->in.level); - ndr_print_lsa_PolicyInformation(ndr, "info", r->out.info); + ndr_print_ptr(ndr, "info", *r->out.info); + ndr->depth++; + if (*r->out.info) { + ndr_print_set_switch_value(ndr, *r->out.info, r->in.level); + ndr_print_lsa_PolicyInformation(ndr, "info", *r->out.info); } ndr->depth--; + ndr->depth--; ndr_print_NTSTATUS(ndr, "result", r->out.result); ndr->depth--; } @@ -8280,15 +9080,18 @@ static enum ndr_err_code ndr_push_lsa_QueryTrustedDomainInfoByName(struct ndr_pu return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); } NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.handle)); - NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.trusted_domain)); + if (r->in.trusted_domain == 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.trusted_domain)); NDR_CHECK(ndr_push_lsa_TrustDomInfoEnum(ndr, NDR_SCALARS, r->in.level)); } if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.info)); - if (r->out.info) { - NDR_CHECK(ndr_push_set_switch_value(ndr, r->out.info, r->in.level)); - NDR_CHECK(ndr_push_lsa_TrustedDomainInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.info)); + 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_lsa_TrustedDomainInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.info)); NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); } return NDR_ERR_SUCCESS; @@ -8296,8 +9099,8 @@ static enum ndr_err_code ndr_push_lsa_QueryTrustedDomainInfoByName(struct ndr_pu static enum ndr_err_code ndr_pull_lsa_QueryTrustedDomainInfoByName(struct ndr_pull *ndr, int flags, struct lsa_QueryTrustedDomainInfoByName *r) { - uint32_t _ptr_info; TALLOC_CTX *_mem_save_handle_0; + TALLOC_CTX *_mem_save_trusted_domain_0; TALLOC_CTX *_mem_save_info_0; if (flags & NDR_IN) { ZERO_STRUCT(r->out); @@ -8309,23 +9112,26 @@ static enum ndr_err_code ndr_pull_lsa_QueryTrustedDomainInfoByName(struct ndr_pu NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC); NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.handle)); NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.trusted_domain)); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.trusted_domain); + } + _mem_save_trusted_domain_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.trusted_domain, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.trusted_domain)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_trusted_domain_0, LIBNDR_FLAG_REF_ALLOC); NDR_CHECK(ndr_pull_lsa_TrustDomInfoEnum(ndr, NDR_SCALARS, &r->in.level)); + NDR_PULL_ALLOC(ndr, r->out.info); + ZERO_STRUCTP(r->out.info); } if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info)); - if (_ptr_info) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { NDR_PULL_ALLOC(ndr, r->out.info); - } else { - r->out.info = NULL; - } - if (r->out.info) { - _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.info, 0); - NDR_CHECK(ndr_pull_set_switch_value(ndr, r->out.info, r->in.level)); - NDR_CHECK(ndr_pull_lsa_TrustedDomainInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.info)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, 0); } + _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_lsa_TrustedDomainInfo(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; @@ -8345,7 +9151,10 @@ _PUBLIC_ void ndr_print_lsa_QueryTrustedDomainInfoByName(struct ndr_print *ndr, ndr->depth++; ndr_print_policy_handle(ndr, "handle", r->in.handle); ndr->depth--; - ndr_print_lsa_String(ndr, "trusted_domain", &r->in.trusted_domain); + ndr_print_ptr(ndr, "trusted_domain", r->in.trusted_domain); + ndr->depth++; + ndr_print_lsa_String(ndr, "trusted_domain", r->in.trusted_domain); + ndr->depth--; ndr_print_lsa_TrustDomInfoEnum(ndr, "level", r->in.level); ndr->depth--; } @@ -8354,10 +9163,8 @@ _PUBLIC_ void ndr_print_lsa_QueryTrustedDomainInfoByName(struct ndr_print *ndr, ndr->depth++; ndr_print_ptr(ndr, "info", r->out.info); ndr->depth++; - if (r->out.info) { - ndr_print_set_switch_value(ndr, r->out.info, r->in.level); - ndr_print_lsa_TrustedDomainInfo(ndr, "info", r->out.info); - } + ndr_print_set_switch_value(ndr, r->out.info, r->in.level); + ndr_print_lsa_TrustedDomainInfo(ndr, "info", r->out.info); ndr->depth--; ndr_print_NTSTATUS(ndr, "result", r->out.result); ndr->depth--; @@ -8985,7 +9792,7 @@ _PUBLIC_ void ndr_print_lsa_TestCall(struct ndr_print *ndr, const char *name, in ndr->depth--; } -static enum ndr_err_code ndr_push_lsa_LookupSids2(struct ndr_push *ndr, int flags, const struct lsa_LookupSids2 *r) +_PUBLIC_ enum ndr_err_code ndr_push_lsa_LookupSids2(struct ndr_push *ndr, int flags, const struct lsa_LookupSids2 *r) { if (flags & NDR_IN) { if (r->in.handle == NULL) { @@ -9009,9 +9816,12 @@ static enum ndr_err_code ndr_push_lsa_LookupSids2(struct ndr_push *ndr, int flag NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.unknown2)); } if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.domains)); - if (r->out.domains) { - NDR_CHECK(ndr_push_lsa_RefDomainList(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.domains)); + if (r->out.domains == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.domains)); + if (*r->out.domains) { + NDR_CHECK(ndr_push_lsa_RefDomainList(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.domains)); } if (r->out.names == NULL) { return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); @@ -9026,12 +9836,13 @@ static enum ndr_err_code ndr_push_lsa_LookupSids2(struct ndr_push *ndr, int flag return NDR_ERR_SUCCESS; } -static enum ndr_err_code ndr_pull_lsa_LookupSids2(struct ndr_pull *ndr, int flags, struct lsa_LookupSids2 *r) +_PUBLIC_ enum ndr_err_code ndr_pull_lsa_LookupSids2(struct ndr_pull *ndr, int flags, struct lsa_LookupSids2 *r) { uint32_t _ptr_domains; TALLOC_CTX *_mem_save_handle_0; TALLOC_CTX *_mem_save_sids_0; TALLOC_CTX *_mem_save_domains_0; + TALLOC_CTX *_mem_save_domains_1; TALLOC_CTX *_mem_save_names_0; TALLOC_CTX *_mem_save_count_0; if (flags & NDR_IN) { @@ -9068,24 +9879,32 @@ static enum ndr_err_code ndr_pull_lsa_LookupSids2(struct ndr_pull *ndr, int flag NDR_PULL_SET_MEM_CTX(ndr, _mem_save_count_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_PULL_ALLOC(ndr, r->out.domains); + ZERO_STRUCTP(r->out.domains); NDR_PULL_ALLOC(ndr, r->out.names); *r->out.names = *r->in.names; NDR_PULL_ALLOC(ndr, r->out.count); *r->out.count = *r->in.count; } if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.domains); + } + _mem_save_domains_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.domains, LIBNDR_FLAG_REF_ALLOC); NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_domains)); if (_ptr_domains) { - NDR_PULL_ALLOC(ndr, r->out.domains); + NDR_PULL_ALLOC(ndr, *r->out.domains); } else { - r->out.domains = NULL; + *r->out.domains = NULL; } - if (r->out.domains) { - _mem_save_domains_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.domains, 0); - NDR_CHECK(ndr_pull_lsa_RefDomainList(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.domains)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domains_0, 0); + if (*r->out.domains) { + _mem_save_domains_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, *r->out.domains, 0); + NDR_CHECK(ndr_pull_lsa_RefDomainList(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.domains)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domains_1, 0); } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domains_0, LIBNDR_FLAG_REF_ALLOC); if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { NDR_PULL_ALLOC(ndr, r->out.names); } @@ -9141,10 +9960,13 @@ _PUBLIC_ void ndr_print_lsa_LookupSids2(struct ndr_print *ndr, const char *name, ndr->depth++; ndr_print_ptr(ndr, "domains", r->out.domains); ndr->depth++; - if (r->out.domains) { - ndr_print_lsa_RefDomainList(ndr, "domains", r->out.domains); + ndr_print_ptr(ndr, "domains", *r->out.domains); + ndr->depth++; + if (*r->out.domains) { + ndr_print_lsa_RefDomainList(ndr, "domains", *r->out.domains); } ndr->depth--; + ndr->depth--; ndr_print_ptr(ndr, "names", r->out.names); ndr->depth++; ndr_print_lsa_TransNameArray2(ndr, "names", r->out.names); @@ -9159,7 +9981,7 @@ _PUBLIC_ void ndr_print_lsa_LookupSids2(struct ndr_print *ndr, const char *name, ndr->depth--; } -static enum ndr_err_code ndr_push_lsa_LookupNames2(struct ndr_push *ndr, int flags, const struct lsa_LookupNames2 *r) +_PUBLIC_ enum ndr_err_code ndr_push_lsa_LookupNames2(struct ndr_push *ndr, int flags, const struct lsa_LookupNames2 *r) { uint32_t cntr_names_0; if (flags & NDR_IN) { @@ -9179,7 +10001,7 @@ static enum ndr_err_code ndr_push_lsa_LookupNames2(struct ndr_push *ndr, int fla return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); } NDR_CHECK(ndr_push_lsa_TransSidArray2(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.sids)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->in.level)); + NDR_CHECK(ndr_push_lsa_LookupNamesLevel(ndr, NDR_SCALARS, r->in.level)); if (r->in.count == NULL) { return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); } @@ -9188,9 +10010,12 @@ static enum ndr_err_code ndr_push_lsa_LookupNames2(struct ndr_push *ndr, int fla NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.unknown2)); } if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.domains)); - if (r->out.domains) { - NDR_CHECK(ndr_push_lsa_RefDomainList(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.domains)); + if (r->out.domains == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.domains)); + if (*r->out.domains) { + NDR_CHECK(ndr_push_lsa_RefDomainList(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.domains)); } if (r->out.sids == NULL) { return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); @@ -9205,13 +10030,14 @@ static enum ndr_err_code ndr_push_lsa_LookupNames2(struct ndr_push *ndr, int fla return NDR_ERR_SUCCESS; } -static enum ndr_err_code ndr_pull_lsa_LookupNames2(struct ndr_pull *ndr, int flags, struct lsa_LookupNames2 *r) +_PUBLIC_ enum ndr_err_code ndr_pull_lsa_LookupNames2(struct ndr_pull *ndr, int flags, struct lsa_LookupNames2 *r) { uint32_t cntr_names_0; uint32_t _ptr_domains; TALLOC_CTX *_mem_save_handle_0; TALLOC_CTX *_mem_save_names_0; TALLOC_CTX *_mem_save_domains_0; + TALLOC_CTX *_mem_save_domains_1; TALLOC_CTX *_mem_save_sids_0; TALLOC_CTX *_mem_save_count_0; if (flags & NDR_IN) { @@ -9246,7 +10072,7 @@ static enum ndr_err_code ndr_pull_lsa_LookupNames2(struct ndr_pull *ndr, int fla NDR_PULL_SET_MEM_CTX(ndr, r->in.sids, LIBNDR_FLAG_REF_ALLOC); NDR_CHECK(ndr_pull_lsa_TransSidArray2(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.sids)); NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sids_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->in.level)); + NDR_CHECK(ndr_pull_lsa_LookupNamesLevel(ndr, NDR_SCALARS, &r->in.level)); if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { NDR_PULL_ALLOC(ndr, r->in.count); } @@ -9256,6 +10082,8 @@ static enum ndr_err_code ndr_pull_lsa_LookupNames2(struct ndr_pull *ndr, int fla NDR_PULL_SET_MEM_CTX(ndr, _mem_save_count_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_PULL_ALLOC(ndr, r->out.domains); + ZERO_STRUCTP(r->out.domains); NDR_PULL_ALLOC(ndr, r->out.sids); *r->out.sids = *r->in.sids; NDR_PULL_ALLOC(ndr, r->out.count); @@ -9265,18 +10093,24 @@ static enum ndr_err_code ndr_pull_lsa_LookupNames2(struct ndr_pull *ndr, int fla } } if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.domains); + } + _mem_save_domains_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.domains, LIBNDR_FLAG_REF_ALLOC); NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_domains)); if (_ptr_domains) { - NDR_PULL_ALLOC(ndr, r->out.domains); + NDR_PULL_ALLOC(ndr, *r->out.domains); } else { - r->out.domains = NULL; + *r->out.domains = NULL; } - if (r->out.domains) { - _mem_save_domains_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.domains, 0); - NDR_CHECK(ndr_pull_lsa_RefDomainList(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.domains)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domains_0, 0); + if (*r->out.domains) { + _mem_save_domains_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, *r->out.domains, 0); + NDR_CHECK(ndr_pull_lsa_RefDomainList(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.domains)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domains_1, 0); } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domains_0, LIBNDR_FLAG_REF_ALLOC); if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { NDR_PULL_ALLOC(ndr, r->out.sids); } @@ -9316,8 +10150,7 @@ _PUBLIC_ void ndr_print_lsa_LookupNames2(struct ndr_print *ndr, const char *name 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) { + if (asprintf(&idx_0, "[%d]", cntr_names_0) != -1) { ndr_print_lsa_String(ndr, "names", &r->in.names[cntr_names_0]); free(idx_0); } @@ -9327,7 +10160,7 @@ _PUBLIC_ void ndr_print_lsa_LookupNames2(struct ndr_print *ndr, const char *name ndr->depth++; ndr_print_lsa_TransSidArray2(ndr, "sids", r->in.sids); ndr->depth--; - ndr_print_uint16(ndr, "level", r->in.level); + ndr_print_lsa_LookupNamesLevel(ndr, "level", r->in.level); ndr_print_ptr(ndr, "count", r->in.count); ndr->depth++; ndr_print_uint32(ndr, "count", *r->in.count); @@ -9341,10 +10174,13 @@ _PUBLIC_ void ndr_print_lsa_LookupNames2(struct ndr_print *ndr, const char *name ndr->depth++; ndr_print_ptr(ndr, "domains", r->out.domains); ndr->depth++; - if (r->out.domains) { - ndr_print_lsa_RefDomainList(ndr, "domains", r->out.domains); + ndr_print_ptr(ndr, "domains", *r->out.domains); + ndr->depth++; + if (*r->out.domains) { + ndr_print_lsa_RefDomainList(ndr, "domains", *r->out.domains); } ndr->depth--; + ndr->depth--; ndr_print_ptr(ndr, "sids", r->out.sids); ndr->depth++; ndr_print_lsa_TransSidArray2(ndr, "sids", r->out.sids); @@ -9728,7 +10564,7 @@ _PUBLIC_ void ndr_print_lsa_CREDRPROFILELOADED(struct ndr_print *ndr, const char ndr->depth--; } -static enum ndr_err_code ndr_push_lsa_LookupNames3(struct ndr_push *ndr, int flags, const struct lsa_LookupNames3 *r) +_PUBLIC_ enum ndr_err_code ndr_push_lsa_LookupNames3(struct ndr_push *ndr, int flags, const struct lsa_LookupNames3 *r) { uint32_t cntr_names_0; if (flags & NDR_IN) { @@ -9748,7 +10584,7 @@ static enum ndr_err_code ndr_push_lsa_LookupNames3(struct ndr_push *ndr, int fla return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); } NDR_CHECK(ndr_push_lsa_TransSidArray3(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.sids)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->in.level)); + NDR_CHECK(ndr_push_lsa_LookupNamesLevel(ndr, NDR_SCALARS, r->in.level)); if (r->in.count == NULL) { return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); } @@ -9757,9 +10593,12 @@ static enum ndr_err_code ndr_push_lsa_LookupNames3(struct ndr_push *ndr, int fla NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.unknown2)); } if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.domains)); - if (r->out.domains) { - NDR_CHECK(ndr_push_lsa_RefDomainList(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.domains)); + if (r->out.domains == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.domains)); + if (*r->out.domains) { + NDR_CHECK(ndr_push_lsa_RefDomainList(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.domains)); } if (r->out.sids == NULL) { return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); @@ -9774,13 +10613,14 @@ static enum ndr_err_code ndr_push_lsa_LookupNames3(struct ndr_push *ndr, int fla return NDR_ERR_SUCCESS; } -static enum ndr_err_code ndr_pull_lsa_LookupNames3(struct ndr_pull *ndr, int flags, struct lsa_LookupNames3 *r) +_PUBLIC_ enum ndr_err_code ndr_pull_lsa_LookupNames3(struct ndr_pull *ndr, int flags, struct lsa_LookupNames3 *r) { uint32_t cntr_names_0; uint32_t _ptr_domains; TALLOC_CTX *_mem_save_handle_0; TALLOC_CTX *_mem_save_names_0; TALLOC_CTX *_mem_save_domains_0; + TALLOC_CTX *_mem_save_domains_1; TALLOC_CTX *_mem_save_sids_0; TALLOC_CTX *_mem_save_count_0; if (flags & NDR_IN) { @@ -9815,7 +10655,7 @@ static enum ndr_err_code ndr_pull_lsa_LookupNames3(struct ndr_pull *ndr, int fla NDR_PULL_SET_MEM_CTX(ndr, r->in.sids, LIBNDR_FLAG_REF_ALLOC); NDR_CHECK(ndr_pull_lsa_TransSidArray3(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.sids)); NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sids_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->in.level)); + NDR_CHECK(ndr_pull_lsa_LookupNamesLevel(ndr, NDR_SCALARS, &r->in.level)); if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { NDR_PULL_ALLOC(ndr, r->in.count); } @@ -9825,6 +10665,8 @@ static enum ndr_err_code ndr_pull_lsa_LookupNames3(struct ndr_pull *ndr, int fla NDR_PULL_SET_MEM_CTX(ndr, _mem_save_count_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_PULL_ALLOC(ndr, r->out.domains); + ZERO_STRUCTP(r->out.domains); NDR_PULL_ALLOC(ndr, r->out.sids); *r->out.sids = *r->in.sids; NDR_PULL_ALLOC(ndr, r->out.count); @@ -9834,18 +10676,24 @@ static enum ndr_err_code ndr_pull_lsa_LookupNames3(struct ndr_pull *ndr, int fla } } if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.domains); + } + _mem_save_domains_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.domains, LIBNDR_FLAG_REF_ALLOC); NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_domains)); if (_ptr_domains) { - NDR_PULL_ALLOC(ndr, r->out.domains); + NDR_PULL_ALLOC(ndr, *r->out.domains); } else { - r->out.domains = NULL; + *r->out.domains = NULL; } - if (r->out.domains) { - _mem_save_domains_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.domains, 0); - NDR_CHECK(ndr_pull_lsa_RefDomainList(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.domains)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domains_0, 0); + if (*r->out.domains) { + _mem_save_domains_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, *r->out.domains, 0); + NDR_CHECK(ndr_pull_lsa_RefDomainList(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.domains)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domains_1, 0); } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domains_0, LIBNDR_FLAG_REF_ALLOC); if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { NDR_PULL_ALLOC(ndr, r->out.sids); } @@ -9885,8 +10733,7 @@ _PUBLIC_ void ndr_print_lsa_LookupNames3(struct ndr_print *ndr, const char *name 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) { + if (asprintf(&idx_0, "[%d]", cntr_names_0) != -1) { ndr_print_lsa_String(ndr, "names", &r->in.names[cntr_names_0]); free(idx_0); } @@ -9896,7 +10743,7 @@ _PUBLIC_ void ndr_print_lsa_LookupNames3(struct ndr_print *ndr, const char *name ndr->depth++; ndr_print_lsa_TransSidArray3(ndr, "sids", r->in.sids); ndr->depth--; - ndr_print_uint16(ndr, "level", r->in.level); + ndr_print_lsa_LookupNamesLevel(ndr, "level", r->in.level); ndr_print_ptr(ndr, "count", r->in.count); ndr->depth++; ndr_print_uint32(ndr, "count", *r->in.count); @@ -9910,10 +10757,13 @@ _PUBLIC_ void ndr_print_lsa_LookupNames3(struct ndr_print *ndr, const char *name ndr->depth++; ndr_print_ptr(ndr, "domains", r->out.domains); ndr->depth++; - if (r->out.domains) { - ndr_print_lsa_RefDomainList(ndr, "domains", r->out.domains); + ndr_print_ptr(ndr, "domains", *r->out.domains); + ndr->depth++; + if (*r->out.domains) { + ndr_print_lsa_RefDomainList(ndr, "domains", *r->out.domains); } ndr->depth--; + ndr->depth--; ndr_print_ptr(ndr, "sids", r->out.sids); ndr->depth++; ndr_print_lsa_TransSidArray3(ndr, "sids", r->out.sids); @@ -10092,41 +10942,117 @@ _PUBLIC_ void ndr_print_lsa_LSARUNREGISTERAUDITEVENT(struct ndr_print *ndr, cons ndr->depth--; } -static enum ndr_err_code ndr_push_lsa_LSARQUERYFORESTTRUSTINFORMATION(struct ndr_push *ndr, int flags, const struct lsa_LSARQUERYFORESTTRUSTINFORMATION *r) +static enum ndr_err_code ndr_push_lsa_lsaRQueryForestTrustInformation(struct ndr_push *ndr, int flags, const struct lsa_lsaRQueryForestTrustInformation *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|NDR_BUFFERS, r->in.handle)); + if (r->in.trusted_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.trusted_domain_name)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->in.unknown)); } if (flags & NDR_OUT) { + if (r->out.forest_trust_info == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.forest_trust_info)); + if (*r->out.forest_trust_info) { + NDR_CHECK(ndr_push_lsa_ForestTrustInformation(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.forest_trust_info)); + } NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); } return NDR_ERR_SUCCESS; } -static enum ndr_err_code ndr_pull_lsa_LSARQUERYFORESTTRUSTINFORMATION(struct ndr_pull *ndr, int flags, struct lsa_LSARQUERYFORESTTRUSTINFORMATION *r) +static enum ndr_err_code ndr_pull_lsa_lsaRQueryForestTrustInformation(struct ndr_pull *ndr, int flags, struct lsa_lsaRQueryForestTrustInformation *r) { + uint32_t _ptr_forest_trust_info; + TALLOC_CTX *_mem_save_handle_0; + TALLOC_CTX *_mem_save_trusted_domain_name_0; + TALLOC_CTX *_mem_save_forest_trust_info_0; + TALLOC_CTX *_mem_save_forest_trust_info_1; 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|NDR_BUFFERS, r->in.handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.trusted_domain_name); + } + _mem_save_trusted_domain_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.trusted_domain_name, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.trusted_domain_name)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_trusted_domain_name_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->in.unknown)); + NDR_PULL_ALLOC(ndr, r->out.forest_trust_info); + ZERO_STRUCTP(r->out.forest_trust_info); } if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.forest_trust_info); + } + _mem_save_forest_trust_info_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.forest_trust_info, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_forest_trust_info)); + if (_ptr_forest_trust_info) { + NDR_PULL_ALLOC(ndr, *r->out.forest_trust_info); + } else { + *r->out.forest_trust_info = NULL; + } + if (*r->out.forest_trust_info) { + _mem_save_forest_trust_info_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, *r->out.forest_trust_info, 0); + NDR_CHECK(ndr_pull_lsa_ForestTrustInformation(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.forest_trust_info)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_forest_trust_info_1, 0); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_forest_trust_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_lsa_LSARQUERYFORESTTRUSTINFORMATION(struct ndr_print *ndr, const char *name, int flags, const struct lsa_LSARQUERYFORESTTRUSTINFORMATION *r) +_PUBLIC_ void ndr_print_lsa_lsaRQueryForestTrustInformation(struct ndr_print *ndr, const char *name, int flags, const struct lsa_lsaRQueryForestTrustInformation *r) { - ndr_print_struct(ndr, name, "lsa_LSARQUERYFORESTTRUSTINFORMATION"); + ndr_print_struct(ndr, name, "lsa_lsaRQueryForestTrustInformation"); ndr->depth++; if (flags & NDR_SET_VALUES) { ndr->flags |= LIBNDR_PRINT_SET_VALUES; } if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "lsa_LSARQUERYFORESTTRUSTINFORMATION"); + ndr_print_struct(ndr, "in", "lsa_lsaRQueryForestTrustInformation"); 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_ptr(ndr, "trusted_domain_name", r->in.trusted_domain_name); + ndr->depth++; + ndr_print_lsa_String(ndr, "trusted_domain_name", r->in.trusted_domain_name); + ndr->depth--; + ndr_print_uint16(ndr, "unknown", r->in.unknown); ndr->depth--; } if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "lsa_LSARQUERYFORESTTRUSTINFORMATION"); + ndr_print_struct(ndr, "out", "lsa_lsaRQueryForestTrustInformation"); + ndr->depth++; + ndr_print_ptr(ndr, "forest_trust_info", r->out.forest_trust_info); ndr->depth++; + ndr_print_ptr(ndr, "forest_trust_info", *r->out.forest_trust_info); + ndr->depth++; + if (*r->out.forest_trust_info) { + ndr_print_lsa_ForestTrustInformation(ndr, "forest_trust_info", *r->out.forest_trust_info); + } + ndr->depth--; + ndr->depth--; ndr_print_NTSTATUS(ndr, "result", r->out.result); ndr->depth--; } @@ -10215,7 +11141,7 @@ _PUBLIC_ void ndr_print_lsa_CREDRRENAME(struct ndr_print *ndr, const char *name, ndr->depth--; } -static enum ndr_err_code ndr_push_lsa_LookupSids3(struct ndr_push *ndr, int flags, const struct lsa_LookupSids3 *r) +_PUBLIC_ enum ndr_err_code ndr_push_lsa_LookupSids3(struct ndr_push *ndr, int flags, const struct lsa_LookupSids3 *r) { if (flags & NDR_IN) { if (r->in.sids == NULL) { @@ -10235,9 +11161,12 @@ static enum ndr_err_code ndr_push_lsa_LookupSids3(struct ndr_push *ndr, int flag NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.unknown2)); } if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.domains)); - if (r->out.domains) { - NDR_CHECK(ndr_push_lsa_RefDomainList(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.domains)); + if (r->out.domains == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.domains)); + if (*r->out.domains) { + NDR_CHECK(ndr_push_lsa_RefDomainList(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.domains)); } if (r->out.names == NULL) { return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); @@ -10252,11 +11181,12 @@ static enum ndr_err_code ndr_push_lsa_LookupSids3(struct ndr_push *ndr, int flag return NDR_ERR_SUCCESS; } -static enum ndr_err_code ndr_pull_lsa_LookupSids3(struct ndr_pull *ndr, int flags, struct lsa_LookupSids3 *r) +_PUBLIC_ enum ndr_err_code ndr_pull_lsa_LookupSids3(struct ndr_pull *ndr, int flags, struct lsa_LookupSids3 *r) { uint32_t _ptr_domains; TALLOC_CTX *_mem_save_sids_0; TALLOC_CTX *_mem_save_domains_0; + TALLOC_CTX *_mem_save_domains_1; TALLOC_CTX *_mem_save_names_0; TALLOC_CTX *_mem_save_count_0; if (flags & NDR_IN) { @@ -10286,24 +11216,32 @@ static enum ndr_err_code ndr_pull_lsa_LookupSids3(struct ndr_pull *ndr, int flag NDR_PULL_SET_MEM_CTX(ndr, _mem_save_count_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_PULL_ALLOC(ndr, r->out.domains); + ZERO_STRUCTP(r->out.domains); NDR_PULL_ALLOC(ndr, r->out.names); *r->out.names = *r->in.names; NDR_PULL_ALLOC(ndr, r->out.count); *r->out.count = *r->in.count; } if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.domains); + } + _mem_save_domains_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.domains, LIBNDR_FLAG_REF_ALLOC); NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_domains)); if (_ptr_domains) { - NDR_PULL_ALLOC(ndr, r->out.domains); + NDR_PULL_ALLOC(ndr, *r->out.domains); } else { - r->out.domains = NULL; + *r->out.domains = NULL; } - if (r->out.domains) { - _mem_save_domains_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.domains, 0); - NDR_CHECK(ndr_pull_lsa_RefDomainList(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.domains)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domains_0, 0); + if (*r->out.domains) { + _mem_save_domains_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, *r->out.domains, 0); + NDR_CHECK(ndr_pull_lsa_RefDomainList(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.domains)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domains_1, 0); } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domains_0, LIBNDR_FLAG_REF_ALLOC); if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { NDR_PULL_ALLOC(ndr, r->out.names); } @@ -10355,10 +11293,13 @@ _PUBLIC_ void ndr_print_lsa_LookupSids3(struct ndr_print *ndr, const char *name, ndr->depth++; ndr_print_ptr(ndr, "domains", r->out.domains); ndr->depth++; - if (r->out.domains) { - ndr_print_lsa_RefDomainList(ndr, "domains", r->out.domains); + ndr_print_ptr(ndr, "domains", *r->out.domains); + ndr->depth++; + if (*r->out.domains) { + ndr_print_lsa_RefDomainList(ndr, "domains", *r->out.domains); } ndr->depth--; + ndr->depth--; ndr_print_ptr(ndr, "names", r->out.names); ndr->depth++; ndr_print_lsa_TransNameArray2(ndr, "names", r->out.names); @@ -10389,7 +11330,7 @@ static enum ndr_err_code ndr_push_lsa_LookupNames4(struct ndr_push *ndr, int fla return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); } NDR_CHECK(ndr_push_lsa_TransSidArray3(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.sids)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->in.level)); + NDR_CHECK(ndr_push_lsa_LookupNamesLevel(ndr, NDR_SCALARS, r->in.level)); if (r->in.count == NULL) { return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); } @@ -10398,9 +11339,12 @@ static enum ndr_err_code ndr_push_lsa_LookupNames4(struct ndr_push *ndr, int fla NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.unknown2)); } if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.domains)); - if (r->out.domains) { - NDR_CHECK(ndr_push_lsa_RefDomainList(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.domains)); + if (r->out.domains == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.domains)); + if (*r->out.domains) { + NDR_CHECK(ndr_push_lsa_RefDomainList(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.domains)); } if (r->out.sids == NULL) { return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); @@ -10421,6 +11365,7 @@ static enum ndr_err_code ndr_pull_lsa_LookupNames4(struct ndr_pull *ndr, int fla uint32_t _ptr_domains; TALLOC_CTX *_mem_save_names_0; TALLOC_CTX *_mem_save_domains_0; + TALLOC_CTX *_mem_save_domains_1; TALLOC_CTX *_mem_save_sids_0; TALLOC_CTX *_mem_save_count_0; if (flags & NDR_IN) { @@ -10448,7 +11393,7 @@ static enum ndr_err_code ndr_pull_lsa_LookupNames4(struct ndr_pull *ndr, int fla NDR_PULL_SET_MEM_CTX(ndr, r->in.sids, LIBNDR_FLAG_REF_ALLOC); NDR_CHECK(ndr_pull_lsa_TransSidArray3(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.sids)); NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sids_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->in.level)); + NDR_CHECK(ndr_pull_lsa_LookupNamesLevel(ndr, NDR_SCALARS, &r->in.level)); if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { NDR_PULL_ALLOC(ndr, r->in.count); } @@ -10458,6 +11403,8 @@ static enum ndr_err_code ndr_pull_lsa_LookupNames4(struct ndr_pull *ndr, int fla NDR_PULL_SET_MEM_CTX(ndr, _mem_save_count_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_PULL_ALLOC(ndr, r->out.domains); + ZERO_STRUCTP(r->out.domains); NDR_PULL_ALLOC(ndr, r->out.sids); *r->out.sids = *r->in.sids; NDR_PULL_ALLOC(ndr, r->out.count); @@ -10467,18 +11414,24 @@ static enum ndr_err_code ndr_pull_lsa_LookupNames4(struct ndr_pull *ndr, int fla } } if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.domains); + } + _mem_save_domains_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.domains, LIBNDR_FLAG_REF_ALLOC); NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_domains)); if (_ptr_domains) { - NDR_PULL_ALLOC(ndr, r->out.domains); + NDR_PULL_ALLOC(ndr, *r->out.domains); } else { - r->out.domains = NULL; + *r->out.domains = NULL; } - if (r->out.domains) { - _mem_save_domains_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.domains, 0); - NDR_CHECK(ndr_pull_lsa_RefDomainList(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.domains)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domains_0, 0); + if (*r->out.domains) { + _mem_save_domains_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, *r->out.domains, 0); + NDR_CHECK(ndr_pull_lsa_RefDomainList(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.domains)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domains_1, 0); } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domains_0, LIBNDR_FLAG_REF_ALLOC); if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { NDR_PULL_ALLOC(ndr, r->out.sids); } @@ -10514,8 +11467,7 @@ _PUBLIC_ void ndr_print_lsa_LookupNames4(struct ndr_print *ndr, const char *name 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) { + if (asprintf(&idx_0, "[%d]", cntr_names_0) != -1) { ndr_print_lsa_String(ndr, "names", &r->in.names[cntr_names_0]); free(idx_0); } @@ -10525,7 +11477,7 @@ _PUBLIC_ void ndr_print_lsa_LookupNames4(struct ndr_print *ndr, const char *name ndr->depth++; ndr_print_lsa_TransSidArray3(ndr, "sids", r->in.sids); ndr->depth--; - ndr_print_uint16(ndr, "level", r->in.level); + ndr_print_lsa_LookupNamesLevel(ndr, "level", r->in.level); ndr_print_ptr(ndr, "count", r->in.count); ndr->depth++; ndr_print_uint32(ndr, "count", *r->in.count); @@ -10539,10 +11491,13 @@ _PUBLIC_ void ndr_print_lsa_LookupNames4(struct ndr_print *ndr, const char *name ndr->depth++; ndr_print_ptr(ndr, "domains", r->out.domains); ndr->depth++; - if (r->out.domains) { - ndr_print_lsa_RefDomainList(ndr, "domains", r->out.domains); + ndr_print_ptr(ndr, "domains", *r->out.domains); + ndr->depth++; + if (*r->out.domains) { + ndr_print_lsa_RefDomainList(ndr, "domains", *r->out.domains); } ndr->depth--; + ndr->depth--; ndr_print_ptr(ndr, "sids", r->out.sids); ndr->depth++; ndr_print_lsa_TransSidArray3(ndr, "sids", r->out.sids); @@ -11307,11 +12262,11 @@ static const struct ndr_interface_call lsarpc_calls[] = { false, }, { - "lsa_LSARQUERYFORESTTRUSTINFORMATION", - sizeof(struct lsa_LSARQUERYFORESTTRUSTINFORMATION), - (ndr_push_flags_fn_t) ndr_push_lsa_LSARQUERYFORESTTRUSTINFORMATION, - (ndr_pull_flags_fn_t) ndr_pull_lsa_LSARQUERYFORESTTRUSTINFORMATION, - (ndr_print_function_t) ndr_print_lsa_LSARQUERYFORESTTRUSTINFORMATION, + "lsa_lsaRQueryForestTrustInformation", + sizeof(struct lsa_lsaRQueryForestTrustInformation), + (ndr_push_flags_fn_t) ndr_push_lsa_lsaRQueryForestTrustInformation, + (ndr_pull_flags_fn_t) ndr_pull_lsa_lsaRQueryForestTrustInformation, + (ndr_print_function_t) ndr_print_lsa_lsaRQueryForestTrustInformation, false, }, { diff --git a/source3/librpc/gen_ndr/ndr_lsa.h b/source3/librpc/gen_ndr/ndr_lsa.h index dc100297f5..a96f2d41b9 100644 --- a/source3/librpc/gen_ndr/ndr_lsa.h +++ b/source3/librpc/gen_ndr/ndr_lsa.h @@ -188,12 +188,19 @@ void ndr_print_lsa_Strings(struct ndr_print *ndr, const char *name, const struct enum ndr_err_code ndr_push_lsa_AsciiString(struct ndr_push *ndr, int ndr_flags, const struct lsa_AsciiString *r); enum ndr_err_code ndr_pull_lsa_AsciiString(struct ndr_pull *ndr, int ndr_flags, struct lsa_AsciiString *r); void ndr_print_lsa_AsciiString(struct ndr_print *ndr, const char *name, const struct lsa_AsciiString *r); +enum ndr_err_code ndr_push_lsa_AsciiStringLarge(struct ndr_push *ndr, int ndr_flags, const struct lsa_AsciiStringLarge *r); +enum ndr_err_code ndr_pull_lsa_AsciiStringLarge(struct ndr_pull *ndr, int ndr_flags, struct lsa_AsciiStringLarge *r); +void ndr_print_lsa_AsciiStringLarge(struct ndr_print *ndr, const char *name, const struct lsa_AsciiStringLarge *r); void ndr_print_lsa_LUID(struct ndr_print *ndr, const char *name, const struct lsa_LUID *r); void ndr_print_lsa_PrivEntry(struct ndr_print *ndr, const char *name, const struct lsa_PrivEntry *r); void ndr_print_lsa_PrivArray(struct ndr_print *ndr, const char *name, const struct lsa_PrivArray *r); void ndr_print_lsa_QosInfo(struct ndr_print *ndr, const char *name, const struct lsa_QosInfo *r); void ndr_print_lsa_ObjectAttribute(struct ndr_print *ndr, const char *name, const struct lsa_ObjectAttribute *r); +enum ndr_err_code ndr_push_lsa_PolicyAccessMask(struct ndr_push *ndr, int ndr_flags, uint32_t r); +enum ndr_err_code ndr_pull_lsa_PolicyAccessMask(struct ndr_pull *ndr, int ndr_flags, uint32_t *r); +void ndr_print_lsa_PolicyAccessMask(struct ndr_print *ndr, const char *name, uint32_t r); void ndr_print_lsa_AuditLogInfo(struct ndr_print *ndr, const char *name, const struct lsa_AuditLogInfo *r); +void ndr_print_lsa_PolicyAuditPolicy(struct ndr_print *ndr, const char *name, enum lsa_PolicyAuditPolicy r); void ndr_print_lsa_AuditEventsInfo(struct ndr_print *ndr, const char *name, const struct lsa_AuditEventsInfo *r); void ndr_print_lsa_DomainInfo(struct ndr_print *ndr, const char *name, const struct lsa_DomainInfo *r); void ndr_print_lsa_PDAccountInfo(struct ndr_print *ndr, const char *name, const struct lsa_PDAccountInfo *r); @@ -215,6 +222,7 @@ void ndr_print_lsa_SidType(struct ndr_print *ndr, const char *name, enum lsa_Sid void ndr_print_lsa_TranslatedSid(struct ndr_print *ndr, const char *name, const struct lsa_TranslatedSid *r); void ndr_print_lsa_TransSidArray(struct ndr_print *ndr, const char *name, const struct lsa_TransSidArray *r); void ndr_print_lsa_RefDomainList(struct ndr_print *ndr, const char *name, const struct lsa_RefDomainList *r); +void ndr_print_lsa_LookupNamesLevel(struct ndr_print *ndr, const char *name, enum lsa_LookupNamesLevel r); void ndr_print_lsa_TranslatedName(struct ndr_print *ndr, const char *name, const struct lsa_TranslatedName *r); void ndr_print_lsa_TransNameArray(struct ndr_print *ndr, const char *name, const struct lsa_TransNameArray *r); void ndr_print_lsa_LUIDAttribute(struct ndr_print *ndr, const char *name, const struct lsa_LUIDAttribute *r); @@ -235,7 +243,6 @@ void ndr_print_lsa_TrustDomainInfoInfoAll(struct ndr_print *ndr, const char *nam void ndr_print_lsa_TrustedDomainInfo(struct ndr_print *ndr, const char *name, const union lsa_TrustedDomainInfo *r); void ndr_print_lsa_DATA_BUF_PTR(struct ndr_print *ndr, const char *name, const struct lsa_DATA_BUF_PTR *r); void ndr_print_lsa_RightSet(struct ndr_print *ndr, const char *name, const struct lsa_RightSet *r); -void ndr_print_lsa_StringPointer(struct ndr_print *ndr, const char *name, const struct lsa_StringPointer *r); void ndr_print_lsa_DomainListEx(struct ndr_print *ndr, const char *name, const struct lsa_DomainListEx *r); void ndr_print_lsa_DomainInfoKerberos(struct ndr_print *ndr, const char *name, const struct lsa_DomainInfoKerberos *r); void ndr_print_lsa_DomainInfoEfs(struct ndr_print *ndr, const char *name, const struct lsa_DomainInfoEfs *r); @@ -246,22 +253,48 @@ void ndr_print_lsa_TranslatedSid2(struct ndr_print *ndr, const char *name, const void ndr_print_lsa_TransSidArray2(struct ndr_print *ndr, const char *name, const struct lsa_TransSidArray2 *r); void ndr_print_lsa_TranslatedSid3(struct ndr_print *ndr, const char *name, const struct lsa_TranslatedSid3 *r); void ndr_print_lsa_TransSidArray3(struct ndr_print *ndr, const char *name, const struct lsa_TransSidArray3 *r); +void ndr_print_lsa_ForestTrustBinaryData(struct ndr_print *ndr, const char *name, const struct lsa_ForestTrustBinaryData *r); +void ndr_print_lsa_ForestTrustDomainInfo(struct ndr_print *ndr, const char *name, const struct lsa_ForestTrustDomainInfo *r); +void ndr_print_lsa_ForestTrustData(struct ndr_print *ndr, const char *name, const union lsa_ForestTrustData *r); +void ndr_print_lsa_ForestTrustRecordType(struct ndr_print *ndr, const char *name, enum lsa_ForestTrustRecordType r); +void ndr_print_lsa_ForestTrustRecord(struct ndr_print *ndr, const char *name, const struct lsa_ForestTrustRecord *r); +enum ndr_err_code ndr_push_lsa_ForestTrustInformation(struct ndr_push *ndr, int ndr_flags, const struct lsa_ForestTrustInformation *r); +enum ndr_err_code ndr_pull_lsa_ForestTrustInformation(struct ndr_pull *ndr, int ndr_flags, struct lsa_ForestTrustInformation *r); +void ndr_print_lsa_ForestTrustInformation(struct ndr_print *ndr, const char *name, const struct lsa_ForestTrustInformation *r); void ndr_print_lsa_Close(struct ndr_print *ndr, const char *name, int flags, const struct lsa_Close *r); +enum ndr_err_code ndr_push_lsa_Delete(struct ndr_push *ndr, int flags, const struct lsa_Delete *r); +enum ndr_err_code ndr_pull_lsa_Delete(struct ndr_pull *ndr, int flags, struct lsa_Delete *r); void ndr_print_lsa_Delete(struct ndr_print *ndr, const char *name, int flags, const struct lsa_Delete *r); +enum ndr_err_code ndr_push_lsa_EnumPrivs(struct ndr_push *ndr, int flags, const struct lsa_EnumPrivs *r); +enum ndr_err_code ndr_pull_lsa_EnumPrivs(struct ndr_pull *ndr, int flags, struct lsa_EnumPrivs *r); void ndr_print_lsa_EnumPrivs(struct ndr_print *ndr, const char *name, int flags, const struct lsa_EnumPrivs *r); void ndr_print_lsa_QuerySecurity(struct ndr_print *ndr, const char *name, int flags, const struct lsa_QuerySecurity *r); void ndr_print_lsa_SetSecObj(struct ndr_print *ndr, const char *name, int flags, const struct lsa_SetSecObj *r); void ndr_print_lsa_ChangePassword(struct ndr_print *ndr, const char *name, int flags, const struct lsa_ChangePassword *r); +enum ndr_err_code ndr_push_lsa_OpenPolicy(struct ndr_push *ndr, int flags, const struct lsa_OpenPolicy *r); +enum ndr_err_code ndr_pull_lsa_OpenPolicy(struct ndr_pull *ndr, int flags, struct lsa_OpenPolicy *r); void ndr_print_lsa_OpenPolicy(struct ndr_print *ndr, const char *name, int flags, const struct lsa_OpenPolicy *r); void ndr_print_lsa_QueryInfoPolicy(struct ndr_print *ndr, const char *name, int flags, const struct lsa_QueryInfoPolicy *r); void ndr_print_lsa_SetInfoPolicy(struct ndr_print *ndr, const char *name, int flags, const struct lsa_SetInfoPolicy *r); void ndr_print_lsa_ClearAuditLog(struct ndr_print *ndr, const char *name, int flags, const struct lsa_ClearAuditLog *r); +enum ndr_err_code ndr_push_lsa_CreateAccount(struct ndr_push *ndr, int flags, const struct lsa_CreateAccount *r); +enum ndr_err_code ndr_pull_lsa_CreateAccount(struct ndr_pull *ndr, int flags, struct lsa_CreateAccount *r); void ndr_print_lsa_CreateAccount(struct ndr_print *ndr, const char *name, int flags, const struct lsa_CreateAccount *r); +enum ndr_err_code ndr_push_lsa_EnumAccounts(struct ndr_push *ndr, int flags, const struct lsa_EnumAccounts *r); +enum ndr_err_code ndr_pull_lsa_EnumAccounts(struct ndr_pull *ndr, int flags, struct lsa_EnumAccounts *r); void ndr_print_lsa_EnumAccounts(struct ndr_print *ndr, const char *name, int flags, const struct lsa_EnumAccounts *r); +enum ndr_err_code ndr_push_lsa_CreateTrustedDomain(struct ndr_push *ndr, int flags, const struct lsa_CreateTrustedDomain *r); +enum ndr_err_code ndr_pull_lsa_CreateTrustedDomain(struct ndr_pull *ndr, int flags, struct lsa_CreateTrustedDomain *r); void ndr_print_lsa_CreateTrustedDomain(struct ndr_print *ndr, const char *name, int flags, const struct lsa_CreateTrustedDomain *r); void ndr_print_lsa_EnumTrustDom(struct ndr_print *ndr, const char *name, int flags, const struct lsa_EnumTrustDom *r); +enum ndr_err_code ndr_push_lsa_LookupNames(struct ndr_push *ndr, int flags, const struct lsa_LookupNames *r); +enum ndr_err_code ndr_pull_lsa_LookupNames(struct ndr_pull *ndr, int flags, struct lsa_LookupNames *r); void ndr_print_lsa_LookupNames(struct ndr_print *ndr, const char *name, int flags, const struct lsa_LookupNames *r); +enum ndr_err_code ndr_push_lsa_LookupSids(struct ndr_push *ndr, int flags, const struct lsa_LookupSids *r); +enum ndr_err_code ndr_pull_lsa_LookupSids(struct ndr_pull *ndr, int flags, struct lsa_LookupSids *r); void ndr_print_lsa_LookupSids(struct ndr_print *ndr, const char *name, int flags, const struct lsa_LookupSids *r); +enum ndr_err_code ndr_push_lsa_CreateSecret(struct ndr_push *ndr, int flags, const struct lsa_CreateSecret *r); +enum ndr_err_code ndr_pull_lsa_CreateSecret(struct ndr_pull *ndr, int flags, struct lsa_CreateSecret *r); void ndr_print_lsa_CreateSecret(struct ndr_print *ndr, const char *name, int flags, const struct lsa_CreateSecret *r); void ndr_print_lsa_OpenAccount(struct ndr_print *ndr, const char *name, int flags, const struct lsa_OpenAccount *r); void ndr_print_lsa_EnumPrivsAccount(struct ndr_print *ndr, const char *name, int flags, const struct lsa_EnumPrivsAccount *r); @@ -274,8 +307,14 @@ void ndr_print_lsa_SetSystemAccessAccount(struct ndr_print *ndr, const char *nam void ndr_print_lsa_OpenTrustedDomain(struct ndr_print *ndr, const char *name, int flags, const struct lsa_OpenTrustedDomain *r); void ndr_print_lsa_QueryTrustedDomainInfo(struct ndr_print *ndr, const char *name, int flags, const struct lsa_QueryTrustedDomainInfo *r); void ndr_print_lsa_SetInformationTrustedDomain(struct ndr_print *ndr, const char *name, int flags, const struct lsa_SetInformationTrustedDomain *r); +enum ndr_err_code ndr_push_lsa_OpenSecret(struct ndr_push *ndr, int flags, const struct lsa_OpenSecret *r); +enum ndr_err_code ndr_pull_lsa_OpenSecret(struct ndr_pull *ndr, int flags, struct lsa_OpenSecret *r); void ndr_print_lsa_OpenSecret(struct ndr_print *ndr, const char *name, int flags, const struct lsa_OpenSecret *r); +enum ndr_err_code ndr_push_lsa_SetSecret(struct ndr_push *ndr, int flags, const struct lsa_SetSecret *r); +enum ndr_err_code ndr_pull_lsa_SetSecret(struct ndr_pull *ndr, int flags, struct lsa_SetSecret *r); void ndr_print_lsa_SetSecret(struct ndr_print *ndr, const char *name, int flags, const struct lsa_SetSecret *r); +enum ndr_err_code ndr_push_lsa_QuerySecret(struct ndr_push *ndr, int flags, const struct lsa_QuerySecret *r); +enum ndr_err_code ndr_pull_lsa_QuerySecret(struct ndr_pull *ndr, int flags, struct lsa_QuerySecret *r); void ndr_print_lsa_QuerySecret(struct ndr_print *ndr, const char *name, int flags, const struct lsa_QuerySecret *r); void ndr_print_lsa_LookupPrivValue(struct ndr_print *ndr, const char *name, int flags, const struct lsa_LookupPrivValue *r); void ndr_print_lsa_LookupPrivName(struct ndr_print *ndr, const char *name, int flags, const struct lsa_LookupPrivName *r); @@ -290,6 +329,8 @@ void ndr_print_lsa_SetTrustedDomainInfo(struct ndr_print *ndr, const char *name, void ndr_print_lsa_DeleteTrustedDomain(struct ndr_print *ndr, const char *name, int flags, const struct lsa_DeleteTrustedDomain *r); void ndr_print_lsa_StorePrivateData(struct ndr_print *ndr, const char *name, int flags, const struct lsa_StorePrivateData *r); void ndr_print_lsa_RetrievePrivateData(struct ndr_print *ndr, const char *name, int flags, const struct lsa_RetrievePrivateData *r); +enum ndr_err_code ndr_push_lsa_OpenPolicy2(struct ndr_push *ndr, int flags, const struct lsa_OpenPolicy2 *r); +enum ndr_err_code ndr_pull_lsa_OpenPolicy2(struct ndr_pull *ndr, int flags, struct lsa_OpenPolicy2 *r); void ndr_print_lsa_OpenPolicy2(struct ndr_print *ndr, const char *name, int flags, const struct lsa_OpenPolicy2 *r); void ndr_print_lsa_GetUserName(struct ndr_print *ndr, const char *name, int flags, const struct lsa_GetUserName *r); void ndr_print_lsa_QueryInfoPolicy2(struct ndr_print *ndr, const char *name, int flags, const struct lsa_QueryInfoPolicy2 *r); @@ -303,7 +344,11 @@ void ndr_print_lsa_QueryDomainInformationPolicy(struct ndr_print *ndr, const cha void ndr_print_lsa_SetDomainInformationPolicy(struct ndr_print *ndr, const char *name, int flags, const struct lsa_SetDomainInformationPolicy *r); void ndr_print_lsa_OpenTrustedDomainByName(struct ndr_print *ndr, const char *name, int flags, const struct lsa_OpenTrustedDomainByName *r); void ndr_print_lsa_TestCall(struct ndr_print *ndr, const char *name, int flags, const struct lsa_TestCall *r); +enum ndr_err_code ndr_push_lsa_LookupSids2(struct ndr_push *ndr, int flags, const struct lsa_LookupSids2 *r); +enum ndr_err_code ndr_pull_lsa_LookupSids2(struct ndr_pull *ndr, int flags, struct lsa_LookupSids2 *r); void ndr_print_lsa_LookupSids2(struct ndr_print *ndr, const char *name, int flags, const struct lsa_LookupSids2 *r); +enum ndr_err_code ndr_push_lsa_LookupNames2(struct ndr_push *ndr, int flags, const struct lsa_LookupNames2 *r); +enum ndr_err_code ndr_pull_lsa_LookupNames2(struct ndr_pull *ndr, int flags, struct lsa_LookupNames2 *r); void ndr_print_lsa_LookupNames2(struct ndr_print *ndr, const char *name, int flags, const struct lsa_LookupNames2 *r); void ndr_print_lsa_CreateTrustedDomainEx2(struct ndr_print *ndr, const char *name, int flags, const struct lsa_CreateTrustedDomainEx2 *r); void ndr_print_lsa_CREDRWRITE(struct ndr_print *ndr, const char *name, int flags, const struct lsa_CREDRWRITE *r); @@ -314,14 +359,18 @@ void ndr_print_lsa_CREDRREADDOMAINCREDENTIALS(struct ndr_print *ndr, const char void ndr_print_lsa_CREDRDELETE(struct ndr_print *ndr, const char *name, int flags, const struct lsa_CREDRDELETE *r); void ndr_print_lsa_CREDRGETTARGETINFO(struct ndr_print *ndr, const char *name, int flags, const struct lsa_CREDRGETTARGETINFO *r); void ndr_print_lsa_CREDRPROFILELOADED(struct ndr_print *ndr, const char *name, int flags, const struct lsa_CREDRPROFILELOADED *r); +enum ndr_err_code ndr_push_lsa_LookupNames3(struct ndr_push *ndr, int flags, const struct lsa_LookupNames3 *r); +enum ndr_err_code ndr_pull_lsa_LookupNames3(struct ndr_pull *ndr, int flags, struct lsa_LookupNames3 *r); void ndr_print_lsa_LookupNames3(struct ndr_print *ndr, const char *name, int flags, const struct lsa_LookupNames3 *r); void ndr_print_lsa_CREDRGETSESSIONTYPES(struct ndr_print *ndr, const char *name, int flags, const struct lsa_CREDRGETSESSIONTYPES *r); void ndr_print_lsa_LSARREGISTERAUDITEVENT(struct ndr_print *ndr, const char *name, int flags, const struct lsa_LSARREGISTERAUDITEVENT *r); void ndr_print_lsa_LSARGENAUDITEVENT(struct ndr_print *ndr, const char *name, int flags, const struct lsa_LSARGENAUDITEVENT *r); void ndr_print_lsa_LSARUNREGISTERAUDITEVENT(struct ndr_print *ndr, const char *name, int flags, const struct lsa_LSARUNREGISTERAUDITEVENT *r); -void ndr_print_lsa_LSARQUERYFORESTTRUSTINFORMATION(struct ndr_print *ndr, const char *name, int flags, const struct lsa_LSARQUERYFORESTTRUSTINFORMATION *r); +void ndr_print_lsa_lsaRQueryForestTrustInformation(struct ndr_print *ndr, const char *name, int flags, const struct lsa_lsaRQueryForestTrustInformation *r); void ndr_print_lsa_LSARSETFORESTTRUSTINFORMATION(struct ndr_print *ndr, const char *name, int flags, const struct lsa_LSARSETFORESTTRUSTINFORMATION *r); void ndr_print_lsa_CREDRRENAME(struct ndr_print *ndr, const char *name, int flags, const struct lsa_CREDRRENAME *r); +enum ndr_err_code ndr_push_lsa_LookupSids3(struct ndr_push *ndr, int flags, const struct lsa_LookupSids3 *r); +enum ndr_err_code ndr_pull_lsa_LookupSids3(struct ndr_pull *ndr, int flags, struct lsa_LookupSids3 *r); void ndr_print_lsa_LookupSids3(struct ndr_print *ndr, const char *name, int flags, const struct lsa_LookupSids3 *r); void ndr_print_lsa_LookupNames4(struct ndr_print *ndr, const char *name, int flags, const struct lsa_LookupNames4 *r); void ndr_print_lsa_LSAROPENPOLICYSCE(struct ndr_print *ndr, const char *name, int flags, const struct lsa_LSAROPENPOLICYSCE *r); diff --git a/source3/librpc/gen_ndr/ndr_messaging.c b/source3/librpc/gen_ndr/ndr_messaging.c index 413421f770..db886316f1 100644 --- a/source3/librpc/gen_ndr/ndr_messaging.c +++ b/source3/librpc/gen_ndr/ndr_messaging.c @@ -103,8 +103,7 @@ _PUBLIC_ void ndr_print_messaging_array(struct ndr_print *ndr, const char *name, ndr->depth++; for (cntr_messages_0=0;cntr_messages_0<r->num_messages;cntr_messages_0++) { char *idx_0=NULL; - asprintf(&idx_0, "[%d]", cntr_messages_0); - if (idx_0) { + if (asprintf(&idx_0, "[%d]", cntr_messages_0) != -1) { ndr_print_messaging_rec(ndr, "messages", &r->messages[cntr_messages_0]); free(idx_0); } diff --git a/source3/librpc/gen_ndr/ndr_misc.c b/source3/librpc/gen_ndr/ndr_misc.c new file mode 100644 index 0000000000..56105d499f --- /dev/null +++ b/source3/librpc/gen_ndr/ndr_misc.c @@ -0,0 +1,185 @@ +/* parser auto-generated by pidl */ + +#include "includes.h" +#include "librpc/gen_ndr/ndr_misc.h" + +_PUBLIC_ enum ndr_err_code ndr_push_GUID(struct ndr_push *ndr, int ndr_flags, const struct GUID *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->time_low)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->time_mid)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->time_hi_and_version)); + NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->clock_seq, 2)); + NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->node, 6)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_GUID(struct ndr_pull *ndr, int ndr_flags, struct GUID *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->time_low)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->time_mid)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->time_hi_and_version)); + NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->clock_seq, 2)); + NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->node, 6)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ size_t ndr_size_GUID(const struct GUID *r, int flags) +{ + return ndr_size_struct(r, flags, (ndr_push_flags_fn_t)ndr_push_GUID); +} + +_PUBLIC_ enum ndr_err_code ndr_push_ndr_syntax_id(struct ndr_push *ndr, int ndr_flags, const struct ndr_syntax_id *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->uuid)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->if_version)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_ndr_syntax_id(struct ndr_pull *ndr, int ndr_flags, struct ndr_syntax_id *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->uuid)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->if_version)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_ndr_syntax_id(struct ndr_print *ndr, const char *name, const struct ndr_syntax_id *r) +{ + ndr_print_struct(ndr, name, "ndr_syntax_id"); + ndr->depth++; + ndr_print_GUID(ndr, "uuid", &r->uuid); + ndr_print_uint32(ndr, "if_version", r->if_version); + ndr->depth--; +} + +_PUBLIC_ enum ndr_err_code ndr_push_policy_handle(struct ndr_push *ndr, int ndr_flags, const struct policy_handle *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->handle_type)); + NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->uuid)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_policy_handle(struct ndr_pull *ndr, int ndr_flags, struct policy_handle *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->handle_type)); + NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->uuid)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_policy_handle(struct ndr_print *ndr, const char *name, const struct policy_handle *r) +{ + ndr_print_struct(ndr, name, "policy_handle"); + ndr->depth++; + ndr_print_uint32(ndr, "handle_type", r->handle_type); + ndr_print_GUID(ndr, "uuid", &r->uuid); + ndr->depth--; +} + +_PUBLIC_ enum ndr_err_code ndr_push_netr_SchannelType(struct ndr_push *ndr, int ndr_flags, enum netr_SchannelType r) +{ + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r)); + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_netr_SchannelType(struct ndr_pull *ndr, int ndr_flags, enum netr_SchannelType *r) +{ + uint16_t v; + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &v)); + *r = v; + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_netr_SchannelType(struct ndr_print *ndr, const char *name, enum netr_SchannelType r) +{ + const char *val = NULL; + + switch (r) { + case SEC_CHAN_WKSTA: val = "SEC_CHAN_WKSTA"; break; + case SEC_CHAN_DOMAIN: val = "SEC_CHAN_DOMAIN"; break; + case SEC_CHAN_BDC: val = "SEC_CHAN_BDC"; break; + } + ndr_print_enum(ndr, name, "ENUM", val, r); +} + +_PUBLIC_ enum ndr_err_code ndr_push_netr_SamDatabaseID(struct ndr_push *ndr, int ndr_flags, enum netr_SamDatabaseID r) +{ + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_netr_SamDatabaseID(struct ndr_pull *ndr, int ndr_flags, enum netr_SamDatabaseID *r) +{ + uint32_t v; + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); + *r = v; + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_netr_SamDatabaseID(struct ndr_print *ndr, const char *name, enum netr_SamDatabaseID r) +{ + const char *val = NULL; + + switch (r) { + case SAM_DATABASE_DOMAIN: val = "SAM_DATABASE_DOMAIN"; break; + case SAM_DATABASE_BUILTIN: val = "SAM_DATABASE_BUILTIN"; break; + case SAM_DATABASE_PRIVS: val = "SAM_DATABASE_PRIVS"; break; + } + ndr_print_enum(ndr, name, "ENUM", val, r); +} + +_PUBLIC_ enum ndr_err_code ndr_push_samr_RejectReason(struct ndr_push *ndr, int ndr_flags, enum samr_RejectReason r) +{ + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_samr_RejectReason(struct ndr_pull *ndr, int ndr_flags, enum samr_RejectReason *r) +{ + uint32_t v; + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); + *r = v; + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_RejectReason(struct ndr_print *ndr, const char *name, enum samr_RejectReason r) +{ + const char *val = NULL; + + switch (r) { + case SAMR_REJECT_OTHER: val = "SAMR_REJECT_OTHER"; break; + case SAMR_REJECT_TOO_SHORT: val = "SAMR_REJECT_TOO_SHORT"; break; + case SAMR_REJECT_IN_HISTORY: val = "SAMR_REJECT_IN_HISTORY"; break; + case SAMR_REJECT_COMPLEXITY: val = "SAMR_REJECT_COMPLEXITY"; break; + } + ndr_print_enum(ndr, name, "ENUM", val, r); +} + diff --git a/source3/librpc/gen_ndr/ndr_misc.h b/source3/librpc/gen_ndr/ndr_misc.h index d43a7d8b4a..a15a781367 100644 --- a/source3/librpc/gen_ndr/ndr_misc.h +++ b/source3/librpc/gen_ndr/ndr_misc.h @@ -1 +1,29 @@ -#include "ndr/ndr_misc.h" +/* header auto-generated by pidl */ + +#include "librpc/ndr/libndr.h" +#include "librpc/gen_ndr/misc.h" + +#ifndef _HEADER_NDR_misc +#define _HEADER_NDR_misc + +#define NDR_MISC_CALL_COUNT (0) +enum ndr_err_code ndr_push_GUID(struct ndr_push *ndr, int ndr_flags, const struct GUID *r); +enum ndr_err_code ndr_pull_GUID(struct ndr_pull *ndr, int ndr_flags, struct GUID *r); +void ndr_print_GUID(struct ndr_print *ndr, const char *name, const struct GUID *r); +size_t ndr_size_GUID(const struct GUID *r, int flags); +enum ndr_err_code ndr_push_ndr_syntax_id(struct ndr_push *ndr, int ndr_flags, const struct ndr_syntax_id *r); +enum ndr_err_code ndr_pull_ndr_syntax_id(struct ndr_pull *ndr, int ndr_flags, struct ndr_syntax_id *r); +void ndr_print_ndr_syntax_id(struct ndr_print *ndr, const char *name, const struct ndr_syntax_id *r); +enum ndr_err_code ndr_push_policy_handle(struct ndr_push *ndr, int ndr_flags, const struct policy_handle *r); +enum ndr_err_code ndr_pull_policy_handle(struct ndr_pull *ndr, int ndr_flags, struct policy_handle *r); +void ndr_print_policy_handle(struct ndr_print *ndr, const char *name, const struct policy_handle *r); +enum ndr_err_code ndr_push_netr_SchannelType(struct ndr_push *ndr, int ndr_flags, enum netr_SchannelType r); +enum ndr_err_code ndr_pull_netr_SchannelType(struct ndr_pull *ndr, int ndr_flags, enum netr_SchannelType *r); +void ndr_print_netr_SchannelType(struct ndr_print *ndr, const char *name, enum netr_SchannelType r); +enum ndr_err_code ndr_push_netr_SamDatabaseID(struct ndr_push *ndr, int ndr_flags, enum netr_SamDatabaseID r); +enum ndr_err_code ndr_pull_netr_SamDatabaseID(struct ndr_pull *ndr, int ndr_flags, enum netr_SamDatabaseID *r); +void ndr_print_netr_SamDatabaseID(struct ndr_print *ndr, const char *name, enum netr_SamDatabaseID r); +enum ndr_err_code ndr_push_samr_RejectReason(struct ndr_push *ndr, int ndr_flags, enum samr_RejectReason r); +enum ndr_err_code ndr_pull_samr_RejectReason(struct ndr_pull *ndr, int ndr_flags, enum samr_RejectReason *r); +void ndr_print_samr_RejectReason(struct ndr_print *ndr, const char *name, enum samr_RejectReason r); +#endif /* _HEADER_NDR_misc */ diff --git a/source3/librpc/gen_ndr/ndr_netlogon.c b/source3/librpc/gen_ndr/ndr_netlogon.c index 081c87fb12..4c46fb0735 100644 --- a/source3/librpc/gen_ndr/ndr_netlogon.c +++ b/source3/librpc/gen_ndr/ndr_netlogon.c @@ -315,8 +315,7 @@ _PUBLIC_ void ndr_print_netr_AcctLockStr(struct ndr_print *ndr, const char *name ndr->depth++; for (cntr_bindata_1=0;cntr_bindata_1<r->length / 2;cntr_bindata_1++) { char *idx_1=NULL; - asprintf(&idx_1, "[%d]", cntr_bindata_1); - if (idx_1) { + if (asprintf(&idx_1, "[%d]", cntr_bindata_1) != -1) { ndr_print_uint16(ndr, "bindata", r->bindata[cntr_bindata_1]); free(idx_1); } @@ -327,12 +326,39 @@ _PUBLIC_ void ndr_print_netr_AcctLockStr(struct ndr_print *ndr, const char *name ndr->depth--; } +_PUBLIC_ enum ndr_err_code ndr_push_netr_LogonParameterControl(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_netr_LogonParameterControl(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_netr_LogonParameterControl(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), "MSV1_0_CLEARTEXT_PASSWORD_ALLOWED", MSV1_0_CLEARTEXT_PASSWORD_ALLOWED, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "MSV1_0_UPDATE_LOGON_STATISTICS", MSV1_0_UPDATE_LOGON_STATISTICS, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "MSV1_0_RETURN_USER_PARAMETERS", MSV1_0_RETURN_USER_PARAMETERS, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "MSV1_0_ALLOW_SERVER_TRUST_ACCOUNT", MSV1_0_ALLOW_SERVER_TRUST_ACCOUNT, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "MSV1_0_RETURN_PROFILE_PATH", MSV1_0_RETURN_PROFILE_PATH, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "MSV1_0_ALLOW_WORKSTATION_TRUST_ACCOUNT", MSV1_0_ALLOW_WORKSTATION_TRUST_ACCOUNT, r); + ndr->depth--; +} + static enum ndr_err_code ndr_push_netr_IdentityInfo(struct ndr_push *ndr, int ndr_flags, const struct netr_IdentityInfo *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)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->parameter_control)); + NDR_CHECK(ndr_push_netr_LogonParameterControl(ndr, NDR_SCALARS, r->parameter_control)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->logon_id_low)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->logon_id_high)); NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->account_name)); @@ -351,7 +377,7 @@ static enum ndr_err_code ndr_pull_netr_IdentityInfo(struct ndr_pull *ndr, int nd if (ndr_flags & NDR_SCALARS) { NDR_CHECK(ndr_pull_align(ndr, 4)); NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->domain_name)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->parameter_control)); + NDR_CHECK(ndr_pull_netr_LogonParameterControl(ndr, NDR_SCALARS, &r->parameter_control)); NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->logon_id_low)); NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->logon_id_high)); NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->account_name)); @@ -370,7 +396,7 @@ _PUBLIC_ void ndr_print_netr_IdentityInfo(struct ndr_print *ndr, const char *nam ndr_print_struct(ndr, name, "netr_IdentityInfo"); ndr->depth++; ndr_print_lsa_String(ndr, "domain_name", &r->domain_name); - ndr_print_uint32(ndr, "parameter_control", r->parameter_control); + ndr_print_netr_LogonParameterControl(ndr, "parameter_control", r->parameter_control); ndr_print_uint32(ndr, "logon_id_low", r->logon_id_low); ndr_print_uint32(ndr, "logon_id_high", r->logon_id_high); ndr_print_lsa_String(ndr, "account_name", &r->account_name); @@ -573,25 +599,25 @@ _PUBLIC_ enum ndr_err_code ndr_push_netr_LogonLevel(struct ndr_push *ndr, int nd int level = ndr_push_get_switch_value(ndr, r); NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, level)); switch (level) { - case 1: + case 1: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->password)); - break; + break; } - case 2: + case 2: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->network)); - break; + break; } - case 3: + case 3: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->password)); - break; + break; } - case 5: + case 5: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->password)); - break; + break; } - case 6: + case 6: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->network)); - break; + break; } default: return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); @@ -814,39 +840,6 @@ _PUBLIC_ void ndr_print_netr_LogonLevel(struct ndr_print *ndr, const char *name, } } -_PUBLIC_ enum ndr_err_code ndr_push_netr_GroupMembership(struct ndr_push *ndr, int ndr_flags, const struct netr_GroupMembership *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_uint32(ndr, NDR_SCALARS, r->attributes)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ enum ndr_err_code ndr_pull_netr_GroupMembership(struct ndr_pull *ndr, int ndr_flags, struct netr_GroupMembership *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_uint32(ndr, NDR_SCALARS, &r->attributes)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_netr_GroupMembership(struct ndr_print *ndr, const char *name, const struct netr_GroupMembership *r) -{ - ndr_print_struct(ndr, name, "netr_GroupMembership"); - ndr->depth++; - ndr_print_uint32(ndr, "rid", r->rid); - ndr_print_uint32(ndr, "attributes", r->attributes); - ndr->depth--; -} - _PUBLIC_ enum ndr_err_code ndr_push_netr_UserSessionKey(struct ndr_push *ndr, int ndr_flags, const struct netr_UserSessionKey *r) { { @@ -965,6 +958,7 @@ _PUBLIC_ void ndr_print_netr_UserFlags(struct ndr_print *ndr, const char *name, ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_NTLMV2_ENABLED", NETLOGON_NTLMV2_ENABLED, r); ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_RESOURCE_GROUPS", NETLOGON_RESOURCE_GROUPS, r); ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_PROFILE_PATH_RETURNED", NETLOGON_PROFILE_PATH_RETURNED, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_GRACE_LOGON", NETLOGON_GRACE_LOGON, r); ndr->depth--; } @@ -1116,8 +1110,7 @@ _PUBLIC_ void ndr_print_netr_SamBaseInfo(struct ndr_print *ndr, const char *name ndr->depth++; for (cntr_unknown_0=0;cntr_unknown_0<7;cntr_unknown_0++) { char *idx_0=NULL; - asprintf(&idx_0, "[%d]", cntr_unknown_0); - if (idx_0) { + if (asprintf(&idx_0, "[%d]", cntr_unknown_0) != -1) { ndr_print_uint32(ndr, "unknown", r->unknown[cntr_unknown_0]); free(idx_0); } @@ -1163,7 +1156,7 @@ static enum ndr_err_code ndr_push_netr_SidAttr(struct ndr_push *ndr, int ndr_fla if (ndr_flags & NDR_SCALARS) { NDR_CHECK(ndr_push_align(ndr, 4)); NDR_CHECK(ndr_push_unique_ptr(ndr, r->sid)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->attribute)); + NDR_CHECK(ndr_push_samr_GroupAttrs(ndr, NDR_SCALARS, r->attributes)); } if (ndr_flags & NDR_BUFFERS) { if (r->sid) { @@ -1185,7 +1178,7 @@ static enum ndr_err_code ndr_pull_netr_SidAttr(struct ndr_pull *ndr, int ndr_fla } else { r->sid = NULL; } - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->attribute)); + NDR_CHECK(ndr_pull_samr_GroupAttrs(ndr, NDR_SCALARS, &r->attributes)); } if (ndr_flags & NDR_BUFFERS) { if (r->sid) { @@ -1208,7 +1201,7 @@ _PUBLIC_ void ndr_print_netr_SidAttr(struct ndr_print *ndr, const char *name, co ndr_print_dom_sid2(ndr, "sid", r->sid); } ndr->depth--; - ndr_print_uint32(ndr, "attribute", r->attribute); + ndr_print_samr_GroupAttrs(ndr, "attributes", r->attributes); ndr->depth--; } @@ -1292,8 +1285,7 @@ _PUBLIC_ void ndr_print_netr_SamInfo3(struct ndr_print *ndr, const char *name, c ndr->depth++; for (cntr_sids_1=0;cntr_sids_1<r->sidcount;cntr_sids_1++) { char *idx_1=NULL; - asprintf(&idx_1, "[%d]", cntr_sids_1); - if (idx_1) { + if (asprintf(&idx_1, "[%d]", cntr_sids_1) != -1) { ndr_print_netr_SidAttr(ndr, "sids", &r->sids[cntr_sids_1]); free(idx_1); } @@ -1401,8 +1393,7 @@ _PUBLIC_ void ndr_print_netr_SamInfo6(struct ndr_print *ndr, const char *name, c ndr->depth++; for (cntr_sids_1=0;cntr_sids_1<r->sidcount;cntr_sids_1++) { char *idx_1=NULL; - asprintf(&idx_1, "[%d]", cntr_sids_1); - if (idx_1) { + if (asprintf(&idx_1, "[%d]", cntr_sids_1) != -1) { ndr_print_netr_SidAttr(ndr, "sids", &r->sids[cntr_sids_1]); free(idx_1); } @@ -1416,8 +1407,7 @@ _PUBLIC_ void ndr_print_netr_SamInfo6(struct ndr_print *ndr, const char *name, c ndr->depth++; for (cntr_unknown4_0=0;cntr_unknown4_0<20;cntr_unknown4_0++) { char *idx_0=NULL; - asprintf(&idx_0, "[%d]", cntr_unknown4_0); - if (idx_0) { + if (asprintf(&idx_0, "[%d]", cntr_unknown4_0) != -1) { ndr_print_uint32(ndr, "unknown4", r->unknown4[cntr_unknown4_0]); free(idx_0); } @@ -1563,8 +1553,7 @@ _PUBLIC_ void ndr_print_netr_PacInfo(struct ndr_print *ndr, const char *name, co ndr->depth++; for (cntr_expansionroom_0=0;cntr_expansionroom_0<10;cntr_expansionroom_0++) { char *idx_0=NULL; - asprintf(&idx_0, "[%d]", cntr_expansionroom_0); - if (idx_0) { + if (asprintf(&idx_0, "[%d]", cntr_expansionroom_0) != -1) { ndr_print_uint32(ndr, "expansionroom", r->expansionroom[cntr_expansionroom_0]); free(idx_0); } @@ -1583,25 +1572,25 @@ _PUBLIC_ enum ndr_err_code ndr_push_netr_Validation(struct ndr_push *ndr, int nd int level = ndr_push_get_switch_value(ndr, r); NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, level)); switch (level) { - case 2: + case 2: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->sam2)); - break; + break; } - case 3: + case 3: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->sam3)); - break; + break; } - case 4: + case 4: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->pac)); - break; + break; } - case 5: + case 5: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->pac)); - break; + break; } - case 6: + case 6: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->sam6)); - break; + break; } default: return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); @@ -2042,10 +2031,10 @@ static enum ndr_err_code ndr_push_netr_PasswordHistory(struct ndr_push *ndr, int if (ndr_flags & NDR_SCALARS) { NDR_CHECK(ndr_push_align(ndr, 4)); NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->nt_length)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->nt_size)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->nt_length)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->nt_flags)); NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->lm_length)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->lm_size)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->lm_length)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->lm_flags)); NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->nt_history, r->nt_length)); NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->lm_history, r->lm_length)); @@ -2080,10 +2069,10 @@ _PUBLIC_ void ndr_print_netr_PasswordHistory(struct ndr_print *ndr, const char * ndr_print_struct(ndr, name, "netr_PasswordHistory"); ndr->depth++; ndr_print_uint16(ndr, "nt_length", r->nt_length); - ndr_print_uint16(ndr, "nt_size", r->nt_size); + ndr_print_uint16(ndr, "nt_size", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?r->nt_length:r->nt_size); ndr_print_uint32(ndr, "nt_flags", r->nt_flags); ndr_print_uint16(ndr, "lm_length", r->lm_length); - ndr_print_uint16(ndr, "lm_size", r->lm_size); + ndr_print_uint16(ndr, "lm_size", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?r->lm_length:r->lm_size); ndr_print_uint32(ndr, "lm_flags", r->lm_flags); ndr_print_array_uint8(ndr, "nt_history", r->nt_history, r->nt_length); ndr_print_array_uint8(ndr, "lm_history", r->lm_history, r->lm_length); @@ -2096,7 +2085,7 @@ static enum ndr_err_code ndr_push_netr_USER_KEYS2(struct ndr_push *ndr, int ndr_ NDR_CHECK(ndr_push_align(ndr, 4)); NDR_CHECK(ndr_push_netr_USER_KEY16(ndr, NDR_SCALARS, &r->lmpassword)); NDR_CHECK(ndr_push_netr_USER_KEY16(ndr, NDR_SCALARS, &r->ntpassword)); - NDR_CHECK(ndr_push_netr_PasswordHistory(ndr, NDR_SCALARS, &r->lmhistory)); + NDR_CHECK(ndr_push_netr_PasswordHistory(ndr, NDR_SCALARS, &r->history)); } if (ndr_flags & NDR_BUFFERS) { NDR_CHECK(ndr_push_netr_USER_KEY16(ndr, NDR_BUFFERS, &r->lmpassword)); @@ -2111,7 +2100,7 @@ static enum ndr_err_code ndr_pull_netr_USER_KEYS2(struct ndr_pull *ndr, int ndr_ NDR_CHECK(ndr_pull_align(ndr, 4)); NDR_CHECK(ndr_pull_netr_USER_KEY16(ndr, NDR_SCALARS, &r->lmpassword)); NDR_CHECK(ndr_pull_netr_USER_KEY16(ndr, NDR_SCALARS, &r->ntpassword)); - NDR_CHECK(ndr_pull_netr_PasswordHistory(ndr, NDR_SCALARS, &r->lmhistory)); + NDR_CHECK(ndr_pull_netr_PasswordHistory(ndr, NDR_SCALARS, &r->history)); } if (ndr_flags & NDR_BUFFERS) { NDR_CHECK(ndr_pull_netr_USER_KEY16(ndr, NDR_BUFFERS, &r->lmpassword)); @@ -2126,7 +2115,7 @@ _PUBLIC_ void ndr_print_netr_USER_KEYS2(struct ndr_print *ndr, const char *name, ndr->depth++; ndr_print_netr_USER_KEY16(ndr, "lmpassword", &r->lmpassword); ndr_print_netr_USER_KEY16(ndr, "ntpassword", &r->ntpassword); - ndr_print_netr_PasswordHistory(ndr, "lmhistory", &r->lmhistory); + ndr_print_netr_PasswordHistory(ndr, "history", &r->history); ndr->depth--; } @@ -2815,8 +2804,7 @@ _PUBLIC_ void ndr_print_netr_DELTA_GROUP_MEMBER(struct ndr_print *ndr, const cha ndr->depth++; for (cntr_rids_1=0;cntr_rids_1<r->num_rids;cntr_rids_1++) { char *idx_1=NULL; - asprintf(&idx_1, "[%d]", cntr_rids_1); - if (idx_1) { + if (asprintf(&idx_1, "[%d]", cntr_rids_1) != -1) { ndr_print_uint32(ndr, "rids", r->rids[cntr_rids_1]); free(idx_1); } @@ -2831,8 +2819,7 @@ _PUBLIC_ void ndr_print_netr_DELTA_GROUP_MEMBER(struct ndr_print *ndr, const cha ndr->depth++; for (cntr_attribs_1=0;cntr_attribs_1<r->num_rids;cntr_attribs_1++) { char *idx_1=NULL; - asprintf(&idx_1, "[%d]", cntr_attribs_1); - if (idx_1) { + if (asprintf(&idx_1, "[%d]", cntr_attribs_1) != -1) { ndr_print_uint32(ndr, "attribs", r->attribs[cntr_attribs_1]); free(idx_1); } @@ -3148,8 +3135,7 @@ _PUBLIC_ void ndr_print_netr_DELTA_POLICY(struct ndr_print *ndr, const char *nam ndr->depth++; for (cntr_eventauditoptions_1=0;cntr_eventauditoptions_1<r->maxauditeventcount + 1;cntr_eventauditoptions_1++) { char *idx_1=NULL; - asprintf(&idx_1, "[%d]", cntr_eventauditoptions_1); - if (idx_1) { + if (asprintf(&idx_1, "[%d]", cntr_eventauditoptions_1) != -1) { ndr_print_uint32(ndr, "eventauditoptions", r->eventauditoptions[cntr_eventauditoptions_1]); free(idx_1); } @@ -3290,8 +3276,7 @@ _PUBLIC_ void ndr_print_netr_DELTA_TRUSTED_DOMAIN(struct ndr_print *ndr, const c ndr->depth++; for (cntr_controller_names_1=0;cntr_controller_names_1<r->num_controllers;cntr_controller_names_1++) { char *idx_1=NULL; - asprintf(&idx_1, "[%d]", cntr_controller_names_1); - if (idx_1) { + if (asprintf(&idx_1, "[%d]", cntr_controller_names_1) != -1) { ndr_print_lsa_String(ndr, "controller_names", &r->controller_names[cntr_controller_names_1]); free(idx_1); } @@ -3489,8 +3474,7 @@ _PUBLIC_ void ndr_print_netr_DELTA_ACCOUNT(struct ndr_print *ndr, const char *na ndr->depth++; for (cntr_privilege_attrib_1=0;cntr_privilege_attrib_1<r->privilege_entries;cntr_privilege_attrib_1++) { char *idx_1=NULL; - asprintf(&idx_1, "[%d]", cntr_privilege_attrib_1); - if (idx_1) { + if (asprintf(&idx_1, "[%d]", cntr_privilege_attrib_1) != -1) { ndr_print_uint32(ndr, "privilege_attrib", r->privilege_attrib[cntr_privilege_attrib_1]); free(idx_1); } @@ -3505,8 +3489,7 @@ _PUBLIC_ void ndr_print_netr_DELTA_ACCOUNT(struct ndr_print *ndr, const char *na ndr->depth++; for (cntr_privilege_name_1=0;cntr_privilege_name_1<r->privilege_entries;cntr_privilege_name_1++) { char *idx_1=NULL; - asprintf(&idx_1, "[%d]", cntr_privilege_name_1); - if (idx_1) { + if (asprintf(&idx_1, "[%d]", cntr_privilege_name_1) != -1) { ndr_print_lsa_String(ndr, "privilege_name", &r->privilege_name[cntr_privilege_name_1]); free(idx_1); } @@ -3795,90 +3778,90 @@ static enum ndr_err_code ndr_push_netr_DELTA_UNION(struct ndr_push *ndr, int ndr int level = ndr_push_get_switch_value(ndr, r); NDR_CHECK(ndr_push_netr_DeltaEnum(ndr, NDR_SCALARS, level)); switch (level) { - case NETR_DELTA_DOMAIN: + case NETR_DELTA_DOMAIN: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->domain)); - break; + break; } - case NETR_DELTA_GROUP: + case NETR_DELTA_GROUP: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->group)); - break; + break; } - case NETR_DELTA_DELETE_GROUP: - break; + case NETR_DELTA_DELETE_GROUP: { + break; } - case NETR_DELTA_RENAME_GROUP: + case NETR_DELTA_RENAME_GROUP: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->rename_group)); - break; + break; } - case NETR_DELTA_USER: + case NETR_DELTA_USER: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->user)); - break; + break; } - case NETR_DELTA_DELETE_USER: - break; + case NETR_DELTA_DELETE_USER: { + break; } - case NETR_DELTA_RENAME_USER: + case NETR_DELTA_RENAME_USER: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->rename_user)); - break; + break; } - case NETR_DELTA_GROUP_MEMBER: + case NETR_DELTA_GROUP_MEMBER: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->group_member)); - break; + break; } - case NETR_DELTA_ALIAS: + case NETR_DELTA_ALIAS: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->alias)); - break; + break; } - case NETR_DELTA_DELETE_ALIAS: - break; + case NETR_DELTA_DELETE_ALIAS: { + break; } - case NETR_DELTA_RENAME_ALIAS: + case NETR_DELTA_RENAME_ALIAS: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->rename_alias)); - break; + break; } - case NETR_DELTA_ALIAS_MEMBER: + case NETR_DELTA_ALIAS_MEMBER: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->alias_member)); - break; + break; } - case NETR_DELTA_POLICY: + case NETR_DELTA_POLICY: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->policy)); - break; + break; } - case NETR_DELTA_TRUSTED_DOMAIN: + case NETR_DELTA_TRUSTED_DOMAIN: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->trusted_domain)); - break; + break; } - case NETR_DELTA_DELETE_TRUST: + case NETR_DELTA_DELETE_TRUST: { NDR_CHECK(ndr_push_netr_DELTA_DELETE_TRUST(ndr, NDR_SCALARS, &r->delete_trust)); - break; + break; } - case NETR_DELTA_ACCOUNT: + case NETR_DELTA_ACCOUNT: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->account)); - break; + break; } - case NETR_DELTA_DELETE_ACCOUNT: + case NETR_DELTA_DELETE_ACCOUNT: { NDR_CHECK(ndr_push_netr_DELTA_DELETE_ACCOUNT(ndr, NDR_SCALARS, &r->delete_account)); - break; + break; } - case NETR_DELTA_SECRET: + case NETR_DELTA_SECRET: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->secret)); - break; + break; } - case NETR_DELTA_DELETE_SECRET: + case NETR_DELTA_DELETE_SECRET: { NDR_CHECK(ndr_push_netr_DELTA_DELETE_SECRET(ndr, NDR_SCALARS, &r->delete_secret)); - break; + break; } - case NETR_DELTA_DELETE_GROUP2: + case NETR_DELTA_DELETE_GROUP2: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->delete_group)); - break; + break; } - case NETR_DELTA_DELETE_USER2: + case NETR_DELTA_DELETE_USER2: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->delete_user)); - break; + break; } - case NETR_DELTA_MODIFY_COUNT: + case NETR_DELTA_MODIFY_COUNT: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->modified_count)); - break; + break; } default: return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); @@ -4573,92 +4556,92 @@ static enum ndr_err_code ndr_push_netr_DELTA_ID_UNION(struct ndr_push *ndr, int int level = ndr_push_get_switch_value(ndr, r); NDR_CHECK(ndr_push_netr_DeltaEnum(ndr, NDR_SCALARS, level)); switch (level) { - case NETR_DELTA_DOMAIN: + case NETR_DELTA_DOMAIN: { NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->rid)); - break; + break; } - case NETR_DELTA_GROUP: + case NETR_DELTA_GROUP: { NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->rid)); - break; + break; } - case NETR_DELTA_DELETE_GROUP: + case NETR_DELTA_DELETE_GROUP: { NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->rid)); - break; + break; } - case NETR_DELTA_RENAME_GROUP: + case NETR_DELTA_RENAME_GROUP: { NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->rid)); - break; + break; } - case NETR_DELTA_USER: + case NETR_DELTA_USER: { NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->rid)); - break; + break; } - case NETR_DELTA_DELETE_USER: + case NETR_DELTA_DELETE_USER: { NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->rid)); - break; + break; } - case NETR_DELTA_RENAME_USER: + case NETR_DELTA_RENAME_USER: { NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->rid)); - break; + break; } - case NETR_DELTA_GROUP_MEMBER: + case NETR_DELTA_GROUP_MEMBER: { NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->rid)); - break; + break; } - case NETR_DELTA_ALIAS: + case NETR_DELTA_ALIAS: { NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->rid)); - break; + break; } - case NETR_DELTA_DELETE_ALIAS: + case NETR_DELTA_DELETE_ALIAS: { NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->rid)); - break; + break; } - case NETR_DELTA_RENAME_ALIAS: + case NETR_DELTA_RENAME_ALIAS: { NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->rid)); - break; + break; } - case NETR_DELTA_ALIAS_MEMBER: + case NETR_DELTA_ALIAS_MEMBER: { NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->rid)); - break; + break; } - case NETR_DELTA_POLICY: + case NETR_DELTA_POLICY: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->sid)); - break; + break; } - case NETR_DELTA_TRUSTED_DOMAIN: + case NETR_DELTA_TRUSTED_DOMAIN: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->sid)); - break; + break; } - case NETR_DELTA_DELETE_TRUST: + case NETR_DELTA_DELETE_TRUST: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->sid)); - break; + break; } - case NETR_DELTA_ACCOUNT: + case NETR_DELTA_ACCOUNT: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->sid)); - break; + break; } - case NETR_DELTA_DELETE_ACCOUNT: + case NETR_DELTA_DELETE_ACCOUNT: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->sid)); - break; + break; } - case NETR_DELTA_SECRET: + case NETR_DELTA_SECRET: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->name)); - break; + break; } - case NETR_DELTA_DELETE_SECRET: + case NETR_DELTA_DELETE_SECRET: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->name)); - break; + break; } - case NETR_DELTA_DELETE_GROUP2: + case NETR_DELTA_DELETE_GROUP2: { NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->rid)); - break; + break; } - case NETR_DELTA_DELETE_USER2: + case NETR_DELTA_DELETE_USER2: { NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->rid)); - break; + break; } - case NETR_DELTA_MODIFY_COUNT: - break; + case NETR_DELTA_MODIFY_COUNT: { + break; } default: return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); @@ -5296,8 +5279,7 @@ _PUBLIC_ void ndr_print_netr_DELTA_ENUM_ARRAY(struct ndr_print *ndr, const char ndr->depth++; for (cntr_delta_enum_1=0;cntr_delta_enum_1<r->num_deltas;cntr_delta_enum_1++) { char *idx_1=NULL; - asprintf(&idx_1, "[%d]", cntr_delta_enum_1); - if (idx_1) { + if (asprintf(&idx_1, "[%d]", cntr_delta_enum_1) != -1) { ndr_print_netr_DELTA_ENUM(ndr, "delta_enum", &r->delta_enum[cntr_delta_enum_1]); free(idx_1); } @@ -5534,17 +5516,17 @@ static enum ndr_err_code ndr_push_netr_CONTROL_QUERY_INFORMATION(struct ndr_push int level = ndr_push_get_switch_value(ndr, r); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, level)); switch (level) { - case 1: + case 1: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1)); - break; + break; } - case 2: + case 2: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->info2)); - break; + break; } - case 3: + case 3: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->info3)); - break; + break; } default: return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); @@ -5719,6 +5701,7 @@ _PUBLIC_ void ndr_print_netr_LogonControlCode(struct ndr_print *ndr, const char const char *val = NULL; switch (r) { + case NETLOGON_CONTROL_SYNC: val = "NETLOGON_CONTROL_SYNC"; break; case NETLOGON_CONTROL_REDISCOVER: val = "NETLOGON_CONTROL_REDISCOVER"; break; case NETLOGON_CONTROL_TC_QUERY: val = "NETLOGON_CONTROL_TC_QUERY"; break; case NETLOGON_CONTROL_TRANSPORT_NOTIFY: val = "NETLOGON_CONTROL_TRANSPORT_NOTIFY"; break; @@ -5733,21 +5716,21 @@ static enum ndr_err_code ndr_push_netr_CONTROL_DATA_INFORMATION(struct ndr_push int level = ndr_push_get_switch_value(ndr, r); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, level)); switch (level) { - case NETLOGON_CONTROL_REDISCOVER: + case NETLOGON_CONTROL_REDISCOVER: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->domain)); - break; + break; } - case NETLOGON_CONTROL_TC_QUERY: + case NETLOGON_CONTROL_TC_QUERY: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->domain)); - break; + break; } - case NETLOGON_CONTROL_TRANSPORT_NOTIFY: + case NETLOGON_CONTROL_TRANSPORT_NOTIFY: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->domain)); - break; + break; } - case NETLOGON_CONTROL_SET_DBFLAG: + case NETLOGON_CONTROL_SET_DBFLAG: { NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->debug_level)); - break; + break; } default: return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); @@ -5942,17 +5925,178 @@ _PUBLIC_ void ndr_print_netr_CONTROL_DATA_INFORMATION(struct ndr_print *ndr, con } } +static enum ndr_err_code ndr_push_netr_Blob(struct ndr_push *ndr, int ndr_flags, const struct netr_Blob *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_netr_Blob(struct ndr_pull *ndr, int ndr_flags, struct netr_Blob *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_netr_Blob(struct ndr_print *ndr, const char *name, const struct netr_Blob *r) +{ + ndr_print_struct(ndr, name, "netr_Blob"); + 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_netr_DsRGetDCName_flags(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_netr_DsRGetDCName_flags(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_netr_DsRGetDCName_flags(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), "DS_FORCE_REDISCOVERY", DS_FORCE_REDISCOVERY, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_DIRECTORY_SERVICE_REQUIRED", DS_DIRECTORY_SERVICE_REQUIRED, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_DIRECTORY_SERVICE_PREFERRED", DS_DIRECTORY_SERVICE_PREFERRED, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_GC_SERVER_REQUIRED", DS_GC_SERVER_REQUIRED, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_PDC_REQUIRED", DS_PDC_REQUIRED, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_BACKGROUND_ONLY", DS_BACKGROUND_ONLY, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_IP_REQUIRED", DS_IP_REQUIRED, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_KDC_REQUIRED", DS_KDC_REQUIRED, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_TIMESERV_REQUIRED", DS_TIMESERV_REQUIRED, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_WRITABLE_REQUIRED", DS_WRITABLE_REQUIRED, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_GOOD_TIMESERV_PREFERRED", DS_GOOD_TIMESERV_PREFERRED, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_AVOID_SELF", DS_AVOID_SELF, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_ONLY_LDAP_NEEDED", DS_ONLY_LDAP_NEEDED, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_IS_FLAT_NAME", DS_IS_FLAT_NAME, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_IS_DNS_NAME", DS_IS_DNS_NAME, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_TRY_NEXTCLOSEST_SITE", DS_TRY_NEXTCLOSEST_SITE, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_DIRECTORY_SERVICE_6_REQUIRED", DS_DIRECTORY_SERVICE_6_REQUIRED, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_RETURN_DNS_NAME", DS_RETURN_DNS_NAME, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_RETURN_FLAT_NAME", DS_RETURN_FLAT_NAME, r); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_netr_DsRGetDCNameInfo_AddressType(struct ndr_push *ndr, int ndr_flags, enum netr_DsRGetDCNameInfo_AddressType r) +{ + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_netr_DsRGetDCNameInfo_AddressType(struct ndr_pull *ndr, int ndr_flags, enum netr_DsRGetDCNameInfo_AddressType *r) +{ + uint32_t v; + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); + *r = v; + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_netr_DsRGetDCNameInfo_AddressType(struct ndr_print *ndr, const char *name, enum netr_DsRGetDCNameInfo_AddressType r) +{ + const char *val = NULL; + + switch (r) { + case DS_ADDRESS_TYPE_INET: val = "DS_ADDRESS_TYPE_INET"; break; + case DS_ADDRESS_TYPE_NETBIOS: val = "DS_ADDRESS_TYPE_NETBIOS"; break; + } + ndr_print_enum(ndr, name, "ENUM", val, r); +} + +static enum ndr_err_code ndr_push_netr_DsR_DcFlags(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_netr_DsR_DcFlags(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_netr_DsR_DcFlags(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), "DS_SERVER_PDC", DS_SERVER_PDC, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_SERVER_GC", DS_SERVER_GC, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_SERVER_LDAP", DS_SERVER_LDAP, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_SERVER_DS", DS_SERVER_DS, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_SERVER_KDC", DS_SERVER_KDC, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_SERVER_TIMESERV", DS_SERVER_TIMESERV, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_SERVER_CLOSEST", DS_SERVER_CLOSEST, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_SERVER_WRITABLE", DS_SERVER_WRITABLE, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_SERVER_GOOD_TIMESERV", DS_SERVER_GOOD_TIMESERV, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_SERVER_NDNC", DS_SERVER_NDNC, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_SERVER_SELECT_SECRET_DOMAIN_6", DS_SERVER_SELECT_SECRET_DOMAIN_6, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_SERVER_FULL_SECRET_DOMAIN_6", DS_SERVER_FULL_SECRET_DOMAIN_6, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_DNS_CONTROLLER", DS_DNS_CONTROLLER, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_DNS_DOMAIN", DS_DNS_DOMAIN, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_DNS_FOREST", DS_DNS_FOREST, r); + ndr->depth--; +} + static enum ndr_err_code ndr_push_netr_DsRGetDCNameInfo(struct ndr_push *ndr, int ndr_flags, const struct netr_DsRGetDCNameInfo *r) { if (ndr_flags & NDR_SCALARS) { NDR_CHECK(ndr_push_align(ndr, 4)); NDR_CHECK(ndr_push_unique_ptr(ndr, r->dc_unc)); NDR_CHECK(ndr_push_unique_ptr(ndr, r->dc_address)); - NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, r->dc_address_type)); + NDR_CHECK(ndr_push_netr_DsRGetDCNameInfo_AddressType(ndr, NDR_SCALARS, r->dc_address_type)); NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->domain_guid)); NDR_CHECK(ndr_push_unique_ptr(ndr, r->domain_name)); NDR_CHECK(ndr_push_unique_ptr(ndr, r->forest_name)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->dc_flags)); + NDR_CHECK(ndr_push_netr_DsR_DcFlags(ndr, NDR_SCALARS, r->dc_flags)); NDR_CHECK(ndr_push_unique_ptr(ndr, r->dc_site_name)); NDR_CHECK(ndr_push_unique_ptr(ndr, r->client_site_name)); } @@ -6026,7 +6170,7 @@ static enum ndr_err_code ndr_pull_netr_DsRGetDCNameInfo(struct ndr_pull *ndr, in } else { r->dc_address = NULL; } - NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, &r->dc_address_type)); + NDR_CHECK(ndr_pull_netr_DsRGetDCNameInfo_AddressType(ndr, NDR_SCALARS, &r->dc_address_type)); NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->domain_guid)); NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_domain_name)); if (_ptr_domain_name) { @@ -6040,7 +6184,7 @@ static enum ndr_err_code ndr_pull_netr_DsRGetDCNameInfo(struct ndr_pull *ndr, in } else { r->forest_name = NULL; } - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->dc_flags)); + NDR_CHECK(ndr_pull_netr_DsR_DcFlags(ndr, NDR_SCALARS, &r->dc_flags)); NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_dc_site_name)); if (_ptr_dc_site_name) { NDR_PULL_ALLOC(ndr, r->dc_site_name); @@ -6148,7 +6292,7 @@ _PUBLIC_ void ndr_print_netr_DsRGetDCNameInfo(struct ndr_print *ndr, const char ndr_print_string(ndr, "dc_address", r->dc_address); } ndr->depth--; - ndr_print_int32(ndr, "dc_address_type", r->dc_address_type); + ndr_print_netr_DsRGetDCNameInfo_AddressType(ndr, "dc_address_type", r->dc_address_type); ndr_print_GUID(ndr, "domain_guid", &r->domain_guid); ndr_print_ptr(ndr, "domain_name", r->domain_name); ndr->depth++; @@ -6162,7 +6306,7 @@ _PUBLIC_ void ndr_print_netr_DsRGetDCNameInfo(struct ndr_print *ndr, const char ndr_print_string(ndr, "forest_name", r->forest_name); } ndr->depth--; - ndr_print_uint32(ndr, "dc_flags", r->dc_flags); + ndr_print_netr_DsR_DcFlags(ndr, "dc_flags", r->dc_flags); ndr_print_ptr(ndr, "dc_site_name", r->dc_site_name); ndr->depth++; if (r->dc_site_name) { @@ -6178,66 +6322,6 @@ _PUBLIC_ void ndr_print_netr_DsRGetDCNameInfo(struct ndr_print *ndr, const char ndr->depth--; } -static enum ndr_err_code ndr_push_netr_Blob(struct ndr_push *ndr, int ndr_flags, const struct netr_Blob *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_netr_Blob(struct ndr_pull *ndr, int ndr_flags, struct netr_Blob *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_netr_Blob(struct ndr_print *ndr, const char *name, const struct netr_Blob *r) -{ - ndr_print_struct(ndr, name, "netr_Blob"); - 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_netr_BinaryString(struct ndr_push *ndr, int ndr_flags, const struct netr_BinaryString *r) { uint32_t cntr_data_1; @@ -6332,8 +6416,7 @@ _PUBLIC_ void ndr_print_netr_BinaryString(struct ndr_print *ndr, const char *nam ndr->depth++; for (cntr_data_1=0;cntr_data_1<r->length / 2;cntr_data_1++) { char *idx_1=NULL; - asprintf(&idx_1, "[%d]", cntr_data_1); - if (idx_1) { + if (asprintf(&idx_1, "[%d]", cntr_data_1) != -1) { ndr_print_uint16(ndr, "data", r->data[cntr_data_1]); free(idx_1); } @@ -6606,8 +6689,7 @@ _PUBLIC_ void ndr_print_netr_DomainQuery1(struct ndr_print *ndr, const char *nam ndr->depth++; for (cntr_unknown7_0=0;cntr_unknown7_0<4;cntr_unknown7_0++) { char *idx_0=NULL; - asprintf(&idx_0, "[%d]", cntr_unknown7_0); - if (idx_0) { + if (asprintf(&idx_0, "[%d]", cntr_unknown7_0) != -1) { ndr_print_uint32(ndr, "unknown7", r->unknown7[cntr_unknown7_0]); free(idx_0); } @@ -6622,13 +6704,13 @@ static enum ndr_err_code ndr_push_netr_DomainQuery(struct ndr_push *ndr, int ndr int level = ndr_push_get_switch_value(ndr, r); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, level)); switch (level) { - case 1: + case 1: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->query1)); - break; + break; } - case 2: + case 2: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->query1)); - break; + break; } default: return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); @@ -6844,8 +6926,7 @@ _PUBLIC_ void ndr_print_netr_DomainTrustInfo(struct ndr_print *ndr, const char * ndr->depth++; for (cntr_unknown1_0=0;cntr_unknown1_0<4;cntr_unknown1_0++) { char *idx_0=NULL; - asprintf(&idx_0, "[%d]", cntr_unknown1_0); - if (idx_0) { + if (asprintf(&idx_0, "[%d]", cntr_unknown1_0) != -1) { ndr_print_netr_BinaryString(ndr, "unknown1", &r->unknown1[cntr_unknown1_0]); free(idx_0); } @@ -6855,8 +6936,7 @@ _PUBLIC_ void ndr_print_netr_DomainTrustInfo(struct ndr_print *ndr, const char * ndr->depth++; for (cntr_unknown_0=0;cntr_unknown_0<4;cntr_unknown_0++) { char *idx_0=NULL; - asprintf(&idx_0, "[%d]", cntr_unknown_0); - if (idx_0) { + if (asprintf(&idx_0, "[%d]", cntr_unknown_0) != -1) { ndr_print_uint32(ndr, "unknown", r->unknown[cntr_unknown_0]); free(idx_0); } @@ -6954,8 +7034,7 @@ _PUBLIC_ void ndr_print_netr_DomainInfo1(struct ndr_print *ndr, const char *name ndr->depth++; for (cntr_trusts_1=0;cntr_trusts_1<r->num_trusts;cntr_trusts_1++) { char *idx_1=NULL; - asprintf(&idx_1, "[%d]", cntr_trusts_1); - if (idx_1) { + if (asprintf(&idx_1, "[%d]", cntr_trusts_1) != -1) { ndr_print_netr_DomainTrustInfo(ndr, "trusts", &r->trusts[cntr_trusts_1]); free(idx_1); } @@ -6967,8 +7046,7 @@ _PUBLIC_ void ndr_print_netr_DomainInfo1(struct ndr_print *ndr, const char *name ndr->depth++; for (cntr_unknown_0=0;cntr_unknown_0<14;cntr_unknown_0++) { char *idx_0=NULL; - asprintf(&idx_0, "[%d]", cntr_unknown_0); - if (idx_0) { + if (asprintf(&idx_0, "[%d]", cntr_unknown_0) != -1) { ndr_print_uint32(ndr, "unknown", r->unknown[cntr_unknown_0]); free(idx_0); } @@ -6983,13 +7061,13 @@ static enum ndr_err_code ndr_push_netr_DomainInfo(struct ndr_push *ndr, int ndr_ int level = ndr_push_get_switch_value(ndr, r); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, level)); switch (level) { - case 1: + case 1: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1)); - break; + break; } - case 2: + case 2: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1)); - break; + break; } default: return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); @@ -7157,6 +7235,152 @@ _PUBLIC_ void ndr_print_netr_CryptPassword(struct ndr_print *ndr, const char *na } } +static enum ndr_err_code ndr_push_netr_DsRAddressToSitenamesWCtr(struct ndr_push *ndr, int ndr_flags, const struct netr_DsRAddressToSitenamesWCtr *r) +{ + uint32_t cntr_sitename_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->sitename)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->sitename) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + for (cntr_sitename_1 = 0; cntr_sitename_1 < r->count; cntr_sitename_1++) { + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->sitename[cntr_sitename_1])); + } + for (cntr_sitename_1 = 0; cntr_sitename_1 < r->count; cntr_sitename_1++) { + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->sitename[cntr_sitename_1])); + } + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_netr_DsRAddressToSitenamesWCtr(struct ndr_pull *ndr, int ndr_flags, struct netr_DsRAddressToSitenamesWCtr *r) +{ + uint32_t _ptr_sitename; + uint32_t cntr_sitename_1; + TALLOC_CTX *_mem_save_sitename_0; + TALLOC_CTX *_mem_save_sitename_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_sitename)); + if (_ptr_sitename) { + NDR_PULL_ALLOC(ndr, r->sitename); + } else { + r->sitename = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->sitename) { + _mem_save_sitename_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->sitename, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->sitename)); + NDR_PULL_ALLOC_N(ndr, r->sitename, ndr_get_array_size(ndr, &r->sitename)); + _mem_save_sitename_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->sitename, 0); + for (cntr_sitename_1 = 0; cntr_sitename_1 < r->count; cntr_sitename_1++) { + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->sitename[cntr_sitename_1])); + } + for (cntr_sitename_1 = 0; cntr_sitename_1 < r->count; cntr_sitename_1++) { + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->sitename[cntr_sitename_1])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sitename_1, 0); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sitename_0, 0); + } + if (r->sitename) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->sitename, r->count)); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_netr_DsRAddressToSitenamesWCtr(struct ndr_print *ndr, const char *name, const struct netr_DsRAddressToSitenamesWCtr *r) +{ + uint32_t cntr_sitename_1; + ndr_print_struct(ndr, name, "netr_DsRAddressToSitenamesWCtr"); + ndr->depth++; + ndr_print_uint32(ndr, "count", r->count); + ndr_print_ptr(ndr, "sitename", r->sitename); + ndr->depth++; + if (r->sitename) { + ndr->print(ndr, "%s: ARRAY(%d)", "sitename", r->count); + ndr->depth++; + for (cntr_sitename_1=0;cntr_sitename_1<r->count;cntr_sitename_1++) { + char *idx_1=NULL; + if (asprintf(&idx_1, "[%d]", cntr_sitename_1) != -1) { + ndr_print_lsa_String(ndr, "sitename", &r->sitename[cntr_sitename_1]); + free(idx_1); + } + } + ndr->depth--; + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_netr_DsRAddress(struct ndr_push *ndr, int ndr_flags, const struct netr_DsRAddress *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->buffer)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->size)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->buffer) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->size)); + NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->buffer, r->size)); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_netr_DsRAddress(struct ndr_pull *ndr, int ndr_flags, struct netr_DsRAddress *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_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->size)); + } + if (ndr_flags & NDR_BUFFERS) { + 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); + } + if (r->buffer) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->buffer, r->size)); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_netr_DsRAddress(struct ndr_print *ndr, const char *name, const struct netr_DsRAddress *r) +{ + ndr_print_struct(ndr, name, "netr_DsRAddress"); + ndr->depth++; + ndr_print_ptr(ndr, "buffer", r->buffer); + ndr->depth++; + if (r->buffer) { + ndr_print_array_uint8(ndr, "buffer", r->buffer, r->size); + } + ndr->depth--; + ndr_print_uint32(ndr, "size", r->size); + ndr->depth--; +} + static enum ndr_err_code ndr_push_netr_TrustFlags(struct ndr_push *ndr, int ndr_flags, uint32_t r) { NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); @@ -7373,6 +7597,320 @@ _PUBLIC_ void ndr_print_netr_DomainTrust(struct ndr_print *ndr, const char *name ndr->depth--; } +static enum ndr_err_code ndr_push_netr_DomainTrustList(struct ndr_push *ndr, int ndr_flags, const struct netr_DomainTrustList *r) +{ + uint32_t cntr_array_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->array)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->array) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { + NDR_CHECK(ndr_push_netr_DomainTrust(ndr, NDR_SCALARS, &r->array[cntr_array_1])); + } + for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { + NDR_CHECK(ndr_push_netr_DomainTrust(ndr, NDR_BUFFERS, &r->array[cntr_array_1])); + } + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_netr_DomainTrustList(struct ndr_pull *ndr, int ndr_flags, struct netr_DomainTrustList *r) +{ + uint32_t _ptr_array; + uint32_t cntr_array_1; + TALLOC_CTX *_mem_save_array_0; + TALLOC_CTX *_mem_save_array_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_array)); + if (_ptr_array) { + NDR_PULL_ALLOC(ndr, r->array); + } else { + r->array = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->array) { + _mem_save_array_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->array)); + NDR_PULL_ALLOC_N(ndr, r->array, ndr_get_array_size(ndr, &r->array)); + _mem_save_array_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); + for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { + NDR_CHECK(ndr_pull_netr_DomainTrust(ndr, NDR_SCALARS, &r->array[cntr_array_1])); + } + for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) { + NDR_CHECK(ndr_pull_netr_DomainTrust(ndr, NDR_BUFFERS, &r->array[cntr_array_1])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_1, 0); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_0, 0); + } + if (r->array) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->array, r->count)); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_netr_DomainTrustList(struct ndr_print *ndr, const char *name, const struct netr_DomainTrustList *r) +{ + uint32_t cntr_array_1; + ndr_print_struct(ndr, name, "netr_DomainTrustList"); + ndr->depth++; + ndr_print_uint32(ndr, "count", r->count); + ndr_print_ptr(ndr, "array", r->array); + ndr->depth++; + if (r->array) { + ndr->print(ndr, "%s: ARRAY(%d)", "array", r->count); + ndr->depth++; + for (cntr_array_1=0;cntr_array_1<r->count;cntr_array_1++) { + char *idx_1=NULL; + if (asprintf(&idx_1, "[%d]", cntr_array_1) != -1) { + ndr_print_netr_DomainTrust(ndr, "array", &r->array[cntr_array_1]); + free(idx_1); + } + } + ndr->depth--; + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_netr_DsRAddressToSitenamesExWCtr(struct ndr_push *ndr, int ndr_flags, const struct netr_DsRAddressToSitenamesExWCtr *r) +{ + uint32_t cntr_sitename_1; + uint32_t cntr_subnetname_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->sitename)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->subnetname)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->sitename) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + for (cntr_sitename_1 = 0; cntr_sitename_1 < r->count; cntr_sitename_1++) { + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->sitename[cntr_sitename_1])); + } + for (cntr_sitename_1 = 0; cntr_sitename_1 < r->count; cntr_sitename_1++) { + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->sitename[cntr_sitename_1])); + } + } + if (r->subnetname) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); + for (cntr_subnetname_1 = 0; cntr_subnetname_1 < r->count; cntr_subnetname_1++) { + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->subnetname[cntr_subnetname_1])); + } + for (cntr_subnetname_1 = 0; cntr_subnetname_1 < r->count; cntr_subnetname_1++) { + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->subnetname[cntr_subnetname_1])); + } + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_netr_DsRAddressToSitenamesExWCtr(struct ndr_pull *ndr, int ndr_flags, struct netr_DsRAddressToSitenamesExWCtr *r) +{ + uint32_t _ptr_sitename; + uint32_t cntr_sitename_1; + TALLOC_CTX *_mem_save_sitename_0; + TALLOC_CTX *_mem_save_sitename_1; + uint32_t _ptr_subnetname; + uint32_t cntr_subnetname_1; + TALLOC_CTX *_mem_save_subnetname_0; + TALLOC_CTX *_mem_save_subnetname_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_sitename)); + if (_ptr_sitename) { + NDR_PULL_ALLOC(ndr, r->sitename); + } else { + r->sitename = NULL; + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_subnetname)); + if (_ptr_subnetname) { + NDR_PULL_ALLOC(ndr, r->subnetname); + } else { + r->subnetname = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->sitename) { + _mem_save_sitename_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->sitename, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->sitename)); + NDR_PULL_ALLOC_N(ndr, r->sitename, ndr_get_array_size(ndr, &r->sitename)); + _mem_save_sitename_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->sitename, 0); + for (cntr_sitename_1 = 0; cntr_sitename_1 < r->count; cntr_sitename_1++) { + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->sitename[cntr_sitename_1])); + } + for (cntr_sitename_1 = 0; cntr_sitename_1 < r->count; cntr_sitename_1++) { + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->sitename[cntr_sitename_1])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sitename_1, 0); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sitename_0, 0); + } + if (r->subnetname) { + _mem_save_subnetname_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->subnetname, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->subnetname)); + NDR_PULL_ALLOC_N(ndr, r->subnetname, ndr_get_array_size(ndr, &r->subnetname)); + _mem_save_subnetname_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->subnetname, 0); + for (cntr_subnetname_1 = 0; cntr_subnetname_1 < r->count; cntr_subnetname_1++) { + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->subnetname[cntr_subnetname_1])); + } + for (cntr_subnetname_1 = 0; cntr_subnetname_1 < r->count; cntr_subnetname_1++) { + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->subnetname[cntr_subnetname_1])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_subnetname_1, 0); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_subnetname_0, 0); + } + if (r->sitename) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->sitename, r->count)); + } + if (r->subnetname) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->subnetname, r->count)); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_netr_DsRAddressToSitenamesExWCtr(struct ndr_print *ndr, const char *name, const struct netr_DsRAddressToSitenamesExWCtr *r) +{ + uint32_t cntr_sitename_1; + uint32_t cntr_subnetname_1; + ndr_print_struct(ndr, name, "netr_DsRAddressToSitenamesExWCtr"); + ndr->depth++; + ndr_print_uint32(ndr, "count", r->count); + ndr_print_ptr(ndr, "sitename", r->sitename); + ndr->depth++; + if (r->sitename) { + ndr->print(ndr, "%s: ARRAY(%d)", "sitename", r->count); + ndr->depth++; + for (cntr_sitename_1=0;cntr_sitename_1<r->count;cntr_sitename_1++) { + char *idx_1=NULL; + if (asprintf(&idx_1, "[%d]", cntr_sitename_1) != -1) { + ndr_print_lsa_String(ndr, "sitename", &r->sitename[cntr_sitename_1]); + free(idx_1); + } + } + ndr->depth--; + } + ndr->depth--; + ndr_print_ptr(ndr, "subnetname", r->subnetname); + ndr->depth++; + if (r->subnetname) { + ndr->print(ndr, "%s: ARRAY(%d)", "subnetname", r->count); + ndr->depth++; + for (cntr_subnetname_1=0;cntr_subnetname_1<r->count;cntr_subnetname_1++) { + char *idx_1=NULL; + if (asprintf(&idx_1, "[%d]", cntr_subnetname_1) != -1) { + ndr_print_lsa_String(ndr, "subnetname", &r->subnetname[cntr_subnetname_1]); + free(idx_1); + } + } + ndr->depth--; + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_DcSitesCtr(struct ndr_push *ndr, int ndr_flags, const struct DcSitesCtr *r) +{ + uint32_t cntr_sites_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_sites)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->sites)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->sites) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_sites)); + for (cntr_sites_1 = 0; cntr_sites_1 < r->num_sites; cntr_sites_1++) { + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->sites[cntr_sites_1])); + } + for (cntr_sites_1 = 0; cntr_sites_1 < r->num_sites; cntr_sites_1++) { + NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->sites[cntr_sites_1])); + } + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_DcSitesCtr(struct ndr_pull *ndr, int ndr_flags, struct DcSitesCtr *r) +{ + uint32_t _ptr_sites; + uint32_t cntr_sites_1; + TALLOC_CTX *_mem_save_sites_0; + TALLOC_CTX *_mem_save_sites_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->num_sites)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_sites)); + if (_ptr_sites) { + NDR_PULL_ALLOC(ndr, r->sites); + } else { + r->sites = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->sites) { + _mem_save_sites_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->sites, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->sites)); + NDR_PULL_ALLOC_N(ndr, r->sites, ndr_get_array_size(ndr, &r->sites)); + _mem_save_sites_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->sites, 0); + for (cntr_sites_1 = 0; cntr_sites_1 < r->num_sites; cntr_sites_1++) { + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->sites[cntr_sites_1])); + } + for (cntr_sites_1 = 0; cntr_sites_1 < r->num_sites; cntr_sites_1++) { + NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->sites[cntr_sites_1])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sites_1, 0); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sites_0, 0); + } + if (r->sites) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->sites, r->num_sites)); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_DcSitesCtr(struct ndr_print *ndr, const char *name, const struct DcSitesCtr *r) +{ + uint32_t cntr_sites_1; + ndr_print_struct(ndr, name, "DcSitesCtr"); + ndr->depth++; + ndr_print_uint32(ndr, "num_sites", r->num_sites); + ndr_print_ptr(ndr, "sites", r->sites); + ndr->depth++; + if (r->sites) { + ndr->print(ndr, "%s: ARRAY(%d)", "sites", r->num_sites); + ndr->depth++; + for (cntr_sites_1=0;cntr_sites_1<r->num_sites;cntr_sites_1++) { + char *idx_1=NULL; + if (asprintf(&idx_1, "[%d]", cntr_sites_1) != -1) { + ndr_print_lsa_String(ndr, "sites", &r->sites[cntr_sites_1]); + free(idx_1); + } + } + ndr->depth--; + } + ndr->depth--; + ndr->depth--; +} + static enum ndr_err_code ndr_push_netr_LogonUasLogon(struct ndr_push *ndr, int flags, const struct netr_LogonUasLogon *r) { if (flags & NDR_IN) { @@ -7393,10 +7931,10 @@ static enum ndr_err_code ndr_push_netr_LogonUasLogon(struct ndr_push *ndr, int f NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.workstation, ndr_charset_length(r->in.workstation, CH_UTF16), sizeof(uint16_t), CH_UTF16)); } if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.info)); - if (r->out.info) { - NDR_CHECK(ndr_push_netr_UasInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.info)); + if (r->out.info == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); } + NDR_CHECK(ndr_push_netr_UasInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.info)); NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); } return NDR_ERR_SUCCESS; @@ -7405,7 +7943,6 @@ static enum ndr_err_code ndr_push_netr_LogonUasLogon(struct ndr_push *ndr, int f static enum ndr_err_code ndr_pull_netr_LogonUasLogon(struct ndr_pull *ndr, int flags, struct netr_LogonUasLogon *r) { uint32_t _ptr_server_name; - uint32_t _ptr_info; TALLOC_CTX *_mem_save_server_name_0; TALLOC_CTX *_mem_save_info_0; if (flags & NDR_IN) { @@ -7443,20 +7980,17 @@ static enum ndr_err_code ndr_pull_netr_LogonUasLogon(struct ndr_pull *ndr, int f } NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.workstation), sizeof(uint16_t))); NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.workstation, ndr_get_array_length(ndr, &r->in.workstation), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_ALLOC(ndr, r->out.info); + ZERO_STRUCTP(r->out.info); } if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info)); - if (_ptr_info) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { NDR_PULL_ALLOC(ndr, r->out.info); - } else { - r->out.info = NULL; - } - if (r->out.info) { - _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.info, 0); - NDR_CHECK(ndr_pull_netr_UasInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.info)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, 0); } + _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_netr_UasInfo(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_WERROR(ndr, NDR_SCALARS, &r->out.result)); } return NDR_ERR_SUCCESS; @@ -7487,9 +8021,7 @@ _PUBLIC_ void ndr_print_netr_LogonUasLogon(struct ndr_print *ndr, const char *na ndr->depth++; ndr_print_ptr(ndr, "info", r->out.info); ndr->depth++; - if (r->out.info) { - ndr_print_netr_UasInfo(ndr, "info", r->out.info); - } + ndr_print_netr_UasInfo(ndr, "info", r->out.info); ndr->depth--; ndr_print_WERROR(ndr, "result", r->out.result); ndr->depth--; @@ -7641,8 +8173,11 @@ static enum ndr_err_code ndr_push_netr_LogonSamLogon(struct ndr_push *ndr, int f NDR_CHECK(ndr_push_netr_Authenticator(ndr, NDR_SCALARS, r->in.return_authenticator)); } NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->in.logon_level)); - NDR_CHECK(ndr_push_set_switch_value(ndr, &r->in.logon, r->in.logon_level)); - NDR_CHECK(ndr_push_netr_LogonLevel(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.logon)); + if (r->in.logon == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_set_switch_value(ndr, r->in.logon, r->in.logon_level)); + NDR_CHECK(ndr_push_netr_LogonLevel(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.logon)); NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->in.validation_level)); } if (flags & NDR_OUT) { @@ -7674,6 +8209,7 @@ static enum ndr_err_code ndr_pull_netr_LogonSamLogon(struct ndr_pull *ndr, int f TALLOC_CTX *_mem_save_computer_name_0; TALLOC_CTX *_mem_save_credential_0; TALLOC_CTX *_mem_save_return_authenticator_0; + TALLOC_CTX *_mem_save_logon_0; TALLOC_CTX *_mem_save_validation_0; TALLOC_CTX *_mem_save_authoritative_0; if (flags & NDR_IN) { @@ -7740,8 +8276,14 @@ static enum ndr_err_code ndr_pull_netr_LogonSamLogon(struct ndr_pull *ndr, int f NDR_PULL_SET_MEM_CTX(ndr, _mem_save_return_authenticator_0, 0); } NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->in.logon_level)); - NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->in.logon, r->in.logon_level)); - NDR_CHECK(ndr_pull_netr_LogonLevel(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.logon)); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.logon); + } + _mem_save_logon_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.logon, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_set_switch_value(ndr, r->in.logon, r->in.logon_level)); + NDR_CHECK(ndr_pull_netr_LogonLevel(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.logon)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_logon_0, LIBNDR_FLAG_REF_ALLOC); NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->in.validation_level)); NDR_PULL_ALLOC(ndr, r->out.validation); ZERO_STRUCTP(r->out.validation); @@ -7816,8 +8358,11 @@ _PUBLIC_ void ndr_print_netr_LogonSamLogon(struct ndr_print *ndr, const char *na } ndr->depth--; ndr_print_uint16(ndr, "logon_level", r->in.logon_level); - ndr_print_set_switch_value(ndr, &r->in.logon, r->in.logon_level); - ndr_print_netr_LogonLevel(ndr, "logon", &r->in.logon); + ndr_print_ptr(ndr, "logon", r->in.logon); + ndr->depth++; + ndr_print_set_switch_value(ndr, r->in.logon, r->in.logon_level); + ndr_print_netr_LogonLevel(ndr, "logon", r->in.logon); + ndr->depth--; ndr_print_uint16(ndr, "validation_level", r->in.validation_level); ndr->depth--; } @@ -8053,10 +8598,10 @@ static enum ndr_err_code ndr_push_netr_ServerReqChallenge(struct ndr_push *ndr, NDR_CHECK(ndr_push_netr_Credential(ndr, NDR_SCALARS, r->in.credentials)); } if (flags & NDR_OUT) { - if (r->out.credentials == NULL) { + if (r->out.return_credentials == NULL) { return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); } - NDR_CHECK(ndr_push_netr_Credential(ndr, NDR_SCALARS, r->out.credentials)); + NDR_CHECK(ndr_push_netr_Credential(ndr, NDR_SCALARS, r->out.return_credentials)); NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); } return NDR_ERR_SUCCESS; @@ -8067,6 +8612,7 @@ static enum ndr_err_code ndr_pull_netr_ServerReqChallenge(struct ndr_pull *ndr, uint32_t _ptr_server_name; TALLOC_CTX *_mem_save_server_name_0; TALLOC_CTX *_mem_save_credentials_0; + TALLOC_CTX *_mem_save_return_credentials_0; if (flags & NDR_IN) { ZERO_STRUCT(r->out); @@ -8102,17 +8648,17 @@ static enum ndr_err_code ndr_pull_netr_ServerReqChallenge(struct ndr_pull *ndr, NDR_PULL_SET_MEM_CTX(ndr, r->in.credentials, LIBNDR_FLAG_REF_ALLOC); NDR_CHECK(ndr_pull_netr_Credential(ndr, NDR_SCALARS, r->in.credentials)); NDR_PULL_SET_MEM_CTX(ndr, _mem_save_credentials_0, LIBNDR_FLAG_REF_ALLOC); - NDR_PULL_ALLOC(ndr, r->out.credentials); - *r->out.credentials = *r->in.credentials; + NDR_PULL_ALLOC(ndr, r->out.return_credentials); + ZERO_STRUCTP(r->out.return_credentials); } if (flags & NDR_OUT) { if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.credentials); + NDR_PULL_ALLOC(ndr, r->out.return_credentials); } - _mem_save_credentials_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.credentials, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_netr_Credential(ndr, NDR_SCALARS, r->out.credentials)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_credentials_0, LIBNDR_FLAG_REF_ALLOC); + _mem_save_return_credentials_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.return_credentials, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_netr_Credential(ndr, NDR_SCALARS, r->out.return_credentials)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_return_credentials_0, LIBNDR_FLAG_REF_ALLOC); NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); } return NDR_ERR_SUCCESS; @@ -8144,9 +8690,9 @@ _PUBLIC_ void ndr_print_netr_ServerReqChallenge(struct ndr_print *ndr, const cha if (flags & NDR_OUT) { ndr_print_struct(ndr, "out", "netr_ServerReqChallenge"); ndr->depth++; - ndr_print_ptr(ndr, "credentials", r->out.credentials); + ndr_print_ptr(ndr, "return_credentials", r->out.return_credentials); ndr->depth++; - ndr_print_netr_Credential(ndr, "credentials", r->out.credentials); + ndr_print_netr_Credential(ndr, "return_credentials", r->out.return_credentials); ndr->depth--; ndr_print_NTSTATUS(ndr, "result", r->out.result); ndr->depth--; @@ -8179,10 +8725,10 @@ static enum ndr_err_code ndr_push_netr_ServerAuthenticate(struct ndr_push *ndr, NDR_CHECK(ndr_push_netr_Credential(ndr, NDR_SCALARS, r->in.credentials)); } if (flags & NDR_OUT) { - if (r->out.credentials == NULL) { + if (r->out.return_credentials == NULL) { return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); } - NDR_CHECK(ndr_push_netr_Credential(ndr, NDR_SCALARS, r->out.credentials)); + NDR_CHECK(ndr_push_netr_Credential(ndr, NDR_SCALARS, r->out.return_credentials)); NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); } return NDR_ERR_SUCCESS; @@ -8193,6 +8739,7 @@ static enum ndr_err_code ndr_pull_netr_ServerAuthenticate(struct ndr_pull *ndr, uint32_t _ptr_server_name; TALLOC_CTX *_mem_save_server_name_0; TALLOC_CTX *_mem_save_credentials_0; + TALLOC_CTX *_mem_save_return_credentials_0; if (flags & NDR_IN) { ZERO_STRUCT(r->out); @@ -8236,17 +8783,17 @@ static enum ndr_err_code ndr_pull_netr_ServerAuthenticate(struct ndr_pull *ndr, NDR_PULL_SET_MEM_CTX(ndr, r->in.credentials, LIBNDR_FLAG_REF_ALLOC); NDR_CHECK(ndr_pull_netr_Credential(ndr, NDR_SCALARS, r->in.credentials)); NDR_PULL_SET_MEM_CTX(ndr, _mem_save_credentials_0, LIBNDR_FLAG_REF_ALLOC); - NDR_PULL_ALLOC(ndr, r->out.credentials); - *r->out.credentials = *r->in.credentials; + NDR_PULL_ALLOC(ndr, r->out.return_credentials); + ZERO_STRUCTP(r->out.return_credentials); } if (flags & NDR_OUT) { if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.credentials); + NDR_PULL_ALLOC(ndr, r->out.return_credentials); } - _mem_save_credentials_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.credentials, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_netr_Credential(ndr, NDR_SCALARS, r->out.credentials)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_credentials_0, LIBNDR_FLAG_REF_ALLOC); + _mem_save_return_credentials_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.return_credentials, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_netr_Credential(ndr, NDR_SCALARS, r->out.return_credentials)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_return_credentials_0, LIBNDR_FLAG_REF_ALLOC); NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); } return NDR_ERR_SUCCESS; @@ -8280,9 +8827,9 @@ _PUBLIC_ void ndr_print_netr_ServerAuthenticate(struct ndr_print *ndr, const cha if (flags & NDR_OUT) { ndr_print_struct(ndr, "out", "netr_ServerAuthenticate"); ndr->depth++; - ndr_print_ptr(ndr, "credentials", r->out.credentials); + ndr_print_ptr(ndr, "return_credentials", r->out.return_credentials); ndr->depth++; - ndr_print_netr_Credential(ndr, "credentials", r->out.credentials); + ndr_print_netr_Credential(ndr, "return_credentials", r->out.return_credentials); ndr->depth--; ndr_print_NTSTATUS(ndr, "result", r->out.result); ndr->depth--; @@ -8309,8 +8856,14 @@ static enum ndr_err_code ndr_push_netr_ServerPasswordSet(struct ndr_push *ndr, i NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.computer_name, CH_UTF16))); NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.computer_name, ndr_charset_length(r->in.computer_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - NDR_CHECK(ndr_push_netr_Authenticator(ndr, NDR_SCALARS, &r->in.credential)); - NDR_CHECK(ndr_push_samr_Password(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.new_password)); + if (r->in.credential == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_netr_Authenticator(ndr, NDR_SCALARS, r->in.credential)); + if (r->in.new_password == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_samr_Password(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.new_password)); } if (flags & NDR_OUT) { if (r->out.return_authenticator == NULL) { @@ -8326,7 +8879,9 @@ static enum ndr_err_code ndr_pull_netr_ServerPasswordSet(struct ndr_pull *ndr, i { uint32_t _ptr_server_name; TALLOC_CTX *_mem_save_server_name_0; + TALLOC_CTX *_mem_save_credential_0; TALLOC_CTX *_mem_save_return_authenticator_0; + TALLOC_CTX *_mem_save_new_password_0; if (flags & NDR_IN) { ZERO_STRUCT(r->out); @@ -8363,8 +8918,20 @@ static enum ndr_err_code ndr_pull_netr_ServerPasswordSet(struct ndr_pull *ndr, i } NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.computer_name), sizeof(uint16_t))); NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.computer_name, ndr_get_array_length(ndr, &r->in.computer_name), sizeof(uint16_t), CH_UTF16)); - NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, &r->in.credential)); - NDR_CHECK(ndr_pull_samr_Password(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.new_password)); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.credential); + } + _mem_save_credential_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.credential, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, r->in.credential)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_credential_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.new_password); + } + _mem_save_new_password_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.new_password, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_samr_Password(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.new_password)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_new_password_0, LIBNDR_FLAG_REF_ALLOC); NDR_PULL_ALLOC(ndr, r->out.return_authenticator); ZERO_STRUCTP(r->out.return_authenticator); } @@ -8400,8 +8967,14 @@ _PUBLIC_ void ndr_print_netr_ServerPasswordSet(struct ndr_print *ndr, const char ndr_print_string(ndr, "account_name", r->in.account_name); ndr_print_netr_SchannelType(ndr, "secure_channel_type", r->in.secure_channel_type); ndr_print_string(ndr, "computer_name", r->in.computer_name); - ndr_print_netr_Authenticator(ndr, "credential", &r->in.credential); - ndr_print_samr_Password(ndr, "new_password", &r->in.new_password); + ndr_print_ptr(ndr, "credential", r->in.credential); + ndr->depth++; + ndr_print_netr_Authenticator(ndr, "credential", r->in.credential); + ndr->depth--; + ndr_print_ptr(ndr, "new_password", r->in.new_password); + ndr->depth++; + ndr_print_samr_Password(ndr, "new_password", r->in.new_password); + ndr->depth--; ndr->depth--; } if (flags & NDR_OUT) { @@ -8428,7 +9001,10 @@ static enum ndr_err_code ndr_push_netr_DatabaseDeltas(struct ndr_push *ndr, int NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.computername, CH_UTF16))); NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.computername, ndr_charset_length(r->in.computername, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - NDR_CHECK(ndr_push_netr_Authenticator(ndr, NDR_SCALARS, &r->in.credential)); + if (r->in.credential == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_netr_Authenticator(ndr, NDR_SCALARS, r->in.credential)); if (r->in.return_authenticator == NULL) { return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); } @@ -8449,9 +9025,12 @@ static enum ndr_err_code ndr_push_netr_DatabaseDeltas(struct ndr_push *ndr, int return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); } NDR_CHECK(ndr_push_udlong(ndr, NDR_SCALARS, *r->out.sequence_num)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.delta_enum_array)); - if (r->out.delta_enum_array) { - NDR_CHECK(ndr_push_netr_DELTA_ENUM_ARRAY(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.delta_enum_array)); + if (r->out.delta_enum_array == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.delta_enum_array)); + if (*r->out.delta_enum_array) { + NDR_CHECK(ndr_push_netr_DELTA_ENUM_ARRAY(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.delta_enum_array)); } NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); } @@ -8461,9 +9040,11 @@ static enum ndr_err_code ndr_push_netr_DatabaseDeltas(struct ndr_push *ndr, int static enum ndr_err_code ndr_pull_netr_DatabaseDeltas(struct ndr_pull *ndr, int flags, struct netr_DatabaseDeltas *r) { uint32_t _ptr_delta_enum_array; + TALLOC_CTX *_mem_save_credential_0; TALLOC_CTX *_mem_save_return_authenticator_0; TALLOC_CTX *_mem_save_sequence_num_0; TALLOC_CTX *_mem_save_delta_enum_array_0; + TALLOC_CTX *_mem_save_delta_enum_array_1; if (flags & NDR_IN) { ZERO_STRUCT(r->out); @@ -8481,7 +9062,13 @@ static enum ndr_err_code ndr_pull_netr_DatabaseDeltas(struct ndr_pull *ndr, int } NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.computername), sizeof(uint16_t))); NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.computername, ndr_get_array_length(ndr, &r->in.computername), sizeof(uint16_t), CH_UTF16)); - NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, &r->in.credential)); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.credential); + } + _mem_save_credential_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.credential, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, r->in.credential)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_credential_0, LIBNDR_FLAG_REF_ALLOC); if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { NDR_PULL_ALLOC(ndr, r->in.return_authenticator); } @@ -8502,6 +9089,8 @@ static enum ndr_err_code ndr_pull_netr_DatabaseDeltas(struct ndr_pull *ndr, int *r->out.return_authenticator = *r->in.return_authenticator; NDR_PULL_ALLOC(ndr, r->out.sequence_num); *r->out.sequence_num = *r->in.sequence_num; + NDR_PULL_ALLOC(ndr, r->out.delta_enum_array); + ZERO_STRUCTP(r->out.delta_enum_array); } if (flags & NDR_OUT) { if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { @@ -8518,18 +9107,24 @@ static enum ndr_err_code ndr_pull_netr_DatabaseDeltas(struct ndr_pull *ndr, int NDR_PULL_SET_MEM_CTX(ndr, r->out.sequence_num, LIBNDR_FLAG_REF_ALLOC); NDR_CHECK(ndr_pull_udlong(ndr, NDR_SCALARS, r->out.sequence_num)); NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sequence_num_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.delta_enum_array); + } + _mem_save_delta_enum_array_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.delta_enum_array, LIBNDR_FLAG_REF_ALLOC); NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_delta_enum_array)); if (_ptr_delta_enum_array) { - NDR_PULL_ALLOC(ndr, r->out.delta_enum_array); + NDR_PULL_ALLOC(ndr, *r->out.delta_enum_array); } else { - r->out.delta_enum_array = NULL; + *r->out.delta_enum_array = NULL; } - if (r->out.delta_enum_array) { - _mem_save_delta_enum_array_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.delta_enum_array, 0); - NDR_CHECK(ndr_pull_netr_DELTA_ENUM_ARRAY(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.delta_enum_array)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_delta_enum_array_0, 0); + if (*r->out.delta_enum_array) { + _mem_save_delta_enum_array_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, *r->out.delta_enum_array, 0); + NDR_CHECK(ndr_pull_netr_DELTA_ENUM_ARRAY(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.delta_enum_array)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_delta_enum_array_1, 0); } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_delta_enum_array_0, LIBNDR_FLAG_REF_ALLOC); NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); } return NDR_ERR_SUCCESS; @@ -8547,7 +9142,10 @@ _PUBLIC_ void ndr_print_netr_DatabaseDeltas(struct ndr_print *ndr, const char *n ndr->depth++; ndr_print_string(ndr, "logon_server", r->in.logon_server); ndr_print_string(ndr, "computername", r->in.computername); - ndr_print_netr_Authenticator(ndr, "credential", &r->in.credential); + ndr_print_ptr(ndr, "credential", r->in.credential); + ndr->depth++; + ndr_print_netr_Authenticator(ndr, "credential", r->in.credential); + ndr->depth--; ndr_print_ptr(ndr, "return_authenticator", r->in.return_authenticator); ndr->depth++; ndr_print_netr_Authenticator(ndr, "return_authenticator", r->in.return_authenticator); @@ -8573,10 +9171,13 @@ _PUBLIC_ void ndr_print_netr_DatabaseDeltas(struct ndr_print *ndr, const char *n ndr->depth--; ndr_print_ptr(ndr, "delta_enum_array", r->out.delta_enum_array); ndr->depth++; - if (r->out.delta_enum_array) { - ndr_print_netr_DELTA_ENUM_ARRAY(ndr, "delta_enum_array", r->out.delta_enum_array); + ndr_print_ptr(ndr, "delta_enum_array", *r->out.delta_enum_array); + ndr->depth++; + if (*r->out.delta_enum_array) { + ndr_print_netr_DELTA_ENUM_ARRAY(ndr, "delta_enum_array", *r->out.delta_enum_array); } ndr->depth--; + ndr->depth--; ndr_print_NTSTATUS(ndr, "result", r->out.result); ndr->depth--; } @@ -8615,10 +9216,10 @@ static enum ndr_err_code ndr_push_netr_DatabaseSync(struct ndr_push *ndr, int fl return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); } NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.sync_context)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.delta_enum_array)); - if (r->out.delta_enum_array) { - NDR_CHECK(ndr_push_netr_DELTA_ENUM_ARRAY(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.delta_enum_array)); + if (r->out.delta_enum_array == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); } + NDR_CHECK(ndr_push_netr_DELTA_ENUM_ARRAY(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.delta_enum_array)); NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); } return NDR_ERR_SUCCESS; @@ -8626,7 +9227,6 @@ static enum ndr_err_code ndr_push_netr_DatabaseSync(struct ndr_push *ndr, int fl static enum ndr_err_code ndr_pull_netr_DatabaseSync(struct ndr_pull *ndr, int flags, struct netr_DatabaseSync *r) { - uint32_t _ptr_delta_enum_array; TALLOC_CTX *_mem_save_return_authenticator_0; TALLOC_CTX *_mem_save_sync_context_0; TALLOC_CTX *_mem_save_delta_enum_array_0; @@ -8668,6 +9268,8 @@ static enum ndr_err_code ndr_pull_netr_DatabaseSync(struct ndr_pull *ndr, int fl *r->out.return_authenticator = *r->in.return_authenticator; NDR_PULL_ALLOC(ndr, r->out.sync_context); *r->out.sync_context = *r->in.sync_context; + NDR_PULL_ALLOC(ndr, r->out.delta_enum_array); + ZERO_STRUCTP(r->out.delta_enum_array); } if (flags & NDR_OUT) { if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { @@ -8684,18 +9286,13 @@ static enum ndr_err_code ndr_pull_netr_DatabaseSync(struct ndr_pull *ndr, int fl NDR_PULL_SET_MEM_CTX(ndr, r->out.sync_context, LIBNDR_FLAG_REF_ALLOC); NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.sync_context)); NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sync_context_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_delta_enum_array)); - if (_ptr_delta_enum_array) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { NDR_PULL_ALLOC(ndr, r->out.delta_enum_array); - } else { - r->out.delta_enum_array = NULL; - } - if (r->out.delta_enum_array) { - _mem_save_delta_enum_array_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.delta_enum_array, 0); - NDR_CHECK(ndr_pull_netr_DELTA_ENUM_ARRAY(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.delta_enum_array)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_delta_enum_array_0, 0); } + _mem_save_delta_enum_array_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.delta_enum_array, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_netr_DELTA_ENUM_ARRAY(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.delta_enum_array)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_delta_enum_array_0, LIBNDR_FLAG_REF_ALLOC); NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); } return NDR_ERR_SUCCESS; @@ -8739,9 +9336,7 @@ _PUBLIC_ void ndr_print_netr_DatabaseSync(struct ndr_print *ndr, const char *nam ndr->depth--; ndr_print_ptr(ndr, "delta_enum_array", r->out.delta_enum_array); ndr->depth++; - if (r->out.delta_enum_array) { - ndr_print_netr_DELTA_ENUM_ARRAY(ndr, "delta_enum_array", r->out.delta_enum_array); - } + ndr_print_netr_DELTA_ENUM_ARRAY(ndr, "delta_enum_array", r->out.delta_enum_array); ndr->depth--; ndr_print_NTSTATUS(ndr, "result", r->out.result); ndr->depth--; @@ -9234,15 +9829,14 @@ static enum ndr_err_code ndr_push_netr_GetDcName(struct ndr_push *ndr, int flags if (r->out.dcname == NULL) { return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); } - if (*r->out.dcname == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.dcname)); + if (*r->out.dcname) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(*r->out.dcname, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(*r->out.dcname, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, *r->out.dcname, ndr_charset_length(*r->out.dcname, CH_UTF16), sizeof(uint16_t), CH_UTF16)); } - NDR_CHECK(ndr_push_ref_ptr(ndr)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(*r->out.dcname, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(*r->out.dcname, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, *r->out.dcname, ndr_charset_length(*r->out.dcname, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); } return NDR_ERR_SUCCESS; } @@ -9253,6 +9847,7 @@ static enum ndr_err_code ndr_pull_netr_GetDcName(struct ndr_pull *ndr, int flags uint32_t _ptr_dcname; TALLOC_CTX *_mem_save_domainname_0; TALLOC_CTX *_mem_save_dcname_0; + TALLOC_CTX *_mem_save_dcname_1; if (flags & NDR_IN) { ZERO_STRUCT(r->out); @@ -9290,16 +9885,26 @@ static enum ndr_err_code ndr_pull_netr_GetDcName(struct ndr_pull *ndr, int flags } _mem_save_dcname_0 = NDR_PULL_GET_MEM_CTX(ndr); NDR_PULL_SET_MEM_CTX(ndr, r->out.dcname, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_ref_ptr(ndr, &_ptr_dcname)); - NDR_CHECK(ndr_pull_array_size(ndr, r->out.dcname)); - NDR_CHECK(ndr_pull_array_length(ndr, r->out.dcname)); - if (ndr_get_array_length(ndr, r->out.dcname) > ndr_get_array_size(ndr, r->out.dcname)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, r->out.dcname), ndr_get_array_length(ndr, r->out.dcname)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, r->out.dcname), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, r->out.dcname, ndr_get_array_length(ndr, r->out.dcname), sizeof(uint16_t), CH_UTF16)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_dcname)); + if (_ptr_dcname) { + NDR_PULL_ALLOC(ndr, *r->out.dcname); + } else { + *r->out.dcname = NULL; + } + if (*r->out.dcname) { + _mem_save_dcname_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, *r->out.dcname, 0); + NDR_CHECK(ndr_pull_array_size(ndr, r->out.dcname)); + NDR_CHECK(ndr_pull_array_length(ndr, r->out.dcname)); + if (ndr_get_array_length(ndr, r->out.dcname) > ndr_get_array_size(ndr, r->out.dcname)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, r->out.dcname), ndr_get_array_length(ndr, r->out.dcname)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, r->out.dcname), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, r->out.dcname, ndr_get_array_length(ndr, r->out.dcname), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_dcname_1, 0); + } NDR_PULL_SET_MEM_CTX(ndr, _mem_save_dcname_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); } return NDR_ERR_SUCCESS; } @@ -9330,10 +9935,12 @@ _PUBLIC_ void ndr_print_netr_GetDcName(struct ndr_print *ndr, const char *name, ndr->depth++; ndr_print_ptr(ndr, "dcname", *r->out.dcname); ndr->depth++; - ndr_print_string(ndr, "dcname", *r->out.dcname); + if (*r->out.dcname) { + ndr_print_string(ndr, "dcname", *r->out.dcname); + } ndr->depth--; ndr->depth--; - ndr_print_NTSTATUS(ndr, "result", r->out.result); + ndr_print_WERROR(ndr, "result", r->out.result); ndr->depth--; } ndr->depth--; @@ -9464,14 +10071,13 @@ static enum ndr_err_code ndr_push_netr_GetAnyDCName(struct ndr_push *ndr, int fl if (r->out.dcname == NULL) { return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); } - if (*r->out.dcname == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.dcname)); + if (*r->out.dcname) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(*r->out.dcname, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(*r->out.dcname, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, *r->out.dcname, ndr_charset_length(*r->out.dcname, CH_UTF16), sizeof(uint16_t), CH_UTF16)); } - NDR_CHECK(ndr_push_ref_ptr(ndr)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(*r->out.dcname, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(*r->out.dcname, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, *r->out.dcname, ndr_charset_length(*r->out.dcname, CH_UTF16), sizeof(uint16_t), CH_UTF16)); NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); } return NDR_ERR_SUCCESS; @@ -9485,6 +10091,7 @@ static enum ndr_err_code ndr_pull_netr_GetAnyDCName(struct ndr_pull *ndr, int fl TALLOC_CTX *_mem_save_logon_server_0; TALLOC_CTX *_mem_save_domainname_0; TALLOC_CTX *_mem_save_dcname_0; + TALLOC_CTX *_mem_save_dcname_1; if (flags & NDR_IN) { ZERO_STRUCT(r->out); @@ -9533,14 +10140,24 @@ static enum ndr_err_code ndr_pull_netr_GetAnyDCName(struct ndr_pull *ndr, int fl } _mem_save_dcname_0 = NDR_PULL_GET_MEM_CTX(ndr); NDR_PULL_SET_MEM_CTX(ndr, r->out.dcname, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_ref_ptr(ndr, &_ptr_dcname)); - NDR_CHECK(ndr_pull_array_size(ndr, r->out.dcname)); - NDR_CHECK(ndr_pull_array_length(ndr, r->out.dcname)); - if (ndr_get_array_length(ndr, r->out.dcname) > ndr_get_array_size(ndr, r->out.dcname)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, r->out.dcname), ndr_get_array_length(ndr, r->out.dcname)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, r->out.dcname), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, r->out.dcname, ndr_get_array_length(ndr, r->out.dcname), sizeof(uint16_t), CH_UTF16)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_dcname)); + if (_ptr_dcname) { + NDR_PULL_ALLOC(ndr, *r->out.dcname); + } else { + *r->out.dcname = NULL; + } + if (*r->out.dcname) { + _mem_save_dcname_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, *r->out.dcname, 0); + NDR_CHECK(ndr_pull_array_size(ndr, r->out.dcname)); + NDR_CHECK(ndr_pull_array_length(ndr, r->out.dcname)); + if (ndr_get_array_length(ndr, r->out.dcname) > ndr_get_array_size(ndr, r->out.dcname)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, r->out.dcname), ndr_get_array_length(ndr, r->out.dcname)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, r->out.dcname), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, r->out.dcname, ndr_get_array_length(ndr, r->out.dcname), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_dcname_1, 0); + } NDR_PULL_SET_MEM_CTX(ndr, _mem_save_dcname_0, LIBNDR_FLAG_REF_ALLOC); NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); } @@ -9578,7 +10195,9 @@ _PUBLIC_ void ndr_print_netr_GetAnyDCName(struct ndr_print *ndr, const char *nam ndr->depth++; ndr_print_ptr(ndr, "dcname", *r->out.dcname); ndr->depth++; - ndr_print_string(ndr, "dcname", *r->out.dcname); + if (*r->out.dcname) { + ndr_print_string(ndr, "dcname", *r->out.dcname); + } ndr->depth--; ndr->depth--; ndr_print_WERROR(ndr, "result", r->out.result); @@ -9599,8 +10218,11 @@ static enum ndr_err_code ndr_push_netr_LogonControl2(struct ndr_push *ndr, int f } NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.function_code)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.level)); - NDR_CHECK(ndr_push_set_switch_value(ndr, &r->in.data, r->in.function_code)); - NDR_CHECK(ndr_push_netr_CONTROL_DATA_INFORMATION(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.data)); + if (r->in.data == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_set_switch_value(ndr, r->in.data, r->in.function_code)); + NDR_CHECK(ndr_push_netr_CONTROL_DATA_INFORMATION(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.data)); } if (flags & NDR_OUT) { if (r->out.query == NULL) { @@ -9617,6 +10239,7 @@ static enum ndr_err_code ndr_pull_netr_LogonControl2(struct ndr_pull *ndr, int f { uint32_t _ptr_logon_server; TALLOC_CTX *_mem_save_logon_server_0; + TALLOC_CTX *_mem_save_data_0; TALLOC_CTX *_mem_save_query_0; if (flags & NDR_IN) { ZERO_STRUCT(r->out); @@ -9641,8 +10264,14 @@ static enum ndr_err_code ndr_pull_netr_LogonControl2(struct ndr_pull *ndr, int f } NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.function_code)); NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.level)); - NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->in.data, r->in.function_code)); - NDR_CHECK(ndr_pull_netr_CONTROL_DATA_INFORMATION(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.data)); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.data); + } + _mem_save_data_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.data, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_set_switch_value(ndr, r->in.data, r->in.function_code)); + NDR_CHECK(ndr_pull_netr_CONTROL_DATA_INFORMATION(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.data)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_data_0, LIBNDR_FLAG_REF_ALLOC); NDR_PULL_ALLOC(ndr, r->out.query); ZERO_STRUCTP(r->out.query); } @@ -9678,8 +10307,11 @@ _PUBLIC_ void ndr_print_netr_LogonControl2(struct ndr_print *ndr, const char *na ndr->depth--; ndr_print_uint32(ndr, "function_code", r->in.function_code); ndr_print_uint32(ndr, "level", r->in.level); - ndr_print_set_switch_value(ndr, &r->in.data, r->in.function_code); - ndr_print_netr_CONTROL_DATA_INFORMATION(ndr, "data", &r->in.data); + ndr_print_ptr(ndr, "data", r->in.data); + ndr->depth++; + ndr_print_set_switch_value(ndr, r->in.data, r->in.function_code); + ndr_print_netr_CONTROL_DATA_INFORMATION(ndr, "data", r->in.data); + ndr->depth--; ndr->depth--; } if (flags & NDR_OUT) { @@ -9725,10 +10357,10 @@ static enum ndr_err_code ndr_push_netr_ServerAuthenticate2(struct ndr_push *ndr, NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.negotiate_flags)); } if (flags & NDR_OUT) { - if (r->out.credentials == NULL) { + if (r->out.return_credentials == NULL) { return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); } - NDR_CHECK(ndr_push_netr_Credential(ndr, NDR_SCALARS, r->out.credentials)); + NDR_CHECK(ndr_push_netr_Credential(ndr, NDR_SCALARS, r->out.return_credentials)); if (r->out.negotiate_flags == NULL) { return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); } @@ -9743,6 +10375,7 @@ static enum ndr_err_code ndr_pull_netr_ServerAuthenticate2(struct ndr_pull *ndr, uint32_t _ptr_server_name; TALLOC_CTX *_mem_save_server_name_0; TALLOC_CTX *_mem_save_credentials_0; + TALLOC_CTX *_mem_save_return_credentials_0; TALLOC_CTX *_mem_save_negotiate_flags_0; if (flags & NDR_IN) { ZERO_STRUCT(r->out); @@ -9794,19 +10427,19 @@ static enum ndr_err_code ndr_pull_netr_ServerAuthenticate2(struct ndr_pull *ndr, NDR_PULL_SET_MEM_CTX(ndr, r->in.negotiate_flags, LIBNDR_FLAG_REF_ALLOC); NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->in.negotiate_flags)); NDR_PULL_SET_MEM_CTX(ndr, _mem_save_negotiate_flags_0, LIBNDR_FLAG_REF_ALLOC); - NDR_PULL_ALLOC(ndr, r->out.credentials); - *r->out.credentials = *r->in.credentials; + NDR_PULL_ALLOC(ndr, r->out.return_credentials); + ZERO_STRUCTP(r->out.return_credentials); NDR_PULL_ALLOC(ndr, r->out.negotiate_flags); *r->out.negotiate_flags = *r->in.negotiate_flags; } if (flags & NDR_OUT) { if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.credentials); + NDR_PULL_ALLOC(ndr, r->out.return_credentials); } - _mem_save_credentials_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.credentials, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_netr_Credential(ndr, NDR_SCALARS, r->out.credentials)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_credentials_0, LIBNDR_FLAG_REF_ALLOC); + _mem_save_return_credentials_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.return_credentials, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_netr_Credential(ndr, NDR_SCALARS, r->out.return_credentials)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_return_credentials_0, LIBNDR_FLAG_REF_ALLOC); if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { NDR_PULL_ALLOC(ndr, r->out.negotiate_flags); } @@ -9851,9 +10484,9 @@ _PUBLIC_ void ndr_print_netr_ServerAuthenticate2(struct ndr_print *ndr, const ch if (flags & NDR_OUT) { ndr_print_struct(ndr, "out", "netr_ServerAuthenticate2"); ndr->depth++; - ndr_print_ptr(ndr, "credentials", r->out.credentials); + ndr_print_ptr(ndr, "return_credentials", r->out.return_credentials); ndr->depth++; - ndr_print_netr_Credential(ndr, "credentials", r->out.credentials); + ndr_print_netr_Credential(ndr, "return_credentials", r->out.return_credentials); ndr->depth--; ndr_print_ptr(ndr, "negotiate_flags", r->out.negotiate_flags); ndr->depth++; @@ -9876,7 +10509,10 @@ static enum ndr_err_code ndr_push_netr_DatabaseSync2(struct ndr_push *ndr, int f NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.computername, CH_UTF16))); NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.computername, ndr_charset_length(r->in.computername, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - NDR_CHECK(ndr_push_netr_Authenticator(ndr, NDR_SCALARS, &r->in.credential)); + if (r->in.credential == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_netr_Authenticator(ndr, NDR_SCALARS, r->in.credential)); if (r->in.return_authenticator == NULL) { return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); } @@ -9898,9 +10534,12 @@ static enum ndr_err_code ndr_push_netr_DatabaseSync2(struct ndr_push *ndr, int f return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); } NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.sync_context)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.delta_enum_array)); - if (r->out.delta_enum_array) { - NDR_CHECK(ndr_push_netr_DELTA_ENUM_ARRAY(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.delta_enum_array)); + if (r->out.delta_enum_array == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.delta_enum_array)); + if (*r->out.delta_enum_array) { + NDR_CHECK(ndr_push_netr_DELTA_ENUM_ARRAY(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.delta_enum_array)); } NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); } @@ -9910,9 +10549,11 @@ static enum ndr_err_code ndr_push_netr_DatabaseSync2(struct ndr_push *ndr, int f static enum ndr_err_code ndr_pull_netr_DatabaseSync2(struct ndr_pull *ndr, int flags, struct netr_DatabaseSync2 *r) { uint32_t _ptr_delta_enum_array; + TALLOC_CTX *_mem_save_credential_0; TALLOC_CTX *_mem_save_return_authenticator_0; TALLOC_CTX *_mem_save_sync_context_0; TALLOC_CTX *_mem_save_delta_enum_array_0; + TALLOC_CTX *_mem_save_delta_enum_array_1; if (flags & NDR_IN) { ZERO_STRUCT(r->out); @@ -9930,7 +10571,13 @@ static enum ndr_err_code ndr_pull_netr_DatabaseSync2(struct ndr_pull *ndr, int f } NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.computername), sizeof(uint16_t))); NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.computername, ndr_get_array_length(ndr, &r->in.computername), sizeof(uint16_t), CH_UTF16)); - NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, &r->in.credential)); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.credential); + } + _mem_save_credential_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.credential, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, r->in.credential)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_credential_0, LIBNDR_FLAG_REF_ALLOC); if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { NDR_PULL_ALLOC(ndr, r->in.return_authenticator); } @@ -9952,6 +10599,8 @@ static enum ndr_err_code ndr_pull_netr_DatabaseSync2(struct ndr_pull *ndr, int f *r->out.return_authenticator = *r->in.return_authenticator; NDR_PULL_ALLOC(ndr, r->out.sync_context); *r->out.sync_context = *r->in.sync_context; + NDR_PULL_ALLOC(ndr, r->out.delta_enum_array); + ZERO_STRUCTP(r->out.delta_enum_array); } if (flags & NDR_OUT) { if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { @@ -9968,18 +10617,24 @@ static enum ndr_err_code ndr_pull_netr_DatabaseSync2(struct ndr_pull *ndr, int f NDR_PULL_SET_MEM_CTX(ndr, r->out.sync_context, LIBNDR_FLAG_REF_ALLOC); NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.sync_context)); NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sync_context_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.delta_enum_array); + } + _mem_save_delta_enum_array_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.delta_enum_array, LIBNDR_FLAG_REF_ALLOC); NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_delta_enum_array)); if (_ptr_delta_enum_array) { - NDR_PULL_ALLOC(ndr, r->out.delta_enum_array); + NDR_PULL_ALLOC(ndr, *r->out.delta_enum_array); } else { - r->out.delta_enum_array = NULL; + *r->out.delta_enum_array = NULL; } - if (r->out.delta_enum_array) { - _mem_save_delta_enum_array_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.delta_enum_array, 0); - NDR_CHECK(ndr_pull_netr_DELTA_ENUM_ARRAY(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.delta_enum_array)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_delta_enum_array_0, 0); + if (*r->out.delta_enum_array) { + _mem_save_delta_enum_array_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, *r->out.delta_enum_array, 0); + NDR_CHECK(ndr_pull_netr_DELTA_ENUM_ARRAY(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.delta_enum_array)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_delta_enum_array_1, 0); } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_delta_enum_array_0, LIBNDR_FLAG_REF_ALLOC); NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); } return NDR_ERR_SUCCESS; @@ -9997,7 +10652,10 @@ _PUBLIC_ void ndr_print_netr_DatabaseSync2(struct ndr_print *ndr, const char *na ndr->depth++; ndr_print_string(ndr, "logon_server", r->in.logon_server); ndr_print_string(ndr, "computername", r->in.computername); - ndr_print_netr_Authenticator(ndr, "credential", &r->in.credential); + ndr_print_ptr(ndr, "credential", r->in.credential); + ndr->depth++; + ndr_print_netr_Authenticator(ndr, "credential", r->in.credential); + ndr->depth--; ndr_print_ptr(ndr, "return_authenticator", r->in.return_authenticator); ndr->depth++; ndr_print_netr_Authenticator(ndr, "return_authenticator", r->in.return_authenticator); @@ -10024,10 +10682,13 @@ _PUBLIC_ void ndr_print_netr_DatabaseSync2(struct ndr_print *ndr, const char *na ndr->depth--; ndr_print_ptr(ndr, "delta_enum_array", r->out.delta_enum_array); ndr->depth++; - if (r->out.delta_enum_array) { - ndr_print_netr_DELTA_ENUM_ARRAY(ndr, "delta_enum_array", r->out.delta_enum_array); + ndr_print_ptr(ndr, "delta_enum_array", *r->out.delta_enum_array); + ndr->depth++; + if (*r->out.delta_enum_array) { + ndr_print_netr_DELTA_ENUM_ARRAY(ndr, "delta_enum_array", *r->out.delta_enum_array); } ndr->depth--; + ndr->depth--; ndr_print_NTSTATUS(ndr, "result", r->out.result); ndr->depth--; } @@ -10062,10 +10723,10 @@ static enum ndr_err_code ndr_push_netr_DatabaseRedo(struct ndr_push *ndr, int fl return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); } NDR_CHECK(ndr_push_netr_Authenticator(ndr, NDR_SCALARS, r->out.return_authenticator)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.delta_enum_array)); - if (r->out.delta_enum_array) { - NDR_CHECK(ndr_push_netr_DELTA_ENUM_ARRAY(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.delta_enum_array)); + if (r->out.delta_enum_array == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); } + NDR_CHECK(ndr_push_netr_DELTA_ENUM_ARRAY(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.delta_enum_array)); NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); } return NDR_ERR_SUCCESS; @@ -10074,7 +10735,6 @@ static enum ndr_err_code ndr_push_netr_DatabaseRedo(struct ndr_push *ndr, int fl static enum ndr_err_code ndr_pull_netr_DatabaseRedo(struct ndr_pull *ndr, int flags, struct netr_DatabaseRedo *r) { uint32_t _ptr_change_log_entry; - uint32_t _ptr_delta_enum_array; TALLOC_CTX *_mem_save_return_authenticator_0; TALLOC_CTX *_mem_save_change_log_entry_0; TALLOC_CTX *_mem_save_delta_enum_array_0; @@ -10120,6 +10780,8 @@ static enum ndr_err_code ndr_pull_netr_DatabaseRedo(struct ndr_pull *ndr, int fl NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.change_log_entry_size)); NDR_PULL_ALLOC(ndr, r->out.return_authenticator); *r->out.return_authenticator = *r->in.return_authenticator; + NDR_PULL_ALLOC(ndr, r->out.delta_enum_array); + ZERO_STRUCTP(r->out.delta_enum_array); if (r->in.change_log_entry) { NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->in.change_log_entry, r->in.change_log_entry_size)); } @@ -10132,18 +10794,13 @@ static enum ndr_err_code ndr_pull_netr_DatabaseRedo(struct ndr_pull *ndr, int fl NDR_PULL_SET_MEM_CTX(ndr, r->out.return_authenticator, LIBNDR_FLAG_REF_ALLOC); NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, r->out.return_authenticator)); NDR_PULL_SET_MEM_CTX(ndr, _mem_save_return_authenticator_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_delta_enum_array)); - if (_ptr_delta_enum_array) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { NDR_PULL_ALLOC(ndr, r->out.delta_enum_array); - } else { - r->out.delta_enum_array = NULL; - } - if (r->out.delta_enum_array) { - _mem_save_delta_enum_array_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.delta_enum_array, 0); - NDR_CHECK(ndr_pull_netr_DELTA_ENUM_ARRAY(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.delta_enum_array)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_delta_enum_array_0, 0); } + _mem_save_delta_enum_array_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.delta_enum_array, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_netr_DELTA_ENUM_ARRAY(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.delta_enum_array)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_delta_enum_array_0, LIBNDR_FLAG_REF_ALLOC); NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); } return NDR_ERR_SUCCESS; @@ -10184,9 +10841,7 @@ _PUBLIC_ void ndr_print_netr_DatabaseRedo(struct ndr_print *ndr, const char *nam ndr->depth--; ndr_print_ptr(ndr, "delta_enum_array", r->out.delta_enum_array); ndr->depth++; - if (r->out.delta_enum_array) { - ndr_print_netr_DELTA_ENUM_ARRAY(ndr, "delta_enum_array", r->out.delta_enum_array); - } + ndr_print_netr_DELTA_ENUM_ARRAY(ndr, "delta_enum_array", r->out.delta_enum_array); ndr->depth--; ndr_print_NTSTATUS(ndr, "result", r->out.result); ndr->depth--; @@ -10303,41 +10958,94 @@ _PUBLIC_ void ndr_print_netr_LogonControl2Ex(struct ndr_print *ndr, const char * ndr->depth--; } -static enum ndr_err_code ndr_push_netr_NETRENUMERATETRUSTEDDOMAINS(struct ndr_push *ndr, int flags, const struct netr_NETRENUMERATETRUSTEDDOMAINS *r) +static enum ndr_err_code ndr_push_netr_NetrEnumerateTrustedDomains(struct ndr_push *ndr, int flags, const struct netr_NetrEnumerateTrustedDomains *r) { if (flags & NDR_IN) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_name)); + if (r->in.server_name) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_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.server_name, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.server_name, ndr_charset_length(r->in.server_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } } if (flags & NDR_OUT) { + if (r->out.trusted_domains_blob == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_netr_Blob(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.trusted_domains_blob)); NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); } return NDR_ERR_SUCCESS; } -static enum ndr_err_code ndr_pull_netr_NETRENUMERATETRUSTEDDOMAINS(struct ndr_pull *ndr, int flags, struct netr_NETRENUMERATETRUSTEDDOMAINS *r) +static enum ndr_err_code ndr_pull_netr_NetrEnumerateTrustedDomains(struct ndr_pull *ndr, int flags, struct netr_NetrEnumerateTrustedDomains *r) { + uint32_t _ptr_server_name; + TALLOC_CTX *_mem_save_server_name_0; + TALLOC_CTX *_mem_save_trusted_domains_blob_0; if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name)); + if (_ptr_server_name) { + NDR_PULL_ALLOC(ndr, r->in.server_name); + } else { + r->in.server_name = NULL; + } + if (r->in.server_name) { + _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.server_name, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_name)); + if (ndr_get_array_length(ndr, &r->in.server_name) > ndr_get_array_size(ndr, &r->in.server_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.server_name), ndr_get_array_length(ndr, &r->in.server_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_name, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0); + } + NDR_PULL_ALLOC(ndr, r->out.trusted_domains_blob); + ZERO_STRUCTP(r->out.trusted_domains_blob); } if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.trusted_domains_blob); + } + _mem_save_trusted_domains_blob_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.trusted_domains_blob, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_netr_Blob(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.trusted_domains_blob)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_trusted_domains_blob_0, LIBNDR_FLAG_REF_ALLOC); NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); } return NDR_ERR_SUCCESS; } -_PUBLIC_ void ndr_print_netr_NETRENUMERATETRUSTEDDOMAINS(struct ndr_print *ndr, const char *name, int flags, const struct netr_NETRENUMERATETRUSTEDDOMAINS *r) +_PUBLIC_ void ndr_print_netr_NetrEnumerateTrustedDomains(struct ndr_print *ndr, const char *name, int flags, const struct netr_NetrEnumerateTrustedDomains *r) { - ndr_print_struct(ndr, name, "netr_NETRENUMERATETRUSTEDDOMAINS"); + ndr_print_struct(ndr, name, "netr_NetrEnumerateTrustedDomains"); ndr->depth++; if (flags & NDR_SET_VALUES) { ndr->flags |= LIBNDR_PRINT_SET_VALUES; } if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "netr_NETRENUMERATETRUSTEDDOMAINS"); + ndr_print_struct(ndr, "in", "netr_NetrEnumerateTrustedDomains"); + ndr->depth++; + ndr_print_ptr(ndr, "server_name", r->in.server_name); ndr->depth++; + if (r->in.server_name) { + ndr_print_string(ndr, "server_name", r->in.server_name); + } + ndr->depth--; ndr->depth--; } if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "netr_NETRENUMERATETRUSTEDDOMAINS"); + ndr_print_struct(ndr, "out", "netr_NetrEnumerateTrustedDomains"); ndr->depth++; + ndr_print_ptr(ndr, "trusted_domains_blob", r->out.trusted_domains_blob); + ndr->depth++; + ndr_print_netr_Blob(ndr, "trusted_domains_blob", r->out.trusted_domains_blob); + ndr->depth--; ndr_print_WERROR(ndr, "result", r->out.result); ndr->depth--; } @@ -10369,12 +11077,15 @@ static enum ndr_err_code ndr_push_netr_DsRGetDCName(struct ndr_push *ndr, int fl if (r->in.site_guid) { NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.site_guid)); } - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.flags)); + NDR_CHECK(ndr_push_netr_DsRGetDCName_flags(ndr, NDR_SCALARS, r->in.flags)); } if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.info)); - if (r->out.info) { - NDR_CHECK(ndr_push_netr_DsRGetDCNameInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.info)); + if (r->out.info == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.info)); + if (*r->out.info) { + NDR_CHECK(ndr_push_netr_DsRGetDCNameInfo(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.info)); } NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); } @@ -10393,6 +11104,7 @@ static enum ndr_err_code ndr_pull_netr_DsRGetDCName(struct ndr_pull *ndr, int fl TALLOC_CTX *_mem_save_domain_guid_0; TALLOC_CTX *_mem_save_site_guid_0; TALLOC_CTX *_mem_save_info_0; + TALLOC_CTX *_mem_save_info_1; if (flags & NDR_IN) { ZERO_STRUCT(r->out); @@ -10456,21 +11168,29 @@ static enum ndr_err_code ndr_pull_netr_DsRGetDCName(struct ndr_pull *ndr, int fl NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.site_guid)); NDR_PULL_SET_MEM_CTX(ndr, _mem_save_site_guid_0, 0); } - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.flags)); + NDR_CHECK(ndr_pull_netr_DsRGetDCName_flags(ndr, NDR_SCALARS, &r->in.flags)); + 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_generic_ptr(ndr, &_ptr_info)); if (_ptr_info) { - NDR_PULL_ALLOC(ndr, r->out.info); + NDR_PULL_ALLOC(ndr, *r->out.info); } else { - r->out.info = NULL; + *r->out.info = NULL; } - if (r->out.info) { - _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.info, 0); - NDR_CHECK(ndr_pull_netr_DsRGetDCNameInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.info)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, 0); + if (*r->out.info) { + _mem_save_info_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, *r->out.info, 0); + NDR_CHECK(ndr_pull_netr_DsRGetDCNameInfo(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.info)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_1, 0); } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, LIBNDR_FLAG_REF_ALLOC); NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); } return NDR_ERR_SUCCESS; @@ -10510,7 +11230,7 @@ _PUBLIC_ void ndr_print_netr_DsRGetDCName(struct ndr_print *ndr, const char *nam ndr_print_GUID(ndr, "site_guid", r->in.site_guid); } ndr->depth--; - ndr_print_uint32(ndr, "flags", r->in.flags); + ndr_print_netr_DsRGetDCName_flags(ndr, "flags", r->in.flags); ndr->depth--; } if (flags & NDR_OUT) { @@ -10518,10 +11238,13 @@ _PUBLIC_ void ndr_print_netr_DsRGetDCName(struct ndr_print *ndr, const char *nam ndr->depth++; ndr_print_ptr(ndr, "info", r->out.info); ndr->depth++; - if (r->out.info) { - ndr_print_netr_DsRGetDCNameInfo(ndr, "info", r->out.info); + ndr_print_ptr(ndr, "info", *r->out.info); + ndr->depth++; + if (*r->out.info) { + ndr_print_netr_DsRGetDCNameInfo(ndr, "info", *r->out.info); } ndr->depth--; + ndr->depth--; ndr_print_WERROR(ndr, "result", r->out.result); ndr->depth--; } @@ -10610,41 +11333,127 @@ _PUBLIC_ void ndr_print_netr_NETRLOGONSETSERVICEBITS(struct ndr_print *ndr, cons ndr->depth--; } -static enum ndr_err_code ndr_push_netr_NETRLOGONGETTRUSTRID(struct ndr_push *ndr, int flags, const struct netr_NETRLOGONGETTRUSTRID *r) +static enum ndr_err_code ndr_push_netr_LogonGetTrustRid(struct ndr_push *ndr, int flags, const struct netr_LogonGetTrustRid *r) { if (flags & NDR_IN) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_name)); + if (r->in.server_name) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_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.server_name, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.server_name, ndr_charset_length(r->in.server_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.domain_name)); + if (r->in.domain_name) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.domain_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.domain_name, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.domain_name, ndr_charset_length(r->in.domain_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } } if (flags & NDR_OUT) { + 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_WERROR(ndr, NDR_SCALARS, r->out.result)); } return NDR_ERR_SUCCESS; } -static enum ndr_err_code ndr_pull_netr_NETRLOGONGETTRUSTRID(struct ndr_pull *ndr, int flags, struct netr_NETRLOGONGETTRUSTRID *r) +static enum ndr_err_code ndr_pull_netr_LogonGetTrustRid(struct ndr_pull *ndr, int flags, struct netr_LogonGetTrustRid *r) { + uint32_t _ptr_server_name; + uint32_t _ptr_domain_name; + TALLOC_CTX *_mem_save_server_name_0; + TALLOC_CTX *_mem_save_domain_name_0; + TALLOC_CTX *_mem_save_rid_0; if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name)); + if (_ptr_server_name) { + NDR_PULL_ALLOC(ndr, r->in.server_name); + } else { + r->in.server_name = NULL; + } + if (r->in.server_name) { + _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.server_name, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_name)); + if (ndr_get_array_length(ndr, &r->in.server_name) > ndr_get_array_size(ndr, &r->in.server_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.server_name), ndr_get_array_length(ndr, &r->in.server_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_name, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0); + } + 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_array_size(ndr, &r->in.domain_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.domain_name)); + if (ndr_get_array_length(ndr, &r->in.domain_name) > ndr_get_array_size(ndr, &r->in.domain_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.domain_name), ndr_get_array_length(ndr, &r->in.domain_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.domain_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.domain_name, ndr_get_array_length(ndr, &r->in.domain_name), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_name_0, 0); + } + 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.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_WERROR(ndr, NDR_SCALARS, &r->out.result)); } return NDR_ERR_SUCCESS; } -_PUBLIC_ void ndr_print_netr_NETRLOGONGETTRUSTRID(struct ndr_print *ndr, const char *name, int flags, const struct netr_NETRLOGONGETTRUSTRID *r) +_PUBLIC_ void ndr_print_netr_LogonGetTrustRid(struct ndr_print *ndr, const char *name, int flags, const struct netr_LogonGetTrustRid *r) { - ndr_print_struct(ndr, name, "netr_NETRLOGONGETTRUSTRID"); + ndr_print_struct(ndr, name, "netr_LogonGetTrustRid"); ndr->depth++; if (flags & NDR_SET_VALUES) { ndr->flags |= LIBNDR_PRINT_SET_VALUES; } if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "netr_NETRLOGONGETTRUSTRID"); + ndr_print_struct(ndr, "in", "netr_LogonGetTrustRid"); + ndr->depth++; + ndr_print_ptr(ndr, "server_name", r->in.server_name); + ndr->depth++; + if (r->in.server_name) { + ndr_print_string(ndr, "server_name", r->in.server_name); + } + ndr->depth--; + ndr_print_ptr(ndr, "domain_name", r->in.domain_name); ndr->depth++; + if (r->in.domain_name) { + ndr_print_string(ndr, "domain_name", r->in.domain_name); + } + ndr->depth--; ndr->depth--; } if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "netr_NETRLOGONGETTRUSTRID"); + ndr_print_struct(ndr, "out", "netr_LogonGetTrustRid"); ndr->depth++; + ndr_print_ptr(ndr, "rid", r->out.rid); + ndr->depth++; + ndr_print_uint32(ndr, "rid", *r->out.rid); + ndr->depth--; ndr_print_WERROR(ndr, "result", r->out.result); ndr->depth--; } @@ -10948,12 +11757,15 @@ static enum ndr_err_code ndr_push_netr_DsRGetDCNameEx(struct ndr_push *ndr, int NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.site_name, CH_UTF16))); NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.site_name, ndr_charset_length(r->in.site_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); } - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.flags)); + NDR_CHECK(ndr_push_netr_DsRGetDCName_flags(ndr, NDR_SCALARS, r->in.flags)); } if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.info)); - if (r->out.info) { - NDR_CHECK(ndr_push_netr_DsRGetDCNameInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.info)); + if (r->out.info == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.info)); + if (*r->out.info) { + NDR_CHECK(ndr_push_netr_DsRGetDCNameInfo(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.info)); } NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); } @@ -10972,6 +11784,7 @@ static enum ndr_err_code ndr_pull_netr_DsRGetDCNameEx(struct ndr_pull *ndr, int TALLOC_CTX *_mem_save_domain_guid_0; TALLOC_CTX *_mem_save_site_name_0; TALLOC_CTX *_mem_save_info_0; + TALLOC_CTX *_mem_save_info_1; if (flags & NDR_IN) { ZERO_STRUCT(r->out); @@ -11041,21 +11854,29 @@ static enum ndr_err_code ndr_pull_netr_DsRGetDCNameEx(struct ndr_pull *ndr, int NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.site_name, ndr_get_array_length(ndr, &r->in.site_name), sizeof(uint16_t), CH_UTF16)); NDR_PULL_SET_MEM_CTX(ndr, _mem_save_site_name_0, 0); } - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.flags)); + NDR_CHECK(ndr_pull_netr_DsRGetDCName_flags(ndr, NDR_SCALARS, &r->in.flags)); + 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_generic_ptr(ndr, &_ptr_info)); if (_ptr_info) { - NDR_PULL_ALLOC(ndr, r->out.info); + NDR_PULL_ALLOC(ndr, *r->out.info); } else { - r->out.info = NULL; + *r->out.info = NULL; } - if (r->out.info) { - _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.info, 0); - NDR_CHECK(ndr_pull_netr_DsRGetDCNameInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.info)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, 0); + if (*r->out.info) { + _mem_save_info_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, *r->out.info, 0); + NDR_CHECK(ndr_pull_netr_DsRGetDCNameInfo(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.info)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_1, 0); } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, LIBNDR_FLAG_REF_ALLOC); NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); } return NDR_ERR_SUCCESS; @@ -11095,7 +11916,7 @@ _PUBLIC_ void ndr_print_netr_DsRGetDCNameEx(struct ndr_print *ndr, const char *n ndr_print_string(ndr, "site_name", r->in.site_name); } ndr->depth--; - ndr_print_uint32(ndr, "flags", r->in.flags); + ndr_print_netr_DsRGetDCName_flags(ndr, "flags", r->in.flags); ndr->depth--; } if (flags & NDR_OUT) { @@ -11103,10 +11924,13 @@ _PUBLIC_ void ndr_print_netr_DsRGetDCNameEx(struct ndr_print *ndr, const char *n ndr->depth++; ndr_print_ptr(ndr, "info", r->out.info); ndr->depth++; - if (r->out.info) { - ndr_print_netr_DsRGetDCNameInfo(ndr, "info", r->out.info); + ndr_print_ptr(ndr, "info", *r->out.info); + ndr->depth++; + if (*r->out.info) { + ndr_print_netr_DsRGetDCNameInfo(ndr, "info", *r->out.info); } ndr->depth--; + ndr->depth--; ndr_print_WERROR(ndr, "result", r->out.result); ndr->depth--; } @@ -11128,14 +11952,13 @@ static enum ndr_err_code ndr_push_netr_DsRGetSiteName(struct ndr_push *ndr, int if (r->out.site == NULL) { return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); } - if (*r->out.site == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.site)); + if (*r->out.site) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(*r->out.site, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(*r->out.site, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, *r->out.site, ndr_charset_length(*r->out.site, CH_UTF16), sizeof(uint16_t), CH_UTF16)); } - NDR_CHECK(ndr_push_ref_ptr(ndr)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(*r->out.site, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(*r->out.site, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, *r->out.site, ndr_charset_length(*r->out.site, CH_UTF16), sizeof(uint16_t), CH_UTF16)); NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); } return NDR_ERR_SUCCESS; @@ -11147,6 +11970,7 @@ static enum ndr_err_code ndr_pull_netr_DsRGetSiteName(struct ndr_pull *ndr, int uint32_t _ptr_site; TALLOC_CTX *_mem_save_computer_name_0; TALLOC_CTX *_mem_save_site_0; + TALLOC_CTX *_mem_save_site_1; if (flags & NDR_IN) { ZERO_STRUCT(r->out); @@ -11177,14 +12001,24 @@ static enum ndr_err_code ndr_pull_netr_DsRGetSiteName(struct ndr_pull *ndr, int } _mem_save_site_0 = NDR_PULL_GET_MEM_CTX(ndr); NDR_PULL_SET_MEM_CTX(ndr, r->out.site, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_ref_ptr(ndr, &_ptr_site)); - NDR_CHECK(ndr_pull_array_size(ndr, r->out.site)); - NDR_CHECK(ndr_pull_array_length(ndr, r->out.site)); - if (ndr_get_array_length(ndr, r->out.site) > ndr_get_array_size(ndr, r->out.site)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, r->out.site), ndr_get_array_length(ndr, r->out.site)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, r->out.site), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, r->out.site, ndr_get_array_length(ndr, r->out.site), sizeof(uint16_t), CH_UTF16)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_site)); + if (_ptr_site) { + NDR_PULL_ALLOC(ndr, *r->out.site); + } else { + *r->out.site = NULL; + } + if (*r->out.site) { + _mem_save_site_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, *r->out.site, 0); + NDR_CHECK(ndr_pull_array_size(ndr, r->out.site)); + NDR_CHECK(ndr_pull_array_length(ndr, r->out.site)); + if (ndr_get_array_length(ndr, r->out.site) > ndr_get_array_size(ndr, r->out.site)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, r->out.site), ndr_get_array_length(ndr, r->out.site)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, r->out.site), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, r->out.site, ndr_get_array_length(ndr, r->out.site), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_site_1, 0); + } NDR_PULL_SET_MEM_CTX(ndr, _mem_save_site_0, LIBNDR_FLAG_REF_ALLOC); NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); } @@ -11216,7 +12050,9 @@ _PUBLIC_ void ndr_print_netr_DsRGetSiteName(struct ndr_print *ndr, const char *n ndr->depth++; ndr_print_ptr(ndr, "site", *r->out.site); ndr->depth++; - ndr_print_string(ndr, "site", *r->out.site); + if (*r->out.site) { + ndr_print_string(ndr, "site", *r->out.site); + } ndr->depth--; ndr->depth--; ndr_print_WERROR(ndr, "result", r->out.result); @@ -11519,41 +12355,155 @@ _PUBLIC_ void ndr_print_netr_ServerPasswordSet2(struct ndr_print *ndr, const cha ndr->depth--; } -static enum ndr_err_code ndr_push_netr_NETRSERVERPASSWORDGET(struct ndr_push *ndr, int flags, const struct netr_NETRSERVERPASSWORDGET *r) +static enum ndr_err_code ndr_push_netr_ServerPasswordGet(struct ndr_push *ndr, int flags, const struct netr_ServerPasswordGet *r) { if (flags & NDR_IN) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_name)); + if (r->in.server_name) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_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.server_name, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.server_name, ndr_charset_length(r->in.server_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.account_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.account_name, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.account_name, ndr_charset_length(r->in.account_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + NDR_CHECK(ndr_push_netr_SchannelType(ndr, NDR_SCALARS, r->in.secure_channel_type)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.computer_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.computer_name, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.computer_name, ndr_charset_length(r->in.computer_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + if (r->in.credential == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_netr_Authenticator(ndr, NDR_SCALARS, r->in.credential)); } if (flags & NDR_OUT) { + if (r->out.return_authenticator == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_netr_Authenticator(ndr, NDR_SCALARS, r->out.return_authenticator)); + if (r->out.password == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_samr_Password(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.password)); NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); } return NDR_ERR_SUCCESS; } -static enum ndr_err_code ndr_pull_netr_NETRSERVERPASSWORDGET(struct ndr_pull *ndr, int flags, struct netr_NETRSERVERPASSWORDGET *r) +static enum ndr_err_code ndr_pull_netr_ServerPasswordGet(struct ndr_pull *ndr, int flags, struct netr_ServerPasswordGet *r) { + uint32_t _ptr_server_name; + TALLOC_CTX *_mem_save_server_name_0; + TALLOC_CTX *_mem_save_credential_0; + TALLOC_CTX *_mem_save_return_authenticator_0; + TALLOC_CTX *_mem_save_password_0; if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name)); + if (_ptr_server_name) { + NDR_PULL_ALLOC(ndr, r->in.server_name); + } else { + r->in.server_name = NULL; + } + if (r->in.server_name) { + _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.server_name, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_name)); + if (ndr_get_array_length(ndr, &r->in.server_name) > ndr_get_array_size(ndr, &r->in.server_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.server_name), ndr_get_array_length(ndr, &r->in.server_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_name, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0); + } + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.account_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.account_name)); + if (ndr_get_array_length(ndr, &r->in.account_name) > ndr_get_array_size(ndr, &r->in.account_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.account_name), ndr_get_array_length(ndr, &r->in.account_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.account_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.account_name, ndr_get_array_length(ndr, &r->in.account_name), sizeof(uint16_t), CH_UTF16)); + NDR_CHECK(ndr_pull_netr_SchannelType(ndr, NDR_SCALARS, &r->in.secure_channel_type)); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.computer_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.computer_name)); + if (ndr_get_array_length(ndr, &r->in.computer_name) > ndr_get_array_size(ndr, &r->in.computer_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.computer_name), ndr_get_array_length(ndr, &r->in.computer_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.computer_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.computer_name, ndr_get_array_length(ndr, &r->in.computer_name), sizeof(uint16_t), CH_UTF16)); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.credential); + } + _mem_save_credential_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.credential, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, r->in.credential)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_credential_0, LIBNDR_FLAG_REF_ALLOC); + NDR_PULL_ALLOC(ndr, r->out.return_authenticator); + ZERO_STRUCTP(r->out.return_authenticator); + NDR_PULL_ALLOC(ndr, r->out.password); + ZERO_STRUCTP(r->out.password); } if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.return_authenticator); + } + _mem_save_return_authenticator_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.return_authenticator, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, r->out.return_authenticator)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_return_authenticator_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.password); + } + _mem_save_password_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.password, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_samr_Password(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.password)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_password_0, LIBNDR_FLAG_REF_ALLOC); NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); } return NDR_ERR_SUCCESS; } -_PUBLIC_ void ndr_print_netr_NETRSERVERPASSWORDGET(struct ndr_print *ndr, const char *name, int flags, const struct netr_NETRSERVERPASSWORDGET *r) +_PUBLIC_ void ndr_print_netr_ServerPasswordGet(struct ndr_print *ndr, const char *name, int flags, const struct netr_ServerPasswordGet *r) { - ndr_print_struct(ndr, name, "netr_NETRSERVERPASSWORDGET"); + ndr_print_struct(ndr, name, "netr_ServerPasswordGet"); ndr->depth++; if (flags & NDR_SET_VALUES) { ndr->flags |= LIBNDR_PRINT_SET_VALUES; } if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "netr_NETRSERVERPASSWORDGET"); + ndr_print_struct(ndr, "in", "netr_ServerPasswordGet"); + ndr->depth++; + ndr_print_ptr(ndr, "server_name", r->in.server_name); + ndr->depth++; + if (r->in.server_name) { + ndr_print_string(ndr, "server_name", r->in.server_name); + } + ndr->depth--; + ndr_print_string(ndr, "account_name", r->in.account_name); + ndr_print_netr_SchannelType(ndr, "secure_channel_type", r->in.secure_channel_type); + ndr_print_string(ndr, "computer_name", r->in.computer_name); + ndr_print_ptr(ndr, "credential", r->in.credential); ndr->depth++; + ndr_print_netr_Authenticator(ndr, "credential", r->in.credential); + ndr->depth--; ndr->depth--; } if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "netr_NETRSERVERPASSWORDGET"); + ndr_print_struct(ndr, "out", "netr_ServerPasswordGet"); + ndr->depth++; + ndr_print_ptr(ndr, "return_authenticator", r->out.return_authenticator); ndr->depth++; + ndr_print_netr_Authenticator(ndr, "return_authenticator", r->out.return_authenticator); + ndr->depth--; + ndr_print_ptr(ndr, "password", r->out.password); + ndr->depth++; + ndr_print_samr_Password(ndr, "password", r->out.password); + ndr->depth--; ndr_print_WERROR(ndr, "result", r->out.result); ndr->depth--; } @@ -11601,41 +12551,164 @@ _PUBLIC_ void ndr_print_netr_NETRLOGONSENDTOSAM(struct ndr_print *ndr, const cha ndr->depth--; } -static enum ndr_err_code ndr_push_netr_DSRADDRESSTOSITENAMESW(struct ndr_push *ndr, int flags, const struct netr_DSRADDRESSTOSITENAMESW *r) +static enum ndr_err_code ndr_push_netr_DsRAddressToSitenamesW(struct ndr_push *ndr, int flags, const struct netr_DsRAddressToSitenamesW *r) { + uint32_t cntr_addresses_1; if (flags & NDR_IN) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_name)); + if (r->in.server_name) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_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.server_name, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.server_name, ndr_charset_length(r->in.server_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.count)); + if (r->in.addresses == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.count)); + for (cntr_addresses_1 = 0; cntr_addresses_1 < r->in.count; cntr_addresses_1++) { + NDR_CHECK(ndr_push_netr_DsRAddress(ndr, NDR_SCALARS, &r->in.addresses[cntr_addresses_1])); + } + for (cntr_addresses_1 = 0; cntr_addresses_1 < r->in.count; cntr_addresses_1++) { + NDR_CHECK(ndr_push_netr_DsRAddress(ndr, NDR_BUFFERS, &r->in.addresses[cntr_addresses_1])); + } } if (flags & NDR_OUT) { + if (r->out.ctr == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.ctr)); + if (*r->out.ctr) { + NDR_CHECK(ndr_push_netr_DsRAddressToSitenamesWCtr(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.ctr)); + } NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); } return NDR_ERR_SUCCESS; } -static enum ndr_err_code ndr_pull_netr_DSRADDRESSTOSITENAMESW(struct ndr_pull *ndr, int flags, struct netr_DSRADDRESSTOSITENAMESW *r) +static enum ndr_err_code ndr_pull_netr_DsRAddressToSitenamesW(struct ndr_pull *ndr, int flags, struct netr_DsRAddressToSitenamesW *r) { + uint32_t _ptr_server_name; + uint32_t cntr_addresses_1; + uint32_t _ptr_ctr; + TALLOC_CTX *_mem_save_server_name_0; + TALLOC_CTX *_mem_save_addresses_1; + TALLOC_CTX *_mem_save_ctr_0; + TALLOC_CTX *_mem_save_ctr_1; if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name)); + if (_ptr_server_name) { + NDR_PULL_ALLOC(ndr, r->in.server_name); + } else { + r->in.server_name = NULL; + } + if (r->in.server_name) { + _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.server_name, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_name)); + if (ndr_get_array_length(ndr, &r->in.server_name) > ndr_get_array_size(ndr, &r->in.server_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.server_name), ndr_get_array_length(ndr, &r->in.server_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_name, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0); + } + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.count)); + if (r->in.count < 0 || r->in.count > 32000) { + return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range"); + } + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.addresses)); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC_N(ndr, r->in.addresses, ndr_get_array_size(ndr, &r->in.addresses)); + } + _mem_save_addresses_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.addresses, 0); + for (cntr_addresses_1 = 0; cntr_addresses_1 < r->in.count; cntr_addresses_1++) { + NDR_CHECK(ndr_pull_netr_DsRAddress(ndr, NDR_SCALARS, &r->in.addresses[cntr_addresses_1])); + } + for (cntr_addresses_1 = 0; cntr_addresses_1 < r->in.count; cntr_addresses_1++) { + NDR_CHECK(ndr_pull_netr_DsRAddress(ndr, NDR_BUFFERS, &r->in.addresses[cntr_addresses_1])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_addresses_1, 0); + NDR_PULL_ALLOC(ndr, r->out.ctr); + ZERO_STRUCTP(r->out.ctr); + if (r->in.addresses) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->in.addresses, r->in.count)); + } } if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.ctr); + } + _mem_save_ctr_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.ctr, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_ctr)); + if (_ptr_ctr) { + NDR_PULL_ALLOC(ndr, *r->out.ctr); + } else { + *r->out.ctr = NULL; + } + if (*r->out.ctr) { + _mem_save_ctr_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, *r->out.ctr, 0); + NDR_CHECK(ndr_pull_netr_DsRAddressToSitenamesWCtr(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.ctr)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ctr_1, 0); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ctr_0, LIBNDR_FLAG_REF_ALLOC); NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); } return NDR_ERR_SUCCESS; } -_PUBLIC_ void ndr_print_netr_DSRADDRESSTOSITENAMESW(struct ndr_print *ndr, const char *name, int flags, const struct netr_DSRADDRESSTOSITENAMESW *r) +_PUBLIC_ void ndr_print_netr_DsRAddressToSitenamesW(struct ndr_print *ndr, const char *name, int flags, const struct netr_DsRAddressToSitenamesW *r) { - ndr_print_struct(ndr, name, "netr_DSRADDRESSTOSITENAMESW"); + uint32_t cntr_addresses_1; + ndr_print_struct(ndr, name, "netr_DsRAddressToSitenamesW"); ndr->depth++; if (flags & NDR_SET_VALUES) { ndr->flags |= LIBNDR_PRINT_SET_VALUES; } if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "netr_DSRADDRESSTOSITENAMESW"); + ndr_print_struct(ndr, "in", "netr_DsRAddressToSitenamesW"); + ndr->depth++; + ndr_print_ptr(ndr, "server_name", r->in.server_name); + ndr->depth++; + if (r->in.server_name) { + ndr_print_string(ndr, "server_name", r->in.server_name); + } + ndr->depth--; + ndr_print_uint32(ndr, "count", r->in.count); + ndr_print_ptr(ndr, "addresses", r->in.addresses); ndr->depth++; + ndr->print(ndr, "%s: ARRAY(%d)", "addresses", r->in.count); + ndr->depth++; + for (cntr_addresses_1=0;cntr_addresses_1<r->in.count;cntr_addresses_1++) { + char *idx_1=NULL; + if (asprintf(&idx_1, "[%d]", cntr_addresses_1) != -1) { + ndr_print_netr_DsRAddress(ndr, "addresses", &r->in.addresses[cntr_addresses_1]); + free(idx_1); + } + } + ndr->depth--; + ndr->depth--; ndr->depth--; } if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "netr_DSRADDRESSTOSITENAMESW"); + ndr_print_struct(ndr, "out", "netr_DsRAddressToSitenamesW"); + ndr->depth++; + ndr_print_ptr(ndr, "ctr", r->out.ctr); + ndr->depth++; + ndr_print_ptr(ndr, "ctr", *r->out.ctr); ndr->depth++; + if (*r->out.ctr) { + ndr_print_netr_DsRAddressToSitenamesWCtr(ndr, "ctr", *r->out.ctr); + } + ndr->depth--; + ndr->depth--; ndr_print_WERROR(ndr, "result", r->out.result); ndr->depth--; } @@ -11659,7 +12732,7 @@ static enum ndr_err_code ndr_push_netr_DsRGetDCNameEx2(struct ndr_push *ndr, int NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.client_account, CH_UTF16))); NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.client_account, ndr_charset_length(r->in.client_account, CH_UTF16), sizeof(uint16_t), CH_UTF16)); } - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.mask)); + NDR_CHECK(ndr_push_samr_AcctFlags(ndr, NDR_SCALARS, r->in.mask)); NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.domain_name)); if (r->in.domain_name) { NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.domain_name, CH_UTF16))); @@ -11678,12 +12751,15 @@ static enum ndr_err_code ndr_push_netr_DsRGetDCNameEx2(struct ndr_push *ndr, int NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.site_name, CH_UTF16))); NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.site_name, ndr_charset_length(r->in.site_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); } - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.flags)); + NDR_CHECK(ndr_push_netr_DsRGetDCName_flags(ndr, NDR_SCALARS, r->in.flags)); } if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.info)); - if (r->out.info) { - NDR_CHECK(ndr_push_netr_DsRGetDCNameInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.info)); + if (r->out.info == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.info)); + if (*r->out.info) { + NDR_CHECK(ndr_push_netr_DsRGetDCNameInfo(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.info)); } NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); } @@ -11704,6 +12780,7 @@ static enum ndr_err_code ndr_pull_netr_DsRGetDCNameEx2(struct ndr_pull *ndr, int TALLOC_CTX *_mem_save_domain_guid_0; TALLOC_CTX *_mem_save_site_name_0; TALLOC_CTX *_mem_save_info_0; + TALLOC_CTX *_mem_save_info_1; if (flags & NDR_IN) { ZERO_STRUCT(r->out); @@ -11743,7 +12820,7 @@ static enum ndr_err_code ndr_pull_netr_DsRGetDCNameEx2(struct ndr_pull *ndr, int NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.client_account, ndr_get_array_length(ndr, &r->in.client_account), sizeof(uint16_t), CH_UTF16)); NDR_PULL_SET_MEM_CTX(ndr, _mem_save_client_account_0, 0); } - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.mask)); + NDR_CHECK(ndr_pull_samr_AcctFlags(ndr, NDR_SCALARS, &r->in.mask)); NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_domain_name)); if (_ptr_domain_name) { NDR_PULL_ALLOC(ndr, r->in.domain_name); @@ -11792,21 +12869,29 @@ static enum ndr_err_code ndr_pull_netr_DsRGetDCNameEx2(struct ndr_pull *ndr, int NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.site_name, ndr_get_array_length(ndr, &r->in.site_name), sizeof(uint16_t), CH_UTF16)); NDR_PULL_SET_MEM_CTX(ndr, _mem_save_site_name_0, 0); } - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.flags)); + NDR_CHECK(ndr_pull_netr_DsRGetDCName_flags(ndr, NDR_SCALARS, &r->in.flags)); + 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_generic_ptr(ndr, &_ptr_info)); if (_ptr_info) { - NDR_PULL_ALLOC(ndr, r->out.info); + NDR_PULL_ALLOC(ndr, *r->out.info); } else { - r->out.info = NULL; + *r->out.info = NULL; } - if (r->out.info) { - _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.info, 0); - NDR_CHECK(ndr_pull_netr_DsRGetDCNameInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.info)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, 0); + if (*r->out.info) { + _mem_save_info_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, *r->out.info, 0); + NDR_CHECK(ndr_pull_netr_DsRGetDCNameInfo(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.info)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_1, 0); } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, LIBNDR_FLAG_REF_ALLOC); NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); } return NDR_ERR_SUCCESS; @@ -11834,7 +12919,7 @@ _PUBLIC_ void ndr_print_netr_DsRGetDCNameEx2(struct ndr_print *ndr, const char * ndr_print_string(ndr, "client_account", r->in.client_account); } ndr->depth--; - ndr_print_uint32(ndr, "mask", r->in.mask); + ndr_print_samr_AcctFlags(ndr, "mask", r->in.mask); ndr_print_ptr(ndr, "domain_name", r->in.domain_name); ndr->depth++; if (r->in.domain_name) { @@ -11853,7 +12938,7 @@ _PUBLIC_ void ndr_print_netr_DsRGetDCNameEx2(struct ndr_print *ndr, const char * ndr_print_string(ndr, "site_name", r->in.site_name); } ndr->depth--; - ndr_print_uint32(ndr, "flags", r->in.flags); + ndr_print_netr_DsRGetDCName_flags(ndr, "flags", r->in.flags); ndr->depth--; } if (flags & NDR_OUT) { @@ -11861,10 +12946,13 @@ _PUBLIC_ void ndr_print_netr_DsRGetDCNameEx2(struct ndr_print *ndr, const char * ndr->depth++; ndr_print_ptr(ndr, "info", r->out.info); ndr->depth++; - if (r->out.info) { - ndr_print_netr_DsRGetDCNameInfo(ndr, "info", r->out.info); + ndr_print_ptr(ndr, "info", *r->out.info); + ndr->depth++; + if (*r->out.info) { + ndr_print_netr_DsRGetDCNameInfo(ndr, "info", *r->out.info); } ndr->depth--; + ndr->depth--; ndr_print_WERROR(ndr, "result", r->out.result); ndr->depth--; } @@ -11912,123 +13000,352 @@ _PUBLIC_ void ndr_print_netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN(struct ndr_prin ndr->depth--; } -static enum ndr_err_code ndr_push_netr_NETRENUMERATETRUSTEDDOMAINSEX(struct ndr_push *ndr, int flags, const struct netr_NETRENUMERATETRUSTEDDOMAINSEX *r) +static enum ndr_err_code ndr_push_netr_NetrEnumerateTrustedDomainsEx(struct ndr_push *ndr, int flags, const struct netr_NetrEnumerateTrustedDomainsEx *r) { if (flags & NDR_IN) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_name)); + if (r->in.server_name) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_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.server_name, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.server_name, ndr_charset_length(r->in.server_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } } if (flags & NDR_OUT) { + if (r->out.dom_trust_list == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_netr_DomainTrustList(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.dom_trust_list)); NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); } return NDR_ERR_SUCCESS; } -static enum ndr_err_code ndr_pull_netr_NETRENUMERATETRUSTEDDOMAINSEX(struct ndr_pull *ndr, int flags, struct netr_NETRENUMERATETRUSTEDDOMAINSEX *r) +static enum ndr_err_code ndr_pull_netr_NetrEnumerateTrustedDomainsEx(struct ndr_pull *ndr, int flags, struct netr_NetrEnumerateTrustedDomainsEx *r) { + uint32_t _ptr_server_name; + TALLOC_CTX *_mem_save_server_name_0; + TALLOC_CTX *_mem_save_dom_trust_list_0; if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name)); + if (_ptr_server_name) { + NDR_PULL_ALLOC(ndr, r->in.server_name); + } else { + r->in.server_name = NULL; + } + if (r->in.server_name) { + _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.server_name, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_name)); + if (ndr_get_array_length(ndr, &r->in.server_name) > ndr_get_array_size(ndr, &r->in.server_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.server_name), ndr_get_array_length(ndr, &r->in.server_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_name, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0); + } + NDR_PULL_ALLOC(ndr, r->out.dom_trust_list); + ZERO_STRUCTP(r->out.dom_trust_list); } if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.dom_trust_list); + } + _mem_save_dom_trust_list_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.dom_trust_list, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_netr_DomainTrustList(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.dom_trust_list)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_dom_trust_list_0, LIBNDR_FLAG_REF_ALLOC); NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); } return NDR_ERR_SUCCESS; } -_PUBLIC_ void ndr_print_netr_NETRENUMERATETRUSTEDDOMAINSEX(struct ndr_print *ndr, const char *name, int flags, const struct netr_NETRENUMERATETRUSTEDDOMAINSEX *r) +_PUBLIC_ void ndr_print_netr_NetrEnumerateTrustedDomainsEx(struct ndr_print *ndr, const char *name, int flags, const struct netr_NetrEnumerateTrustedDomainsEx *r) { - ndr_print_struct(ndr, name, "netr_NETRENUMERATETRUSTEDDOMAINSEX"); + ndr_print_struct(ndr, name, "netr_NetrEnumerateTrustedDomainsEx"); ndr->depth++; if (flags & NDR_SET_VALUES) { ndr->flags |= LIBNDR_PRINT_SET_VALUES; } if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "netr_NETRENUMERATETRUSTEDDOMAINSEX"); + ndr_print_struct(ndr, "in", "netr_NetrEnumerateTrustedDomainsEx"); + ndr->depth++; + ndr_print_ptr(ndr, "server_name", r->in.server_name); ndr->depth++; + if (r->in.server_name) { + ndr_print_string(ndr, "server_name", r->in.server_name); + } + ndr->depth--; ndr->depth--; } if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "netr_NETRENUMERATETRUSTEDDOMAINSEX"); + ndr_print_struct(ndr, "out", "netr_NetrEnumerateTrustedDomainsEx"); ndr->depth++; + ndr_print_ptr(ndr, "dom_trust_list", r->out.dom_trust_list); + ndr->depth++; + ndr_print_netr_DomainTrustList(ndr, "dom_trust_list", r->out.dom_trust_list); + ndr->depth--; ndr_print_WERROR(ndr, "result", r->out.result); ndr->depth--; } ndr->depth--; } -static enum ndr_err_code ndr_push_netr_DSRADDRESSTOSITENAMESEXW(struct ndr_push *ndr, int flags, const struct netr_DSRADDRESSTOSITENAMESEXW *r) +static enum ndr_err_code ndr_push_netr_DsRAddressToSitenamesExW(struct ndr_push *ndr, int flags, const struct netr_DsRAddressToSitenamesExW *r) { + uint32_t cntr_addresses_1; if (flags & NDR_IN) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_name)); + if (r->in.server_name) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_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.server_name, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.server_name, ndr_charset_length(r->in.server_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.count)); + if (r->in.addresses == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.count)); + for (cntr_addresses_1 = 0; cntr_addresses_1 < r->in.count; cntr_addresses_1++) { + NDR_CHECK(ndr_push_netr_DsRAddress(ndr, NDR_SCALARS, &r->in.addresses[cntr_addresses_1])); + } + for (cntr_addresses_1 = 0; cntr_addresses_1 < r->in.count; cntr_addresses_1++) { + NDR_CHECK(ndr_push_netr_DsRAddress(ndr, NDR_BUFFERS, &r->in.addresses[cntr_addresses_1])); + } } if (flags & NDR_OUT) { + if (r->out.ctr == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.ctr)); + if (*r->out.ctr) { + NDR_CHECK(ndr_push_netr_DsRAddressToSitenamesExWCtr(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.ctr)); + } NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); } return NDR_ERR_SUCCESS; } -static enum ndr_err_code ndr_pull_netr_DSRADDRESSTOSITENAMESEXW(struct ndr_pull *ndr, int flags, struct netr_DSRADDRESSTOSITENAMESEXW *r) +static enum ndr_err_code ndr_pull_netr_DsRAddressToSitenamesExW(struct ndr_pull *ndr, int flags, struct netr_DsRAddressToSitenamesExW *r) { + uint32_t _ptr_server_name; + uint32_t cntr_addresses_1; + uint32_t _ptr_ctr; + TALLOC_CTX *_mem_save_server_name_0; + TALLOC_CTX *_mem_save_addresses_1; + TALLOC_CTX *_mem_save_ctr_0; + TALLOC_CTX *_mem_save_ctr_1; if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name)); + if (_ptr_server_name) { + NDR_PULL_ALLOC(ndr, r->in.server_name); + } else { + r->in.server_name = NULL; + } + if (r->in.server_name) { + _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.server_name, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_name)); + if (ndr_get_array_length(ndr, &r->in.server_name) > ndr_get_array_size(ndr, &r->in.server_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.server_name), ndr_get_array_length(ndr, &r->in.server_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_name, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0); + } + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.count)); + if (r->in.count < 0 || r->in.count > 32000) { + return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range"); + } + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.addresses)); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC_N(ndr, r->in.addresses, ndr_get_array_size(ndr, &r->in.addresses)); + } + _mem_save_addresses_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.addresses, 0); + for (cntr_addresses_1 = 0; cntr_addresses_1 < r->in.count; cntr_addresses_1++) { + NDR_CHECK(ndr_pull_netr_DsRAddress(ndr, NDR_SCALARS, &r->in.addresses[cntr_addresses_1])); + } + for (cntr_addresses_1 = 0; cntr_addresses_1 < r->in.count; cntr_addresses_1++) { + NDR_CHECK(ndr_pull_netr_DsRAddress(ndr, NDR_BUFFERS, &r->in.addresses[cntr_addresses_1])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_addresses_1, 0); + NDR_PULL_ALLOC(ndr, r->out.ctr); + ZERO_STRUCTP(r->out.ctr); + if (r->in.addresses) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->in.addresses, r->in.count)); + } } if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.ctr); + } + _mem_save_ctr_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.ctr, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_ctr)); + if (_ptr_ctr) { + NDR_PULL_ALLOC(ndr, *r->out.ctr); + } else { + *r->out.ctr = NULL; + } + if (*r->out.ctr) { + _mem_save_ctr_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, *r->out.ctr, 0); + NDR_CHECK(ndr_pull_netr_DsRAddressToSitenamesExWCtr(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.ctr)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ctr_1, 0); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ctr_0, LIBNDR_FLAG_REF_ALLOC); NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); } return NDR_ERR_SUCCESS; } -_PUBLIC_ void ndr_print_netr_DSRADDRESSTOSITENAMESEXW(struct ndr_print *ndr, const char *name, int flags, const struct netr_DSRADDRESSTOSITENAMESEXW *r) +_PUBLIC_ void ndr_print_netr_DsRAddressToSitenamesExW(struct ndr_print *ndr, const char *name, int flags, const struct netr_DsRAddressToSitenamesExW *r) { - ndr_print_struct(ndr, name, "netr_DSRADDRESSTOSITENAMESEXW"); + uint32_t cntr_addresses_1; + ndr_print_struct(ndr, name, "netr_DsRAddressToSitenamesExW"); ndr->depth++; if (flags & NDR_SET_VALUES) { ndr->flags |= LIBNDR_PRINT_SET_VALUES; } if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "netr_DSRADDRESSTOSITENAMESEXW"); + ndr_print_struct(ndr, "in", "netr_DsRAddressToSitenamesExW"); ndr->depth++; + ndr_print_ptr(ndr, "server_name", r->in.server_name); + ndr->depth++; + if (r->in.server_name) { + ndr_print_string(ndr, "server_name", r->in.server_name); + } + ndr->depth--; + ndr_print_uint32(ndr, "count", r->in.count); + ndr_print_ptr(ndr, "addresses", r->in.addresses); + ndr->depth++; + ndr->print(ndr, "%s: ARRAY(%d)", "addresses", r->in.count); + ndr->depth++; + for (cntr_addresses_1=0;cntr_addresses_1<r->in.count;cntr_addresses_1++) { + char *idx_1=NULL; + if (asprintf(&idx_1, "[%d]", cntr_addresses_1) != -1) { + ndr_print_netr_DsRAddress(ndr, "addresses", &r->in.addresses[cntr_addresses_1]); + free(idx_1); + } + } + ndr->depth--; + ndr->depth--; ndr->depth--; } if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "netr_DSRADDRESSTOSITENAMESEXW"); + ndr_print_struct(ndr, "out", "netr_DsRAddressToSitenamesExW"); + ndr->depth++; + ndr_print_ptr(ndr, "ctr", r->out.ctr); + ndr->depth++; + ndr_print_ptr(ndr, "ctr", *r->out.ctr); ndr->depth++; + if (*r->out.ctr) { + ndr_print_netr_DsRAddressToSitenamesExWCtr(ndr, "ctr", *r->out.ctr); + } + ndr->depth--; + ndr->depth--; ndr_print_WERROR(ndr, "result", r->out.result); ndr->depth--; } ndr->depth--; } -static enum ndr_err_code ndr_push_netr_DSRGETDCSITECOVERAGEW(struct ndr_push *ndr, int flags, const struct netr_DSRGETDCSITECOVERAGEW *r) +static enum ndr_err_code ndr_push_netr_DsrGetDcSiteCoverageW(struct ndr_push *ndr, int flags, const struct netr_DsrGetDcSiteCoverageW *r) { if (flags & NDR_IN) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_name)); + if (r->in.server_name) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_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.server_name, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.server_name, ndr_charset_length(r->in.server_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } } if (flags & NDR_OUT) { + if (r->out.ctr == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_DcSitesCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.ctr)); NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); } return NDR_ERR_SUCCESS; } -static enum ndr_err_code ndr_pull_netr_DSRGETDCSITECOVERAGEW(struct ndr_pull *ndr, int flags, struct netr_DSRGETDCSITECOVERAGEW *r) +static enum ndr_err_code ndr_pull_netr_DsrGetDcSiteCoverageW(struct ndr_pull *ndr, int flags, struct netr_DsrGetDcSiteCoverageW *r) { + uint32_t _ptr_server_name; + TALLOC_CTX *_mem_save_server_name_0; + TALLOC_CTX *_mem_save_ctr_0; if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name)); + if (_ptr_server_name) { + NDR_PULL_ALLOC(ndr, r->in.server_name); + } else { + r->in.server_name = NULL; + } + if (r->in.server_name) { + _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.server_name, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_name)); + if (ndr_get_array_length(ndr, &r->in.server_name) > ndr_get_array_size(ndr, &r->in.server_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.server_name), ndr_get_array_length(ndr, &r->in.server_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_name, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0); + } + NDR_PULL_ALLOC(ndr, r->out.ctr); + ZERO_STRUCTP(r->out.ctr); } if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.ctr); + } + _mem_save_ctr_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.ctr, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_DcSitesCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.ctr)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ctr_0, LIBNDR_FLAG_REF_ALLOC); NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); } return NDR_ERR_SUCCESS; } -_PUBLIC_ void ndr_print_netr_DSRGETDCSITECOVERAGEW(struct ndr_print *ndr, const char *name, int flags, const struct netr_DSRGETDCSITECOVERAGEW *r) +_PUBLIC_ void ndr_print_netr_DsrGetDcSiteCoverageW(struct ndr_print *ndr, const char *name, int flags, const struct netr_DsrGetDcSiteCoverageW *r) { - ndr_print_struct(ndr, name, "netr_DSRGETDCSITECOVERAGEW"); + ndr_print_struct(ndr, name, "netr_DsrGetDcSiteCoverageW"); ndr->depth++; if (flags & NDR_SET_VALUES) { ndr->flags |= LIBNDR_PRINT_SET_VALUES; } if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "netr_DSRGETDCSITECOVERAGEW"); + ndr_print_struct(ndr, "in", "netr_DsrGetDcSiteCoverageW"); + ndr->depth++; + ndr_print_ptr(ndr, "server_name", r->in.server_name); ndr->depth++; + if (r->in.server_name) { + ndr_print_string(ndr, "server_name", r->in.server_name); + } + ndr->depth--; ndr->depth--; } if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "netr_DSRGETDCSITECOVERAGEW"); + ndr_print_struct(ndr, "out", "netr_DsrGetDcSiteCoverageW"); ndr->depth++; + ndr_print_ptr(ndr, "ctr", r->out.ctr); + ndr->depth++; + ndr_print_DcSitesCtr(ndr, "ctr", r->out.ctr); + ndr->depth--; ndr_print_WERROR(ndr, "result", r->out.result); ndr->depth--; } @@ -12053,8 +13370,11 @@ static enum ndr_err_code ndr_push_netr_LogonSamLogonEx(struct ndr_push *ndr, int NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.computer_name, ndr_charset_length(r->in.computer_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); } NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->in.logon_level)); - NDR_CHECK(ndr_push_set_switch_value(ndr, &r->in.logon, r->in.logon_level)); - NDR_CHECK(ndr_push_netr_LogonLevel(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.logon)); + if (r->in.logon == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_set_switch_value(ndr, r->in.logon, r->in.logon_level)); + NDR_CHECK(ndr_push_netr_LogonLevel(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.logon)); NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->in.validation_level)); if (r->in.flags == NULL) { return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); @@ -12086,6 +13406,7 @@ static enum ndr_err_code ndr_pull_netr_LogonSamLogonEx(struct ndr_pull *ndr, int uint32_t _ptr_computer_name; TALLOC_CTX *_mem_save_server_name_0; TALLOC_CTX *_mem_save_computer_name_0; + TALLOC_CTX *_mem_save_logon_0; TALLOC_CTX *_mem_save_validation_0; TALLOC_CTX *_mem_save_authoritative_0; TALLOC_CTX *_mem_save_flags_0; @@ -12129,8 +13450,14 @@ static enum ndr_err_code ndr_pull_netr_LogonSamLogonEx(struct ndr_pull *ndr, int NDR_PULL_SET_MEM_CTX(ndr, _mem_save_computer_name_0, 0); } NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->in.logon_level)); - NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->in.logon, r->in.logon_level)); - NDR_CHECK(ndr_pull_netr_LogonLevel(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.logon)); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.logon); + } + _mem_save_logon_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.logon, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_set_switch_value(ndr, r->in.logon, r->in.logon_level)); + NDR_CHECK(ndr_pull_netr_LogonLevel(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.logon)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_logon_0, LIBNDR_FLAG_REF_ALLOC); NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->in.validation_level)); if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { NDR_PULL_ALLOC(ndr, r->in.flags); @@ -12197,8 +13524,11 @@ _PUBLIC_ void ndr_print_netr_LogonSamLogonEx(struct ndr_print *ndr, const char * } ndr->depth--; ndr_print_uint16(ndr, "logon_level", r->in.logon_level); - ndr_print_set_switch_value(ndr, &r->in.logon, r->in.logon_level); - ndr_print_netr_LogonLevel(ndr, "logon", &r->in.logon); + ndr_print_ptr(ndr, "logon", r->in.logon); + ndr->depth++; + ndr_print_set_switch_value(ndr, r->in.logon, r->in.logon_level); + ndr_print_netr_LogonLevel(ndr, "logon", r->in.logon); + ndr->depth--; ndr_print_uint16(ndr, "validation_level", r->in.validation_level); ndr_print_ptr(ndr, "flags", r->in.flags); ndr->depth++; @@ -12230,7 +13560,6 @@ _PUBLIC_ void ndr_print_netr_LogonSamLogonEx(struct ndr_print *ndr, const char * static enum ndr_err_code ndr_push_netr_DsrEnumerateDomainTrusts(struct ndr_push *ndr, int flags, const struct netr_DsrEnumerateDomainTrusts *r) { - uint32_t cntr_trusts_1; if (flags & NDR_IN) { NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_name)); if (r->in.server_name) { @@ -12242,23 +13571,10 @@ static enum ndr_err_code ndr_push_netr_DsrEnumerateDomainTrusts(struct ndr_push NDR_CHECK(ndr_push_netr_TrustFlags(ndr, NDR_SCALARS, r->in.trust_flags)); } if (flags & NDR_OUT) { - if (r->out.count == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.count)); if (r->out.trusts == NULL) { return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); } - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->out.count)); - for (cntr_trusts_1 = 0; cntr_trusts_1 < r->out.count; cntr_trusts_1++) { - if (r->out.trusts[cntr_trusts_1] == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_ref_ptr(ndr)); - } - for (cntr_trusts_1 = 0; cntr_trusts_1 < r->out.count; cntr_trusts_1++) { - NDR_CHECK(ndr_push_netr_DomainTrust(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.trusts[cntr_trusts_1])); - } + NDR_CHECK(ndr_push_netr_DomainTrustList(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.trusts)); NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); } return NDR_ERR_SUCCESS; @@ -12267,12 +13583,8 @@ static enum ndr_err_code ndr_push_netr_DsrEnumerateDomainTrusts(struct ndr_push static enum ndr_err_code ndr_pull_netr_DsrEnumerateDomainTrusts(struct ndr_pull *ndr, int flags, struct netr_DsrEnumerateDomainTrusts *r) { uint32_t _ptr_server_name; - uint32_t _ptr_trusts; - uint32_t cntr_trusts_1; TALLOC_CTX *_mem_save_server_name_0; - TALLOC_CTX *_mem_save_count_0; - TALLOC_CTX *_mem_save_trusts_1; - TALLOC_CTX *_mem_save_trusts_2; + TALLOC_CTX *_mem_save_trusts_0; if (flags & NDR_IN) { ZERO_STRUCT(r->out); @@ -12295,49 +13607,24 @@ static enum ndr_err_code ndr_pull_netr_DsrEnumerateDomainTrusts(struct ndr_pull NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0); } NDR_CHECK(ndr_pull_netr_TrustFlags(ndr, NDR_SCALARS, &r->in.trust_flags)); - NDR_PULL_ALLOC(ndr, r->out.count); - ZERO_STRUCTP(r->out.count); - NDR_PULL_ALLOC_N(ndr, r->out.trusts, count); - memset(r->out.trusts, 0, count * sizeof(*r->out.trusts)); + NDR_PULL_ALLOC(ndr, r->out.trusts); + ZERO_STRUCTP(r->out.trusts); } if (flags & NDR_OUT) { if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.count); - } - _mem_save_count_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.count, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.count)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_count_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_array_size(ndr, &r->out.trusts)); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC_N(ndr, r->out.trusts, ndr_get_array_size(ndr, &r->out.trusts)); - } - _mem_save_trusts_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.trusts, 0); - for (cntr_trusts_1 = 0; cntr_trusts_1 < r->out.count; cntr_trusts_1++) { - NDR_CHECK(ndr_pull_ref_ptr(ndr, &_ptr_trusts)); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.trusts[cntr_trusts_1]); - } + NDR_PULL_ALLOC(ndr, r->out.trusts); } - for (cntr_trusts_1 = 0; cntr_trusts_1 < r->out.count; cntr_trusts_1++) { - _mem_save_trusts_2 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.trusts[cntr_trusts_1], LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_netr_DomainTrust(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.trusts[cntr_trusts_1])); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_trusts_2, LIBNDR_FLAG_REF_ALLOC); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_trusts_1, 0); + _mem_save_trusts_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.trusts, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_netr_DomainTrustList(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.trusts)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_trusts_0, LIBNDR_FLAG_REF_ALLOC); NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - if (r->out.trusts) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->out.trusts, r->out.count)); - } } return NDR_ERR_SUCCESS; } _PUBLIC_ void ndr_print_netr_DsrEnumerateDomainTrusts(struct ndr_print *ndr, const char *name, int flags, const struct netr_DsrEnumerateDomainTrusts *r) { - uint32_t cntr_trusts_1; ndr_print_struct(ndr, name, "netr_DsrEnumerateDomainTrusts"); ndr->depth++; if (flags & NDR_SET_VALUES) { @@ -12358,26 +13645,9 @@ _PUBLIC_ void ndr_print_netr_DsrEnumerateDomainTrusts(struct ndr_print *ndr, con if (flags & NDR_OUT) { ndr_print_struct(ndr, "out", "netr_DsrEnumerateDomainTrusts"); ndr->depth++; - ndr_print_ptr(ndr, "count", r->out.count); - ndr->depth++; - ndr_print_uint32(ndr, "count", *r->out.count); - ndr->depth--; ndr_print_ptr(ndr, "trusts", r->out.trusts); ndr->depth++; - ndr->print(ndr, "%s: ARRAY(%d)", "trusts", r->out.count); - ndr->depth++; - for (cntr_trusts_1=0;cntr_trusts_1<r->out.count;cntr_trusts_1++) { - char *idx_1=NULL; - asprintf(&idx_1, "[%d]", cntr_trusts_1); - if (idx_1) { - ndr_print_ptr(ndr, "trusts", r->out.trusts[cntr_trusts_1]); - ndr->depth++; - ndr_print_netr_DomainTrust(ndr, "trusts", r->out.trusts[cntr_trusts_1]); - ndr->depth--; - free(idx_1); - } - } - ndr->depth--; + ndr_print_netr_DomainTrustList(ndr, "trusts", r->out.trusts); ndr->depth--; ndr_print_WERROR(ndr, "result", r->out.result); ndr->depth--; @@ -12385,9 +13655,38 @@ _PUBLIC_ void ndr_print_netr_DsrEnumerateDomainTrusts(struct ndr_print *ndr, con ndr->depth--; } -static enum ndr_err_code ndr_push_netr_DSRDEREGISTERDNSHOSTRECORDS(struct ndr_push *ndr, int flags, const struct netr_DSRDEREGISTERDNSHOSTRECORDS *r) +static enum ndr_err_code ndr_push_netr_DsrDeregisterDNSHostRecords(struct ndr_push *ndr, int flags, const struct netr_DsrDeregisterDNSHostRecords *r) { if (flags & NDR_IN) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_name)); + if (r->in.server_name) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_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.server_name, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.server_name, ndr_charset_length(r->in.server_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.domain)); + if (r->in.domain) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.domain, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.domain, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.domain, ndr_charset_length(r->in.domain, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.domain_guid)); + if (r->in.domain_guid) { + NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.domain_guid)); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.dsa_guid)); + if (r->in.dsa_guid) { + NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.dsa_guid)); + } + if (r->in.dns_host == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.dns_host, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.dns_host, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.dns_host, ndr_charset_length(r->in.dns_host, CH_UTF16), sizeof(uint16_t), CH_UTF16)); } if (flags & NDR_OUT) { NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); @@ -12395,9 +13694,84 @@ static enum ndr_err_code ndr_push_netr_DSRDEREGISTERDNSHOSTRECORDS(struct ndr_pu return NDR_ERR_SUCCESS; } -static enum ndr_err_code ndr_pull_netr_DSRDEREGISTERDNSHOSTRECORDS(struct ndr_pull *ndr, int flags, struct netr_DSRDEREGISTERDNSHOSTRECORDS *r) +static enum ndr_err_code ndr_pull_netr_DsrDeregisterDNSHostRecords(struct ndr_pull *ndr, int flags, struct netr_DsrDeregisterDNSHostRecords *r) { + uint32_t _ptr_server_name; + uint32_t _ptr_domain; + uint32_t _ptr_domain_guid; + uint32_t _ptr_dsa_guid; + TALLOC_CTX *_mem_save_server_name_0; + TALLOC_CTX *_mem_save_domain_0; + TALLOC_CTX *_mem_save_domain_guid_0; + TALLOC_CTX *_mem_save_dsa_guid_0; if (flags & NDR_IN) { + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name)); + if (_ptr_server_name) { + NDR_PULL_ALLOC(ndr, r->in.server_name); + } else { + r->in.server_name = NULL; + } + if (r->in.server_name) { + _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.server_name, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_name)); + if (ndr_get_array_length(ndr, &r->in.server_name) > ndr_get_array_size(ndr, &r->in.server_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.server_name), ndr_get_array_length(ndr, &r->in.server_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_name, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0); + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_domain)); + if (_ptr_domain) { + NDR_PULL_ALLOC(ndr, r->in.domain); + } else { + r->in.domain = NULL; + } + if (r->in.domain) { + _mem_save_domain_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.domain, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.domain)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.domain)); + if (ndr_get_array_length(ndr, &r->in.domain) > ndr_get_array_size(ndr, &r->in.domain)) { + 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.domain), ndr_get_array_length(ndr, &r->in.domain)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.domain), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.domain, ndr_get_array_length(ndr, &r->in.domain), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_0, 0); + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_domain_guid)); + if (_ptr_domain_guid) { + NDR_PULL_ALLOC(ndr, r->in.domain_guid); + } else { + r->in.domain_guid = NULL; + } + if (r->in.domain_guid) { + _mem_save_domain_guid_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.domain_guid, 0); + NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.domain_guid)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_guid_0, 0); + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_dsa_guid)); + if (_ptr_dsa_guid) { + NDR_PULL_ALLOC(ndr, r->in.dsa_guid); + } else { + r->in.dsa_guid = NULL; + } + if (r->in.dsa_guid) { + _mem_save_dsa_guid_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.dsa_guid, 0); + NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.dsa_guid)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_dsa_guid_0, 0); + } + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.dns_host)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.dns_host)); + if (ndr_get_array_length(ndr, &r->in.dns_host) > ndr_get_array_size(ndr, &r->in.dns_host)) { + 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.dns_host), ndr_get_array_length(ndr, &r->in.dns_host)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.dns_host), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.dns_host, ndr_get_array_length(ndr, &r->in.dns_host), sizeof(uint16_t), CH_UTF16)); } if (flags & NDR_OUT) { NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); @@ -12405,20 +13779,48 @@ static enum ndr_err_code ndr_pull_netr_DSRDEREGISTERDNSHOSTRECORDS(struct ndr_pu return NDR_ERR_SUCCESS; } -_PUBLIC_ void ndr_print_netr_DSRDEREGISTERDNSHOSTRECORDS(struct ndr_print *ndr, const char *name, int flags, const struct netr_DSRDEREGISTERDNSHOSTRECORDS *r) +_PUBLIC_ void ndr_print_netr_DsrDeregisterDNSHostRecords(struct ndr_print *ndr, const char *name, int flags, const struct netr_DsrDeregisterDNSHostRecords *r) { - ndr_print_struct(ndr, name, "netr_DSRDEREGISTERDNSHOSTRECORDS"); + ndr_print_struct(ndr, name, "netr_DsrDeregisterDNSHostRecords"); ndr->depth++; if (flags & NDR_SET_VALUES) { ndr->flags |= LIBNDR_PRINT_SET_VALUES; } if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "netr_DSRDEREGISTERDNSHOSTRECORDS"); + ndr_print_struct(ndr, "in", "netr_DsrDeregisterDNSHostRecords"); + ndr->depth++; + ndr_print_ptr(ndr, "server_name", r->in.server_name); ndr->depth++; + if (r->in.server_name) { + ndr_print_string(ndr, "server_name", r->in.server_name); + } + ndr->depth--; + ndr_print_ptr(ndr, "domain", r->in.domain); + ndr->depth++; + if (r->in.domain) { + ndr_print_string(ndr, "domain", r->in.domain); + } + ndr->depth--; + ndr_print_ptr(ndr, "domain_guid", r->in.domain_guid); + ndr->depth++; + if (r->in.domain_guid) { + ndr_print_GUID(ndr, "domain_guid", r->in.domain_guid); + } + ndr->depth--; + ndr_print_ptr(ndr, "dsa_guid", r->in.dsa_guid); + ndr->depth++; + if (r->in.dsa_guid) { + ndr_print_GUID(ndr, "dsa_guid", r->in.dsa_guid); + } + ndr->depth--; + ndr_print_ptr(ndr, "dns_host", r->in.dns_host); + ndr->depth++; + ndr_print_string(ndr, "dns_host", r->in.dns_host); + ndr->depth--; ndr->depth--; } if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "netr_DSRDEREGISTERDNSHOSTRECORDS"); + ndr_print_struct(ndr, "out", "netr_DsrDeregisterDNSHostRecords"); ndr->depth++; ndr_print_WERROR(ndr, "result", r->out.result); ndr->depth--; @@ -12426,123 +13828,494 @@ _PUBLIC_ void ndr_print_netr_DSRDEREGISTERDNSHOSTRECORDS(struct ndr_print *ndr, ndr->depth--; } -static enum ndr_err_code ndr_push_netr_NETRSERVERTRUSTPASSWORDSGET(struct ndr_push *ndr, int flags, const struct netr_NETRSERVERTRUSTPASSWORDSGET *r) +static enum ndr_err_code ndr_push_netr_ServerTrustPasswordsGet(struct ndr_push *ndr, int flags, const struct netr_ServerTrustPasswordsGet *r) { if (flags & NDR_IN) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_name)); + if (r->in.server_name) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_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.server_name, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.server_name, ndr_charset_length(r->in.server_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.account_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.account_name, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.account_name, ndr_charset_length(r->in.account_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + NDR_CHECK(ndr_push_netr_SchannelType(ndr, NDR_SCALARS, r->in.secure_channel_type)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.computer_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.computer_name, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.computer_name, ndr_charset_length(r->in.computer_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + if (r->in.credential == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_netr_Authenticator(ndr, NDR_SCALARS, r->in.credential)); } if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + if (r->out.return_authenticator == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_netr_Authenticator(ndr, NDR_SCALARS, r->out.return_authenticator)); + if (r->out.password == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_samr_Password(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.password)); + if (r->out.password2 == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_samr_Password(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.password2)); + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); } return NDR_ERR_SUCCESS; } -static enum ndr_err_code ndr_pull_netr_NETRSERVERTRUSTPASSWORDSGET(struct ndr_pull *ndr, int flags, struct netr_NETRSERVERTRUSTPASSWORDSGET *r) +static enum ndr_err_code ndr_pull_netr_ServerTrustPasswordsGet(struct ndr_pull *ndr, int flags, struct netr_ServerTrustPasswordsGet *r) { + uint32_t _ptr_server_name; + TALLOC_CTX *_mem_save_server_name_0; + TALLOC_CTX *_mem_save_credential_0; + TALLOC_CTX *_mem_save_return_authenticator_0; + TALLOC_CTX *_mem_save_password_0; + TALLOC_CTX *_mem_save_password2_0; if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name)); + if (_ptr_server_name) { + NDR_PULL_ALLOC(ndr, r->in.server_name); + } else { + r->in.server_name = NULL; + } + if (r->in.server_name) { + _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.server_name, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_name)); + if (ndr_get_array_length(ndr, &r->in.server_name) > ndr_get_array_size(ndr, &r->in.server_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.server_name), ndr_get_array_length(ndr, &r->in.server_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_name, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0); + } + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.account_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.account_name)); + if (ndr_get_array_length(ndr, &r->in.account_name) > ndr_get_array_size(ndr, &r->in.account_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.account_name), ndr_get_array_length(ndr, &r->in.account_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.account_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.account_name, ndr_get_array_length(ndr, &r->in.account_name), sizeof(uint16_t), CH_UTF16)); + NDR_CHECK(ndr_pull_netr_SchannelType(ndr, NDR_SCALARS, &r->in.secure_channel_type)); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.computer_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.computer_name)); + if (ndr_get_array_length(ndr, &r->in.computer_name) > ndr_get_array_size(ndr, &r->in.computer_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.computer_name), ndr_get_array_length(ndr, &r->in.computer_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.computer_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.computer_name, ndr_get_array_length(ndr, &r->in.computer_name), sizeof(uint16_t), CH_UTF16)); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.credential); + } + _mem_save_credential_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.credential, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, r->in.credential)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_credential_0, LIBNDR_FLAG_REF_ALLOC); + NDR_PULL_ALLOC(ndr, r->out.return_authenticator); + ZERO_STRUCTP(r->out.return_authenticator); + NDR_PULL_ALLOC(ndr, r->out.password); + ZERO_STRUCTP(r->out.password); + NDR_PULL_ALLOC(ndr, r->out.password2); + ZERO_STRUCTP(r->out.password2); } if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.return_authenticator); + } + _mem_save_return_authenticator_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.return_authenticator, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, r->out.return_authenticator)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_return_authenticator_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.password); + } + _mem_save_password_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.password, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_samr_Password(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.password)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_password_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.password2); + } + _mem_save_password2_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.password2, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_samr_Password(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.password2)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_password2_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); } return NDR_ERR_SUCCESS; } -_PUBLIC_ void ndr_print_netr_NETRSERVERTRUSTPASSWORDSGET(struct ndr_print *ndr, const char *name, int flags, const struct netr_NETRSERVERTRUSTPASSWORDSGET *r) +_PUBLIC_ void ndr_print_netr_ServerTrustPasswordsGet(struct ndr_print *ndr, const char *name, int flags, const struct netr_ServerTrustPasswordsGet *r) { - ndr_print_struct(ndr, name, "netr_NETRSERVERTRUSTPASSWORDSGET"); + ndr_print_struct(ndr, name, "netr_ServerTrustPasswordsGet"); ndr->depth++; if (flags & NDR_SET_VALUES) { ndr->flags |= LIBNDR_PRINT_SET_VALUES; } if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "netr_NETRSERVERTRUSTPASSWORDSGET"); + ndr_print_struct(ndr, "in", "netr_ServerTrustPasswordsGet"); + ndr->depth++; + ndr_print_ptr(ndr, "server_name", r->in.server_name); ndr->depth++; + if (r->in.server_name) { + ndr_print_string(ndr, "server_name", r->in.server_name); + } + ndr->depth--; + ndr_print_string(ndr, "account_name", r->in.account_name); + ndr_print_netr_SchannelType(ndr, "secure_channel_type", r->in.secure_channel_type); + ndr_print_string(ndr, "computer_name", r->in.computer_name); + ndr_print_ptr(ndr, "credential", r->in.credential); + ndr->depth++; + ndr_print_netr_Authenticator(ndr, "credential", r->in.credential); + ndr->depth--; ndr->depth--; } if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "netr_NETRSERVERTRUSTPASSWORDSGET"); + ndr_print_struct(ndr, "out", "netr_ServerTrustPasswordsGet"); ndr->depth++; - ndr_print_WERROR(ndr, "result", r->out.result); + ndr_print_ptr(ndr, "return_authenticator", r->out.return_authenticator); + ndr->depth++; + ndr_print_netr_Authenticator(ndr, "return_authenticator", r->out.return_authenticator); + ndr->depth--; + ndr_print_ptr(ndr, "password", r->out.password); + ndr->depth++; + ndr_print_samr_Password(ndr, "password", r->out.password); + ndr->depth--; + ndr_print_ptr(ndr, "password2", r->out.password2); + ndr->depth++; + ndr_print_samr_Password(ndr, "password2", r->out.password2); + ndr->depth--; + ndr_print_NTSTATUS(ndr, "result", r->out.result); ndr->depth--; } ndr->depth--; } -static enum ndr_err_code ndr_push_netr_DSRGETFORESTTRUSTINFORMATION(struct ndr_push *ndr, int flags, const struct netr_DSRGETFORESTTRUSTINFORMATION *r) +static enum ndr_err_code ndr_push_netr_DsRGetForestTrustInformation(struct ndr_push *ndr, int flags, const struct netr_DsRGetForestTrustInformation *r) { if (flags & NDR_IN) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_name)); + if (r->in.server_name) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_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.server_name, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.server_name, ndr_charset_length(r->in.server_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.trusted_domain_name)); + if (r->in.trusted_domain_name) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.trusted_domain_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.trusted_domain_name, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.trusted_domain_name, ndr_charset_length(r->in.trusted_domain_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.flags)); } if (flags & NDR_OUT) { + if (r->out.forest_trust_info == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.forest_trust_info)); + if (*r->out.forest_trust_info) { + NDR_CHECK(ndr_push_lsa_ForestTrustInformation(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.forest_trust_info)); + } NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); } return NDR_ERR_SUCCESS; } -static enum ndr_err_code ndr_pull_netr_DSRGETFORESTTRUSTINFORMATION(struct ndr_pull *ndr, int flags, struct netr_DSRGETFORESTTRUSTINFORMATION *r) +static enum ndr_err_code ndr_pull_netr_DsRGetForestTrustInformation(struct ndr_pull *ndr, int flags, struct netr_DsRGetForestTrustInformation *r) { + uint32_t _ptr_server_name; + uint32_t _ptr_trusted_domain_name; + uint32_t _ptr_forest_trust_info; + TALLOC_CTX *_mem_save_server_name_0; + TALLOC_CTX *_mem_save_trusted_domain_name_0; + TALLOC_CTX *_mem_save_forest_trust_info_0; + TALLOC_CTX *_mem_save_forest_trust_info_1; if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name)); + if (_ptr_server_name) { + NDR_PULL_ALLOC(ndr, r->in.server_name); + } else { + r->in.server_name = NULL; + } + if (r->in.server_name) { + _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.server_name, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_name)); + if (ndr_get_array_length(ndr, &r->in.server_name) > ndr_get_array_size(ndr, &r->in.server_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.server_name), ndr_get_array_length(ndr, &r->in.server_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_name, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0); + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_trusted_domain_name)); + if (_ptr_trusted_domain_name) { + NDR_PULL_ALLOC(ndr, r->in.trusted_domain_name); + } else { + r->in.trusted_domain_name = NULL; + } + if (r->in.trusted_domain_name) { + _mem_save_trusted_domain_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.trusted_domain_name, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.trusted_domain_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.trusted_domain_name)); + if (ndr_get_array_length(ndr, &r->in.trusted_domain_name) > ndr_get_array_size(ndr, &r->in.trusted_domain_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.trusted_domain_name), ndr_get_array_length(ndr, &r->in.trusted_domain_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.trusted_domain_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.trusted_domain_name, ndr_get_array_length(ndr, &r->in.trusted_domain_name), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_trusted_domain_name_0, 0); + } + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.flags)); + NDR_PULL_ALLOC(ndr, r->out.forest_trust_info); + ZERO_STRUCTP(r->out.forest_trust_info); } if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.forest_trust_info); + } + _mem_save_forest_trust_info_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.forest_trust_info, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_forest_trust_info)); + if (_ptr_forest_trust_info) { + NDR_PULL_ALLOC(ndr, *r->out.forest_trust_info); + } else { + *r->out.forest_trust_info = NULL; + } + if (*r->out.forest_trust_info) { + _mem_save_forest_trust_info_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, *r->out.forest_trust_info, 0); + NDR_CHECK(ndr_pull_lsa_ForestTrustInformation(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.forest_trust_info)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_forest_trust_info_1, 0); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_forest_trust_info_0, LIBNDR_FLAG_REF_ALLOC); NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); } return NDR_ERR_SUCCESS; } -_PUBLIC_ void ndr_print_netr_DSRGETFORESTTRUSTINFORMATION(struct ndr_print *ndr, const char *name, int flags, const struct netr_DSRGETFORESTTRUSTINFORMATION *r) +_PUBLIC_ void ndr_print_netr_DsRGetForestTrustInformation(struct ndr_print *ndr, const char *name, int flags, const struct netr_DsRGetForestTrustInformation *r) { - ndr_print_struct(ndr, name, "netr_DSRGETFORESTTRUSTINFORMATION"); + ndr_print_struct(ndr, name, "netr_DsRGetForestTrustInformation"); ndr->depth++; if (flags & NDR_SET_VALUES) { ndr->flags |= LIBNDR_PRINT_SET_VALUES; } if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "netr_DSRGETFORESTTRUSTINFORMATION"); + ndr_print_struct(ndr, "in", "netr_DsRGetForestTrustInformation"); + ndr->depth++; + ndr_print_ptr(ndr, "server_name", r->in.server_name); ndr->depth++; + if (r->in.server_name) { + ndr_print_string(ndr, "server_name", r->in.server_name); + } + ndr->depth--; + ndr_print_ptr(ndr, "trusted_domain_name", r->in.trusted_domain_name); + ndr->depth++; + if (r->in.trusted_domain_name) { + ndr_print_string(ndr, "trusted_domain_name", r->in.trusted_domain_name); + } + ndr->depth--; + ndr_print_uint32(ndr, "flags", r->in.flags); ndr->depth--; } if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "netr_DSRGETFORESTTRUSTINFORMATION"); + ndr_print_struct(ndr, "out", "netr_DsRGetForestTrustInformation"); + ndr->depth++; + ndr_print_ptr(ndr, "forest_trust_info", r->out.forest_trust_info); ndr->depth++; + ndr_print_ptr(ndr, "forest_trust_info", *r->out.forest_trust_info); + ndr->depth++; + if (*r->out.forest_trust_info) { + ndr_print_lsa_ForestTrustInformation(ndr, "forest_trust_info", *r->out.forest_trust_info); + } + ndr->depth--; + ndr->depth--; ndr_print_WERROR(ndr, "result", r->out.result); ndr->depth--; } ndr->depth--; } -static enum ndr_err_code ndr_push_netr_NETRGETFORESTTRUSTINFORMATION(struct ndr_push *ndr, int flags, const struct netr_NETRGETFORESTTRUSTINFORMATION *r) +static enum ndr_err_code ndr_push_netr_GetForestTrustInformation(struct ndr_push *ndr, int flags, const struct netr_GetForestTrustInformation *r) { if (flags & NDR_IN) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_name)); + if (r->in.server_name) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.server_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.server_name, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.server_name, ndr_charset_length(r->in.server_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + if (r->in.trusted_domain_name == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.trusted_domain_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.trusted_domain_name, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.trusted_domain_name, ndr_charset_length(r->in.trusted_domain_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + if (r->in.credential == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_netr_Authenticator(ndr, NDR_SCALARS, r->in.credential)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.flags)); } if (flags & NDR_OUT) { + if (r->out.return_authenticator == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_netr_Authenticator(ndr, NDR_SCALARS, r->out.return_authenticator)); + if (r->out.forest_trust_info == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.forest_trust_info)); + if (*r->out.forest_trust_info) { + NDR_CHECK(ndr_push_lsa_ForestTrustInformation(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.forest_trust_info)); + } NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); } return NDR_ERR_SUCCESS; } -static enum ndr_err_code ndr_pull_netr_NETRGETFORESTTRUSTINFORMATION(struct ndr_pull *ndr, int flags, struct netr_NETRGETFORESTTRUSTINFORMATION *r) +static enum ndr_err_code ndr_pull_netr_GetForestTrustInformation(struct ndr_pull *ndr, int flags, struct netr_GetForestTrustInformation *r) { + uint32_t _ptr_server_name; + uint32_t _ptr_forest_trust_info; + TALLOC_CTX *_mem_save_server_name_0; + TALLOC_CTX *_mem_save_credential_0; + TALLOC_CTX *_mem_save_return_authenticator_0; + TALLOC_CTX *_mem_save_forest_trust_info_0; + TALLOC_CTX *_mem_save_forest_trust_info_1; if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name)); + if (_ptr_server_name) { + NDR_PULL_ALLOC(ndr, r->in.server_name); + } else { + r->in.server_name = NULL; + } + if (r->in.server_name) { + _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.server_name, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.server_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.server_name)); + if (ndr_get_array_length(ndr, &r->in.server_name) > ndr_get_array_size(ndr, &r->in.server_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.server_name), ndr_get_array_length(ndr, &r->in.server_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_name, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0); + } + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.trusted_domain_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.trusted_domain_name)); + if (ndr_get_array_length(ndr, &r->in.trusted_domain_name) > ndr_get_array_size(ndr, &r->in.trusted_domain_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.trusted_domain_name), ndr_get_array_length(ndr, &r->in.trusted_domain_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.trusted_domain_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.trusted_domain_name, ndr_get_array_length(ndr, &r->in.trusted_domain_name), sizeof(uint16_t), CH_UTF16)); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.credential); + } + _mem_save_credential_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.credential, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, r->in.credential)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_credential_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.flags)); + NDR_PULL_ALLOC(ndr, r->out.return_authenticator); + ZERO_STRUCTP(r->out.return_authenticator); + NDR_PULL_ALLOC(ndr, r->out.forest_trust_info); + ZERO_STRUCTP(r->out.forest_trust_info); } if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.return_authenticator); + } + _mem_save_return_authenticator_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.return_authenticator, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, r->out.return_authenticator)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_return_authenticator_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.forest_trust_info); + } + _mem_save_forest_trust_info_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.forest_trust_info, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_forest_trust_info)); + if (_ptr_forest_trust_info) { + NDR_PULL_ALLOC(ndr, *r->out.forest_trust_info); + } else { + *r->out.forest_trust_info = NULL; + } + if (*r->out.forest_trust_info) { + _mem_save_forest_trust_info_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, *r->out.forest_trust_info, 0); + NDR_CHECK(ndr_pull_lsa_ForestTrustInformation(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.forest_trust_info)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_forest_trust_info_1, 0); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_forest_trust_info_0, LIBNDR_FLAG_REF_ALLOC); NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); } return NDR_ERR_SUCCESS; } -_PUBLIC_ void ndr_print_netr_NETRGETFORESTTRUSTINFORMATION(struct ndr_print *ndr, const char *name, int flags, const struct netr_NETRGETFORESTTRUSTINFORMATION *r) +_PUBLIC_ void ndr_print_netr_GetForestTrustInformation(struct ndr_print *ndr, const char *name, int flags, const struct netr_GetForestTrustInformation *r) { - ndr_print_struct(ndr, name, "netr_NETRGETFORESTTRUSTINFORMATION"); + ndr_print_struct(ndr, name, "netr_GetForestTrustInformation"); ndr->depth++; if (flags & NDR_SET_VALUES) { ndr->flags |= LIBNDR_PRINT_SET_VALUES; } if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "netr_NETRGETFORESTTRUSTINFORMATION"); + ndr_print_struct(ndr, "in", "netr_GetForestTrustInformation"); + ndr->depth++; + ndr_print_ptr(ndr, "server_name", r->in.server_name); ndr->depth++; + if (r->in.server_name) { + ndr_print_string(ndr, "server_name", r->in.server_name); + } + ndr->depth--; + ndr_print_ptr(ndr, "trusted_domain_name", r->in.trusted_domain_name); + ndr->depth++; + ndr_print_string(ndr, "trusted_domain_name", r->in.trusted_domain_name); + ndr->depth--; + ndr_print_ptr(ndr, "credential", r->in.credential); + ndr->depth++; + ndr_print_netr_Authenticator(ndr, "credential", r->in.credential); + ndr->depth--; + ndr_print_uint32(ndr, "flags", r->in.flags); ndr->depth--; } if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "netr_NETRGETFORESTTRUSTINFORMATION"); + ndr_print_struct(ndr, "out", "netr_GetForestTrustInformation"); ndr->depth++; + ndr_print_ptr(ndr, "return_authenticator", r->out.return_authenticator); + ndr->depth++; + ndr_print_netr_Authenticator(ndr, "return_authenticator", r->out.return_authenticator); + ndr->depth--; + ndr_print_ptr(ndr, "forest_trust_info", r->out.forest_trust_info); + ndr->depth++; + ndr_print_ptr(ndr, "forest_trust_info", *r->out.forest_trust_info); + ndr->depth++; + if (*r->out.forest_trust_info) { + ndr_print_lsa_ForestTrustInformation(ndr, "forest_trust_info", *r->out.forest_trust_info); + } + ndr->depth--; + ndr->depth--; ndr_print_WERROR(ndr, "result", r->out.result); ndr->depth--; } @@ -13007,11 +14780,11 @@ static const struct ndr_interface_call netlogon_calls[] = { false, }, { - "netr_NETRENUMERATETRUSTEDDOMAINS", - sizeof(struct netr_NETRENUMERATETRUSTEDDOMAINS), - (ndr_push_flags_fn_t) ndr_push_netr_NETRENUMERATETRUSTEDDOMAINS, - (ndr_pull_flags_fn_t) ndr_pull_netr_NETRENUMERATETRUSTEDDOMAINS, - (ndr_print_function_t) ndr_print_netr_NETRENUMERATETRUSTEDDOMAINS, + "netr_NetrEnumerateTrustedDomains", + sizeof(struct netr_NetrEnumerateTrustedDomains), + (ndr_push_flags_fn_t) ndr_push_netr_NetrEnumerateTrustedDomains, + (ndr_pull_flags_fn_t) ndr_pull_netr_NetrEnumerateTrustedDomains, + (ndr_print_function_t) ndr_print_netr_NetrEnumerateTrustedDomains, false, }, { @@ -13039,11 +14812,11 @@ static const struct ndr_interface_call netlogon_calls[] = { false, }, { - "netr_NETRLOGONGETTRUSTRID", - sizeof(struct netr_NETRLOGONGETTRUSTRID), - (ndr_push_flags_fn_t) ndr_push_netr_NETRLOGONGETTRUSTRID, - (ndr_pull_flags_fn_t) ndr_pull_netr_NETRLOGONGETTRUSTRID, - (ndr_print_function_t) ndr_print_netr_NETRLOGONGETTRUSTRID, + "netr_LogonGetTrustRid", + sizeof(struct netr_LogonGetTrustRid), + (ndr_push_flags_fn_t) ndr_push_netr_LogonGetTrustRid, + (ndr_pull_flags_fn_t) ndr_pull_netr_LogonGetTrustRid, + (ndr_print_function_t) ndr_print_netr_LogonGetTrustRid, false, }, { @@ -13103,11 +14876,11 @@ static const struct ndr_interface_call netlogon_calls[] = { false, }, { - "netr_NETRSERVERPASSWORDGET", - sizeof(struct netr_NETRSERVERPASSWORDGET), - (ndr_push_flags_fn_t) ndr_push_netr_NETRSERVERPASSWORDGET, - (ndr_pull_flags_fn_t) ndr_pull_netr_NETRSERVERPASSWORDGET, - (ndr_print_function_t) ndr_print_netr_NETRSERVERPASSWORDGET, + "netr_ServerPasswordGet", + sizeof(struct netr_ServerPasswordGet), + (ndr_push_flags_fn_t) ndr_push_netr_ServerPasswordGet, + (ndr_pull_flags_fn_t) ndr_pull_netr_ServerPasswordGet, + (ndr_print_function_t) ndr_print_netr_ServerPasswordGet, false, }, { @@ -13119,11 +14892,11 @@ static const struct ndr_interface_call netlogon_calls[] = { false, }, { - "netr_DSRADDRESSTOSITENAMESW", - sizeof(struct netr_DSRADDRESSTOSITENAMESW), - (ndr_push_flags_fn_t) ndr_push_netr_DSRADDRESSTOSITENAMESW, - (ndr_pull_flags_fn_t) ndr_pull_netr_DSRADDRESSTOSITENAMESW, - (ndr_print_function_t) ndr_print_netr_DSRADDRESSTOSITENAMESW, + "netr_DsRAddressToSitenamesW", + sizeof(struct netr_DsRAddressToSitenamesW), + (ndr_push_flags_fn_t) ndr_push_netr_DsRAddressToSitenamesW, + (ndr_pull_flags_fn_t) ndr_pull_netr_DsRAddressToSitenamesW, + (ndr_print_function_t) ndr_print_netr_DsRAddressToSitenamesW, false, }, { @@ -13143,27 +14916,27 @@ static const struct ndr_interface_call netlogon_calls[] = { false, }, { - "netr_NETRENUMERATETRUSTEDDOMAINSEX", - sizeof(struct netr_NETRENUMERATETRUSTEDDOMAINSEX), - (ndr_push_flags_fn_t) ndr_push_netr_NETRENUMERATETRUSTEDDOMAINSEX, - (ndr_pull_flags_fn_t) ndr_pull_netr_NETRENUMERATETRUSTEDDOMAINSEX, - (ndr_print_function_t) ndr_print_netr_NETRENUMERATETRUSTEDDOMAINSEX, + "netr_NetrEnumerateTrustedDomainsEx", + sizeof(struct netr_NetrEnumerateTrustedDomainsEx), + (ndr_push_flags_fn_t) ndr_push_netr_NetrEnumerateTrustedDomainsEx, + (ndr_pull_flags_fn_t) ndr_pull_netr_NetrEnumerateTrustedDomainsEx, + (ndr_print_function_t) ndr_print_netr_NetrEnumerateTrustedDomainsEx, false, }, { - "netr_DSRADDRESSTOSITENAMESEXW", - sizeof(struct netr_DSRADDRESSTOSITENAMESEXW), - (ndr_push_flags_fn_t) ndr_push_netr_DSRADDRESSTOSITENAMESEXW, - (ndr_pull_flags_fn_t) ndr_pull_netr_DSRADDRESSTOSITENAMESEXW, - (ndr_print_function_t) ndr_print_netr_DSRADDRESSTOSITENAMESEXW, + "netr_DsRAddressToSitenamesExW", + sizeof(struct netr_DsRAddressToSitenamesExW), + (ndr_push_flags_fn_t) ndr_push_netr_DsRAddressToSitenamesExW, + (ndr_pull_flags_fn_t) ndr_pull_netr_DsRAddressToSitenamesExW, + (ndr_print_function_t) ndr_print_netr_DsRAddressToSitenamesExW, false, }, { - "netr_DSRGETDCSITECOVERAGEW", - sizeof(struct netr_DSRGETDCSITECOVERAGEW), - (ndr_push_flags_fn_t) ndr_push_netr_DSRGETDCSITECOVERAGEW, - (ndr_pull_flags_fn_t) ndr_pull_netr_DSRGETDCSITECOVERAGEW, - (ndr_print_function_t) ndr_print_netr_DSRGETDCSITECOVERAGEW, + "netr_DsrGetDcSiteCoverageW", + sizeof(struct netr_DsrGetDcSiteCoverageW), + (ndr_push_flags_fn_t) ndr_push_netr_DsrGetDcSiteCoverageW, + (ndr_pull_flags_fn_t) ndr_pull_netr_DsrGetDcSiteCoverageW, + (ndr_print_function_t) ndr_print_netr_DsrGetDcSiteCoverageW, false, }, { @@ -13183,35 +14956,35 @@ static const struct ndr_interface_call netlogon_calls[] = { false, }, { - "netr_DSRDEREGISTERDNSHOSTRECORDS", - sizeof(struct netr_DSRDEREGISTERDNSHOSTRECORDS), - (ndr_push_flags_fn_t) ndr_push_netr_DSRDEREGISTERDNSHOSTRECORDS, - (ndr_pull_flags_fn_t) ndr_pull_netr_DSRDEREGISTERDNSHOSTRECORDS, - (ndr_print_function_t) ndr_print_netr_DSRDEREGISTERDNSHOSTRECORDS, + "netr_DsrDeregisterDNSHostRecords", + sizeof(struct netr_DsrDeregisterDNSHostRecords), + (ndr_push_flags_fn_t) ndr_push_netr_DsrDeregisterDNSHostRecords, + (ndr_pull_flags_fn_t) ndr_pull_netr_DsrDeregisterDNSHostRecords, + (ndr_print_function_t) ndr_print_netr_DsrDeregisterDNSHostRecords, false, }, { - "netr_NETRSERVERTRUSTPASSWORDSGET", - sizeof(struct netr_NETRSERVERTRUSTPASSWORDSGET), - (ndr_push_flags_fn_t) ndr_push_netr_NETRSERVERTRUSTPASSWORDSGET, - (ndr_pull_flags_fn_t) ndr_pull_netr_NETRSERVERTRUSTPASSWORDSGET, - (ndr_print_function_t) ndr_print_netr_NETRSERVERTRUSTPASSWORDSGET, + "netr_ServerTrustPasswordsGet", + sizeof(struct netr_ServerTrustPasswordsGet), + (ndr_push_flags_fn_t) ndr_push_netr_ServerTrustPasswordsGet, + (ndr_pull_flags_fn_t) ndr_pull_netr_ServerTrustPasswordsGet, + (ndr_print_function_t) ndr_print_netr_ServerTrustPasswordsGet, false, }, { - "netr_DSRGETFORESTTRUSTINFORMATION", - sizeof(struct netr_DSRGETFORESTTRUSTINFORMATION), - (ndr_push_flags_fn_t) ndr_push_netr_DSRGETFORESTTRUSTINFORMATION, - (ndr_pull_flags_fn_t) ndr_pull_netr_DSRGETFORESTTRUSTINFORMATION, - (ndr_print_function_t) ndr_print_netr_DSRGETFORESTTRUSTINFORMATION, + "netr_DsRGetForestTrustInformation", + sizeof(struct netr_DsRGetForestTrustInformation), + (ndr_push_flags_fn_t) ndr_push_netr_DsRGetForestTrustInformation, + (ndr_pull_flags_fn_t) ndr_pull_netr_DsRGetForestTrustInformation, + (ndr_print_function_t) ndr_print_netr_DsRGetForestTrustInformation, false, }, { - "netr_NETRGETFORESTTRUSTINFORMATION", - sizeof(struct netr_NETRGETFORESTTRUSTINFORMATION), - (ndr_push_flags_fn_t) ndr_push_netr_NETRGETFORESTTRUSTINFORMATION, - (ndr_pull_flags_fn_t) ndr_pull_netr_NETRGETFORESTTRUSTINFORMATION, - (ndr_print_function_t) ndr_print_netr_NETRGETFORESTTRUSTINFORMATION, + "netr_GetForestTrustInformation", + sizeof(struct netr_GetForestTrustInformation), + (ndr_push_flags_fn_t) ndr_push_netr_GetForestTrustInformation, + (ndr_pull_flags_fn_t) ndr_pull_netr_GetForestTrustInformation, + (ndr_print_function_t) ndr_print_netr_GetForestTrustInformation, false, }, { diff --git a/source3/librpc/gen_ndr/ndr_netlogon.h b/source3/librpc/gen_ndr/ndr_netlogon.h index 07c96f8c89..9a2eea8eff 100644 --- a/source3/librpc/gen_ndr/ndr_netlogon.h +++ b/source3/librpc/gen_ndr/ndr_netlogon.h @@ -57,7 +57,7 @@ extern const struct ndr_interface_table ndr_table_netlogon; #define NDR_NETR_NETRLOGONSETSERVICEBITS (0x16) -#define NDR_NETR_NETRLOGONGETTRUSTRID (0x17) +#define NDR_NETR_LOGONGETTRUSTRID (0x17) #define NDR_NETR_NETRLOGONCOMPUTESERVERDIGEST (0x18) @@ -73,7 +73,7 @@ extern const struct ndr_interface_table ndr_table_netlogon; #define NDR_NETR_SERVERPASSWORDSET2 (0x1e) -#define NDR_NETR_NETRSERVERPASSWORDGET (0x1f) +#define NDR_NETR_SERVERPASSWORDGET (0x1f) #define NDR_NETR_NETRLOGONSENDTOSAM (0x20) @@ -95,11 +95,11 @@ extern const struct ndr_interface_table ndr_table_netlogon; #define NDR_NETR_DSRDEREGISTERDNSHOSTRECORDS (0x29) -#define NDR_NETR_NETRSERVERTRUSTPASSWORDSGET (0x2a) +#define NDR_NETR_SERVERTRUSTPASSWORDSGET (0x2a) #define NDR_NETR_DSRGETFORESTTRUSTINFORMATION (0x2b) -#define NDR_NETR_NETRGETFORESTTRUSTINFORMATION (0x2c) +#define NDR_NETR_GETFORESTTRUSTINFORMATION (0x2c) #define NDR_NETR_LOGONSAMLOGONWITHFLAGS (0x2d) @@ -109,6 +109,9 @@ extern const struct ndr_interface_table ndr_table_netlogon; void ndr_print_netr_UasInfo(struct ndr_print *ndr, const char *name, const struct netr_UasInfo *r); void ndr_print_netr_UasLogoffInfo(struct ndr_print *ndr, const char *name, const struct netr_UasLogoffInfo *r); void ndr_print_netr_AcctLockStr(struct ndr_print *ndr, const char *name, const struct netr_AcctLockStr *r); +enum ndr_err_code ndr_push_netr_LogonParameterControl(struct ndr_push *ndr, int ndr_flags, uint32_t r); +enum ndr_err_code ndr_pull_netr_LogonParameterControl(struct ndr_pull *ndr, int ndr_flags, uint32_t *r); +void ndr_print_netr_LogonParameterControl(struct ndr_print *ndr, const char *name, uint32_t r); void ndr_print_netr_IdentityInfo(struct ndr_print *ndr, const char *name, const struct netr_IdentityInfo *r); void ndr_print_netr_PasswordInfo(struct ndr_print *ndr, const char *name, const struct netr_PasswordInfo *r); void ndr_print_netr_ChallengeResponse(struct ndr_print *ndr, const char *name, const struct netr_ChallengeResponse *r); @@ -116,9 +119,6 @@ void ndr_print_netr_NetworkInfo(struct ndr_print *ndr, const char *name, const s enum ndr_err_code ndr_push_netr_LogonLevel(struct ndr_push *ndr, int ndr_flags, const union netr_LogonLevel *r); enum ndr_err_code ndr_pull_netr_LogonLevel(struct ndr_pull *ndr, int ndr_flags, union netr_LogonLevel *r); void ndr_print_netr_LogonLevel(struct ndr_print *ndr, const char *name, const union netr_LogonLevel *r); -enum ndr_err_code ndr_push_netr_GroupMembership(struct ndr_push *ndr, int ndr_flags, const struct netr_GroupMembership *r); -enum ndr_err_code ndr_pull_netr_GroupMembership(struct ndr_pull *ndr, int ndr_flags, struct netr_GroupMembership *r); -void ndr_print_netr_GroupMembership(struct ndr_print *ndr, const char *name, const struct netr_GroupMembership *r); enum ndr_err_code ndr_push_netr_UserSessionKey(struct ndr_push *ndr, int ndr_flags, const struct netr_UserSessionKey *r); enum ndr_err_code ndr_pull_netr_UserSessionKey(struct ndr_pull *ndr, int ndr_flags, struct netr_UserSessionKey *r); void ndr_print_netr_UserSessionKey(struct ndr_print *ndr, const char *name, const struct netr_UserSessionKey *r); @@ -183,8 +183,11 @@ void ndr_print_netr_NETLOGON_INFO_3(struct ndr_print *ndr, const char *name, con void ndr_print_netr_CONTROL_QUERY_INFORMATION(struct ndr_print *ndr, const char *name, const union netr_CONTROL_QUERY_INFORMATION *r); void ndr_print_netr_LogonControlCode(struct ndr_print *ndr, const char *name, enum netr_LogonControlCode r); void ndr_print_netr_CONTROL_DATA_INFORMATION(struct ndr_print *ndr, const char *name, const union netr_CONTROL_DATA_INFORMATION *r); -void ndr_print_netr_DsRGetDCNameInfo(struct ndr_print *ndr, const char *name, const struct netr_DsRGetDCNameInfo *r); void ndr_print_netr_Blob(struct ndr_print *ndr, const char *name, const struct netr_Blob *r); +void ndr_print_netr_DsRGetDCName_flags(struct ndr_print *ndr, const char *name, uint32_t r); +void ndr_print_netr_DsRGetDCNameInfo_AddressType(struct ndr_print *ndr, const char *name, enum netr_DsRGetDCNameInfo_AddressType r); +void ndr_print_netr_DsR_DcFlags(struct ndr_print *ndr, const char *name, uint32_t r); +void ndr_print_netr_DsRGetDCNameInfo(struct ndr_print *ndr, const char *name, const struct netr_DsRGetDCNameInfo *r); void ndr_print_netr_BinaryString(struct ndr_print *ndr, const char *name, const struct netr_BinaryString *r); void ndr_print_netr_DomainQuery1(struct ndr_print *ndr, const char *name, const struct netr_DomainQuery1 *r); void ndr_print_netr_DomainQuery(struct ndr_print *ndr, const char *name, const union netr_DomainQuery *r); @@ -192,10 +195,15 @@ void ndr_print_netr_DomainTrustInfo(struct ndr_print *ndr, const char *name, con void ndr_print_netr_DomainInfo1(struct ndr_print *ndr, const char *name, const struct netr_DomainInfo1 *r); void ndr_print_netr_DomainInfo(struct ndr_print *ndr, const char *name, const union netr_DomainInfo *r); void ndr_print_netr_CryptPassword(struct ndr_print *ndr, const char *name, const struct netr_CryptPassword *r); +void ndr_print_netr_DsRAddressToSitenamesWCtr(struct ndr_print *ndr, const char *name, const struct netr_DsRAddressToSitenamesWCtr *r); +void ndr_print_netr_DsRAddress(struct ndr_print *ndr, const char *name, const struct netr_DsRAddress *r); void ndr_print_netr_TrustFlags(struct ndr_print *ndr, const char *name, uint32_t r); void ndr_print_netr_TrustType(struct ndr_print *ndr, const char *name, enum netr_TrustType r); void ndr_print_netr_TrustAttributes(struct ndr_print *ndr, const char *name, uint32_t r); void ndr_print_netr_DomainTrust(struct ndr_print *ndr, const char *name, const struct netr_DomainTrust *r); +void ndr_print_netr_DomainTrustList(struct ndr_print *ndr, const char *name, const struct netr_DomainTrustList *r); +void ndr_print_netr_DsRAddressToSitenamesExWCtr(struct ndr_print *ndr, const char *name, const struct netr_DsRAddressToSitenamesExWCtr *r); +void ndr_print_DcSitesCtr(struct ndr_print *ndr, const char *name, const struct DcSitesCtr *r); void ndr_print_netr_LogonUasLogon(struct ndr_print *ndr, const char *name, int flags, const struct netr_LogonUasLogon *r); void ndr_print_netr_LogonUasLogoff(struct ndr_print *ndr, const char *name, int flags, const struct netr_LogonUasLogoff *r); void ndr_print_netr_LogonSamLogon(struct ndr_print *ndr, const char *name, int flags, const struct netr_LogonSamLogon *r); @@ -215,11 +223,11 @@ void ndr_print_netr_ServerAuthenticate2(struct ndr_print *ndr, const char *name, void ndr_print_netr_DatabaseSync2(struct ndr_print *ndr, const char *name, int flags, const struct netr_DatabaseSync2 *r); void ndr_print_netr_DatabaseRedo(struct ndr_print *ndr, const char *name, int flags, const struct netr_DatabaseRedo *r); void ndr_print_netr_LogonControl2Ex(struct ndr_print *ndr, const char *name, int flags, const struct netr_LogonControl2Ex *r); -void ndr_print_netr_NETRENUMERATETRUSTEDDOMAINS(struct ndr_print *ndr, const char *name, int flags, const struct netr_NETRENUMERATETRUSTEDDOMAINS *r); +void ndr_print_netr_NetrEnumerateTrustedDomains(struct ndr_print *ndr, const char *name, int flags, const struct netr_NetrEnumerateTrustedDomains *r); void ndr_print_netr_DsRGetDCName(struct ndr_print *ndr, const char *name, int flags, const struct netr_DsRGetDCName *r); void ndr_print_netr_NETRLOGONDUMMYROUTINE1(struct ndr_print *ndr, const char *name, int flags, const struct netr_NETRLOGONDUMMYROUTINE1 *r); void ndr_print_netr_NETRLOGONSETSERVICEBITS(struct ndr_print *ndr, const char *name, int flags, const struct netr_NETRLOGONSETSERVICEBITS *r); -void ndr_print_netr_NETRLOGONGETTRUSTRID(struct ndr_print *ndr, const char *name, int flags, const struct netr_NETRLOGONGETTRUSTRID *r); +void ndr_print_netr_LogonGetTrustRid(struct ndr_print *ndr, const char *name, int flags, const struct netr_LogonGetTrustRid *r); void ndr_print_netr_NETRLOGONCOMPUTESERVERDIGEST(struct ndr_print *ndr, const char *name, int flags, const struct netr_NETRLOGONCOMPUTESERVERDIGEST *r); void ndr_print_netr_NETRLOGONCOMPUTECLIENTDIGEST(struct ndr_print *ndr, const char *name, int flags, const struct netr_NETRLOGONCOMPUTECLIENTDIGEST *r); void ndr_print_netr_ServerAuthenticate3(struct ndr_print *ndr, const char *name, int flags, const struct netr_ServerAuthenticate3 *r); @@ -227,20 +235,20 @@ void ndr_print_netr_DsRGetDCNameEx(struct ndr_print *ndr, const char *name, int void ndr_print_netr_DsRGetSiteName(struct ndr_print *ndr, const char *name, int flags, const struct netr_DsRGetSiteName *r); void ndr_print_netr_LogonGetDomainInfo(struct ndr_print *ndr, const char *name, int flags, const struct netr_LogonGetDomainInfo *r); void ndr_print_netr_ServerPasswordSet2(struct ndr_print *ndr, const char *name, int flags, const struct netr_ServerPasswordSet2 *r); -void ndr_print_netr_NETRSERVERPASSWORDGET(struct ndr_print *ndr, const char *name, int flags, const struct netr_NETRSERVERPASSWORDGET *r); +void ndr_print_netr_ServerPasswordGet(struct ndr_print *ndr, const char *name, int flags, const struct netr_ServerPasswordGet *r); void ndr_print_netr_NETRLOGONSENDTOSAM(struct ndr_print *ndr, const char *name, int flags, const struct netr_NETRLOGONSENDTOSAM *r); -void ndr_print_netr_DSRADDRESSTOSITENAMESW(struct ndr_print *ndr, const char *name, int flags, const struct netr_DSRADDRESSTOSITENAMESW *r); +void ndr_print_netr_DsRAddressToSitenamesW(struct ndr_print *ndr, const char *name, int flags, const struct netr_DsRAddressToSitenamesW *r); void ndr_print_netr_DsRGetDCNameEx2(struct ndr_print *ndr, const char *name, int flags, const struct netr_DsRGetDCNameEx2 *r); void ndr_print_netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN(struct ndr_print *ndr, const char *name, int flags, const struct netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN *r); -void ndr_print_netr_NETRENUMERATETRUSTEDDOMAINSEX(struct ndr_print *ndr, const char *name, int flags, const struct netr_NETRENUMERATETRUSTEDDOMAINSEX *r); -void ndr_print_netr_DSRADDRESSTOSITENAMESEXW(struct ndr_print *ndr, const char *name, int flags, const struct netr_DSRADDRESSTOSITENAMESEXW *r); -void ndr_print_netr_DSRGETDCSITECOVERAGEW(struct ndr_print *ndr, const char *name, int flags, const struct netr_DSRGETDCSITECOVERAGEW *r); +void ndr_print_netr_NetrEnumerateTrustedDomainsEx(struct ndr_print *ndr, const char *name, int flags, const struct netr_NetrEnumerateTrustedDomainsEx *r); +void ndr_print_netr_DsRAddressToSitenamesExW(struct ndr_print *ndr, const char *name, int flags, const struct netr_DsRAddressToSitenamesExW *r); +void ndr_print_netr_DsrGetDcSiteCoverageW(struct ndr_print *ndr, const char *name, int flags, const struct netr_DsrGetDcSiteCoverageW *r); void ndr_print_netr_LogonSamLogonEx(struct ndr_print *ndr, const char *name, int flags, const struct netr_LogonSamLogonEx *r); void ndr_print_netr_DsrEnumerateDomainTrusts(struct ndr_print *ndr, const char *name, int flags, const struct netr_DsrEnumerateDomainTrusts *r); -void ndr_print_netr_DSRDEREGISTERDNSHOSTRECORDS(struct ndr_print *ndr, const char *name, int flags, const struct netr_DSRDEREGISTERDNSHOSTRECORDS *r); -void ndr_print_netr_NETRSERVERTRUSTPASSWORDSGET(struct ndr_print *ndr, const char *name, int flags, const struct netr_NETRSERVERTRUSTPASSWORDSGET *r); -void ndr_print_netr_DSRGETFORESTTRUSTINFORMATION(struct ndr_print *ndr, const char *name, int flags, const struct netr_DSRGETFORESTTRUSTINFORMATION *r); -void ndr_print_netr_NETRGETFORESTTRUSTINFORMATION(struct ndr_print *ndr, const char *name, int flags, const struct netr_NETRGETFORESTTRUSTINFORMATION *r); +void ndr_print_netr_DsrDeregisterDNSHostRecords(struct ndr_print *ndr, const char *name, int flags, const struct netr_DsrDeregisterDNSHostRecords *r); +void ndr_print_netr_ServerTrustPasswordsGet(struct ndr_print *ndr, const char *name, int flags, const struct netr_ServerTrustPasswordsGet *r); +void ndr_print_netr_DsRGetForestTrustInformation(struct ndr_print *ndr, const char *name, int flags, const struct netr_DsRGetForestTrustInformation *r); +void ndr_print_netr_GetForestTrustInformation(struct ndr_print *ndr, const char *name, int flags, const struct netr_GetForestTrustInformation *r); void ndr_print_netr_LogonSamLogonWithFlags(struct ndr_print *ndr, const char *name, int flags, const struct netr_LogonSamLogonWithFlags *r); void ndr_print_netr_NETRSERVERGETTRUSTINFO(struct ndr_print *ndr, const char *name, int flags, const struct netr_NETRSERVERGETTRUSTINFO *r); #endif /* _HEADER_NDR_netlogon */ diff --git a/source3/librpc/gen_ndr/ndr_notify.c b/source3/librpc/gen_ndr/ndr_notify.c index 8abfdfdf92..195d421408 100644 --- a/source3/librpc/gen_ndr/ndr_notify.c +++ b/source3/librpc/gen_ndr/ndr_notify.c @@ -120,8 +120,7 @@ _PUBLIC_ void ndr_print_notify_depth(struct ndr_print *ndr, const char *name, co ndr->depth++; for (cntr_entries_0=0;cntr_entries_0<r->num_entries;cntr_entries_0++) { char *idx_0=NULL; - asprintf(&idx_0, "[%d]", cntr_entries_0); - if (idx_0) { + if (asprintf(&idx_0, "[%d]", cntr_entries_0) != -1) { ndr_print_notify_entry(ndr, "entries", &r->entries[cntr_entries_0]); free(idx_0); } @@ -184,8 +183,7 @@ _PUBLIC_ void ndr_print_notify_array(struct ndr_print *ndr, const char *name, co ndr->depth++; for (cntr_depth_0=0;cntr_depth_0<r->num_depths;cntr_depth_0++) { char *idx_0=NULL; - asprintf(&idx_0, "[%d]", cntr_depth_0); - if (idx_0) { + if (asprintf(&idx_0, "[%d]", cntr_depth_0) != -1) { ndr_print_notify_depth(ndr, "depth", &r->depth[cntr_depth_0]); free(idx_0); } diff --git a/source3/librpc/gen_ndr/ndr_ntsvcs.c b/source3/librpc/gen_ndr/ndr_ntsvcs.c new file mode 100644 index 0000000000..9a0e2bcf4f --- /dev/null +++ b/source3/librpc/gen_ndr/ndr_ntsvcs.c @@ -0,0 +1,3616 @@ +/* parser auto-generated by pidl */ + +#include "includes.h" +#include "librpc/gen_ndr/ndr_ntsvcs.h" + +static enum ndr_err_code ndr_push_PNP_HwProfInfo(struct ndr_push *ndr, int ndr_flags, const struct PNP_HwProfInfo *r) +{ + uint32_t cntr_unknown2_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown1)); + for (cntr_unknown2_0 = 0; cntr_unknown2_0 < 160; cntr_unknown2_0++) { + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->unknown2[cntr_unknown2_0])); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown3)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_PNP_HwProfInfo(struct ndr_pull *ndr, int ndr_flags, struct PNP_HwProfInfo *r) +{ + uint32_t cntr_unknown2_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown1)); + for (cntr_unknown2_0 = 0; cntr_unknown2_0 < 160; cntr_unknown2_0++) { + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->unknown2[cntr_unknown2_0])); + } + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown3)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_PNP_HwProfInfo(struct ndr_print *ndr, const char *name, const struct PNP_HwProfInfo *r) +{ + uint32_t cntr_unknown2_0; + ndr_print_struct(ndr, name, "PNP_HwProfInfo"); + ndr->depth++; + ndr_print_uint32(ndr, "unknown1", r->unknown1); + ndr->print(ndr, "%s: ARRAY(%d)", "unknown2", 160); + ndr->depth++; + for (cntr_unknown2_0=0;cntr_unknown2_0<160;cntr_unknown2_0++) { + char *idx_0=NULL; + if (asprintf(&idx_0, "[%d]", cntr_unknown2_0) != -1) { + ndr_print_uint16(ndr, "unknown2", r->unknown2[cntr_unknown2_0]); + free(idx_0); + } + } + ndr->depth--; + ndr_print_uint32(ndr, "unknown3", r->unknown3); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_PNP_Disconnect(struct ndr_push *ndr, int flags, const struct PNP_Disconnect *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_PNP_Disconnect(struct ndr_pull *ndr, int flags, struct PNP_Disconnect *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_PNP_Disconnect(struct ndr_print *ndr, const char *name, int flags, const struct PNP_Disconnect *r) +{ + ndr_print_struct(ndr, name, "PNP_Disconnect"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "PNP_Disconnect"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "PNP_Disconnect"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_PNP_Connect(struct ndr_push *ndr, int flags, const struct PNP_Connect *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_PNP_Connect(struct ndr_pull *ndr, int flags, struct PNP_Connect *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_PNP_Connect(struct ndr_print *ndr, const char *name, int flags, const struct PNP_Connect *r) +{ + ndr_print_struct(ndr, name, "PNP_Connect"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "PNP_Connect"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "PNP_Connect"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_PNP_GetVersion(struct ndr_push *ndr, int flags, const struct PNP_GetVersion *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + if (r->out.version == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, *r->out.version)); + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_PNP_GetVersion(struct ndr_pull *ndr, int flags, struct PNP_GetVersion *r) +{ + TALLOC_CTX *_mem_save_version_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + NDR_PULL_ALLOC(ndr, r->out.version); + ZERO_STRUCTP(r->out.version); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.version); + } + _mem_save_version_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.version, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, r->out.version)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_version_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_PNP_GetVersion(struct ndr_print *ndr, const char *name, int flags, const struct PNP_GetVersion *r) +{ + ndr_print_struct(ndr, name, "PNP_GetVersion"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "PNP_GetVersion"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "PNP_GetVersion"); + ndr->depth++; + ndr_print_ptr(ndr, "version", r->out.version); + ndr->depth++; + ndr_print_uint16(ndr, "version", *r->out.version); + ndr->depth--; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_PNP_GetGlobalState(struct ndr_push *ndr, int flags, const struct PNP_GetGlobalState *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_PNP_GetGlobalState(struct ndr_pull *ndr, int flags, struct PNP_GetGlobalState *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_PNP_GetGlobalState(struct ndr_print *ndr, const char *name, int flags, const struct PNP_GetGlobalState *r) +{ + ndr_print_struct(ndr, name, "PNP_GetGlobalState"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "PNP_GetGlobalState"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "PNP_GetGlobalState"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_PNP_InitDetection(struct ndr_push *ndr, int flags, const struct PNP_InitDetection *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_PNP_InitDetection(struct ndr_pull *ndr, int flags, struct PNP_InitDetection *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_PNP_InitDetection(struct ndr_print *ndr, const char *name, int flags, const struct PNP_InitDetection *r) +{ + ndr_print_struct(ndr, name, "PNP_InitDetection"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "PNP_InitDetection"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "PNP_InitDetection"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_PNP_ReportLogOn(struct ndr_push *ndr, int flags, const struct PNP_ReportLogOn *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_PNP_ReportLogOn(struct ndr_pull *ndr, int flags, struct PNP_ReportLogOn *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_PNP_ReportLogOn(struct ndr_print *ndr, const char *name, int flags, const struct PNP_ReportLogOn *r) +{ + ndr_print_struct(ndr, name, "PNP_ReportLogOn"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "PNP_ReportLogOn"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "PNP_ReportLogOn"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_PNP_ValidateDeviceInstance(struct ndr_push *ndr, int flags, const struct PNP_ValidateDeviceInstance *r) +{ + if (flags & NDR_IN) { + if (r->in.devicepath == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.devicepath, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.devicepath, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.devicepath, ndr_charset_length(r->in.devicepath, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.flags)); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_PNP_ValidateDeviceInstance(struct ndr_pull *ndr, int flags, struct PNP_ValidateDeviceInstance *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.devicepath)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.devicepath)); + if (ndr_get_array_length(ndr, &r->in.devicepath) > ndr_get_array_size(ndr, &r->in.devicepath)) { + 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.devicepath), ndr_get_array_length(ndr, &r->in.devicepath)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.devicepath), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.devicepath, ndr_get_array_length(ndr, &r->in.devicepath), sizeof(uint16_t), CH_UTF16)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.flags)); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_PNP_ValidateDeviceInstance(struct ndr_print *ndr, const char *name, int flags, const struct PNP_ValidateDeviceInstance *r) +{ + ndr_print_struct(ndr, name, "PNP_ValidateDeviceInstance"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "PNP_ValidateDeviceInstance"); + ndr->depth++; + ndr_print_ptr(ndr, "devicepath", r->in.devicepath); + ndr->depth++; + ndr_print_string(ndr, "devicepath", r->in.devicepath); + ndr->depth--; + ndr_print_uint32(ndr, "flags", r->in.flags); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "PNP_ValidateDeviceInstance"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_PNP_GetRootDeviceInstance(struct ndr_push *ndr, int flags, const struct PNP_GetRootDeviceInstance *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_PNP_GetRootDeviceInstance(struct ndr_pull *ndr, int flags, struct PNP_GetRootDeviceInstance *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_PNP_GetRootDeviceInstance(struct ndr_print *ndr, const char *name, int flags, const struct PNP_GetRootDeviceInstance *r) +{ + ndr_print_struct(ndr, name, "PNP_GetRootDeviceInstance"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "PNP_GetRootDeviceInstance"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "PNP_GetRootDeviceInstance"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_PNP_GetRelatedDeviceInstance(struct ndr_push *ndr, int flags, const struct PNP_GetRelatedDeviceInstance *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_PNP_GetRelatedDeviceInstance(struct ndr_pull *ndr, int flags, struct PNP_GetRelatedDeviceInstance *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_PNP_GetRelatedDeviceInstance(struct ndr_print *ndr, const char *name, int flags, const struct PNP_GetRelatedDeviceInstance *r) +{ + ndr_print_struct(ndr, name, "PNP_GetRelatedDeviceInstance"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "PNP_GetRelatedDeviceInstance"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "PNP_GetRelatedDeviceInstance"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_PNP_EnumerateSubKeys(struct ndr_push *ndr, int flags, const struct PNP_EnumerateSubKeys *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_PNP_EnumerateSubKeys(struct ndr_pull *ndr, int flags, struct PNP_EnumerateSubKeys *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_PNP_EnumerateSubKeys(struct ndr_print *ndr, const char *name, int flags, const struct PNP_EnumerateSubKeys *r) +{ + ndr_print_struct(ndr, name, "PNP_EnumerateSubKeys"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "PNP_EnumerateSubKeys"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "PNP_EnumerateSubKeys"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_PNP_GetDeviceList(struct ndr_push *ndr, int flags, const struct PNP_GetDeviceList *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_PNP_GetDeviceList(struct ndr_pull *ndr, int flags, struct PNP_GetDeviceList *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_PNP_GetDeviceList(struct ndr_print *ndr, const char *name, int flags, const struct PNP_GetDeviceList *r) +{ + ndr_print_struct(ndr, name, "PNP_GetDeviceList"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "PNP_GetDeviceList"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "PNP_GetDeviceList"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_PNP_GetDeviceListSize(struct ndr_push *ndr, int flags, const struct PNP_GetDeviceListSize *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.devicename)); + if (r->in.devicename) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.devicename, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.devicename, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.devicename, ndr_charset_length(r->in.devicename, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.flags)); + } + if (flags & NDR_OUT) { + if (r->out.size == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.size)); + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_PNP_GetDeviceListSize(struct ndr_pull *ndr, int flags, struct PNP_GetDeviceListSize *r) +{ + uint32_t _ptr_devicename; + TALLOC_CTX *_mem_save_devicename_0; + TALLOC_CTX *_mem_save_size_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_devicename)); + if (_ptr_devicename) { + NDR_PULL_ALLOC(ndr, r->in.devicename); + } else { + r->in.devicename = NULL; + } + if (r->in.devicename) { + _mem_save_devicename_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.devicename, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.devicename)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.devicename)); + if (ndr_get_array_length(ndr, &r->in.devicename) > ndr_get_array_size(ndr, &r->in.devicename)) { + 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.devicename), ndr_get_array_length(ndr, &r->in.devicename)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.devicename), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.devicename, ndr_get_array_length(ndr, &r->in.devicename), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_devicename_0, 0); + } + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.flags)); + NDR_PULL_ALLOC(ndr, r->out.size); + ZERO_STRUCTP(r->out.size); + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.size); + } + _mem_save_size_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.size, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.size)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_size_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_PNP_GetDeviceListSize(struct ndr_print *ndr, const char *name, int flags, const struct PNP_GetDeviceListSize *r) +{ + ndr_print_struct(ndr, name, "PNP_GetDeviceListSize"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "PNP_GetDeviceListSize"); + ndr->depth++; + ndr_print_ptr(ndr, "devicename", r->in.devicename); + ndr->depth++; + if (r->in.devicename) { + ndr_print_string(ndr, "devicename", r->in.devicename); + } + ndr->depth--; + ndr_print_uint32(ndr, "flags", r->in.flags); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "PNP_GetDeviceListSize"); + ndr->depth++; + ndr_print_ptr(ndr, "size", r->out.size); + ndr->depth++; + ndr_print_uint32(ndr, "size", *r->out.size); + ndr->depth--; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_PNP_GetDepth(struct ndr_push *ndr, int flags, const struct PNP_GetDepth *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_PNP_GetDepth(struct ndr_pull *ndr, int flags, struct PNP_GetDepth *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_PNP_GetDepth(struct ndr_print *ndr, const char *name, int flags, const struct PNP_GetDepth *r) +{ + ndr_print_struct(ndr, name, "PNP_GetDepth"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "PNP_GetDepth"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "PNP_GetDepth"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_PNP_GetDeviceRegProp(struct ndr_push *ndr, int flags, const struct PNP_GetDeviceRegProp *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_PNP_GetDeviceRegProp(struct ndr_pull *ndr, int flags, struct PNP_GetDeviceRegProp *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_PNP_GetDeviceRegProp(struct ndr_print *ndr, const char *name, int flags, const struct PNP_GetDeviceRegProp *r) +{ + ndr_print_struct(ndr, name, "PNP_GetDeviceRegProp"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "PNP_GetDeviceRegProp"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "PNP_GetDeviceRegProp"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_PNP_SetDeviceRegProp(struct ndr_push *ndr, int flags, const struct PNP_SetDeviceRegProp *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_PNP_SetDeviceRegProp(struct ndr_pull *ndr, int flags, struct PNP_SetDeviceRegProp *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_PNP_SetDeviceRegProp(struct ndr_print *ndr, const char *name, int flags, const struct PNP_SetDeviceRegProp *r) +{ + ndr_print_struct(ndr, name, "PNP_SetDeviceRegProp"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "PNP_SetDeviceRegProp"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "PNP_SetDeviceRegProp"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_PNP_GetClassInstance(struct ndr_push *ndr, int flags, const struct PNP_GetClassInstance *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_PNP_GetClassInstance(struct ndr_pull *ndr, int flags, struct PNP_GetClassInstance *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_PNP_GetClassInstance(struct ndr_print *ndr, const char *name, int flags, const struct PNP_GetClassInstance *r) +{ + ndr_print_struct(ndr, name, "PNP_GetClassInstance"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "PNP_GetClassInstance"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "PNP_GetClassInstance"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_PNP_CreateKey(struct ndr_push *ndr, int flags, const struct PNP_CreateKey *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_PNP_CreateKey(struct ndr_pull *ndr, int flags, struct PNP_CreateKey *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_PNP_CreateKey(struct ndr_print *ndr, const char *name, int flags, const struct PNP_CreateKey *r) +{ + ndr_print_struct(ndr, name, "PNP_CreateKey"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "PNP_CreateKey"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "PNP_CreateKey"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_PNP_DeleteRegistryKey(struct ndr_push *ndr, int flags, const struct PNP_DeleteRegistryKey *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_PNP_DeleteRegistryKey(struct ndr_pull *ndr, int flags, struct PNP_DeleteRegistryKey *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_PNP_DeleteRegistryKey(struct ndr_print *ndr, const char *name, int flags, const struct PNP_DeleteRegistryKey *r) +{ + ndr_print_struct(ndr, name, "PNP_DeleteRegistryKey"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "PNP_DeleteRegistryKey"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "PNP_DeleteRegistryKey"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_PNP_GetClassCount(struct ndr_push *ndr, int flags, const struct PNP_GetClassCount *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_PNP_GetClassCount(struct ndr_pull *ndr, int flags, struct PNP_GetClassCount *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_PNP_GetClassCount(struct ndr_print *ndr, const char *name, int flags, const struct PNP_GetClassCount *r) +{ + ndr_print_struct(ndr, name, "PNP_GetClassCount"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "PNP_GetClassCount"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "PNP_GetClassCount"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_PNP_GetClassName(struct ndr_push *ndr, int flags, const struct PNP_GetClassName *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_PNP_GetClassName(struct ndr_pull *ndr, int flags, struct PNP_GetClassName *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_PNP_GetClassName(struct ndr_print *ndr, const char *name, int flags, const struct PNP_GetClassName *r) +{ + ndr_print_struct(ndr, name, "PNP_GetClassName"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "PNP_GetClassName"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "PNP_GetClassName"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_PNP_DeleteClassKey(struct ndr_push *ndr, int flags, const struct PNP_DeleteClassKey *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_PNP_DeleteClassKey(struct ndr_pull *ndr, int flags, struct PNP_DeleteClassKey *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_PNP_DeleteClassKey(struct ndr_print *ndr, const char *name, int flags, const struct PNP_DeleteClassKey *r) +{ + ndr_print_struct(ndr, name, "PNP_DeleteClassKey"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "PNP_DeleteClassKey"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "PNP_DeleteClassKey"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_PNP_GetInterfaceDeviceAlias(struct ndr_push *ndr, int flags, const struct PNP_GetInterfaceDeviceAlias *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_PNP_GetInterfaceDeviceAlias(struct ndr_pull *ndr, int flags, struct PNP_GetInterfaceDeviceAlias *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_PNP_GetInterfaceDeviceAlias(struct ndr_print *ndr, const char *name, int flags, const struct PNP_GetInterfaceDeviceAlias *r) +{ + ndr_print_struct(ndr, name, "PNP_GetInterfaceDeviceAlias"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "PNP_GetInterfaceDeviceAlias"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "PNP_GetInterfaceDeviceAlias"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_PNP_GetInterfaceDeviceList(struct ndr_push *ndr, int flags, const struct PNP_GetInterfaceDeviceList *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_PNP_GetInterfaceDeviceList(struct ndr_pull *ndr, int flags, struct PNP_GetInterfaceDeviceList *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_PNP_GetInterfaceDeviceList(struct ndr_print *ndr, const char *name, int flags, const struct PNP_GetInterfaceDeviceList *r) +{ + ndr_print_struct(ndr, name, "PNP_GetInterfaceDeviceList"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "PNP_GetInterfaceDeviceList"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "PNP_GetInterfaceDeviceList"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_PNP_GetInterfaceDeviceListSize(struct ndr_push *ndr, int flags, const struct PNP_GetInterfaceDeviceListSize *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_PNP_GetInterfaceDeviceListSize(struct ndr_pull *ndr, int flags, struct PNP_GetInterfaceDeviceListSize *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_PNP_GetInterfaceDeviceListSize(struct ndr_print *ndr, const char *name, int flags, const struct PNP_GetInterfaceDeviceListSize *r) +{ + ndr_print_struct(ndr, name, "PNP_GetInterfaceDeviceListSize"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "PNP_GetInterfaceDeviceListSize"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "PNP_GetInterfaceDeviceListSize"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_PNP_RegisterDeviceClassAssociation(struct ndr_push *ndr, int flags, const struct PNP_RegisterDeviceClassAssociation *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_PNP_RegisterDeviceClassAssociation(struct ndr_pull *ndr, int flags, struct PNP_RegisterDeviceClassAssociation *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_PNP_RegisterDeviceClassAssociation(struct ndr_print *ndr, const char *name, int flags, const struct PNP_RegisterDeviceClassAssociation *r) +{ + ndr_print_struct(ndr, name, "PNP_RegisterDeviceClassAssociation"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "PNP_RegisterDeviceClassAssociation"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "PNP_RegisterDeviceClassAssociation"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_PNP_UnregisterDeviceClassAssociation(struct ndr_push *ndr, int flags, const struct PNP_UnregisterDeviceClassAssociation *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_PNP_UnregisterDeviceClassAssociation(struct ndr_pull *ndr, int flags, struct PNP_UnregisterDeviceClassAssociation *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_PNP_UnregisterDeviceClassAssociation(struct ndr_print *ndr, const char *name, int flags, const struct PNP_UnregisterDeviceClassAssociation *r) +{ + ndr_print_struct(ndr, name, "PNP_UnregisterDeviceClassAssociation"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "PNP_UnregisterDeviceClassAssociation"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "PNP_UnregisterDeviceClassAssociation"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_PNP_GetClassRegProp(struct ndr_push *ndr, int flags, const struct PNP_GetClassRegProp *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_PNP_GetClassRegProp(struct ndr_pull *ndr, int flags, struct PNP_GetClassRegProp *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_PNP_GetClassRegProp(struct ndr_print *ndr, const char *name, int flags, const struct PNP_GetClassRegProp *r) +{ + ndr_print_struct(ndr, name, "PNP_GetClassRegProp"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "PNP_GetClassRegProp"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "PNP_GetClassRegProp"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_PNP_SetClassRegProp(struct ndr_push *ndr, int flags, const struct PNP_SetClassRegProp *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_PNP_SetClassRegProp(struct ndr_pull *ndr, int flags, struct PNP_SetClassRegProp *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_PNP_SetClassRegProp(struct ndr_print *ndr, const char *name, int flags, const struct PNP_SetClassRegProp *r) +{ + ndr_print_struct(ndr, name, "PNP_SetClassRegProp"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "PNP_SetClassRegProp"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "PNP_SetClassRegProp"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_PNP_CreateDevInst(struct ndr_push *ndr, int flags, const struct PNP_CreateDevInst *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_PNP_CreateDevInst(struct ndr_pull *ndr, int flags, struct PNP_CreateDevInst *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_PNP_CreateDevInst(struct ndr_print *ndr, const char *name, int flags, const struct PNP_CreateDevInst *r) +{ + ndr_print_struct(ndr, name, "PNP_CreateDevInst"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "PNP_CreateDevInst"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "PNP_CreateDevInst"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_PNP_DeviceInstanceAction(struct ndr_push *ndr, int flags, const struct PNP_DeviceInstanceAction *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_PNP_DeviceInstanceAction(struct ndr_pull *ndr, int flags, struct PNP_DeviceInstanceAction *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_PNP_DeviceInstanceAction(struct ndr_print *ndr, const char *name, int flags, const struct PNP_DeviceInstanceAction *r) +{ + ndr_print_struct(ndr, name, "PNP_DeviceInstanceAction"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "PNP_DeviceInstanceAction"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "PNP_DeviceInstanceAction"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_PNP_GetDeviceStatus(struct ndr_push *ndr, int flags, const struct PNP_GetDeviceStatus *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_PNP_GetDeviceStatus(struct ndr_pull *ndr, int flags, struct PNP_GetDeviceStatus *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_PNP_GetDeviceStatus(struct ndr_print *ndr, const char *name, int flags, const struct PNP_GetDeviceStatus *r) +{ + ndr_print_struct(ndr, name, "PNP_GetDeviceStatus"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "PNP_GetDeviceStatus"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "PNP_GetDeviceStatus"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_PNP_SetDeviceProblem(struct ndr_push *ndr, int flags, const struct PNP_SetDeviceProblem *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_PNP_SetDeviceProblem(struct ndr_pull *ndr, int flags, struct PNP_SetDeviceProblem *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_PNP_SetDeviceProblem(struct ndr_print *ndr, const char *name, int flags, const struct PNP_SetDeviceProblem *r) +{ + ndr_print_struct(ndr, name, "PNP_SetDeviceProblem"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "PNP_SetDeviceProblem"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "PNP_SetDeviceProblem"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_PNP_DisableDevInst(struct ndr_push *ndr, int flags, const struct PNP_DisableDevInst *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_PNP_DisableDevInst(struct ndr_pull *ndr, int flags, struct PNP_DisableDevInst *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_PNP_DisableDevInst(struct ndr_print *ndr, const char *name, int flags, const struct PNP_DisableDevInst *r) +{ + ndr_print_struct(ndr, name, "PNP_DisableDevInst"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "PNP_DisableDevInst"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "PNP_DisableDevInst"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_PNP_UninstallDevInst(struct ndr_push *ndr, int flags, const struct PNP_UninstallDevInst *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_PNP_UninstallDevInst(struct ndr_pull *ndr, int flags, struct PNP_UninstallDevInst *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_PNP_UninstallDevInst(struct ndr_print *ndr, const char *name, int flags, const struct PNP_UninstallDevInst *r) +{ + ndr_print_struct(ndr, name, "PNP_UninstallDevInst"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "PNP_UninstallDevInst"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "PNP_UninstallDevInst"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_PNP_AddID(struct ndr_push *ndr, int flags, const struct PNP_AddID *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_PNP_AddID(struct ndr_pull *ndr, int flags, struct PNP_AddID *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_PNP_AddID(struct ndr_print *ndr, const char *name, int flags, const struct PNP_AddID *r) +{ + ndr_print_struct(ndr, name, "PNP_AddID"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "PNP_AddID"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "PNP_AddID"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_PNP_RegisterDriver(struct ndr_push *ndr, int flags, const struct PNP_RegisterDriver *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_PNP_RegisterDriver(struct ndr_pull *ndr, int flags, struct PNP_RegisterDriver *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_PNP_RegisterDriver(struct ndr_print *ndr, const char *name, int flags, const struct PNP_RegisterDriver *r) +{ + ndr_print_struct(ndr, name, "PNP_RegisterDriver"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "PNP_RegisterDriver"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "PNP_RegisterDriver"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_PNP_QueryRemove(struct ndr_push *ndr, int flags, const struct PNP_QueryRemove *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_PNP_QueryRemove(struct ndr_pull *ndr, int flags, struct PNP_QueryRemove *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_PNP_QueryRemove(struct ndr_print *ndr, const char *name, int flags, const struct PNP_QueryRemove *r) +{ + ndr_print_struct(ndr, name, "PNP_QueryRemove"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "PNP_QueryRemove"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "PNP_QueryRemove"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_PNP_RequestDeviceEject(struct ndr_push *ndr, int flags, const struct PNP_RequestDeviceEject *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_PNP_RequestDeviceEject(struct ndr_pull *ndr, int flags, struct PNP_RequestDeviceEject *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_PNP_RequestDeviceEject(struct ndr_print *ndr, const char *name, int flags, const struct PNP_RequestDeviceEject *r) +{ + ndr_print_struct(ndr, name, "PNP_RequestDeviceEject"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "PNP_RequestDeviceEject"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "PNP_RequestDeviceEject"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_PNP_IsDockStationPresent(struct ndr_push *ndr, int flags, const struct PNP_IsDockStationPresent *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_PNP_IsDockStationPresent(struct ndr_pull *ndr, int flags, struct PNP_IsDockStationPresent *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_PNP_IsDockStationPresent(struct ndr_print *ndr, const char *name, int flags, const struct PNP_IsDockStationPresent *r) +{ + ndr_print_struct(ndr, name, "PNP_IsDockStationPresent"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "PNP_IsDockStationPresent"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "PNP_IsDockStationPresent"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_PNP_RequestEjectPC(struct ndr_push *ndr, int flags, const struct PNP_RequestEjectPC *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_PNP_RequestEjectPC(struct ndr_pull *ndr, int flags, struct PNP_RequestEjectPC *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_PNP_RequestEjectPC(struct ndr_print *ndr, const char *name, int flags, const struct PNP_RequestEjectPC *r) +{ + ndr_print_struct(ndr, name, "PNP_RequestEjectPC"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "PNP_RequestEjectPC"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "PNP_RequestEjectPC"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_PNP_HwProfFlags(struct ndr_push *ndr, int flags, const struct PNP_HwProfFlags *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.unknown1)); + if (r->in.devicepath == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.devicepath, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.devicepath, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.devicepath, ndr_charset_length(r->in.devicepath, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.unknown2)); + if (r->in.unknown3 == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.unknown3)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.unknown4)); + if (r->in.unknown4) { + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, *r->in.unknown4)); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.unknown5)); + if (r->in.unknown5) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.unknown5, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.unknown5, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.unknown5, ndr_charset_length(r->in.unknown5, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.unknown6)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.unknown7)); + } + if (flags & NDR_OUT) { + if (r->out.unknown3 == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.unknown3)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.unknown4)); + if (r->out.unknown4) { + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, *r->out.unknown4)); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.unknown5a)); + if (r->out.unknown5a) { + NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.unknown5a)); + if (*r->out.unknown5a) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(*r->out.unknown5a, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(*r->out.unknown5a, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, *r->out.unknown5a, ndr_charset_length(*r->out.unknown5a, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + } + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_PNP_HwProfFlags(struct ndr_pull *ndr, int flags, struct PNP_HwProfFlags *r) +{ + uint32_t _ptr_unknown4; + uint32_t _ptr_unknown5; + uint32_t _ptr_unknown5a; + TALLOC_CTX *_mem_save_unknown3_0; + TALLOC_CTX *_mem_save_unknown4_0; + TALLOC_CTX *_mem_save_unknown5_0; + TALLOC_CTX *_mem_save_unknown5a_0; + TALLOC_CTX *_mem_save_unknown5a_1; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.unknown1)); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.devicepath)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.devicepath)); + if (ndr_get_array_length(ndr, &r->in.devicepath) > ndr_get_array_size(ndr, &r->in.devicepath)) { + 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.devicepath), ndr_get_array_length(ndr, &r->in.devicepath)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.devicepath), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.devicepath, ndr_get_array_length(ndr, &r->in.devicepath), sizeof(uint16_t), CH_UTF16)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.unknown2)); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->in.unknown3); + } + _mem_save_unknown3_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.unknown3, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->in.unknown3)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_unknown3_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_unknown4)); + if (_ptr_unknown4) { + NDR_PULL_ALLOC(ndr, r->in.unknown4); + } else { + r->in.unknown4 = NULL; + } + if (r->in.unknown4) { + _mem_save_unknown4_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.unknown4, 0); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, r->in.unknown4)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_unknown4_0, 0); + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_unknown5)); + if (_ptr_unknown5) { + NDR_PULL_ALLOC(ndr, r->in.unknown5); + } else { + r->in.unknown5 = NULL; + } + if (r->in.unknown5) { + _mem_save_unknown5_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.unknown5, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.unknown5)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.unknown5)); + if (ndr_get_array_length(ndr, &r->in.unknown5) > ndr_get_array_size(ndr, &r->in.unknown5)) { + 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.unknown5), ndr_get_array_length(ndr, &r->in.unknown5)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.unknown5), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.unknown5, ndr_get_array_length(ndr, &r->in.unknown5), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_unknown5_0, 0); + } + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.unknown6)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.unknown7)); + NDR_PULL_ALLOC(ndr, r->out.unknown3); + *r->out.unknown3 = *r->in.unknown3; + } + if (flags & NDR_OUT) { + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.unknown3); + } + _mem_save_unknown3_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.unknown3, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.unknown3)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_unknown3_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_unknown4)); + if (_ptr_unknown4) { + NDR_PULL_ALLOC(ndr, r->out.unknown4); + } else { + r->out.unknown4 = NULL; + } + if (r->out.unknown4) { + _mem_save_unknown4_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.unknown4, 0); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, r->out.unknown4)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_unknown4_0, 0); + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_unknown5a)); + if (_ptr_unknown5a) { + NDR_PULL_ALLOC(ndr, r->out.unknown5a); + } else { + r->out.unknown5a = NULL; + } + if (r->out.unknown5a) { + _mem_save_unknown5a_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.unknown5a, 0); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_unknown5a)); + if (_ptr_unknown5a) { + NDR_PULL_ALLOC(ndr, *r->out.unknown5a); + } else { + *r->out.unknown5a = NULL; + } + if (*r->out.unknown5a) { + _mem_save_unknown5a_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, *r->out.unknown5a, 0); + NDR_CHECK(ndr_pull_array_size(ndr, r->out.unknown5a)); + NDR_CHECK(ndr_pull_array_length(ndr, r->out.unknown5a)); + if (ndr_get_array_length(ndr, r->out.unknown5a) > ndr_get_array_size(ndr, r->out.unknown5a)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, r->out.unknown5a), ndr_get_array_length(ndr, r->out.unknown5a)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, r->out.unknown5a), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, r->out.unknown5a, ndr_get_array_length(ndr, r->out.unknown5a), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_unknown5a_1, 0); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_unknown5a_0, 0); + } + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_PNP_HwProfFlags(struct ndr_print *ndr, const char *name, int flags, const struct PNP_HwProfFlags *r) +{ + ndr_print_struct(ndr, name, "PNP_HwProfFlags"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "PNP_HwProfFlags"); + ndr->depth++; + ndr_print_uint32(ndr, "unknown1", r->in.unknown1); + ndr_print_ptr(ndr, "devicepath", r->in.devicepath); + ndr->depth++; + ndr_print_string(ndr, "devicepath", r->in.devicepath); + ndr->depth--; + ndr_print_uint32(ndr, "unknown2", r->in.unknown2); + ndr_print_ptr(ndr, "unknown3", r->in.unknown3); + ndr->depth++; + ndr_print_uint32(ndr, "unknown3", *r->in.unknown3); + ndr->depth--; + ndr_print_ptr(ndr, "unknown4", r->in.unknown4); + ndr->depth++; + if (r->in.unknown4) { + ndr_print_uint16(ndr, "unknown4", *r->in.unknown4); + } + ndr->depth--; + ndr_print_ptr(ndr, "unknown5", r->in.unknown5); + ndr->depth++; + if (r->in.unknown5) { + ndr_print_string(ndr, "unknown5", r->in.unknown5); + } + ndr->depth--; + ndr_print_uint32(ndr, "unknown6", r->in.unknown6); + ndr_print_uint32(ndr, "unknown7", r->in.unknown7); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "PNP_HwProfFlags"); + ndr->depth++; + ndr_print_ptr(ndr, "unknown3", r->out.unknown3); + ndr->depth++; + ndr_print_uint32(ndr, "unknown3", *r->out.unknown3); + ndr->depth--; + ndr_print_ptr(ndr, "unknown4", r->out.unknown4); + ndr->depth++; + if (r->out.unknown4) { + ndr_print_uint16(ndr, "unknown4", *r->out.unknown4); + } + ndr->depth--; + ndr_print_ptr(ndr, "unknown5a", r->out.unknown5a); + ndr->depth++; + if (r->out.unknown5a) { + ndr_print_ptr(ndr, "unknown5a", *r->out.unknown5a); + ndr->depth++; + if (*r->out.unknown5a) { + ndr_print_string(ndr, "unknown5a", *r->out.unknown5a); + } + ndr->depth--; + } + ndr->depth--; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_PNP_GetHwProfInfo(struct ndr_push *ndr, int flags, const struct PNP_GetHwProfInfo *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.idx)); + if (r->in.info == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_PNP_HwProfInfo(ndr, NDR_SCALARS, r->in.info)); + 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) { + if (r->out.info == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_PNP_HwProfInfo(ndr, NDR_SCALARS, r->out.info)); + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_PNP_GetHwProfInfo(struct ndr_pull *ndr, int flags, struct PNP_GetHwProfInfo *r) +{ + TALLOC_CTX *_mem_save_info_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.idx)); + 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_PNP_HwProfInfo(ndr, NDR_SCALARS, r->in.info)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_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_PULL_ALLOC(ndr, r->out.info); + *r->out.info = *r->in.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_PNP_HwProfInfo(ndr, NDR_SCALARS, r->out.info)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_PNP_GetHwProfInfo(struct ndr_print *ndr, const char *name, int flags, const struct PNP_GetHwProfInfo *r) +{ + ndr_print_struct(ndr, name, "PNP_GetHwProfInfo"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "PNP_GetHwProfInfo"); + ndr->depth++; + ndr_print_uint32(ndr, "idx", r->in.idx); + ndr_print_ptr(ndr, "info", r->in.info); + ndr->depth++; + ndr_print_PNP_HwProfInfo(ndr, "info", r->in.info); + 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", "PNP_GetHwProfInfo"); + ndr->depth++; + ndr_print_ptr(ndr, "info", r->out.info); + ndr->depth++; + ndr_print_PNP_HwProfInfo(ndr, "info", r->out.info); + ndr->depth--; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_PNP_AddEmptyLogConf(struct ndr_push *ndr, int flags, const struct PNP_AddEmptyLogConf *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_PNP_AddEmptyLogConf(struct ndr_pull *ndr, int flags, struct PNP_AddEmptyLogConf *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_PNP_AddEmptyLogConf(struct ndr_print *ndr, const char *name, int flags, const struct PNP_AddEmptyLogConf *r) +{ + ndr_print_struct(ndr, name, "PNP_AddEmptyLogConf"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "PNP_AddEmptyLogConf"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "PNP_AddEmptyLogConf"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_PNP_FreeLogConf(struct ndr_push *ndr, int flags, const struct PNP_FreeLogConf *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_PNP_FreeLogConf(struct ndr_pull *ndr, int flags, struct PNP_FreeLogConf *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_PNP_FreeLogConf(struct ndr_print *ndr, const char *name, int flags, const struct PNP_FreeLogConf *r) +{ + ndr_print_struct(ndr, name, "PNP_FreeLogConf"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "PNP_FreeLogConf"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "PNP_FreeLogConf"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_PNP_GetFirstLogConf(struct ndr_push *ndr, int flags, const struct PNP_GetFirstLogConf *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_PNP_GetFirstLogConf(struct ndr_pull *ndr, int flags, struct PNP_GetFirstLogConf *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_PNP_GetFirstLogConf(struct ndr_print *ndr, const char *name, int flags, const struct PNP_GetFirstLogConf *r) +{ + ndr_print_struct(ndr, name, "PNP_GetFirstLogConf"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "PNP_GetFirstLogConf"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "PNP_GetFirstLogConf"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_PNP_GetNextLogConf(struct ndr_push *ndr, int flags, const struct PNP_GetNextLogConf *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_PNP_GetNextLogConf(struct ndr_pull *ndr, int flags, struct PNP_GetNextLogConf *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_PNP_GetNextLogConf(struct ndr_print *ndr, const char *name, int flags, const struct PNP_GetNextLogConf *r) +{ + ndr_print_struct(ndr, name, "PNP_GetNextLogConf"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "PNP_GetNextLogConf"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "PNP_GetNextLogConf"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_PNP_GetLogConfPriority(struct ndr_push *ndr, int flags, const struct PNP_GetLogConfPriority *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_PNP_GetLogConfPriority(struct ndr_pull *ndr, int flags, struct PNP_GetLogConfPriority *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_PNP_GetLogConfPriority(struct ndr_print *ndr, const char *name, int flags, const struct PNP_GetLogConfPriority *r) +{ + ndr_print_struct(ndr, name, "PNP_GetLogConfPriority"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "PNP_GetLogConfPriority"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "PNP_GetLogConfPriority"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_PNP_AddResDes(struct ndr_push *ndr, int flags, const struct PNP_AddResDes *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_PNP_AddResDes(struct ndr_pull *ndr, int flags, struct PNP_AddResDes *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_PNP_AddResDes(struct ndr_print *ndr, const char *name, int flags, const struct PNP_AddResDes *r) +{ + ndr_print_struct(ndr, name, "PNP_AddResDes"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "PNP_AddResDes"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "PNP_AddResDes"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_PNP_FreeResDes(struct ndr_push *ndr, int flags, const struct PNP_FreeResDes *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_PNP_FreeResDes(struct ndr_pull *ndr, int flags, struct PNP_FreeResDes *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_PNP_FreeResDes(struct ndr_print *ndr, const char *name, int flags, const struct PNP_FreeResDes *r) +{ + ndr_print_struct(ndr, name, "PNP_FreeResDes"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "PNP_FreeResDes"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "PNP_FreeResDes"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_PNP_GetNextResDes(struct ndr_push *ndr, int flags, const struct PNP_GetNextResDes *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_PNP_GetNextResDes(struct ndr_pull *ndr, int flags, struct PNP_GetNextResDes *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_PNP_GetNextResDes(struct ndr_print *ndr, const char *name, int flags, const struct PNP_GetNextResDes *r) +{ + ndr_print_struct(ndr, name, "PNP_GetNextResDes"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "PNP_GetNextResDes"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "PNP_GetNextResDes"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_PNP_GetResDesData(struct ndr_push *ndr, int flags, const struct PNP_GetResDesData *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_PNP_GetResDesData(struct ndr_pull *ndr, int flags, struct PNP_GetResDesData *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_PNP_GetResDesData(struct ndr_print *ndr, const char *name, int flags, const struct PNP_GetResDesData *r) +{ + ndr_print_struct(ndr, name, "PNP_GetResDesData"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "PNP_GetResDesData"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "PNP_GetResDesData"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_PNP_GetResDesDataSize(struct ndr_push *ndr, int flags, const struct PNP_GetResDesDataSize *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_PNP_GetResDesDataSize(struct ndr_pull *ndr, int flags, struct PNP_GetResDesDataSize *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_PNP_GetResDesDataSize(struct ndr_print *ndr, const char *name, int flags, const struct PNP_GetResDesDataSize *r) +{ + ndr_print_struct(ndr, name, "PNP_GetResDesDataSize"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "PNP_GetResDesDataSize"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "PNP_GetResDesDataSize"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_PNP_ModifyResDes(struct ndr_push *ndr, int flags, const struct PNP_ModifyResDes *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_PNP_ModifyResDes(struct ndr_pull *ndr, int flags, struct PNP_ModifyResDes *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_PNP_ModifyResDes(struct ndr_print *ndr, const char *name, int flags, const struct PNP_ModifyResDes *r) +{ + ndr_print_struct(ndr, name, "PNP_ModifyResDes"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "PNP_ModifyResDes"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "PNP_ModifyResDes"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_PNP_DetectResourceLimit(struct ndr_push *ndr, int flags, const struct PNP_DetectResourceLimit *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_PNP_DetectResourceLimit(struct ndr_pull *ndr, int flags, struct PNP_DetectResourceLimit *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_PNP_DetectResourceLimit(struct ndr_print *ndr, const char *name, int flags, const struct PNP_DetectResourceLimit *r) +{ + ndr_print_struct(ndr, name, "PNP_DetectResourceLimit"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "PNP_DetectResourceLimit"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "PNP_DetectResourceLimit"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_PNP_QueryResConfList(struct ndr_push *ndr, int flags, const struct PNP_QueryResConfList *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_PNP_QueryResConfList(struct ndr_pull *ndr, int flags, struct PNP_QueryResConfList *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_PNP_QueryResConfList(struct ndr_print *ndr, const char *name, int flags, const struct PNP_QueryResConfList *r) +{ + ndr_print_struct(ndr, name, "PNP_QueryResConfList"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "PNP_QueryResConfList"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "PNP_QueryResConfList"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_PNP_SetHwProf(struct ndr_push *ndr, int flags, const struct PNP_SetHwProf *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_PNP_SetHwProf(struct ndr_pull *ndr, int flags, struct PNP_SetHwProf *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_PNP_SetHwProf(struct ndr_print *ndr, const char *name, int flags, const struct PNP_SetHwProf *r) +{ + ndr_print_struct(ndr, name, "PNP_SetHwProf"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "PNP_SetHwProf"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "PNP_SetHwProf"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_PNP_QueryArbitratorFreeData(struct ndr_push *ndr, int flags, const struct PNP_QueryArbitratorFreeData *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_PNP_QueryArbitratorFreeData(struct ndr_pull *ndr, int flags, struct PNP_QueryArbitratorFreeData *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_PNP_QueryArbitratorFreeData(struct ndr_print *ndr, const char *name, int flags, const struct PNP_QueryArbitratorFreeData *r) +{ + ndr_print_struct(ndr, name, "PNP_QueryArbitratorFreeData"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "PNP_QueryArbitratorFreeData"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "PNP_QueryArbitratorFreeData"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_PNP_QueryArbitratorFreeSize(struct ndr_push *ndr, int flags, const struct PNP_QueryArbitratorFreeSize *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_PNP_QueryArbitratorFreeSize(struct ndr_pull *ndr, int flags, struct PNP_QueryArbitratorFreeSize *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_PNP_QueryArbitratorFreeSize(struct ndr_print *ndr, const char *name, int flags, const struct PNP_QueryArbitratorFreeSize *r) +{ + ndr_print_struct(ndr, name, "PNP_QueryArbitratorFreeSize"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "PNP_QueryArbitratorFreeSize"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "PNP_QueryArbitratorFreeSize"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_PNP_RunDetection(struct ndr_push *ndr, int flags, const struct PNP_RunDetection *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_PNP_RunDetection(struct ndr_pull *ndr, int flags, struct PNP_RunDetection *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_PNP_RunDetection(struct ndr_print *ndr, const char *name, int flags, const struct PNP_RunDetection *r) +{ + ndr_print_struct(ndr, name, "PNP_RunDetection"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "PNP_RunDetection"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "PNP_RunDetection"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_PNP_RegisterNotification(struct ndr_push *ndr, int flags, const struct PNP_RegisterNotification *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_PNP_RegisterNotification(struct ndr_pull *ndr, int flags, struct PNP_RegisterNotification *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_PNP_RegisterNotification(struct ndr_print *ndr, const char *name, int flags, const struct PNP_RegisterNotification *r) +{ + ndr_print_struct(ndr, name, "PNP_RegisterNotification"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "PNP_RegisterNotification"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "PNP_RegisterNotification"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_PNP_UnregisterNotification(struct ndr_push *ndr, int flags, const struct PNP_UnregisterNotification *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_PNP_UnregisterNotification(struct ndr_pull *ndr, int flags, struct PNP_UnregisterNotification *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_PNP_UnregisterNotification(struct ndr_print *ndr, const char *name, int flags, const struct PNP_UnregisterNotification *r) +{ + ndr_print_struct(ndr, name, "PNP_UnregisterNotification"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "PNP_UnregisterNotification"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "PNP_UnregisterNotification"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_PNP_GetCustomDevProp(struct ndr_push *ndr, int flags, const struct PNP_GetCustomDevProp *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_PNP_GetCustomDevProp(struct ndr_pull *ndr, int flags, struct PNP_GetCustomDevProp *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_PNP_GetCustomDevProp(struct ndr_print *ndr, const char *name, int flags, const struct PNP_GetCustomDevProp *r) +{ + ndr_print_struct(ndr, name, "PNP_GetCustomDevProp"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "PNP_GetCustomDevProp"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "PNP_GetCustomDevProp"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_PNP_GetVersionInternal(struct ndr_push *ndr, int flags, const struct PNP_GetVersionInternal *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_PNP_GetVersionInternal(struct ndr_pull *ndr, int flags, struct PNP_GetVersionInternal *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_PNP_GetVersionInternal(struct ndr_print *ndr, const char *name, int flags, const struct PNP_GetVersionInternal *r) +{ + ndr_print_struct(ndr, name, "PNP_GetVersionInternal"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "PNP_GetVersionInternal"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "PNP_GetVersionInternal"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_PNP_GetBlockedDriverInfo(struct ndr_push *ndr, int flags, const struct PNP_GetBlockedDriverInfo *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_PNP_GetBlockedDriverInfo(struct ndr_pull *ndr, int flags, struct PNP_GetBlockedDriverInfo *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_PNP_GetBlockedDriverInfo(struct ndr_print *ndr, const char *name, int flags, const struct PNP_GetBlockedDriverInfo *r) +{ + ndr_print_struct(ndr, name, "PNP_GetBlockedDriverInfo"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "PNP_GetBlockedDriverInfo"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "PNP_GetBlockedDriverInfo"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static enum ndr_err_code ndr_push_PNP_GetServerSideDeviceInstallFlags(struct ndr_push *ndr, int flags, const struct PNP_GetServerSideDeviceInstallFlags *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_PNP_GetServerSideDeviceInstallFlags(struct ndr_pull *ndr, int flags, struct PNP_GetServerSideDeviceInstallFlags *r) +{ + if (flags & NDR_IN) { + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_PNP_GetServerSideDeviceInstallFlags(struct ndr_print *ndr, const char *name, int flags, const struct PNP_GetServerSideDeviceInstallFlags *r) +{ + ndr_print_struct(ndr, name, "PNP_GetServerSideDeviceInstallFlags"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "PNP_GetServerSideDeviceInstallFlags"); + ndr->depth++; + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "PNP_GetServerSideDeviceInstallFlags"); + ndr->depth++; + ndr_print_WERROR(ndr, "result", r->out.result); + ndr->depth--; + } + ndr->depth--; +} + +static const struct ndr_interface_call ntsvcs_calls[] = { + { + "PNP_Disconnect", + sizeof(struct PNP_Disconnect), + (ndr_push_flags_fn_t) ndr_push_PNP_Disconnect, + (ndr_pull_flags_fn_t) ndr_pull_PNP_Disconnect, + (ndr_print_function_t) ndr_print_PNP_Disconnect, + false, + }, + { + "PNP_Connect", + sizeof(struct PNP_Connect), + (ndr_push_flags_fn_t) ndr_push_PNP_Connect, + (ndr_pull_flags_fn_t) ndr_pull_PNP_Connect, + (ndr_print_function_t) ndr_print_PNP_Connect, + false, + }, + { + "PNP_GetVersion", + sizeof(struct PNP_GetVersion), + (ndr_push_flags_fn_t) ndr_push_PNP_GetVersion, + (ndr_pull_flags_fn_t) ndr_pull_PNP_GetVersion, + (ndr_print_function_t) ndr_print_PNP_GetVersion, + false, + }, + { + "PNP_GetGlobalState", + sizeof(struct PNP_GetGlobalState), + (ndr_push_flags_fn_t) ndr_push_PNP_GetGlobalState, + (ndr_pull_flags_fn_t) ndr_pull_PNP_GetGlobalState, + (ndr_print_function_t) ndr_print_PNP_GetGlobalState, + false, + }, + { + "PNP_InitDetection", + sizeof(struct PNP_InitDetection), + (ndr_push_flags_fn_t) ndr_push_PNP_InitDetection, + (ndr_pull_flags_fn_t) ndr_pull_PNP_InitDetection, + (ndr_print_function_t) ndr_print_PNP_InitDetection, + false, + }, + { + "PNP_ReportLogOn", + sizeof(struct PNP_ReportLogOn), + (ndr_push_flags_fn_t) ndr_push_PNP_ReportLogOn, + (ndr_pull_flags_fn_t) ndr_pull_PNP_ReportLogOn, + (ndr_print_function_t) ndr_print_PNP_ReportLogOn, + false, + }, + { + "PNP_ValidateDeviceInstance", + sizeof(struct PNP_ValidateDeviceInstance), + (ndr_push_flags_fn_t) ndr_push_PNP_ValidateDeviceInstance, + (ndr_pull_flags_fn_t) ndr_pull_PNP_ValidateDeviceInstance, + (ndr_print_function_t) ndr_print_PNP_ValidateDeviceInstance, + false, + }, + { + "PNP_GetRootDeviceInstance", + sizeof(struct PNP_GetRootDeviceInstance), + (ndr_push_flags_fn_t) ndr_push_PNP_GetRootDeviceInstance, + (ndr_pull_flags_fn_t) ndr_pull_PNP_GetRootDeviceInstance, + (ndr_print_function_t) ndr_print_PNP_GetRootDeviceInstance, + false, + }, + { + "PNP_GetRelatedDeviceInstance", + sizeof(struct PNP_GetRelatedDeviceInstance), + (ndr_push_flags_fn_t) ndr_push_PNP_GetRelatedDeviceInstance, + (ndr_pull_flags_fn_t) ndr_pull_PNP_GetRelatedDeviceInstance, + (ndr_print_function_t) ndr_print_PNP_GetRelatedDeviceInstance, + false, + }, + { + "PNP_EnumerateSubKeys", + sizeof(struct PNP_EnumerateSubKeys), + (ndr_push_flags_fn_t) ndr_push_PNP_EnumerateSubKeys, + (ndr_pull_flags_fn_t) ndr_pull_PNP_EnumerateSubKeys, + (ndr_print_function_t) ndr_print_PNP_EnumerateSubKeys, + false, + }, + { + "PNP_GetDeviceList", + sizeof(struct PNP_GetDeviceList), + (ndr_push_flags_fn_t) ndr_push_PNP_GetDeviceList, + (ndr_pull_flags_fn_t) ndr_pull_PNP_GetDeviceList, + (ndr_print_function_t) ndr_print_PNP_GetDeviceList, + false, + }, + { + "PNP_GetDeviceListSize", + sizeof(struct PNP_GetDeviceListSize), + (ndr_push_flags_fn_t) ndr_push_PNP_GetDeviceListSize, + (ndr_pull_flags_fn_t) ndr_pull_PNP_GetDeviceListSize, + (ndr_print_function_t) ndr_print_PNP_GetDeviceListSize, + false, + }, + { + "PNP_GetDepth", + sizeof(struct PNP_GetDepth), + (ndr_push_flags_fn_t) ndr_push_PNP_GetDepth, + (ndr_pull_flags_fn_t) ndr_pull_PNP_GetDepth, + (ndr_print_function_t) ndr_print_PNP_GetDepth, + false, + }, + { + "PNP_GetDeviceRegProp", + sizeof(struct PNP_GetDeviceRegProp), + (ndr_push_flags_fn_t) ndr_push_PNP_GetDeviceRegProp, + (ndr_pull_flags_fn_t) ndr_pull_PNP_GetDeviceRegProp, + (ndr_print_function_t) ndr_print_PNP_GetDeviceRegProp, + false, + }, + { + "PNP_SetDeviceRegProp", + sizeof(struct PNP_SetDeviceRegProp), + (ndr_push_flags_fn_t) ndr_push_PNP_SetDeviceRegProp, + (ndr_pull_flags_fn_t) ndr_pull_PNP_SetDeviceRegProp, + (ndr_print_function_t) ndr_print_PNP_SetDeviceRegProp, + false, + }, + { + "PNP_GetClassInstance", + sizeof(struct PNP_GetClassInstance), + (ndr_push_flags_fn_t) ndr_push_PNP_GetClassInstance, + (ndr_pull_flags_fn_t) ndr_pull_PNP_GetClassInstance, + (ndr_print_function_t) ndr_print_PNP_GetClassInstance, + false, + }, + { + "PNP_CreateKey", + sizeof(struct PNP_CreateKey), + (ndr_push_flags_fn_t) ndr_push_PNP_CreateKey, + (ndr_pull_flags_fn_t) ndr_pull_PNP_CreateKey, + (ndr_print_function_t) ndr_print_PNP_CreateKey, + false, + }, + { + "PNP_DeleteRegistryKey", + sizeof(struct PNP_DeleteRegistryKey), + (ndr_push_flags_fn_t) ndr_push_PNP_DeleteRegistryKey, + (ndr_pull_flags_fn_t) ndr_pull_PNP_DeleteRegistryKey, + (ndr_print_function_t) ndr_print_PNP_DeleteRegistryKey, + false, + }, + { + "PNP_GetClassCount", + sizeof(struct PNP_GetClassCount), + (ndr_push_flags_fn_t) ndr_push_PNP_GetClassCount, + (ndr_pull_flags_fn_t) ndr_pull_PNP_GetClassCount, + (ndr_print_function_t) ndr_print_PNP_GetClassCount, + false, + }, + { + "PNP_GetClassName", + sizeof(struct PNP_GetClassName), + (ndr_push_flags_fn_t) ndr_push_PNP_GetClassName, + (ndr_pull_flags_fn_t) ndr_pull_PNP_GetClassName, + (ndr_print_function_t) ndr_print_PNP_GetClassName, + false, + }, + { + "PNP_DeleteClassKey", + sizeof(struct PNP_DeleteClassKey), + (ndr_push_flags_fn_t) ndr_push_PNP_DeleteClassKey, + (ndr_pull_flags_fn_t) ndr_pull_PNP_DeleteClassKey, + (ndr_print_function_t) ndr_print_PNP_DeleteClassKey, + false, + }, + { + "PNP_GetInterfaceDeviceAlias", + sizeof(struct PNP_GetInterfaceDeviceAlias), + (ndr_push_flags_fn_t) ndr_push_PNP_GetInterfaceDeviceAlias, + (ndr_pull_flags_fn_t) ndr_pull_PNP_GetInterfaceDeviceAlias, + (ndr_print_function_t) ndr_print_PNP_GetInterfaceDeviceAlias, + false, + }, + { + "PNP_GetInterfaceDeviceList", + sizeof(struct PNP_GetInterfaceDeviceList), + (ndr_push_flags_fn_t) ndr_push_PNP_GetInterfaceDeviceList, + (ndr_pull_flags_fn_t) ndr_pull_PNP_GetInterfaceDeviceList, + (ndr_print_function_t) ndr_print_PNP_GetInterfaceDeviceList, + false, + }, + { + "PNP_GetInterfaceDeviceListSize", + sizeof(struct PNP_GetInterfaceDeviceListSize), + (ndr_push_flags_fn_t) ndr_push_PNP_GetInterfaceDeviceListSize, + (ndr_pull_flags_fn_t) ndr_pull_PNP_GetInterfaceDeviceListSize, + (ndr_print_function_t) ndr_print_PNP_GetInterfaceDeviceListSize, + false, + }, + { + "PNP_RegisterDeviceClassAssociation", + sizeof(struct PNP_RegisterDeviceClassAssociation), + (ndr_push_flags_fn_t) ndr_push_PNP_RegisterDeviceClassAssociation, + (ndr_pull_flags_fn_t) ndr_pull_PNP_RegisterDeviceClassAssociation, + (ndr_print_function_t) ndr_print_PNP_RegisterDeviceClassAssociation, + false, + }, + { + "PNP_UnregisterDeviceClassAssociation", + sizeof(struct PNP_UnregisterDeviceClassAssociation), + (ndr_push_flags_fn_t) ndr_push_PNP_UnregisterDeviceClassAssociation, + (ndr_pull_flags_fn_t) ndr_pull_PNP_UnregisterDeviceClassAssociation, + (ndr_print_function_t) ndr_print_PNP_UnregisterDeviceClassAssociation, + false, + }, + { + "PNP_GetClassRegProp", + sizeof(struct PNP_GetClassRegProp), + (ndr_push_flags_fn_t) ndr_push_PNP_GetClassRegProp, + (ndr_pull_flags_fn_t) ndr_pull_PNP_GetClassRegProp, + (ndr_print_function_t) ndr_print_PNP_GetClassRegProp, + false, + }, + { + "PNP_SetClassRegProp", + sizeof(struct PNP_SetClassRegProp), + (ndr_push_flags_fn_t) ndr_push_PNP_SetClassRegProp, + (ndr_pull_flags_fn_t) ndr_pull_PNP_SetClassRegProp, + (ndr_print_function_t) ndr_print_PNP_SetClassRegProp, + false, + }, + { + "PNP_CreateDevInst", + sizeof(struct PNP_CreateDevInst), + (ndr_push_flags_fn_t) ndr_push_PNP_CreateDevInst, + (ndr_pull_flags_fn_t) ndr_pull_PNP_CreateDevInst, + (ndr_print_function_t) ndr_print_PNP_CreateDevInst, + false, + }, + { + "PNP_DeviceInstanceAction", + sizeof(struct PNP_DeviceInstanceAction), + (ndr_push_flags_fn_t) ndr_push_PNP_DeviceInstanceAction, + (ndr_pull_flags_fn_t) ndr_pull_PNP_DeviceInstanceAction, + (ndr_print_function_t) ndr_print_PNP_DeviceInstanceAction, + false, + }, + { + "PNP_GetDeviceStatus", + sizeof(struct PNP_GetDeviceStatus), + (ndr_push_flags_fn_t) ndr_push_PNP_GetDeviceStatus, + (ndr_pull_flags_fn_t) ndr_pull_PNP_GetDeviceStatus, + (ndr_print_function_t) ndr_print_PNP_GetDeviceStatus, + false, + }, + { + "PNP_SetDeviceProblem", + sizeof(struct PNP_SetDeviceProblem), + (ndr_push_flags_fn_t) ndr_push_PNP_SetDeviceProblem, + (ndr_pull_flags_fn_t) ndr_pull_PNP_SetDeviceProblem, + (ndr_print_function_t) ndr_print_PNP_SetDeviceProblem, + false, + }, + { + "PNP_DisableDevInst", + sizeof(struct PNP_DisableDevInst), + (ndr_push_flags_fn_t) ndr_push_PNP_DisableDevInst, + (ndr_pull_flags_fn_t) ndr_pull_PNP_DisableDevInst, + (ndr_print_function_t) ndr_print_PNP_DisableDevInst, + false, + }, + { + "PNP_UninstallDevInst", + sizeof(struct PNP_UninstallDevInst), + (ndr_push_flags_fn_t) ndr_push_PNP_UninstallDevInst, + (ndr_pull_flags_fn_t) ndr_pull_PNP_UninstallDevInst, + (ndr_print_function_t) ndr_print_PNP_UninstallDevInst, + false, + }, + { + "PNP_AddID", + sizeof(struct PNP_AddID), + (ndr_push_flags_fn_t) ndr_push_PNP_AddID, + (ndr_pull_flags_fn_t) ndr_pull_PNP_AddID, + (ndr_print_function_t) ndr_print_PNP_AddID, + false, + }, + { + "PNP_RegisterDriver", + sizeof(struct PNP_RegisterDriver), + (ndr_push_flags_fn_t) ndr_push_PNP_RegisterDriver, + (ndr_pull_flags_fn_t) ndr_pull_PNP_RegisterDriver, + (ndr_print_function_t) ndr_print_PNP_RegisterDriver, + false, + }, + { + "PNP_QueryRemove", + sizeof(struct PNP_QueryRemove), + (ndr_push_flags_fn_t) ndr_push_PNP_QueryRemove, + (ndr_pull_flags_fn_t) ndr_pull_PNP_QueryRemove, + (ndr_print_function_t) ndr_print_PNP_QueryRemove, + false, + }, + { + "PNP_RequestDeviceEject", + sizeof(struct PNP_RequestDeviceEject), + (ndr_push_flags_fn_t) ndr_push_PNP_RequestDeviceEject, + (ndr_pull_flags_fn_t) ndr_pull_PNP_RequestDeviceEject, + (ndr_print_function_t) ndr_print_PNP_RequestDeviceEject, + false, + }, + { + "PNP_IsDockStationPresent", + sizeof(struct PNP_IsDockStationPresent), + (ndr_push_flags_fn_t) ndr_push_PNP_IsDockStationPresent, + (ndr_pull_flags_fn_t) ndr_pull_PNP_IsDockStationPresent, + (ndr_print_function_t) ndr_print_PNP_IsDockStationPresent, + false, + }, + { + "PNP_RequestEjectPC", + sizeof(struct PNP_RequestEjectPC), + (ndr_push_flags_fn_t) ndr_push_PNP_RequestEjectPC, + (ndr_pull_flags_fn_t) ndr_pull_PNP_RequestEjectPC, + (ndr_print_function_t) ndr_print_PNP_RequestEjectPC, + false, + }, + { + "PNP_HwProfFlags", + sizeof(struct PNP_HwProfFlags), + (ndr_push_flags_fn_t) ndr_push_PNP_HwProfFlags, + (ndr_pull_flags_fn_t) ndr_pull_PNP_HwProfFlags, + (ndr_print_function_t) ndr_print_PNP_HwProfFlags, + false, + }, + { + "PNP_GetHwProfInfo", + sizeof(struct PNP_GetHwProfInfo), + (ndr_push_flags_fn_t) ndr_push_PNP_GetHwProfInfo, + (ndr_pull_flags_fn_t) ndr_pull_PNP_GetHwProfInfo, + (ndr_print_function_t) ndr_print_PNP_GetHwProfInfo, + false, + }, + { + "PNP_AddEmptyLogConf", + sizeof(struct PNP_AddEmptyLogConf), + (ndr_push_flags_fn_t) ndr_push_PNP_AddEmptyLogConf, + (ndr_pull_flags_fn_t) ndr_pull_PNP_AddEmptyLogConf, + (ndr_print_function_t) ndr_print_PNP_AddEmptyLogConf, + false, + }, + { + "PNP_FreeLogConf", + sizeof(struct PNP_FreeLogConf), + (ndr_push_flags_fn_t) ndr_push_PNP_FreeLogConf, + (ndr_pull_flags_fn_t) ndr_pull_PNP_FreeLogConf, + (ndr_print_function_t) ndr_print_PNP_FreeLogConf, + false, + }, + { + "PNP_GetFirstLogConf", + sizeof(struct PNP_GetFirstLogConf), + (ndr_push_flags_fn_t) ndr_push_PNP_GetFirstLogConf, + (ndr_pull_flags_fn_t) ndr_pull_PNP_GetFirstLogConf, + (ndr_print_function_t) ndr_print_PNP_GetFirstLogConf, + false, + }, + { + "PNP_GetNextLogConf", + sizeof(struct PNP_GetNextLogConf), + (ndr_push_flags_fn_t) ndr_push_PNP_GetNextLogConf, + (ndr_pull_flags_fn_t) ndr_pull_PNP_GetNextLogConf, + (ndr_print_function_t) ndr_print_PNP_GetNextLogConf, + false, + }, + { + "PNP_GetLogConfPriority", + sizeof(struct PNP_GetLogConfPriority), + (ndr_push_flags_fn_t) ndr_push_PNP_GetLogConfPriority, + (ndr_pull_flags_fn_t) ndr_pull_PNP_GetLogConfPriority, + (ndr_print_function_t) ndr_print_PNP_GetLogConfPriority, + false, + }, + { + "PNP_AddResDes", + sizeof(struct PNP_AddResDes), + (ndr_push_flags_fn_t) ndr_push_PNP_AddResDes, + (ndr_pull_flags_fn_t) ndr_pull_PNP_AddResDes, + (ndr_print_function_t) ndr_print_PNP_AddResDes, + false, + }, + { + "PNP_FreeResDes", + sizeof(struct PNP_FreeResDes), + (ndr_push_flags_fn_t) ndr_push_PNP_FreeResDes, + (ndr_pull_flags_fn_t) ndr_pull_PNP_FreeResDes, + (ndr_print_function_t) ndr_print_PNP_FreeResDes, + false, + }, + { + "PNP_GetNextResDes", + sizeof(struct PNP_GetNextResDes), + (ndr_push_flags_fn_t) ndr_push_PNP_GetNextResDes, + (ndr_pull_flags_fn_t) ndr_pull_PNP_GetNextResDes, + (ndr_print_function_t) ndr_print_PNP_GetNextResDes, + false, + }, + { + "PNP_GetResDesData", + sizeof(struct PNP_GetResDesData), + (ndr_push_flags_fn_t) ndr_push_PNP_GetResDesData, + (ndr_pull_flags_fn_t) ndr_pull_PNP_GetResDesData, + (ndr_print_function_t) ndr_print_PNP_GetResDesData, + false, + }, + { + "PNP_GetResDesDataSize", + sizeof(struct PNP_GetResDesDataSize), + (ndr_push_flags_fn_t) ndr_push_PNP_GetResDesDataSize, + (ndr_pull_flags_fn_t) ndr_pull_PNP_GetResDesDataSize, + (ndr_print_function_t) ndr_print_PNP_GetResDesDataSize, + false, + }, + { + "PNP_ModifyResDes", + sizeof(struct PNP_ModifyResDes), + (ndr_push_flags_fn_t) ndr_push_PNP_ModifyResDes, + (ndr_pull_flags_fn_t) ndr_pull_PNP_ModifyResDes, + (ndr_print_function_t) ndr_print_PNP_ModifyResDes, + false, + }, + { + "PNP_DetectResourceLimit", + sizeof(struct PNP_DetectResourceLimit), + (ndr_push_flags_fn_t) ndr_push_PNP_DetectResourceLimit, + (ndr_pull_flags_fn_t) ndr_pull_PNP_DetectResourceLimit, + (ndr_print_function_t) ndr_print_PNP_DetectResourceLimit, + false, + }, + { + "PNP_QueryResConfList", + sizeof(struct PNP_QueryResConfList), + (ndr_push_flags_fn_t) ndr_push_PNP_QueryResConfList, + (ndr_pull_flags_fn_t) ndr_pull_PNP_QueryResConfList, + (ndr_print_function_t) ndr_print_PNP_QueryResConfList, + false, + }, + { + "PNP_SetHwProf", + sizeof(struct PNP_SetHwProf), + (ndr_push_flags_fn_t) ndr_push_PNP_SetHwProf, + (ndr_pull_flags_fn_t) ndr_pull_PNP_SetHwProf, + (ndr_print_function_t) ndr_print_PNP_SetHwProf, + false, + }, + { + "PNP_QueryArbitratorFreeData", + sizeof(struct PNP_QueryArbitratorFreeData), + (ndr_push_flags_fn_t) ndr_push_PNP_QueryArbitratorFreeData, + (ndr_pull_flags_fn_t) ndr_pull_PNP_QueryArbitratorFreeData, + (ndr_print_function_t) ndr_print_PNP_QueryArbitratorFreeData, + false, + }, + { + "PNP_QueryArbitratorFreeSize", + sizeof(struct PNP_QueryArbitratorFreeSize), + (ndr_push_flags_fn_t) ndr_push_PNP_QueryArbitratorFreeSize, + (ndr_pull_flags_fn_t) ndr_pull_PNP_QueryArbitratorFreeSize, + (ndr_print_function_t) ndr_print_PNP_QueryArbitratorFreeSize, + false, + }, + { + "PNP_RunDetection", + sizeof(struct PNP_RunDetection), + (ndr_push_flags_fn_t) ndr_push_PNP_RunDetection, + (ndr_pull_flags_fn_t) ndr_pull_PNP_RunDetection, + (ndr_print_function_t) ndr_print_PNP_RunDetection, + false, + }, + { + "PNP_RegisterNotification", + sizeof(struct PNP_RegisterNotification), + (ndr_push_flags_fn_t) ndr_push_PNP_RegisterNotification, + (ndr_pull_flags_fn_t) ndr_pull_PNP_RegisterNotification, + (ndr_print_function_t) ndr_print_PNP_RegisterNotification, + false, + }, + { + "PNP_UnregisterNotification", + sizeof(struct PNP_UnregisterNotification), + (ndr_push_flags_fn_t) ndr_push_PNP_UnregisterNotification, + (ndr_pull_flags_fn_t) ndr_pull_PNP_UnregisterNotification, + (ndr_print_function_t) ndr_print_PNP_UnregisterNotification, + false, + }, + { + "PNP_GetCustomDevProp", + sizeof(struct PNP_GetCustomDevProp), + (ndr_push_flags_fn_t) ndr_push_PNP_GetCustomDevProp, + (ndr_pull_flags_fn_t) ndr_pull_PNP_GetCustomDevProp, + (ndr_print_function_t) ndr_print_PNP_GetCustomDevProp, + false, + }, + { + "PNP_GetVersionInternal", + sizeof(struct PNP_GetVersionInternal), + (ndr_push_flags_fn_t) ndr_push_PNP_GetVersionInternal, + (ndr_pull_flags_fn_t) ndr_pull_PNP_GetVersionInternal, + (ndr_print_function_t) ndr_print_PNP_GetVersionInternal, + false, + }, + { + "PNP_GetBlockedDriverInfo", + sizeof(struct PNP_GetBlockedDriverInfo), + (ndr_push_flags_fn_t) ndr_push_PNP_GetBlockedDriverInfo, + (ndr_pull_flags_fn_t) ndr_pull_PNP_GetBlockedDriverInfo, + (ndr_print_function_t) ndr_print_PNP_GetBlockedDriverInfo, + false, + }, + { + "PNP_GetServerSideDeviceInstallFlags", + sizeof(struct PNP_GetServerSideDeviceInstallFlags), + (ndr_push_flags_fn_t) ndr_push_PNP_GetServerSideDeviceInstallFlags, + (ndr_pull_flags_fn_t) ndr_pull_PNP_GetServerSideDeviceInstallFlags, + (ndr_print_function_t) ndr_print_PNP_GetServerSideDeviceInstallFlags, + false, + }, + { NULL, 0, NULL, NULL, NULL, false } +}; + +static const char * const ntsvcs_endpoint_strings[] = { + "ncacn_np:[\\pipe\\ntsvcs]", +}; + +static const struct ndr_interface_string_array ntsvcs_endpoints = { + .count = 1, + .names = ntsvcs_endpoint_strings +}; + +static const char * const ntsvcs_authservice_strings[] = { + "host", +}; + +static const struct ndr_interface_string_array ntsvcs_authservices = { + .count = 1, + .names = ntsvcs_authservice_strings +}; + + +const struct ndr_interface_table ndr_table_ntsvcs = { + .name = "ntsvcs", + .syntax_id = { + {0x8d9f4e40,0xa03d,0x11ce,{0x8f,0x69},{0x08,0x00,0x3e,0x30,0x05,0x1b}}, + NDR_NTSVCS_VERSION + }, + .helpstring = NDR_NTSVCS_HELPSTRING, + .num_calls = 65, + .calls = ntsvcs_calls, + .endpoints = &ntsvcs_endpoints, + .authservices = &ntsvcs_authservices +}; + diff --git a/source3/librpc/gen_ndr/ndr_ntsvcs.h b/source3/librpc/gen_ndr/ndr_ntsvcs.h new file mode 100644 index 0000000000..0e3b6b91c4 --- /dev/null +++ b/source3/librpc/gen_ndr/ndr_ntsvcs.h @@ -0,0 +1,211 @@ +/* header auto-generated by pidl */ + +#include "librpc/ndr/libndr.h" +#include "librpc/gen_ndr/ntsvcs.h" + +#ifndef _HEADER_NDR_ntsvcs +#define _HEADER_NDR_ntsvcs + +#define NDR_NTSVCS_UUID "8d9f4e40-a03d-11ce-8f69-08003e30051b" +#define NDR_NTSVCS_VERSION 1.0 +#define NDR_NTSVCS_NAME "ntsvcs" +#define NDR_NTSVCS_HELPSTRING "Plug and Play services" +extern const struct ndr_interface_table ndr_table_ntsvcs; +#define NDR_PNP_DISCONNECT (0x00) + +#define NDR_PNP_CONNECT (0x01) + +#define NDR_PNP_GETVERSION (0x02) + +#define NDR_PNP_GETGLOBALSTATE (0x03) + +#define NDR_PNP_INITDETECTION (0x04) + +#define NDR_PNP_REPORTLOGON (0x05) + +#define NDR_PNP_VALIDATEDEVICEINSTANCE (0x06) + +#define NDR_PNP_GETROOTDEVICEINSTANCE (0x07) + +#define NDR_PNP_GETRELATEDDEVICEINSTANCE (0x08) + +#define NDR_PNP_ENUMERATESUBKEYS (0x09) + +#define NDR_PNP_GETDEVICELIST (0x0a) + +#define NDR_PNP_GETDEVICELISTSIZE (0x0b) + +#define NDR_PNP_GETDEPTH (0x0c) + +#define NDR_PNP_GETDEVICEREGPROP (0x0d) + +#define NDR_PNP_SETDEVICEREGPROP (0x0e) + +#define NDR_PNP_GETCLASSINSTANCE (0x0f) + +#define NDR_PNP_CREATEKEY (0x10) + +#define NDR_PNP_DELETEREGISTRYKEY (0x11) + +#define NDR_PNP_GETCLASSCOUNT (0x12) + +#define NDR_PNP_GETCLASSNAME (0x13) + +#define NDR_PNP_DELETECLASSKEY (0x14) + +#define NDR_PNP_GETINTERFACEDEVICEALIAS (0x15) + +#define NDR_PNP_GETINTERFACEDEVICELIST (0x16) + +#define NDR_PNP_GETINTERFACEDEVICELISTSIZE (0x17) + +#define NDR_PNP_REGISTERDEVICECLASSASSOCIATION (0x18) + +#define NDR_PNP_UNREGISTERDEVICECLASSASSOCIATION (0x19) + +#define NDR_PNP_GETCLASSREGPROP (0x1a) + +#define NDR_PNP_SETCLASSREGPROP (0x1b) + +#define NDR_PNP_CREATEDEVINST (0x1c) + +#define NDR_PNP_DEVICEINSTANCEACTION (0x1d) + +#define NDR_PNP_GETDEVICESTATUS (0x1e) + +#define NDR_PNP_SETDEVICEPROBLEM (0x1f) + +#define NDR_PNP_DISABLEDEVINST (0x20) + +#define NDR_PNP_UNINSTALLDEVINST (0x21) + +#define NDR_PNP_ADDID (0x22) + +#define NDR_PNP_REGISTERDRIVER (0x23) + +#define NDR_PNP_QUERYREMOVE (0x24) + +#define NDR_PNP_REQUESTDEVICEEJECT (0x25) + +#define NDR_PNP_ISDOCKSTATIONPRESENT (0x26) + +#define NDR_PNP_REQUESTEJECTPC (0x27) + +#define NDR_PNP_HWPROFFLAGS (0x28) + +#define NDR_PNP_GETHWPROFINFO (0x29) + +#define NDR_PNP_ADDEMPTYLOGCONF (0x2a) + +#define NDR_PNP_FREELOGCONF (0x2b) + +#define NDR_PNP_GETFIRSTLOGCONF (0x2c) + +#define NDR_PNP_GETNEXTLOGCONF (0x2d) + +#define NDR_PNP_GETLOGCONFPRIORITY (0x2e) + +#define NDR_PNP_ADDRESDES (0x2f) + +#define NDR_PNP_FREERESDES (0x30) + +#define NDR_PNP_GETNEXTRESDES (0x31) + +#define NDR_PNP_GETRESDESDATA (0x32) + +#define NDR_PNP_GETRESDESDATASIZE (0x33) + +#define NDR_PNP_MODIFYRESDES (0x34) + +#define NDR_PNP_DETECTRESOURCELIMIT (0x35) + +#define NDR_PNP_QUERYRESCONFLIST (0x36) + +#define NDR_PNP_SETHWPROF (0x37) + +#define NDR_PNP_QUERYARBITRATORFREEDATA (0x38) + +#define NDR_PNP_QUERYARBITRATORFREESIZE (0x39) + +#define NDR_PNP_RUNDETECTION (0x3a) + +#define NDR_PNP_REGISTERNOTIFICATION (0x3b) + +#define NDR_PNP_UNREGISTERNOTIFICATION (0x3c) + +#define NDR_PNP_GETCUSTOMDEVPROP (0x3d) + +#define NDR_PNP_GETVERSIONINTERNAL (0x3e) + +#define NDR_PNP_GETBLOCKEDDRIVERINFO (0x3f) + +#define NDR_PNP_GETSERVERSIDEDEVICEINSTALLFLAGS (0x40) + +#define NDR_NTSVCS_CALL_COUNT (65) +void ndr_print_PNP_HwProfInfo(struct ndr_print *ndr, const char *name, const struct PNP_HwProfInfo *r); +void ndr_print_PNP_Disconnect(struct ndr_print *ndr, const char *name, int flags, const struct PNP_Disconnect *r); +void ndr_print_PNP_Connect(struct ndr_print *ndr, const char *name, int flags, const struct PNP_Connect *r); +void ndr_print_PNP_GetVersion(struct ndr_print *ndr, const char *name, int flags, const struct PNP_GetVersion *r); +void ndr_print_PNP_GetGlobalState(struct ndr_print *ndr, const char *name, int flags, const struct PNP_GetGlobalState *r); +void ndr_print_PNP_InitDetection(struct ndr_print *ndr, const char *name, int flags, const struct PNP_InitDetection *r); +void ndr_print_PNP_ReportLogOn(struct ndr_print *ndr, const char *name, int flags, const struct PNP_ReportLogOn *r); +void ndr_print_PNP_ValidateDeviceInstance(struct ndr_print *ndr, const char *name, int flags, const struct PNP_ValidateDeviceInstance *r); +void ndr_print_PNP_GetRootDeviceInstance(struct ndr_print *ndr, const char *name, int flags, const struct PNP_GetRootDeviceInstance *r); +void ndr_print_PNP_GetRelatedDeviceInstance(struct ndr_print *ndr, const char *name, int flags, const struct PNP_GetRelatedDeviceInstance *r); +void ndr_print_PNP_EnumerateSubKeys(struct ndr_print *ndr, const char *name, int flags, const struct PNP_EnumerateSubKeys *r); +void ndr_print_PNP_GetDeviceList(struct ndr_print *ndr, const char *name, int flags, const struct PNP_GetDeviceList *r); +void ndr_print_PNP_GetDeviceListSize(struct ndr_print *ndr, const char *name, int flags, const struct PNP_GetDeviceListSize *r); +void ndr_print_PNP_GetDepth(struct ndr_print *ndr, const char *name, int flags, const struct PNP_GetDepth *r); +void ndr_print_PNP_GetDeviceRegProp(struct ndr_print *ndr, const char *name, int flags, const struct PNP_GetDeviceRegProp *r); +void ndr_print_PNP_SetDeviceRegProp(struct ndr_print *ndr, const char *name, int flags, const struct PNP_SetDeviceRegProp *r); +void ndr_print_PNP_GetClassInstance(struct ndr_print *ndr, const char *name, int flags, const struct PNP_GetClassInstance *r); +void ndr_print_PNP_CreateKey(struct ndr_print *ndr, const char *name, int flags, const struct PNP_CreateKey *r); +void ndr_print_PNP_DeleteRegistryKey(struct ndr_print *ndr, const char *name, int flags, const struct PNP_DeleteRegistryKey *r); +void ndr_print_PNP_GetClassCount(struct ndr_print *ndr, const char *name, int flags, const struct PNP_GetClassCount *r); +void ndr_print_PNP_GetClassName(struct ndr_print *ndr, const char *name, int flags, const struct PNP_GetClassName *r); +void ndr_print_PNP_DeleteClassKey(struct ndr_print *ndr, const char *name, int flags, const struct PNP_DeleteClassKey *r); +void ndr_print_PNP_GetInterfaceDeviceAlias(struct ndr_print *ndr, const char *name, int flags, const struct PNP_GetInterfaceDeviceAlias *r); +void ndr_print_PNP_GetInterfaceDeviceList(struct ndr_print *ndr, const char *name, int flags, const struct PNP_GetInterfaceDeviceList *r); +void ndr_print_PNP_GetInterfaceDeviceListSize(struct ndr_print *ndr, const char *name, int flags, const struct PNP_GetInterfaceDeviceListSize *r); +void ndr_print_PNP_RegisterDeviceClassAssociation(struct ndr_print *ndr, const char *name, int flags, const struct PNP_RegisterDeviceClassAssociation *r); +void ndr_print_PNP_UnregisterDeviceClassAssociation(struct ndr_print *ndr, const char *name, int flags, const struct PNP_UnregisterDeviceClassAssociation *r); +void ndr_print_PNP_GetClassRegProp(struct ndr_print *ndr, const char *name, int flags, const struct PNP_GetClassRegProp *r); +void ndr_print_PNP_SetClassRegProp(struct ndr_print *ndr, const char *name, int flags, const struct PNP_SetClassRegProp *r); +void ndr_print_PNP_CreateDevInst(struct ndr_print *ndr, const char *name, int flags, const struct PNP_CreateDevInst *r); +void ndr_print_PNP_DeviceInstanceAction(struct ndr_print *ndr, const char *name, int flags, const struct PNP_DeviceInstanceAction *r); +void ndr_print_PNP_GetDeviceStatus(struct ndr_print *ndr, const char *name, int flags, const struct PNP_GetDeviceStatus *r); +void ndr_print_PNP_SetDeviceProblem(struct ndr_print *ndr, const char *name, int flags, const struct PNP_SetDeviceProblem *r); +void ndr_print_PNP_DisableDevInst(struct ndr_print *ndr, const char *name, int flags, const struct PNP_DisableDevInst *r); +void ndr_print_PNP_UninstallDevInst(struct ndr_print *ndr, const char *name, int flags, const struct PNP_UninstallDevInst *r); +void ndr_print_PNP_AddID(struct ndr_print *ndr, const char *name, int flags, const struct PNP_AddID *r); +void ndr_print_PNP_RegisterDriver(struct ndr_print *ndr, const char *name, int flags, const struct PNP_RegisterDriver *r); +void ndr_print_PNP_QueryRemove(struct ndr_print *ndr, const char *name, int flags, const struct PNP_QueryRemove *r); +void ndr_print_PNP_RequestDeviceEject(struct ndr_print *ndr, const char *name, int flags, const struct PNP_RequestDeviceEject *r); +void ndr_print_PNP_IsDockStationPresent(struct ndr_print *ndr, const char *name, int flags, const struct PNP_IsDockStationPresent *r); +void ndr_print_PNP_RequestEjectPC(struct ndr_print *ndr, const char *name, int flags, const struct PNP_RequestEjectPC *r); +void ndr_print_PNP_HwProfFlags(struct ndr_print *ndr, const char *name, int flags, const struct PNP_HwProfFlags *r); +void ndr_print_PNP_GetHwProfInfo(struct ndr_print *ndr, const char *name, int flags, const struct PNP_GetHwProfInfo *r); +void ndr_print_PNP_AddEmptyLogConf(struct ndr_print *ndr, const char *name, int flags, const struct PNP_AddEmptyLogConf *r); +void ndr_print_PNP_FreeLogConf(struct ndr_print *ndr, const char *name, int flags, const struct PNP_FreeLogConf *r); +void ndr_print_PNP_GetFirstLogConf(struct ndr_print *ndr, const char *name, int flags, const struct PNP_GetFirstLogConf *r); +void ndr_print_PNP_GetNextLogConf(struct ndr_print *ndr, const char *name, int flags, const struct PNP_GetNextLogConf *r); +void ndr_print_PNP_GetLogConfPriority(struct ndr_print *ndr, const char *name, int flags, const struct PNP_GetLogConfPriority *r); +void ndr_print_PNP_AddResDes(struct ndr_print *ndr, const char *name, int flags, const struct PNP_AddResDes *r); +void ndr_print_PNP_FreeResDes(struct ndr_print *ndr, const char *name, int flags, const struct PNP_FreeResDes *r); +void ndr_print_PNP_GetNextResDes(struct ndr_print *ndr, const char *name, int flags, const struct PNP_GetNextResDes *r); +void ndr_print_PNP_GetResDesData(struct ndr_print *ndr, const char *name, int flags, const struct PNP_GetResDesData *r); +void ndr_print_PNP_GetResDesDataSize(struct ndr_print *ndr, const char *name, int flags, const struct PNP_GetResDesDataSize *r); +void ndr_print_PNP_ModifyResDes(struct ndr_print *ndr, const char *name, int flags, const struct PNP_ModifyResDes *r); +void ndr_print_PNP_DetectResourceLimit(struct ndr_print *ndr, const char *name, int flags, const struct PNP_DetectResourceLimit *r); +void ndr_print_PNP_QueryResConfList(struct ndr_print *ndr, const char *name, int flags, const struct PNP_QueryResConfList *r); +void ndr_print_PNP_SetHwProf(struct ndr_print *ndr, const char *name, int flags, const struct PNP_SetHwProf *r); +void ndr_print_PNP_QueryArbitratorFreeData(struct ndr_print *ndr, const char *name, int flags, const struct PNP_QueryArbitratorFreeData *r); +void ndr_print_PNP_QueryArbitratorFreeSize(struct ndr_print *ndr, const char *name, int flags, const struct PNP_QueryArbitratorFreeSize *r); +void ndr_print_PNP_RunDetection(struct ndr_print *ndr, const char *name, int flags, const struct PNP_RunDetection *r); +void ndr_print_PNP_RegisterNotification(struct ndr_print *ndr, const char *name, int flags, const struct PNP_RegisterNotification *r); +void ndr_print_PNP_UnregisterNotification(struct ndr_print *ndr, const char *name, int flags, const struct PNP_UnregisterNotification *r); +void ndr_print_PNP_GetCustomDevProp(struct ndr_print *ndr, const char *name, int flags, const struct PNP_GetCustomDevProp *r); +void ndr_print_PNP_GetVersionInternal(struct ndr_print *ndr, const char *name, int flags, const struct PNP_GetVersionInternal *r); +void ndr_print_PNP_GetBlockedDriverInfo(struct ndr_print *ndr, const char *name, int flags, const struct PNP_GetBlockedDriverInfo *r); +void ndr_print_PNP_GetServerSideDeviceInstallFlags(struct ndr_print *ndr, const char *name, int flags, const struct PNP_GetServerSideDeviceInstallFlags *r); +#endif /* _HEADER_NDR_ntsvcs */ diff --git a/source3/librpc/gen_ndr/ndr_samr.c b/source3/librpc/gen_ndr/ndr_samr.c new file mode 100644 index 0000000000..3af589f393 --- /dev/null +++ b/source3/librpc/gen_ndr/ndr_samr.c @@ -0,0 +1,12676 @@ +/* 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), "SAMR_USER_ACCESS_GET_NAME_ETC", SAMR_USER_ACCESS_GET_NAME_ETC, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_USER_ACCESS_GET_LOCALE", SAMR_USER_ACCESS_GET_LOCALE, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_USER_ACCESS_SET_LOC_COM", SAMR_USER_ACCESS_SET_LOC_COM, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_USER_ACCESS_GET_LOGONINFO", SAMR_USER_ACCESS_GET_LOGONINFO, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_USER_ACCESS_GET_ATTRIBUTES", SAMR_USER_ACCESS_GET_ATTRIBUTES, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_USER_ACCESS_SET_ATTRIBUTES", SAMR_USER_ACCESS_SET_ATTRIBUTES, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_USER_ACCESS_CHANGE_PASSWORD", SAMR_USER_ACCESS_CHANGE_PASSWORD, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_USER_ACCESS_SET_PASSWORD", SAMR_USER_ACCESS_SET_PASSWORD, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_USER_ACCESS_GET_GROUPS", SAMR_USER_ACCESS_GET_GROUPS, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_USER_ACCESS_GET_GROUP_MEMBERSHIP", SAMR_USER_ACCESS_GET_GROUP_MEMBERSHIP, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_USER_ACCESS_CHANGE_GROUP_MEMBERSHIP", SAMR_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), "SAMR_DOMAIN_ACCESS_LOOKUP_INFO_1", SAMR_DOMAIN_ACCESS_LOOKUP_INFO_1, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_DOMAIN_ACCESS_SET_INFO_1", SAMR_DOMAIN_ACCESS_SET_INFO_1, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_DOMAIN_ACCESS_LOOKUP_INFO_2", SAMR_DOMAIN_ACCESS_LOOKUP_INFO_2, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_DOMAIN_ACCESS_SET_INFO_2", SAMR_DOMAIN_ACCESS_SET_INFO_2, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_DOMAIN_ACCESS_CREATE_USER", SAMR_DOMAIN_ACCESS_CREATE_USER, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_DOMAIN_ACCESS_CREATE_GROUP", SAMR_DOMAIN_ACCESS_CREATE_GROUP, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_DOMAIN_ACCESS_CREATE_ALIAS", SAMR_DOMAIN_ACCESS_CREATE_ALIAS, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_DOMAIN_ACCESS_LOOKUP_ALIAS", SAMR_DOMAIN_ACCESS_LOOKUP_ALIAS, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_DOMAIN_ACCESS_ENUM_ACCOUNTS", SAMR_DOMAIN_ACCESS_ENUM_ACCOUNTS, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_DOMAIN_ACCESS_OPEN_ACCOUNT", SAMR_DOMAIN_ACCESS_OPEN_ACCOUNT, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_DOMAIN_ACCESS_SET_INFO_3", SAMR_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), "SAMR_GROUP_ACCESS_LOOKUP_INFO", SAMR_GROUP_ACCESS_LOOKUP_INFO, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_GROUP_ACCESS_SET_INFO", SAMR_GROUP_ACCESS_SET_INFO, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_GROUP_ACCESS_ADD_MEMBER", SAMR_GROUP_ACCESS_ADD_MEMBER, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_GROUP_ACCESS_REMOVE_MEMBER", SAMR_GROUP_ACCESS_REMOVE_MEMBER, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_GROUP_ACCESS_GET_MEMBERS", SAMR_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), "SAMR_ALIAS_ACCESS_ADD_MEMBER", SAMR_ALIAS_ACCESS_ADD_MEMBER, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_ALIAS_ACCESS_REMOVE_MEMBER", SAMR_ALIAS_ACCESS_REMOVE_MEMBER, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_ALIAS_ACCESS_GET_MEMBERS", SAMR_ALIAS_ACCESS_GET_MEMBERS, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_ALIAS_ACCESS_LOOKUP_INFO", SAMR_ALIAS_ACCESS_LOOKUP_INFO, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_ALIAS_ACCESS_SET_INFO", SAMR_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; + if (asprintf(&idx_1, "[%d]", cntr_entries_1) != -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; + if (asprintf(&idx_1, "[%d]", cntr_ids_1) != -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; + if (asprintf(&idx_1, "[%d]", cntr_rids_1) != -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; + if (asprintf(&idx_1, "[%d]", cntr_types_1) != -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--; +} + +_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; + } +} + +static enum ndr_err_code ndr_push_samr_UserInfo18(struct ndr_push *ndr, int ndr_flags, const struct samr_UserInfo18 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 1)); + NDR_CHECK(ndr_push_samr_Password(ndr, NDR_SCALARS, &r->lm_pwd)); + NDR_CHECK(ndr_push_samr_Password(ndr, NDR_SCALARS, &r->nt_pwd)); + NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->lm_pwd_active)); + NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->nt_pwd_active)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_UserInfo18(struct ndr_pull *ndr, int ndr_flags, struct samr_UserInfo18 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 1)); + NDR_CHECK(ndr_pull_samr_Password(ndr, NDR_SCALARS, &r->lm_pwd)); + NDR_CHECK(ndr_pull_samr_Password(ndr, NDR_SCALARS, &r->nt_pwd)); + NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->lm_pwd_active)); + NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->nt_pwd_active)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_UserInfo18(struct ndr_print *ndr, const char *name, const struct samr_UserInfo18 *r) +{ + ndr_print_struct(ndr, name, "samr_UserInfo18"); + ndr->depth++; + ndr_print_samr_Password(ndr, "lm_pwd", &r->lm_pwd); + ndr_print_samr_Password(ndr, "nt_pwd", &r->nt_pwd); + ndr_print_uint8(ndr, "lm_pwd_active", r->lm_pwd_active); + ndr_print_uint8(ndr, "nt_pwd_active", r->nt_pwd_active); + 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 18: { + NDR_CHECK(ndr_push_samr_UserInfo18(ndr, NDR_SCALARS, &r->info18)); + 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 18: + 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 18: { + NDR_CHECK(ndr_pull_samr_UserInfo18(ndr, NDR_SCALARS, &r->info18)); + 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 18: + 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 18: + ndr_print_samr_UserInfo18(ndr, "info18", &r->info18); + 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_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; + if (asprintf(&idx_1, "[%d]", cntr_rids_1) != -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; + if (asprintf(&idx_1, "[%d]", cntr_entries_1) != -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; + if (asprintf(&idx_1, "[%d]", cntr_entries_1) != -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; + if (asprintf(&idx_1, "[%d]", cntr_entries_1) != -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_AsciiStringLarge(ndr, NDR_SCALARS, &r->account_name)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_push_lsa_AsciiStringLarge(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_AsciiStringLarge(ndr, NDR_SCALARS, &r->account_name)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_pull_lsa_AsciiStringLarge(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_AsciiStringLarge(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; + if (asprintf(&idx_1, "[%d]", cntr_entries_1) != -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_ConnectVersion(struct ndr_push *ndr, int ndr_flags, enum samr_ConnectVersion r) +{ + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r)); + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_samr_ConnectVersion(struct ndr_pull *ndr, int ndr_flags, enum samr_ConnectVersion *r) +{ + uint16_t v; + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &v)); + *r = v; + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_samr_ConnectVersion(struct ndr_print *ndr, const char *name, enum samr_ConnectVersion r) +{ + const char *val = NULL; + + switch (r) { + case SAMR_CONNECT_PRE_W2K: val = "SAMR_CONNECT_PRE_W2K"; break; + case SAMR_CONNECT_W2K: val = "SAMR_CONNECT_W2K"; break; + case SAMR_CONNECT_AFTER_W2K: val = "SAMR_CONNECT_AFTER_W2K"; break; + } + ndr_print_enum(ndr, name, "ENUM", val, r); +} + +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_samr_ConnectVersion(ndr, NDR_SCALARS, r->client_version)); + 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_samr_ConnectVersion(ndr, NDR_SCALARS, &r->client_version)); + 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_samr_ConnectVersion(ndr, "client_version", r->client_version); + 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; + if (asprintf(&idx_1, "[%d]", cntr_pwd_history_1) != -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_unique_ptr(ndr, *r->out.sdbuf)); + if (*r->out.sdbuf) { + 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) +{ + uint32_t _ptr_sdbuf; + TALLOC_CTX *_mem_save_handle_0; + TALLOC_CTX *_mem_save_sdbuf_0; + TALLOC_CTX *_mem_save_sdbuf_1; + 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_generic_ptr(ndr, &_ptr_sdbuf)); + if (_ptr_sdbuf) { + NDR_PULL_ALLOC(ndr, *r->out.sdbuf); + } else { + *r->out.sdbuf = NULL; + } + if (*r->out.sdbuf) { + _mem_save_sdbuf_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, *r->out.sdbuf, 0); + NDR_CHECK(ndr_pull_sec_desc_buf(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.sdbuf)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sdbuf_1, 0); + } + 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_ptr(ndr, "sdbuf", *r->out.sdbuf); + ndr->depth++; + if (*r->out.sdbuf) { + ndr_print_sec_desc_buf(ndr, "sdbuf", *r->out.sdbuf); + } + ndr->depth--; + 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_unique_ptr(ndr, *r->out.sid)); + if (*r->out.sid) { + 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) +{ + uint32_t _ptr_sid; + TALLOC_CTX *_mem_save_connect_handle_0; + TALLOC_CTX *_mem_save_domain_name_0; + TALLOC_CTX *_mem_save_sid_0; + TALLOC_CTX *_mem_save_sid_1; + 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_generic_ptr(ndr, &_ptr_sid)); + if (_ptr_sid) { + NDR_PULL_ALLOC(ndr, *r->out.sid); + } else { + *r->out.sid = NULL; + } + if (*r->out.sid) { + _mem_save_sid_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, *r->out.sid, 0); + NDR_CHECK(ndr_pull_dom_sid2(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.sid)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sid_1, 0); + } + 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_ptr(ndr, "sid", *r->out.sid); + ndr->depth++; + if (*r->out.sid) { + ndr_print_dom_sid2(ndr, "sid", *r->out.sid); + } + ndr->depth--; + 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_unique_ptr(ndr, *r->out.sam)); + if (*r->out.sam) { + 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) +{ + uint32_t _ptr_sam; + TALLOC_CTX *_mem_save_connect_handle_0; + TALLOC_CTX *_mem_save_resume_handle_0; + TALLOC_CTX *_mem_save_sam_0; + TALLOC_CTX *_mem_save_sam_1; + 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_generic_ptr(ndr, &_ptr_sam)); + if (_ptr_sam) { + NDR_PULL_ALLOC(ndr, *r->out.sam); + } else { + *r->out.sam = NULL; + } + if (*r->out.sam) { + _mem_save_sam_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, *r->out.sam, 0); + NDR_CHECK(ndr_pull_samr_SamArray(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.sam)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sam_1, 0); + } + 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_ptr(ndr, "sam", *r->out.sam); + ndr->depth++; + if (*r->out.sam) { + ndr_print_samr_SamArray(ndr, "sam", *r->out.sam); + } + ndr->depth--; + 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_unique_ptr(ndr, *r->out.info)); + if (*r->out.info) { + 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) +{ + uint32_t _ptr_info; + TALLOC_CTX *_mem_save_domain_handle_0; + TALLOC_CTX *_mem_save_info_0; + TALLOC_CTX *_mem_save_info_1; + 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_generic_ptr(ndr, &_ptr_info)); + if (_ptr_info) { + NDR_PULL_ALLOC(ndr, *r->out.info); + } else { + *r->out.info = NULL; + } + if (*r->out.info) { + _mem_save_info_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, *r->out.info, 0); + 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_1, 0); + } + 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_ptr(ndr, "info", *r->out.info); + ndr->depth++; + if (*r->out.info) { + ndr_print_set_switch_value(ndr, *r->out.info, r->in.level); + ndr_print_samr_DomainInfo(ndr, "info", *r->out.info); + } + ndr->depth--; + 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_unique_ptr(ndr, *r->out.sam)); + if (*r->out.sam) { + 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) +{ + uint32_t _ptr_sam; + TALLOC_CTX *_mem_save_domain_handle_0; + TALLOC_CTX *_mem_save_resume_handle_0; + TALLOC_CTX *_mem_save_sam_0; + TALLOC_CTX *_mem_save_sam_1; + 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_generic_ptr(ndr, &_ptr_sam)); + if (_ptr_sam) { + NDR_PULL_ALLOC(ndr, *r->out.sam); + } else { + *r->out.sam = NULL; + } + if (*r->out.sam) { + _mem_save_sam_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, *r->out.sam, 0); + NDR_CHECK(ndr_pull_samr_SamArray(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.sam)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sam_1, 0); + } + 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_ptr(ndr, "sam", *r->out.sam); + ndr->depth++; + if (*r->out.sam) { + ndr_print_samr_SamArray(ndr, "sam", *r->out.sam); + } + ndr->depth--; + 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_unique_ptr(ndr, *r->out.sam)); + if (*r->out.sam) { + 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) +{ + uint32_t _ptr_sam; + TALLOC_CTX *_mem_save_domain_handle_0; + TALLOC_CTX *_mem_save_resume_handle_0; + TALLOC_CTX *_mem_save_sam_0; + TALLOC_CTX *_mem_save_sam_1; + 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_generic_ptr(ndr, &_ptr_sam)); + if (_ptr_sam) { + NDR_PULL_ALLOC(ndr, *r->out.sam); + } else { + *r->out.sam = NULL; + } + if (*r->out.sam) { + _mem_save_sam_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, *r->out.sam, 0); + NDR_CHECK(ndr_pull_samr_SamArray(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.sam)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sam_1, 0); + } + 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_ptr(ndr, "sam", *r->out.sam); + ndr->depth++; + if (*r->out.sam) { + ndr_print_samr_SamArray(ndr, "sam", *r->out.sam); + } + ndr->depth--; + 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_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_unique_ptr(ndr, *r->out.sam)); + if (*r->out.sam) { + 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) +{ + uint32_t _ptr_sam; + TALLOC_CTX *_mem_save_domain_handle_0; + TALLOC_CTX *_mem_save_resume_handle_0; + TALLOC_CTX *_mem_save_sam_0; + TALLOC_CTX *_mem_save_sam_1; + 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_generic_ptr(ndr, &_ptr_sam)); + if (_ptr_sam) { + NDR_PULL_ALLOC(ndr, *r->out.sam); + } else { + *r->out.sam = NULL; + } + if (*r->out.sam) { + _mem_save_sam_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, *r->out.sam, 0); + NDR_CHECK(ndr_pull_samr_SamArray(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.sam)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sam_1, 0); + } + 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_uint32(ndr, "max_size", r->in.max_size); + 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_ptr(ndr, "sam", *r->out.sam); + ndr->depth++; + if (*r->out.sam) { + ndr_print_samr_SamArray(ndr, "sam", *r->out.sam); + } + ndr->depth--; + 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; + if (asprintf(&idx_0, "[%d]", cntr_names_0) != -1) { + 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; + if (asprintf(&idx_0, "[%d]", cntr_rids_0) != -1) { + 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_unique_ptr(ndr, *r->out.info)); + if (*r->out.info) { + 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) +{ + uint32_t _ptr_info; + TALLOC_CTX *_mem_save_group_handle_0; + TALLOC_CTX *_mem_save_info_0; + TALLOC_CTX *_mem_save_info_1; + 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_generic_ptr(ndr, &_ptr_info)); + if (_ptr_info) { + NDR_PULL_ALLOC(ndr, *r->out.info); + } else { + *r->out.info = NULL; + } + if (*r->out.info) { + _mem_save_info_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, *r->out.info, 0); + 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_1, 0); + } + 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_ptr(ndr, "info", *r->out.info); + ndr->depth++; + if (*r->out.info) { + ndr_print_set_switch_value(ndr, *r->out.info, r->in.level); + ndr_print_samr_GroupInfo(ndr, "info", *r->out.info); + } + ndr->depth--; + 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_unique_ptr(ndr, *r->out.rids)); + if (*r->out.rids) { + 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) +{ + uint32_t _ptr_rids; + TALLOC_CTX *_mem_save_group_handle_0; + TALLOC_CTX *_mem_save_rids_0; + TALLOC_CTX *_mem_save_rids_1; + 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_generic_ptr(ndr, &_ptr_rids)); + if (_ptr_rids) { + NDR_PULL_ALLOC(ndr, *r->out.rids); + } else { + *r->out.rids = NULL; + } + if (*r->out.rids) { + _mem_save_rids_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, *r->out.rids, 0); + NDR_CHECK(ndr_pull_samr_RidTypeArray(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.rids)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_rids_1, 0); + } + 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_ptr(ndr, "rids", *r->out.rids); + ndr->depth++; + if (*r->out.rids) { + ndr_print_samr_RidTypeArray(ndr, "rids", *r->out.rids); + } + ndr->depth--; + 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_unique_ptr(ndr, *r->out.info)); + if (*r->out.info) { + 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) +{ + uint32_t _ptr_info; + TALLOC_CTX *_mem_save_alias_handle_0; + TALLOC_CTX *_mem_save_info_0; + TALLOC_CTX *_mem_save_info_1; + 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_generic_ptr(ndr, &_ptr_info)); + if (_ptr_info) { + NDR_PULL_ALLOC(ndr, *r->out.info); + } else { + *r->out.info = NULL; + } + if (*r->out.info) { + _mem_save_info_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, *r->out.info, 0); + 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_1, 0); + } + 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_ptr(ndr, "info", *r->out.info); + ndr->depth++; + if (*r->out.info) { + ndr_print_set_switch_value(ndr, *r->out.info, r->in.level); + ndr_print_samr_AliasInfo(ndr, "info", *r->out.info); + } + ndr->depth--; + 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_unique_ptr(ndr, *r->out.info)); + if (*r->out.info) { + 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) +{ + uint32_t _ptr_info; + TALLOC_CTX *_mem_save_user_handle_0; + TALLOC_CTX *_mem_save_info_0; + TALLOC_CTX *_mem_save_info_1; + 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_generic_ptr(ndr, &_ptr_info)); + if (_ptr_info) { + NDR_PULL_ALLOC(ndr, *r->out.info); + } else { + *r->out.info = NULL; + } + if (*r->out.info) { + _mem_save_info_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, *r->out.info, 0); + 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_1, 0); + } + 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_ptr(ndr, "info", *r->out.info); + ndr->depth++; + if (*r->out.info) { + ndr_print_set_switch_value(ndr, *r->out.info, r->in.level); + ndr_print_samr_UserInfo(ndr, "info", *r->out.info); + } + ndr->depth--; + 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_unique_ptr(ndr, *r->out.rids)); + if (*r->out.rids) { + 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) +{ + uint32_t _ptr_rids; + TALLOC_CTX *_mem_save_user_handle_0; + TALLOC_CTX *_mem_save_rids_0; + TALLOC_CTX *_mem_save_rids_1; + 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_generic_ptr(ndr, &_ptr_rids)); + if (_ptr_rids) { + NDR_PULL_ALLOC(ndr, *r->out.rids); + } else { + *r->out.rids = NULL; + } + if (*r->out.rids) { + _mem_save_rids_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, *r->out.rids, 0); + NDR_CHECK(ndr_pull_samr_RidWithAttributeArray(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.rids)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_rids_1, 0); + } + 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_ptr(ndr, "rids", *r->out.rids); + ndr->depth++; + if (*r->out.rids) { + ndr_print_samr_RidWithAttributeArray(ndr, "rids", *r->out.rids); + } + ndr->depth--; + 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_unique_ptr(ndr, *r->out.info)); + if (*r->out.info) { + 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) +{ + uint32_t _ptr_info; + TALLOC_CTX *_mem_save_domain_handle_0; + TALLOC_CTX *_mem_save_info_0; + TALLOC_CTX *_mem_save_info_1; + 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_generic_ptr(ndr, &_ptr_info)); + if (_ptr_info) { + NDR_PULL_ALLOC(ndr, *r->out.info); + } else { + *r->out.info = NULL; + } + if (*r->out.info) { + _mem_save_info_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, *r->out.info, 0); + 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_1, 0); + } + 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_ptr(ndr, "info", *r->out.info); + ndr->depth++; + if (*r->out.info) { + ndr_print_set_switch_value(ndr, *r->out.info, r->in.level); + ndr_print_samr_DomainInfo(ndr, "info", *r->out.info); + } + ndr->depth--; + 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_samr_ConnectVersion(ndr, NDR_SCALARS, r->in.client_version)); + 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_samr_ConnectVersion(ndr, NDR_SCALARS, &r->in.client_version)); + 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_samr_ConnectVersion(ndr, "client_version", r->in.client_version); + 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_unique_ptr(ndr, *r->out.dominfo)); + if (*r->out.dominfo) { + 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_unique_ptr(ndr, *r->out.reject)); + if (*r->out.reject) { + 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; + uint32_t _ptr_dominfo; + uint32_t _ptr_reject; + 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_dominfo_1; + TALLOC_CTX *_mem_save_reject_0; + TALLOC_CTX *_mem_save_reject_1; + 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_generic_ptr(ndr, &_ptr_dominfo)); + if (_ptr_dominfo) { + NDR_PULL_ALLOC(ndr, *r->out.dominfo); + } else { + *r->out.dominfo = NULL; + } + if (*r->out.dominfo) { + _mem_save_dominfo_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, *r->out.dominfo, 0); + NDR_CHECK(ndr_pull_samr_DomInfo1(ndr, NDR_SCALARS, *r->out.dominfo)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_dominfo_1, 0); + } + 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_generic_ptr(ndr, &_ptr_reject)); + if (_ptr_reject) { + NDR_PULL_ALLOC(ndr, *r->out.reject); + } else { + *r->out.reject = NULL; + } + if (*r->out.reject) { + _mem_save_reject_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, *r->out.reject, 0); + NDR_CHECK(ndr_pull_samr_ChangeReject(ndr, NDR_SCALARS, *r->out.reject)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_reject_1, 0); + } + 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_ptr(ndr, "dominfo", *r->out.dominfo); + ndr->depth++; + if (*r->out.dominfo) { + ndr_print_samr_DomInfo1(ndr, "dominfo", *r->out.dominfo); + } + ndr->depth--; + ndr->depth--; + ndr_print_ptr(ndr, "reject", r->out.reject); + ndr->depth++; + ndr_print_ptr(ndr, "reject", *r->out.reject); + ndr->depth++; + if (*r->out.reject) { + ndr_print_samr_ChangeReject(ndr, "reject", *r->out.reject); + } + ndr->depth--; + 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..c21b5455fb --- /dev/null +++ b/source3/librpc/gen_ndr/ndr_samr.h @@ -0,0 +1,342 @@ +/* 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); +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); +void ndr_print_samr_UserInfo18(struct ndr_print *ndr, const char *name, const struct samr_UserInfo18 *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_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_ConnectVersion(struct ndr_print *ndr, const char *name, enum samr_ConnectVersion 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/ndr_security.c b/source3/librpc/gen_ndr/ndr_security.c new file mode 100644 index 0000000000..cbeabf48e5 --- /dev/null +++ b/source3/librpc/gen_ndr/ndr_security.c @@ -0,0 +1,1026 @@ +/* parser auto-generated by pidl */ + +#include "includes.h" +#include "librpc/gen_ndr/ndr_security.h" + +#include "librpc/gen_ndr/ndr_misc.h" +static enum ndr_err_code ndr_push_security_ace_flags(struct ndr_push *ndr, int ndr_flags, uint8_t r) +{ + NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r)); + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_security_ace_flags(struct ndr_pull *ndr, int ndr_flags, uint8_t *r) +{ + uint8_t v; + NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &v)); + *r = v; + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_security_ace_flags(struct ndr_print *ndr, const char *name, uint8_t r) +{ + ndr_print_uint8(ndr, name, r); + ndr->depth++; + ndr_print_bitmap_flag(ndr, sizeof(uint8_t), "SEC_ACE_FLAG_OBJECT_INHERIT", SEC_ACE_FLAG_OBJECT_INHERIT, r); + ndr_print_bitmap_flag(ndr, sizeof(uint8_t), "SEC_ACE_FLAG_CONTAINER_INHERIT", SEC_ACE_FLAG_CONTAINER_INHERIT, r); + ndr_print_bitmap_flag(ndr, sizeof(uint8_t), "SEC_ACE_FLAG_NO_PROPAGATE_INHERIT", SEC_ACE_FLAG_NO_PROPAGATE_INHERIT, r); + ndr_print_bitmap_flag(ndr, sizeof(uint8_t), "SEC_ACE_FLAG_INHERIT_ONLY", SEC_ACE_FLAG_INHERIT_ONLY, r); + ndr_print_bitmap_flag(ndr, sizeof(uint8_t), "SEC_ACE_FLAG_INHERITED_ACE", SEC_ACE_FLAG_INHERITED_ACE, r); + ndr_print_bitmap_flag(ndr, sizeof(uint8_t), "SEC_ACE_FLAG_VALID_INHERIT", SEC_ACE_FLAG_VALID_INHERIT, r); + ndr_print_bitmap_flag(ndr, sizeof(uint8_t), "SEC_ACE_FLAG_SUCCESSFUL_ACCESS", SEC_ACE_FLAG_SUCCESSFUL_ACCESS, r); + ndr_print_bitmap_flag(ndr, sizeof(uint8_t), "SEC_ACE_FLAG_FAILED_ACCESS", SEC_ACE_FLAG_FAILED_ACCESS, r); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_security_ace_type(struct ndr_push *ndr, int ndr_flags, enum security_ace_type r) +{ + NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r)); + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_security_ace_type(struct ndr_pull *ndr, int ndr_flags, enum security_ace_type *r) +{ + uint8_t v; + NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &v)); + *r = v; + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_security_ace_type(struct ndr_print *ndr, const char *name, enum security_ace_type r) +{ + const char *val = NULL; + + switch (r) { + case SEC_ACE_TYPE_ACCESS_ALLOWED: val = "SEC_ACE_TYPE_ACCESS_ALLOWED"; break; + case SEC_ACE_TYPE_ACCESS_DENIED: val = "SEC_ACE_TYPE_ACCESS_DENIED"; break; + case SEC_ACE_TYPE_SYSTEM_AUDIT: val = "SEC_ACE_TYPE_SYSTEM_AUDIT"; break; + case SEC_ACE_TYPE_SYSTEM_ALARM: val = "SEC_ACE_TYPE_SYSTEM_ALARM"; break; + case SEC_ACE_TYPE_ALLOWED_COMPOUND: val = "SEC_ACE_TYPE_ALLOWED_COMPOUND"; break; + case SEC_ACE_TYPE_ACCESS_ALLOWED_OBJECT: val = "SEC_ACE_TYPE_ACCESS_ALLOWED_OBJECT"; break; + case SEC_ACE_TYPE_ACCESS_DENIED_OBJECT: val = "SEC_ACE_TYPE_ACCESS_DENIED_OBJECT"; break; + case SEC_ACE_TYPE_SYSTEM_AUDIT_OBJECT: val = "SEC_ACE_TYPE_SYSTEM_AUDIT_OBJECT"; break; + case SEC_ACE_TYPE_SYSTEM_ALARM_OBJECT: val = "SEC_ACE_TYPE_SYSTEM_ALARM_OBJECT"; break; + } + ndr_print_enum(ndr, name, "ENUM", val, r); +} + +static enum ndr_err_code ndr_push_security_ace_object_flags(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_security_ace_object_flags(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_security_ace_object_flags(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), "SEC_ACE_OBJECT_TYPE_PRESENT", SEC_ACE_OBJECT_TYPE_PRESENT, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SEC_ACE_INHERITED_OBJECT_TYPE_PRESENT", SEC_ACE_INHERITED_OBJECT_TYPE_PRESENT, r); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_security_ace_object_type(struct ndr_push *ndr, int ndr_flags, const union security_ace_object_type *r) +{ + if (ndr_flags & NDR_SCALARS) { + int level = ndr_push_get_switch_value(ndr, r); + switch (level) { + case SEC_ACE_OBJECT_TYPE_PRESENT: { + NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->type)); + break; } + + default: { + break; } + + } + } + if (ndr_flags & NDR_BUFFERS) { + int level = ndr_push_get_switch_value(ndr, r); + switch (level) { + case SEC_ACE_OBJECT_TYPE_PRESENT: + break; + + default: + break; + + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_security_ace_object_type(struct ndr_pull *ndr, int ndr_flags, union security_ace_object_type *r) +{ + int level; + level = ndr_pull_get_switch_value(ndr, r); + if (ndr_flags & NDR_SCALARS) { + switch (level) { + case SEC_ACE_OBJECT_TYPE_PRESENT: { + NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->type)); + break; } + + default: { + break; } + + } + } + if (ndr_flags & NDR_BUFFERS) { + switch (level) { + case SEC_ACE_OBJECT_TYPE_PRESENT: + break; + + default: + break; + + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_security_ace_object_type(struct ndr_print *ndr, const char *name, const union security_ace_object_type *r) +{ + int level; + level = ndr_print_get_switch_value(ndr, r); + ndr_print_union(ndr, name, level, "security_ace_object_type"); + switch (level) { + case SEC_ACE_OBJECT_TYPE_PRESENT: + ndr_print_GUID(ndr, "type", &r->type); + break; + + default: + break; + + } +} + +static enum ndr_err_code ndr_push_security_ace_object_inherited_type(struct ndr_push *ndr, int ndr_flags, const union security_ace_object_inherited_type *r) +{ + if (ndr_flags & NDR_SCALARS) { + int level = ndr_push_get_switch_value(ndr, r); + switch (level) { + case SEC_ACE_INHERITED_OBJECT_TYPE_PRESENT: { + NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->inherited_type)); + break; } + + default: { + break; } + + } + } + if (ndr_flags & NDR_BUFFERS) { + int level = ndr_push_get_switch_value(ndr, r); + switch (level) { + case SEC_ACE_INHERITED_OBJECT_TYPE_PRESENT: + break; + + default: + break; + + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_security_ace_object_inherited_type(struct ndr_pull *ndr, int ndr_flags, union security_ace_object_inherited_type *r) +{ + int level; + level = ndr_pull_get_switch_value(ndr, r); + if (ndr_flags & NDR_SCALARS) { + switch (level) { + case SEC_ACE_INHERITED_OBJECT_TYPE_PRESENT: { + NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->inherited_type)); + break; } + + default: { + break; } + + } + } + if (ndr_flags & NDR_BUFFERS) { + switch (level) { + case SEC_ACE_INHERITED_OBJECT_TYPE_PRESENT: + break; + + default: + break; + + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_security_ace_object_inherited_type(struct ndr_print *ndr, const char *name, const union security_ace_object_inherited_type *r) +{ + int level; + level = ndr_print_get_switch_value(ndr, r); + ndr_print_union(ndr, name, level, "security_ace_object_inherited_type"); + switch (level) { + case SEC_ACE_INHERITED_OBJECT_TYPE_PRESENT: + ndr_print_GUID(ndr, "inherited_type", &r->inherited_type); + break; + + default: + break; + + } +} + +static enum ndr_err_code ndr_push_security_ace_object(struct ndr_push *ndr, int ndr_flags, const struct security_ace_object *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_security_ace_object_flags(ndr, NDR_SCALARS, r->flags)); + NDR_CHECK(ndr_push_set_switch_value(ndr, &r->type, r->flags & SEC_ACE_OBJECT_TYPE_PRESENT)); + NDR_CHECK(ndr_push_security_ace_object_type(ndr, NDR_SCALARS, &r->type)); + NDR_CHECK(ndr_push_set_switch_value(ndr, &r->inherited_type, r->flags & SEC_ACE_INHERITED_OBJECT_TYPE_PRESENT)); + NDR_CHECK(ndr_push_security_ace_object_inherited_type(ndr, NDR_SCALARS, &r->inherited_type)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_push_security_ace_object_type(ndr, NDR_BUFFERS, &r->type)); + NDR_CHECK(ndr_push_security_ace_object_inherited_type(ndr, NDR_BUFFERS, &r->inherited_type)); + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_security_ace_object(struct ndr_pull *ndr, int ndr_flags, struct security_ace_object *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_security_ace_object_flags(ndr, NDR_SCALARS, &r->flags)); + NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->type, r->flags & SEC_ACE_OBJECT_TYPE_PRESENT)); + NDR_CHECK(ndr_pull_security_ace_object_type(ndr, NDR_SCALARS, &r->type)); + NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->inherited_type, r->flags & SEC_ACE_INHERITED_OBJECT_TYPE_PRESENT)); + NDR_CHECK(ndr_pull_security_ace_object_inherited_type(ndr, NDR_SCALARS, &r->inherited_type)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_pull_security_ace_object_type(ndr, NDR_BUFFERS, &r->type)); + NDR_CHECK(ndr_pull_security_ace_object_inherited_type(ndr, NDR_BUFFERS, &r->inherited_type)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_security_ace_object(struct ndr_print *ndr, const char *name, const struct security_ace_object *r) +{ + ndr_print_struct(ndr, name, "security_ace_object"); + ndr->depth++; + ndr_print_security_ace_object_flags(ndr, "flags", r->flags); + ndr_print_set_switch_value(ndr, &r->type, r->flags & SEC_ACE_OBJECT_TYPE_PRESENT); + ndr_print_security_ace_object_type(ndr, "type", &r->type); + ndr_print_set_switch_value(ndr, &r->inherited_type, r->flags & SEC_ACE_INHERITED_OBJECT_TYPE_PRESENT); + ndr_print_security_ace_object_inherited_type(ndr, "inherited_type", &r->inherited_type); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_security_ace_object_ctr(struct ndr_push *ndr, int ndr_flags, const union security_ace_object_ctr *r) +{ + if (ndr_flags & NDR_SCALARS) { + int level = ndr_push_get_switch_value(ndr, r); + switch (level) { + case SEC_ACE_TYPE_ACCESS_ALLOWED_OBJECT: { + NDR_CHECK(ndr_push_security_ace_object(ndr, NDR_SCALARS, &r->object)); + break; } + + case SEC_ACE_TYPE_ACCESS_DENIED_OBJECT: { + NDR_CHECK(ndr_push_security_ace_object(ndr, NDR_SCALARS, &r->object)); + break; } + + case SEC_ACE_TYPE_SYSTEM_AUDIT_OBJECT: { + NDR_CHECK(ndr_push_security_ace_object(ndr, NDR_SCALARS, &r->object)); + break; } + + case SEC_ACE_TYPE_SYSTEM_ALARM_OBJECT: { + NDR_CHECK(ndr_push_security_ace_object(ndr, NDR_SCALARS, &r->object)); + break; } + + default: { + break; } + + } + } + if (ndr_flags & NDR_BUFFERS) { + int level = ndr_push_get_switch_value(ndr, r); + switch (level) { + case SEC_ACE_TYPE_ACCESS_ALLOWED_OBJECT: + NDR_CHECK(ndr_push_security_ace_object(ndr, NDR_BUFFERS, &r->object)); + break; + + case SEC_ACE_TYPE_ACCESS_DENIED_OBJECT: + NDR_CHECK(ndr_push_security_ace_object(ndr, NDR_BUFFERS, &r->object)); + break; + + case SEC_ACE_TYPE_SYSTEM_AUDIT_OBJECT: + NDR_CHECK(ndr_push_security_ace_object(ndr, NDR_BUFFERS, &r->object)); + break; + + case SEC_ACE_TYPE_SYSTEM_ALARM_OBJECT: + NDR_CHECK(ndr_push_security_ace_object(ndr, NDR_BUFFERS, &r->object)); + break; + + default: + break; + + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_security_ace_object_ctr(struct ndr_pull *ndr, int ndr_flags, union security_ace_object_ctr *r) +{ + int level; + level = ndr_pull_get_switch_value(ndr, r); + if (ndr_flags & NDR_SCALARS) { + switch (level) { + case SEC_ACE_TYPE_ACCESS_ALLOWED_OBJECT: { + NDR_CHECK(ndr_pull_security_ace_object(ndr, NDR_SCALARS, &r->object)); + break; } + + case SEC_ACE_TYPE_ACCESS_DENIED_OBJECT: { + NDR_CHECK(ndr_pull_security_ace_object(ndr, NDR_SCALARS, &r->object)); + break; } + + case SEC_ACE_TYPE_SYSTEM_AUDIT_OBJECT: { + NDR_CHECK(ndr_pull_security_ace_object(ndr, NDR_SCALARS, &r->object)); + break; } + + case SEC_ACE_TYPE_SYSTEM_ALARM_OBJECT: { + NDR_CHECK(ndr_pull_security_ace_object(ndr, NDR_SCALARS, &r->object)); + break; } + + default: { + break; } + + } + } + if (ndr_flags & NDR_BUFFERS) { + switch (level) { + case SEC_ACE_TYPE_ACCESS_ALLOWED_OBJECT: + NDR_CHECK(ndr_pull_security_ace_object(ndr, NDR_BUFFERS, &r->object)); + break; + + case SEC_ACE_TYPE_ACCESS_DENIED_OBJECT: + NDR_CHECK(ndr_pull_security_ace_object(ndr, NDR_BUFFERS, &r->object)); + break; + + case SEC_ACE_TYPE_SYSTEM_AUDIT_OBJECT: + NDR_CHECK(ndr_pull_security_ace_object(ndr, NDR_BUFFERS, &r->object)); + break; + + case SEC_ACE_TYPE_SYSTEM_ALARM_OBJECT: + NDR_CHECK(ndr_pull_security_ace_object(ndr, NDR_BUFFERS, &r->object)); + break; + + default: + break; + + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_security_ace_object_ctr(struct ndr_print *ndr, const char *name, const union security_ace_object_ctr *r) +{ + int level; + level = ndr_print_get_switch_value(ndr, r); + ndr_print_union(ndr, name, level, "security_ace_object_ctr"); + switch (level) { + case SEC_ACE_TYPE_ACCESS_ALLOWED_OBJECT: + ndr_print_security_ace_object(ndr, "object", &r->object); + break; + + case SEC_ACE_TYPE_ACCESS_DENIED_OBJECT: + ndr_print_security_ace_object(ndr, "object", &r->object); + break; + + case SEC_ACE_TYPE_SYSTEM_AUDIT_OBJECT: + ndr_print_security_ace_object(ndr, "object", &r->object); + break; + + case SEC_ACE_TYPE_SYSTEM_ALARM_OBJECT: + ndr_print_security_ace_object(ndr, "object", &r->object); + break; + + default: + break; + + } +} + +_PUBLIC_ enum ndr_err_code ndr_push_security_ace(struct ndr_push *ndr, int ndr_flags, const struct security_ace *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_security_ace_type(ndr, NDR_SCALARS, r->type)); + NDR_CHECK(ndr_push_security_ace_flags(ndr, NDR_SCALARS, r->flags)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, ndr_size_security_ace(r, ndr->flags))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->access_mask)); + NDR_CHECK(ndr_push_set_switch_value(ndr, &r->object, r->type)); + NDR_CHECK(ndr_push_security_ace_object_ctr(ndr, NDR_SCALARS, &r->object)); + NDR_CHECK(ndr_push_dom_sid(ndr, NDR_SCALARS, &r->trustee)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_push_security_ace_object_ctr(ndr, NDR_BUFFERS, &r->object)); + NDR_CHECK(ndr_push_dom_sid(ndr, NDR_BUFFERS, &r->trustee)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_security_ace(struct ndr_pull *ndr, int ndr_flags, struct security_ace *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_security_ace_type(ndr, NDR_SCALARS, &r->type)); + NDR_CHECK(ndr_pull_security_ace_flags(ndr, NDR_SCALARS, &r->flags)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->size)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->access_mask)); + NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->object, r->type)); + NDR_CHECK(ndr_pull_security_ace_object_ctr(ndr, NDR_SCALARS, &r->object)); + NDR_CHECK(ndr_pull_dom_sid(ndr, NDR_SCALARS, &r->trustee)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_pull_security_ace_object_ctr(ndr, NDR_BUFFERS, &r->object)); + NDR_CHECK(ndr_pull_dom_sid(ndr, NDR_BUFFERS, &r->trustee)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_security_ace(struct ndr_print *ndr, const char *name, const struct security_ace *r) +{ + ndr_print_struct(ndr, name, "security_ace"); + ndr->depth++; + ndr_print_security_ace_type(ndr, "type", r->type); + ndr_print_security_ace_flags(ndr, "flags", r->flags); + ndr_print_uint16(ndr, "size", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?ndr_size_security_ace(r, ndr->flags):r->size); + ndr_print_uint32(ndr, "access_mask", r->access_mask); + ndr_print_set_switch_value(ndr, &r->object, r->type); + ndr_print_security_ace_object_ctr(ndr, "object", &r->object); + ndr_print_dom_sid(ndr, "trustee", &r->trustee); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_security_acl_revision(struct ndr_push *ndr, int ndr_flags, enum security_acl_revision r) +{ + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r)); + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_security_acl_revision(struct ndr_pull *ndr, int ndr_flags, enum security_acl_revision *r) +{ + uint16_t v; + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &v)); + *r = v; + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_security_acl_revision(struct ndr_print *ndr, const char *name, enum security_acl_revision r) +{ + const char *val = NULL; + + switch (r) { + case SECURITY_ACL_REVISION_NT4: val = "SECURITY_ACL_REVISION_NT4"; break; + case SECURITY_ACL_REVISION_ADS: val = "SECURITY_ACL_REVISION_ADS"; break; + } + ndr_print_enum(ndr, name, "ENUM", val, r); +} + +_PUBLIC_ enum ndr_err_code ndr_push_security_acl(struct ndr_push *ndr, int ndr_flags, const struct security_acl *r) +{ + uint32_t cntr_aces_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_security_acl_revision(ndr, NDR_SCALARS, r->revision)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, ndr_size_security_acl(r, ndr->flags))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_aces)); + for (cntr_aces_0 = 0; cntr_aces_0 < r->num_aces; cntr_aces_0++) { + NDR_CHECK(ndr_push_security_ace(ndr, NDR_SCALARS, &r->aces[cntr_aces_0])); + } + } + if (ndr_flags & NDR_BUFFERS) { + for (cntr_aces_0 = 0; cntr_aces_0 < r->num_aces; cntr_aces_0++) { + NDR_CHECK(ndr_push_security_ace(ndr, NDR_BUFFERS, &r->aces[cntr_aces_0])); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_security_acl(struct ndr_pull *ndr, int ndr_flags, struct security_acl *r) +{ + uint32_t cntr_aces_0; + TALLOC_CTX *_mem_save_aces_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_security_acl_revision(ndr, NDR_SCALARS, &r->revision)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->size)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->num_aces)); + if (r->num_aces < 0 || r->num_aces > 1000) { + return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range"); + } + NDR_PULL_ALLOC_N(ndr, r->aces, r->num_aces); + _mem_save_aces_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->aces, 0); + for (cntr_aces_0 = 0; cntr_aces_0 < r->num_aces; cntr_aces_0++) { + NDR_CHECK(ndr_pull_security_ace(ndr, NDR_SCALARS, &r->aces[cntr_aces_0])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_aces_0, 0); + } + if (ndr_flags & NDR_BUFFERS) { + _mem_save_aces_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->aces, 0); + for (cntr_aces_0 = 0; cntr_aces_0 < r->num_aces; cntr_aces_0++) { + NDR_CHECK(ndr_pull_security_ace(ndr, NDR_BUFFERS, &r->aces[cntr_aces_0])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_aces_0, 0); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_security_acl(struct ndr_print *ndr, const char *name, const struct security_acl *r) +{ + uint32_t cntr_aces_0; + ndr_print_struct(ndr, name, "security_acl"); + ndr->depth++; + ndr_print_security_acl_revision(ndr, "revision", r->revision); + ndr_print_uint16(ndr, "size", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?ndr_size_security_acl(r, ndr->flags):r->size); + ndr_print_uint32(ndr, "num_aces", r->num_aces); + ndr->print(ndr, "%s: ARRAY(%d)", "aces", r->num_aces); + ndr->depth++; + for (cntr_aces_0=0;cntr_aces_0<r->num_aces;cntr_aces_0++) { + char *idx_0=NULL; + if (asprintf(&idx_0, "[%d]", cntr_aces_0) != -1) { + ndr_print_security_ace(ndr, "aces", &r->aces[cntr_aces_0]); + free(idx_0); + } + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_security_descriptor_revision(struct ndr_push *ndr, int ndr_flags, enum security_descriptor_revision r) +{ + NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r)); + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_security_descriptor_revision(struct ndr_pull *ndr, int ndr_flags, enum security_descriptor_revision *r) +{ + uint8_t v; + NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &v)); + *r = v; + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_security_descriptor_revision(struct ndr_print *ndr, const char *name, enum security_descriptor_revision r) +{ + const char *val = NULL; + + switch (r) { + case SECURITY_DESCRIPTOR_REVISION_1: val = "SECURITY_DESCRIPTOR_REVISION_1"; break; + } + ndr_print_enum(ndr, name, "ENUM", val, r); +} + +static enum ndr_err_code ndr_push_security_descriptor_type(struct ndr_push *ndr, int ndr_flags, uint16_t r) +{ + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r)); + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_security_descriptor_type(struct ndr_pull *ndr, int ndr_flags, uint16_t *r) +{ + uint16_t v; + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &v)); + *r = v; + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_security_descriptor_type(struct ndr_print *ndr, const char *name, uint16_t r) +{ + ndr_print_uint16(ndr, name, r); + ndr->depth++; + ndr_print_bitmap_flag(ndr, sizeof(uint16_t), "SEC_DESC_OWNER_DEFAULTED", SEC_DESC_OWNER_DEFAULTED, r); + ndr_print_bitmap_flag(ndr, sizeof(uint16_t), "SEC_DESC_GROUP_DEFAULTED", SEC_DESC_GROUP_DEFAULTED, r); + ndr_print_bitmap_flag(ndr, sizeof(uint16_t), "SEC_DESC_DACL_PRESENT", SEC_DESC_DACL_PRESENT, r); + ndr_print_bitmap_flag(ndr, sizeof(uint16_t), "SEC_DESC_DACL_DEFAULTED", SEC_DESC_DACL_DEFAULTED, r); + ndr_print_bitmap_flag(ndr, sizeof(uint16_t), "SEC_DESC_SACL_PRESENT", SEC_DESC_SACL_PRESENT, r); + ndr_print_bitmap_flag(ndr, sizeof(uint16_t), "SEC_DESC_SACL_DEFAULTED", SEC_DESC_SACL_DEFAULTED, r); + ndr_print_bitmap_flag(ndr, sizeof(uint16_t), "SEC_DESC_DACL_TRUSTED", SEC_DESC_DACL_TRUSTED, r); + ndr_print_bitmap_flag(ndr, sizeof(uint16_t), "SEC_DESC_SERVER_SECURITY", SEC_DESC_SERVER_SECURITY, r); + ndr_print_bitmap_flag(ndr, sizeof(uint16_t), "SEC_DESC_DACL_AUTO_INHERIT_REQ", SEC_DESC_DACL_AUTO_INHERIT_REQ, r); + ndr_print_bitmap_flag(ndr, sizeof(uint16_t), "SEC_DESC_SACL_AUTO_INHERIT_REQ", SEC_DESC_SACL_AUTO_INHERIT_REQ, r); + ndr_print_bitmap_flag(ndr, sizeof(uint16_t), "SEC_DESC_DACL_AUTO_INHERITED", SEC_DESC_DACL_AUTO_INHERITED, r); + ndr_print_bitmap_flag(ndr, sizeof(uint16_t), "SEC_DESC_SACL_AUTO_INHERITED", SEC_DESC_SACL_AUTO_INHERITED, r); + ndr_print_bitmap_flag(ndr, sizeof(uint16_t), "SEC_DESC_DACL_PROTECTED", SEC_DESC_DACL_PROTECTED, r); + ndr_print_bitmap_flag(ndr, sizeof(uint16_t), "SEC_DESC_SACL_PROTECTED", SEC_DESC_SACL_PROTECTED, r); + ndr_print_bitmap_flag(ndr, sizeof(uint16_t), "SEC_DESC_RM_CONTROL_VALID", SEC_DESC_RM_CONTROL_VALID, r); + ndr_print_bitmap_flag(ndr, sizeof(uint16_t), "SEC_DESC_SELF_RELATIVE", SEC_DESC_SELF_RELATIVE, r); + ndr->depth--; +} + +_PUBLIC_ enum ndr_err_code ndr_push_security_descriptor(struct ndr_push *ndr, int ndr_flags, const struct security_descriptor *r) +{ + { + uint32_t _flags_save_STRUCT = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_LITTLE_ENDIAN); + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_security_descriptor_revision(ndr, NDR_SCALARS, r->revision)); + NDR_CHECK(ndr_push_security_descriptor_type(ndr, NDR_SCALARS, r->type)); + NDR_CHECK(ndr_push_relative_ptr1(ndr, r->owner_sid)); + NDR_CHECK(ndr_push_relative_ptr1(ndr, r->group_sid)); + NDR_CHECK(ndr_push_relative_ptr1(ndr, r->sacl)); + NDR_CHECK(ndr_push_relative_ptr1(ndr, r->dacl)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->owner_sid) { + NDR_CHECK(ndr_push_relative_ptr2(ndr, r->owner_sid)); + NDR_CHECK(ndr_push_dom_sid(ndr, NDR_SCALARS|NDR_BUFFERS, r->owner_sid)); + } + if (r->group_sid) { + NDR_CHECK(ndr_push_relative_ptr2(ndr, r->group_sid)); + NDR_CHECK(ndr_push_dom_sid(ndr, NDR_SCALARS|NDR_BUFFERS, r->group_sid)); + } + if (r->sacl) { + NDR_CHECK(ndr_push_relative_ptr2(ndr, r->sacl)); + NDR_CHECK(ndr_push_security_acl(ndr, NDR_SCALARS|NDR_BUFFERS, r->sacl)); + } + if (r->dacl) { + NDR_CHECK(ndr_push_relative_ptr2(ndr, r->dacl)); + NDR_CHECK(ndr_push_security_acl(ndr, NDR_SCALARS|NDR_BUFFERS, r->dacl)); + } + } + ndr->flags = _flags_save_STRUCT; + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_security_descriptor(struct ndr_pull *ndr, int ndr_flags, struct security_descriptor *r) +{ + uint32_t _ptr_owner_sid; + TALLOC_CTX *_mem_save_owner_sid_0; + uint32_t _ptr_group_sid; + TALLOC_CTX *_mem_save_group_sid_0; + uint32_t _ptr_sacl; + TALLOC_CTX *_mem_save_sacl_0; + uint32_t _ptr_dacl; + TALLOC_CTX *_mem_save_dacl_0; + { + uint32_t _flags_save_STRUCT = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_LITTLE_ENDIAN); + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_security_descriptor_revision(ndr, NDR_SCALARS, &r->revision)); + NDR_CHECK(ndr_pull_security_descriptor_type(ndr, NDR_SCALARS, &r->type)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_owner_sid)); + if (_ptr_owner_sid) { + NDR_PULL_ALLOC(ndr, r->owner_sid); + NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->owner_sid, _ptr_owner_sid)); + } else { + r->owner_sid = NULL; + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_group_sid)); + if (_ptr_group_sid) { + NDR_PULL_ALLOC(ndr, r->group_sid); + NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->group_sid, _ptr_group_sid)); + } else { + r->group_sid = NULL; + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_sacl)); + if (_ptr_sacl) { + NDR_PULL_ALLOC(ndr, r->sacl); + NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->sacl, _ptr_sacl)); + } else { + r->sacl = NULL; + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_dacl)); + if (_ptr_dacl) { + NDR_PULL_ALLOC(ndr, r->dacl); + NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->dacl, _ptr_dacl)); + } else { + r->dacl = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->owner_sid) { + uint32_t _relative_save_offset; + _relative_save_offset = ndr->offset; + NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->owner_sid)); + _mem_save_owner_sid_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->owner_sid, 0); + NDR_CHECK(ndr_pull_dom_sid(ndr, NDR_SCALARS|NDR_BUFFERS, r->owner_sid)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_owner_sid_0, 0); + ndr->offset = _relative_save_offset; + } + if (r->group_sid) { + uint32_t _relative_save_offset; + _relative_save_offset = ndr->offset; + NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->group_sid)); + _mem_save_group_sid_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->group_sid, 0); + NDR_CHECK(ndr_pull_dom_sid(ndr, NDR_SCALARS|NDR_BUFFERS, r->group_sid)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_group_sid_0, 0); + ndr->offset = _relative_save_offset; + } + if (r->sacl) { + uint32_t _relative_save_offset; + _relative_save_offset = ndr->offset; + NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->sacl)); + _mem_save_sacl_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->sacl, 0); + NDR_CHECK(ndr_pull_security_acl(ndr, NDR_SCALARS|NDR_BUFFERS, r->sacl)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sacl_0, 0); + ndr->offset = _relative_save_offset; + } + if (r->dacl) { + uint32_t _relative_save_offset; + _relative_save_offset = ndr->offset; + NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->dacl)); + _mem_save_dacl_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->dacl, 0); + NDR_CHECK(ndr_pull_security_acl(ndr, NDR_SCALARS|NDR_BUFFERS, r->dacl)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_dacl_0, 0); + ndr->offset = _relative_save_offset; + } + } + ndr->flags = _flags_save_STRUCT; + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_security_descriptor(struct ndr_print *ndr, const char *name, const struct security_descriptor *r) +{ + ndr_print_struct(ndr, name, "security_descriptor"); + { + uint32_t _flags_save_STRUCT = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_LITTLE_ENDIAN); + ndr->depth++; + ndr_print_security_descriptor_revision(ndr, "revision", r->revision); + ndr_print_security_descriptor_type(ndr, "type", r->type); + ndr_print_ptr(ndr, "owner_sid", r->owner_sid); + ndr->depth++; + if (r->owner_sid) { + ndr_print_dom_sid(ndr, "owner_sid", r->owner_sid); + } + ndr->depth--; + ndr_print_ptr(ndr, "group_sid", r->group_sid); + ndr->depth++; + if (r->group_sid) { + ndr_print_dom_sid(ndr, "group_sid", r->group_sid); + } + ndr->depth--; + ndr_print_ptr(ndr, "sacl", r->sacl); + ndr->depth++; + if (r->sacl) { + ndr_print_security_acl(ndr, "sacl", r->sacl); + } + ndr->depth--; + ndr_print_ptr(ndr, "dacl", r->dacl); + ndr->depth++; + if (r->dacl) { + ndr_print_security_acl(ndr, "dacl", r->dacl); + } + ndr->depth--; + ndr->depth--; + ndr->flags = _flags_save_STRUCT; + } +} + +_PUBLIC_ enum ndr_err_code ndr_push_sec_desc_buf(struct ndr_push *ndr, int ndr_flags, const struct sec_desc_buf *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_size_security_descriptor(r->sd, ndr->flags))); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->sd)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->sd) { + { + struct ndr_push *_ndr_sd; + NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_sd, 4, -1)); + NDR_CHECK(ndr_push_security_descriptor(_ndr_sd, NDR_SCALARS|NDR_BUFFERS, r->sd)); + NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_sd, 4, -1)); + } + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_sec_desc_buf(struct ndr_pull *ndr, int ndr_flags, struct sec_desc_buf *r) +{ + uint32_t _ptr_sd; + TALLOC_CTX *_mem_save_sd_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sd_size)); + if (r->sd_size < 0 || r->sd_size > 0x40000) { + return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range"); + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_sd)); + if (_ptr_sd) { + NDR_PULL_ALLOC(ndr, r->sd); + } else { + r->sd = NULL; + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->sd) { + _mem_save_sd_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->sd, 0); + { + struct ndr_pull *_ndr_sd; + NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_sd, 4, -1)); + NDR_CHECK(ndr_pull_security_descriptor(_ndr_sd, NDR_SCALARS|NDR_BUFFERS, r->sd)); + NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_sd, 4, -1)); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sd_0, 0); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_sec_desc_buf(struct ndr_print *ndr, const char *name, const struct sec_desc_buf *r) +{ + ndr_print_struct(ndr, name, "sec_desc_buf"); + ndr->depth++; + ndr_print_uint32(ndr, "sd_size", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?ndr_size_security_descriptor(r->sd, ndr->flags):r->sd_size); + ndr_print_ptr(ndr, "sd", r->sd); + ndr->depth++; + if (r->sd) { + ndr_print_security_descriptor(ndr, "sd", r->sd); + } + ndr->depth--; + ndr->depth--; +} + +_PUBLIC_ enum ndr_err_code ndr_push_security_token(struct ndr_push *ndr, int ndr_flags, const struct security_token *r) +{ + uint32_t cntr_sids_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->user_sid)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->group_sid)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_sids)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_sids)); + for (cntr_sids_0 = 0; cntr_sids_0 < r->num_sids; cntr_sids_0++) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->sids[cntr_sids_0])); + } + NDR_CHECK(ndr_push_udlong(ndr, NDR_SCALARS, r->privilege_mask)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->user_sid) { + NDR_CHECK(ndr_push_dom_sid(ndr, NDR_SCALARS|NDR_BUFFERS, r->user_sid)); + } + if (r->group_sid) { + NDR_CHECK(ndr_push_dom_sid(ndr, NDR_SCALARS|NDR_BUFFERS, r->group_sid)); + } + for (cntr_sids_0 = 0; cntr_sids_0 < r->num_sids; cntr_sids_0++) { + if (r->sids[cntr_sids_0]) { + NDR_CHECK(ndr_push_dom_sid(ndr, NDR_SCALARS|NDR_BUFFERS, r->sids[cntr_sids_0])); + } + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_security_token(struct ndr_pull *ndr, int ndr_flags, struct security_token *r) +{ + uint32_t _ptr_user_sid; + TALLOC_CTX *_mem_save_user_sid_0; + uint32_t _ptr_group_sid; + TALLOC_CTX *_mem_save_group_sid_0; + uint32_t _ptr_sids; + uint32_t cntr_sids_0; + TALLOC_CTX *_mem_save_sids_0; + TALLOC_CTX *_mem_save_sids_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_user_sid)); + if (_ptr_user_sid) { + NDR_PULL_ALLOC(ndr, r->user_sid); + } else { + r->user_sid = NULL; + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_group_sid)); + if (_ptr_group_sid) { + NDR_PULL_ALLOC(ndr, r->group_sid); + } else { + r->group_sid = NULL; + } + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->num_sids)); + NDR_CHECK(ndr_pull_array_size(ndr, &r->sids)); + NDR_PULL_ALLOC_N(ndr, r->sids, ndr_get_array_size(ndr, &r->sids)); + _mem_save_sids_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->sids, 0); + for (cntr_sids_0 = 0; cntr_sids_0 < r->num_sids; cntr_sids_0++) { + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_sids)); + if (_ptr_sids) { + NDR_PULL_ALLOC(ndr, r->sids[cntr_sids_0]); + } else { + r->sids[cntr_sids_0] = NULL; + } + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sids_0, 0); + NDR_CHECK(ndr_pull_udlong(ndr, NDR_SCALARS, &r->privilege_mask)); + if (r->sids) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->sids, r->num_sids)); + } + } + if (ndr_flags & NDR_BUFFERS) { + if (r->user_sid) { + _mem_save_user_sid_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->user_sid, 0); + NDR_CHECK(ndr_pull_dom_sid(ndr, NDR_SCALARS|NDR_BUFFERS, r->user_sid)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_user_sid_0, 0); + } + if (r->group_sid) { + _mem_save_group_sid_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->group_sid, 0); + NDR_CHECK(ndr_pull_dom_sid(ndr, NDR_SCALARS|NDR_BUFFERS, r->group_sid)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_group_sid_0, 0); + } + _mem_save_sids_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->sids, 0); + for (cntr_sids_0 = 0; cntr_sids_0 < r->num_sids; cntr_sids_0++) { + if (r->sids[cntr_sids_0]) { + _mem_save_sids_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->sids[cntr_sids_0], 0); + NDR_CHECK(ndr_pull_dom_sid(ndr, NDR_SCALARS|NDR_BUFFERS, r->sids[cntr_sids_0])); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sids_1, 0); + } + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sids_0, 0); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_security_token(struct ndr_print *ndr, const char *name, const struct security_token *r) +{ + uint32_t cntr_sids_0; + ndr_print_struct(ndr, name, "security_token"); + ndr->depth++; + ndr_print_ptr(ndr, "user_sid", r->user_sid); + ndr->depth++; + if (r->user_sid) { + ndr_print_dom_sid(ndr, "user_sid", r->user_sid); + } + ndr->depth--; + ndr_print_ptr(ndr, "group_sid", r->group_sid); + ndr->depth++; + if (r->group_sid) { + ndr_print_dom_sid(ndr, "group_sid", r->group_sid); + } + ndr->depth--; + ndr_print_uint32(ndr, "num_sids", r->num_sids); + ndr->print(ndr, "%s: ARRAY(%d)", "sids", r->num_sids); + ndr->depth++; + for (cntr_sids_0=0;cntr_sids_0<r->num_sids;cntr_sids_0++) { + char *idx_0=NULL; + if (asprintf(&idx_0, "[%d]", cntr_sids_0) != -1) { + ndr_print_ptr(ndr, "sids", r->sids[cntr_sids_0]); + ndr->depth++; + if (r->sids[cntr_sids_0]) { + ndr_print_dom_sid(ndr, "sids", r->sids[cntr_sids_0]); + } + ndr->depth--; + free(idx_0); + } + } + ndr->depth--; + ndr_print_udlong(ndr, "privilege_mask", r->privilege_mask); + ndr->depth--; +} + +_PUBLIC_ enum ndr_err_code ndr_push_security_secinfo(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_security_secinfo(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_security_secinfo(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), "SECINFO_OWNER", SECINFO_OWNER, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SECINFO_GROUP", SECINFO_GROUP, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SECINFO_DACL", SECINFO_DACL, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SECINFO_SACL", SECINFO_SACL, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SECINFO_UNPROTECTED_SACL", SECINFO_UNPROTECTED_SACL, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SECINFO_UNPROTECTED_DACL", SECINFO_UNPROTECTED_DACL, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SECINFO_PROTECTED_SACL", SECINFO_PROTECTED_SACL, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SECINFO_PROTECTED_DACL", SECINFO_PROTECTED_DACL, r); + ndr->depth--; +} + diff --git a/source3/librpc/gen_ndr/ndr_security.h b/source3/librpc/gen_ndr/ndr_security.h index 292e9011c6..79bfd78f51 100644 --- a/source3/librpc/gen_ndr/ndr_security.h +++ b/source3/librpc/gen_ndr/ndr_security.h @@ -1,2 +1,41 @@ -/* empty header to deal with pidl */ +/* header auto-generated by pidl */ +#include "librpc/ndr/libndr.h" +#include "librpc/gen_ndr/security.h" + +#ifndef _HEADER_NDR_security +#define _HEADER_NDR_security + +#define NDR_SECURITY_CALL_COUNT (0) +void ndr_print_security_ace_flags(struct ndr_print *ndr, const char *name, uint8_t r); +void ndr_print_security_ace_type(struct ndr_print *ndr, const char *name, enum security_ace_type r); +void ndr_print_security_ace_object_flags(struct ndr_print *ndr, const char *name, uint32_t r); +void ndr_print_security_ace_object_type(struct ndr_print *ndr, const char *name, const union security_ace_object_type *r); +void ndr_print_security_ace_object_inherited_type(struct ndr_print *ndr, const char *name, const union security_ace_object_inherited_type *r); +void ndr_print_security_ace_object(struct ndr_print *ndr, const char *name, const struct security_ace_object *r); +void ndr_print_security_ace_object_ctr(struct ndr_print *ndr, const char *name, const union security_ace_object_ctr *r); +enum ndr_err_code ndr_push_security_ace(struct ndr_push *ndr, int ndr_flags, const struct security_ace *r); +enum ndr_err_code ndr_pull_security_ace(struct ndr_pull *ndr, int ndr_flags, struct security_ace *r); +void ndr_print_security_ace(struct ndr_print *ndr, const char *name, const struct security_ace *r); +size_t ndr_size_security_ace(const struct security_ace *r, int flags); +void ndr_print_security_acl_revision(struct ndr_print *ndr, const char *name, enum security_acl_revision r); +enum ndr_err_code ndr_push_security_acl(struct ndr_push *ndr, int ndr_flags, const struct security_acl *r); +enum ndr_err_code ndr_pull_security_acl(struct ndr_pull *ndr, int ndr_flags, struct security_acl *r); +void ndr_print_security_acl(struct ndr_print *ndr, const char *name, const struct security_acl *r); +size_t ndr_size_security_acl(const struct security_acl *r, int flags); +void ndr_print_security_descriptor_revision(struct ndr_print *ndr, const char *name, enum security_descriptor_revision r); +void ndr_print_security_descriptor_type(struct ndr_print *ndr, const char *name, uint16_t r); +enum ndr_err_code ndr_push_security_descriptor(struct ndr_push *ndr, int ndr_flags, const struct security_descriptor *r); +enum ndr_err_code ndr_pull_security_descriptor(struct ndr_pull *ndr, int ndr_flags, struct security_descriptor *r); +void ndr_print_security_descriptor(struct ndr_print *ndr, const char *name, const struct security_descriptor *r); +size_t ndr_size_security_descriptor(const struct security_descriptor *r, int flags); +enum ndr_err_code ndr_push_sec_desc_buf(struct ndr_push *ndr, int ndr_flags, const struct sec_desc_buf *r); +enum ndr_err_code ndr_pull_sec_desc_buf(struct ndr_pull *ndr, int ndr_flags, struct sec_desc_buf *r); +void ndr_print_sec_desc_buf(struct ndr_print *ndr, const char *name, const struct sec_desc_buf *r); +enum ndr_err_code ndr_push_security_token(struct ndr_push *ndr, int ndr_flags, const struct security_token *r); +enum ndr_err_code ndr_pull_security_token(struct ndr_pull *ndr, int ndr_flags, struct security_token *r); +void ndr_print_security_token(struct ndr_print *ndr, const char *name, const struct security_token *r); +enum ndr_err_code ndr_push_security_secinfo(struct ndr_push *ndr, int ndr_flags, uint32_t r); +enum ndr_err_code ndr_pull_security_secinfo(struct ndr_pull *ndr, int ndr_flags, uint32_t *r); +void ndr_print_security_secinfo(struct ndr_print *ndr, const char *name, uint32_t r); +#endif /* _HEADER_NDR_security */ diff --git a/source3/librpc/gen_ndr/ndr_srvsvc.c b/source3/librpc/gen_ndr/ndr_srvsvc.c index 2675ac2206..9b08ade4af 100644 --- a/source3/librpc/gen_ndr/ndr_srvsvc.c +++ b/source3/librpc/gen_ndr/ndr_srvsvc.c @@ -140,8 +140,7 @@ _PUBLIC_ void ndr_print_srvsvc_NetCharDevCtr0(struct ndr_print *ndr, const char ndr->depth++; for (cntr_array_1=0;cntr_array_1<r->count;cntr_array_1++) { char *idx_1=NULL; - asprintf(&idx_1, "[%d]", cntr_array_1); - if (idx_1) { + if (asprintf(&idx_1, "[%d]", cntr_array_1) != -1) { ndr_print_srvsvc_NetCharDevInfo0(ndr, "array", &r->array[cntr_array_1]); free(idx_1); } @@ -326,8 +325,7 @@ _PUBLIC_ void ndr_print_srvsvc_NetCharDevCtr1(struct ndr_print *ndr, const char ndr->depth++; for (cntr_array_1=0;cntr_array_1<r->count;cntr_array_1++) { char *idx_1=NULL; - asprintf(&idx_1, "[%d]", cntr_array_1); - if (idx_1) { + if (asprintf(&idx_1, "[%d]", cntr_array_1) != -1) { ndr_print_srvsvc_NetCharDevInfo1(ndr, "array", &r->array[cntr_array_1]); free(idx_1); } @@ -344,16 +342,16 @@ static enum ndr_err_code ndr_push_srvsvc_NetCharDevInfo(struct ndr_push *ndr, in int level = ndr_push_get_switch_value(ndr, r); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, level)); switch (level) { - case 0: + case 0: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->info0)); - break; + break; } - case 1: + case 1: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1)); - break; + break; } - default: - break; + default: { + break; } } } @@ -482,16 +480,16 @@ static enum ndr_err_code ndr_push_srvsvc_NetCharDevCtr(struct ndr_push *ndr, int int level = ndr_push_get_switch_value(ndr, r); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, level)); switch (level) { - case 0: + case 0: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->ctr0)); - break; + break; } - case 1: + case 1: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->ctr1)); - break; + break; } - default: - break; + default: { + break; } } } @@ -749,8 +747,7 @@ _PUBLIC_ void ndr_print_srvsvc_NetCharDevQCtr0(struct ndr_print *ndr, const char ndr->depth++; for (cntr_array_1=0;cntr_array_1<r->count;cntr_array_1++) { char *idx_1=NULL; - asprintf(&idx_1, "[%d]", cntr_array_1); - if (idx_1) { + if (asprintf(&idx_1, "[%d]", cntr_array_1) != -1) { ndr_print_srvsvc_NetCharDevQInfo0(ndr, "array", &r->array[cntr_array_1]); free(idx_1); } @@ -938,8 +935,7 @@ _PUBLIC_ void ndr_print_srvsvc_NetCharDevQCtr1(struct ndr_print *ndr, const char ndr->depth++; for (cntr_array_1=0;cntr_array_1<r->count;cntr_array_1++) { char *idx_1=NULL; - asprintf(&idx_1, "[%d]", cntr_array_1); - if (idx_1) { + if (asprintf(&idx_1, "[%d]", cntr_array_1) != -1) { ndr_print_srvsvc_NetCharDevQInfo1(ndr, "array", &r->array[cntr_array_1]); free(idx_1); } @@ -956,16 +952,16 @@ static enum ndr_err_code ndr_push_srvsvc_NetCharDevQInfo(struct ndr_push *ndr, i int level = ndr_push_get_switch_value(ndr, r); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, level)); switch (level) { - case 0: + case 0: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->info0)); - break; + break; } - case 1: + case 1: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1)); - break; + break; } - default: - break; + default: { + break; } } } @@ -1094,16 +1090,16 @@ static enum ndr_err_code ndr_push_srvsvc_NetCharDevQCtr(struct ndr_push *ndr, in int level = ndr_push_get_switch_value(ndr, r); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, level)); switch (level) { - case 0: + case 0: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->ctr0)); - break; + break; } - case 1: + case 1: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->ctr1)); - break; + break; } - default: - break; + default: { + break; } } } @@ -1325,8 +1321,7 @@ _PUBLIC_ void ndr_print_srvsvc_NetConnCtr0(struct ndr_print *ndr, const char *na ndr->depth++; for (cntr_array_1=0;cntr_array_1<r->count;cntr_array_1++) { char *idx_1=NULL; - asprintf(&idx_1, "[%d]", cntr_array_1); - if (idx_1) { + if (asprintf(&idx_1, "[%d]", cntr_array_1) != -1) { ndr_print_srvsvc_NetConnInfo0(ndr, "array", &r->array[cntr_array_1]); free(idx_1); } @@ -1520,8 +1515,7 @@ _PUBLIC_ void ndr_print_srvsvc_NetConnCtr1(struct ndr_print *ndr, const char *na ndr->depth++; for (cntr_array_1=0;cntr_array_1<r->count;cntr_array_1++) { char *idx_1=NULL; - asprintf(&idx_1, "[%d]", cntr_array_1); - if (idx_1) { + if (asprintf(&idx_1, "[%d]", cntr_array_1) != -1) { ndr_print_srvsvc_NetConnInfo1(ndr, "array", &r->array[cntr_array_1]); free(idx_1); } @@ -1538,16 +1532,16 @@ static enum ndr_err_code ndr_push_srvsvc_NetConnCtr(struct ndr_push *ndr, int nd int level = ndr_push_get_switch_value(ndr, r); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, level)); switch (level) { - case 0: + case 0: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->ctr0)); - break; + break; } - case 1: + case 1: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->ctr1)); - break; + break; } - default: - break; + default: { + break; } } } @@ -1769,8 +1763,7 @@ _PUBLIC_ void ndr_print_srvsvc_NetFileCtr2(struct ndr_print *ndr, const char *na ndr->depth++; for (cntr_array_1=0;cntr_array_1<r->count;cntr_array_1++) { char *idx_1=NULL; - asprintf(&idx_1, "[%d]", cntr_array_1); - if (idx_1) { + if (asprintf(&idx_1, "[%d]", cntr_array_1) != -1) { ndr_print_srvsvc_NetFileInfo2(ndr, "array", &r->array[cntr_array_1]); free(idx_1); } @@ -1958,8 +1951,7 @@ _PUBLIC_ void ndr_print_srvsvc_NetFileCtr3(struct ndr_print *ndr, const char *na ndr->depth++; for (cntr_array_1=0;cntr_array_1<r->count;cntr_array_1++) { char *idx_1=NULL; - asprintf(&idx_1, "[%d]", cntr_array_1); - if (idx_1) { + if (asprintf(&idx_1, "[%d]", cntr_array_1) != -1) { ndr_print_srvsvc_NetFileInfo3(ndr, "array", &r->array[cntr_array_1]); free(idx_1); } @@ -1976,16 +1968,16 @@ static enum ndr_err_code ndr_push_srvsvc_NetFileInfo(struct ndr_push *ndr, int n int level = ndr_push_get_switch_value(ndr, r); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, level)); switch (level) { - case 2: + case 2: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->info2)); - break; + break; } - case 3: + case 3: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->info3)); - break; + break; } - default: - break; + default: { + break; } } } @@ -2114,16 +2106,16 @@ static enum ndr_err_code ndr_push_srvsvc_NetFileCtr(struct ndr_push *ndr, int nd int level = ndr_push_get_switch_value(ndr, r); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, level)); switch (level) { - case 2: + case 2: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->ctr2)); - break; + break; } - case 3: + case 3: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->ctr3)); - break; + break; } - default: - break; + default: { + break; } } } @@ -2381,8 +2373,7 @@ _PUBLIC_ void ndr_print_srvsvc_NetSessCtr0(struct ndr_print *ndr, const char *na ndr->depth++; for (cntr_array_1=0;cntr_array_1<r->count;cntr_array_1++) { char *idx_1=NULL; - asprintf(&idx_1, "[%d]", cntr_array_1); - if (idx_1) { + if (asprintf(&idx_1, "[%d]", cntr_array_1) != -1) { ndr_print_srvsvc_NetSessInfo0(ndr, "array", &r->array[cntr_array_1]); free(idx_1); } @@ -2573,8 +2564,7 @@ _PUBLIC_ void ndr_print_srvsvc_NetSessCtr1(struct ndr_print *ndr, const char *na ndr->depth++; for (cntr_array_1=0;cntr_array_1<r->count;cntr_array_1++) { char *idx_1=NULL; - asprintf(&idx_1, "[%d]", cntr_array_1); - if (idx_1) { + if (asprintf(&idx_1, "[%d]", cntr_array_1) != -1) { ndr_print_srvsvc_NetSessInfo1(ndr, "array", &r->array[cntr_array_1]); free(idx_1); } @@ -2798,8 +2788,7 @@ _PUBLIC_ void ndr_print_srvsvc_NetSessCtr2(struct ndr_print *ndr, const char *na ndr->depth++; for (cntr_array_1=0;cntr_array_1<r->count;cntr_array_1++) { char *idx_1=NULL; - asprintf(&idx_1, "[%d]", cntr_array_1); - if (idx_1) { + if (asprintf(&idx_1, "[%d]", cntr_array_1) != -1) { ndr_print_srvsvc_NetSessInfo2(ndr, "array", &r->array[cntr_array_1]); free(idx_1); } @@ -2984,8 +2973,7 @@ _PUBLIC_ void ndr_print_srvsvc_NetSessCtr10(struct ndr_print *ndr, const char *n ndr->depth++; for (cntr_array_1=0;cntr_array_1<r->count;cntr_array_1++) { char *idx_1=NULL; - asprintf(&idx_1, "[%d]", cntr_array_1); - if (idx_1) { + if (asprintf(&idx_1, "[%d]", cntr_array_1) != -1) { ndr_print_srvsvc_NetSessInfo10(ndr, "array", &r->array[cntr_array_1]); free(idx_1); } @@ -3242,8 +3230,7 @@ _PUBLIC_ void ndr_print_srvsvc_NetSessCtr502(struct ndr_print *ndr, const char * ndr->depth++; for (cntr_array_1=0;cntr_array_1<r->count;cntr_array_1++) { char *idx_1=NULL; - asprintf(&idx_1, "[%d]", cntr_array_1); - if (idx_1) { + if (asprintf(&idx_1, "[%d]", cntr_array_1) != -1) { ndr_print_srvsvc_NetSessInfo502(ndr, "array", &r->array[cntr_array_1]); free(idx_1); } @@ -3260,28 +3247,28 @@ static enum ndr_err_code ndr_push_srvsvc_NetSessCtr(struct ndr_push *ndr, int nd int level = ndr_push_get_switch_value(ndr, r); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, level)); switch (level) { - case 0: + case 0: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->ctr0)); - break; + break; } - case 1: + case 1: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->ctr1)); - break; + break; } - case 2: + case 2: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->ctr2)); - break; + break; } - case 10: + case 10: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->ctr10)); - break; + break; } - case 502: + case 502: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->ctr502)); - break; + break; } - default: - break; + default: { + break; } } } @@ -3694,8 +3681,7 @@ _PUBLIC_ void ndr_print_srvsvc_NetShareCtr0(struct ndr_print *ndr, const char *n ndr->depth++; for (cntr_array_1=0;cntr_array_1<r->count;cntr_array_1++) { char *idx_1=NULL; - asprintf(&idx_1, "[%d]", cntr_array_1); - if (idx_1) { + if (asprintf(&idx_1, "[%d]", cntr_array_1) != -1) { ndr_print_srvsvc_NetShareInfo0(ndr, "array", &r->array[cntr_array_1]); free(idx_1); } @@ -3877,8 +3863,7 @@ _PUBLIC_ void ndr_print_srvsvc_NetShareCtr1(struct ndr_print *ndr, const char *n ndr->depth++; for (cntr_array_1=0;cntr_array_1<r->count;cntr_array_1++) { char *idx_1=NULL; - asprintf(&idx_1, "[%d]", cntr_array_1); - if (idx_1) { + if (asprintf(&idx_1, "[%d]", cntr_array_1) != -1) { ndr_print_srvsvc_NetShareInfo1(ndr, "array", &r->array[cntr_array_1]); free(idx_1); } @@ -4135,8 +4120,7 @@ _PUBLIC_ void ndr_print_srvsvc_NetShareCtr2(struct ndr_print *ndr, const char *n ndr->depth++; for (cntr_array_1=0;cntr_array_1<r->count;cntr_array_1++) { char *idx_1=NULL; - asprintf(&idx_1, "[%d]", cntr_array_1); - if (idx_1) { + if (asprintf(&idx_1, "[%d]", cntr_array_1) != -1) { ndr_print_srvsvc_NetShareInfo2(ndr, "array", &r->array[cntr_array_1]); free(idx_1); } @@ -4321,8 +4305,7 @@ _PUBLIC_ void ndr_print_srvsvc_NetShareCtr501(struct ndr_print *ndr, const char ndr->depth++; for (cntr_array_1=0;cntr_array_1<r->count;cntr_array_1++) { char *idx_1=NULL; - asprintf(&idx_1, "[%d]", cntr_array_1); - if (idx_1) { + if (asprintf(&idx_1, "[%d]", cntr_array_1) != -1) { ndr_print_srvsvc_NetShareInfo501(ndr, "array", &r->array[cntr_array_1]); free(idx_1); } @@ -4616,8 +4599,7 @@ _PUBLIC_ void ndr_print_srvsvc_NetShareCtr502(struct ndr_print *ndr, const char ndr->depth++; for (cntr_array_1=0;cntr_array_1<r->count;cntr_array_1++) { char *idx_1=NULL; - asprintf(&idx_1, "[%d]", cntr_array_1); - if (idx_1) { + if (asprintf(&idx_1, "[%d]", cntr_array_1) != -1) { ndr_print_srvsvc_NetShareInfo502(ndr, "array", &r->array[cntr_array_1]); free(idx_1); } @@ -4763,8 +4745,7 @@ _PUBLIC_ void ndr_print_srvsvc_NetShareCtr1004(struct ndr_print *ndr, const char ndr->depth++; for (cntr_array_1=0;cntr_array_1<r->count;cntr_array_1++) { char *idx_1=NULL; - asprintf(&idx_1, "[%d]", cntr_array_1); - if (idx_1) { + if (asprintf(&idx_1, "[%d]", cntr_array_1) != -1) { ndr_print_srvsvc_NetShareInfo1004(ndr, "array", &r->array[cntr_array_1]); free(idx_1); } @@ -4897,8 +4878,7 @@ _PUBLIC_ void ndr_print_srvsvc_NetShareCtr1005(struct ndr_print *ndr, const char ndr->depth++; for (cntr_array_1=0;cntr_array_1<r->count;cntr_array_1++) { char *idx_1=NULL; - asprintf(&idx_1, "[%d]", cntr_array_1); - if (idx_1) { + if (asprintf(&idx_1, "[%d]", cntr_array_1) != -1) { ndr_print_srvsvc_NetShareInfo1005(ndr, "array", &r->array[cntr_array_1]); free(idx_1); } @@ -5008,8 +4988,7 @@ _PUBLIC_ void ndr_print_srvsvc_NetShareCtr1006(struct ndr_print *ndr, const char ndr->depth++; for (cntr_array_1=0;cntr_array_1<r->count;cntr_array_1++) { char *idx_1=NULL; - asprintf(&idx_1, "[%d]", cntr_array_1); - if (idx_1) { + if (asprintf(&idx_1, "[%d]", cntr_array_1) != -1) { ndr_print_srvsvc_NetShareInfo1006(ndr, "array", &r->array[cntr_array_1]); free(idx_1); } @@ -5158,8 +5137,7 @@ _PUBLIC_ void ndr_print_srvsvc_NetShareCtr1007(struct ndr_print *ndr, const char ndr->depth++; for (cntr_array_1=0;cntr_array_1<r->count;cntr_array_1++) { char *idx_1=NULL; - asprintf(&idx_1, "[%d]", cntr_array_1); - if (idx_1) { + if (asprintf(&idx_1, "[%d]", cntr_array_1) != -1) { ndr_print_srvsvc_NetShareInfo1007(ndr, "array", &r->array[cntr_array_1]); free(idx_1); } @@ -5245,8 +5223,7 @@ _PUBLIC_ void ndr_print_srvsvc_NetShareCtr1501(struct ndr_print *ndr, const char ndr->depth++; for (cntr_array_1=0;cntr_array_1<r->count;cntr_array_1++) { char *idx_1=NULL; - asprintf(&idx_1, "[%d]", cntr_array_1); - if (idx_1) { + if (asprintf(&idx_1, "[%d]", cntr_array_1) != -1) { ndr_print_sec_desc_buf(ndr, "array", &r->array[cntr_array_1]); free(idx_1); } @@ -5263,48 +5240,48 @@ static enum ndr_err_code ndr_push_srvsvc_NetShareInfo(struct ndr_push *ndr, int int level = ndr_push_get_switch_value(ndr, r); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, level)); switch (level) { - case 0: + case 0: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->info0)); - break; + break; } - case 1: + case 1: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1)); - break; + break; } - case 2: + case 2: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->info2)); - break; + break; } - case 501: + case 501: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->info501)); - break; + break; } - case 502: + case 502: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->info502)); - break; + break; } - case 1004: + case 1004: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1004)); - break; + break; } - case 1005: + case 1005: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1005)); - break; + break; } - case 1006: + case 1006: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1006)); - break; + break; } - case 1007: + case 1007: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1007)); - break; + break; } - case 1501: + case 1501: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1501)); - break; + break; } - default: - break; + default: { + break; } } } @@ -5713,48 +5690,48 @@ static enum ndr_err_code ndr_push_srvsvc_NetShareCtr(struct ndr_push *ndr, int n int level = ndr_push_get_switch_value(ndr, r); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, level)); switch (level) { - case 0: + case 0: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->ctr0)); - break; + break; } - case 1: + case 1: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->ctr1)); - break; + break; } - case 2: + case 2: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->ctr2)); - break; + break; } - case 501: + case 501: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->ctr501)); - break; + break; } - case 502: + case 502: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->ctr502)); - break; + break; } - case 1004: + case 1004: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->ctr1004)); - break; + break; } - case 1005: + case 1005: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->ctr1005)); - break; + break; } - case 1006: + case 1006: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->ctr1006)); - break; + break; } - case 1007: + case 1007: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->ctr1007)); - break; + break; } - case 1501: + case 1501: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->ctr1501)); - break; + break; } - default: - break; + default: { + break; } } } @@ -9014,244 +8991,244 @@ static enum ndr_err_code ndr_push_srvsvc_NetSrvInfo(struct ndr_push *ndr, int nd int level = ndr_push_get_switch_value(ndr, r); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, level)); switch (level) { - case 100: + case 100: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->info100)); - break; + break; } - case 101: + case 101: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->info101)); - break; + break; } - case 102: + case 102: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->info102)); - break; + break; } - case 402: + case 402: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->info402)); - break; + break; } - case 403: + case 403: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->info403)); - break; + break; } - case 502: + case 502: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->info502)); - break; + break; } - case 503: + case 503: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->info503)); - break; + break; } - case 599: + case 599: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->info599)); - break; + break; } - case 1005: + case 1005: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1005)); - break; + break; } - case 1010: + case 1010: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1010)); - break; + break; } - case 1016: + case 1016: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1016)); - break; + break; } - case 1017: + case 1017: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1017)); - break; + break; } - case 1018: + case 1018: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1018)); - break; + break; } - case 1107: + case 1107: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1107)); - break; + break; } - case 1501: + case 1501: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1501)); - break; + break; } - case 1502: + case 1502: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1502)); - break; + break; } - case 1503: + case 1503: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1503)); - break; + break; } - case 1506: + case 1506: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1506)); - break; + break; } - case 1509: + case 1509: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1509)); - break; + break; } - case 1510: + case 1510: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1510)); - break; + break; } - case 1511: + case 1511: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1511)); - break; + break; } - case 1512: + case 1512: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1512)); - break; + break; } - case 1513: + case 1513: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1513)); - break; + break; } - case 1514: + case 1514: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1514)); - break; + break; } - case 1515: + case 1515: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1515)); - break; + break; } - case 1516: + case 1516: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1516)); - break; + break; } - case 1518: + case 1518: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1518)); - break; + break; } - case 1520: + case 1520: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1520)); - break; + break; } - case 1521: + case 1521: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1521)); - break; + break; } - case 1522: + case 1522: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1522)); - break; + break; } - case 1523: + case 1523: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1523)); - break; + break; } - case 1524: + case 1524: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1524)); - break; + break; } - case 1525: + case 1525: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1525)); - break; + break; } - case 1528: + case 1528: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1528)); - break; + break; } - case 1529: + case 1529: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1529)); - break; + break; } - case 1530: + case 1530: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1530)); - break; + break; } - case 1533: + case 1533: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1533)); - break; + break; } - case 1534: + case 1534: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1534)); - break; + break; } - case 1535: + case 1535: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1535)); - break; + break; } - case 1536: + case 1536: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1536)); - break; + break; } - case 1537: + case 1537: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1537)); - break; + break; } - case 1538: + case 1538: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1538)); - break; + break; } - case 1539: + case 1539: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1539)); - break; + break; } - case 1540: + case 1540: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1540)); - break; + break; } - case 1541: + case 1541: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1541)); - break; + break; } - case 1542: + case 1542: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1542)); - break; + break; } - case 1543: + case 1543: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1543)); - break; + break; } - case 1544: + case 1544: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1544)); - break; + break; } - case 1545: + case 1545: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1545)); - break; + break; } - case 1546: + case 1546: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1546)); - break; + break; } - case 1547: + case 1547: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1547)); - break; + break; } - case 1548: + case 1548: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1548)); - break; + break; } - case 1549: + case 1549: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1549)); - break; + break; } - case 1550: + case 1550: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1550)); - break; + break; } - case 1552: + case 1552: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1552)); - break; + break; } - case 1553: + case 1553: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1553)); - break; + break; } - case 1554: + case 1554: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1554)); - break; + break; } - case 1555: + case 1555: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1555)); - break; + break; } - case 1556: + case 1556: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1556)); - break; + break; } - default: - break; + default: { + break; } } } @@ -11487,8 +11464,7 @@ _PUBLIC_ void ndr_print_srvsvc_NetDiskInfo(struct ndr_print *ndr, const char *na ndr->depth++; for (cntr_disks_1=0;cntr_disks_1<r->count;cntr_disks_1++) { char *idx_1=NULL; - asprintf(&idx_1, "[%d]", cntr_disks_1); - if (idx_1) { + if (asprintf(&idx_1, "[%d]", cntr_disks_1) != -1) { ndr_print_srvsvc_NetDiskInfo0(ndr, "disks", &r->disks[cntr_disks_1]); free(idx_1); } @@ -11781,8 +11757,7 @@ _PUBLIC_ void ndr_print_srvsvc_NetTransportCtr0(struct ndr_print *ndr, const cha ndr->depth++; for (cntr_array_1=0;cntr_array_1<r->count;cntr_array_1++) { char *idx_1=NULL; - asprintf(&idx_1, "[%d]", cntr_array_1); - if (idx_1) { + if (asprintf(&idx_1, "[%d]", cntr_array_1) != -1) { ndr_print_srvsvc_NetTransportInfo0(ndr, "array", &r->array[cntr_array_1]); free(idx_1); } @@ -12030,8 +12005,7 @@ _PUBLIC_ void ndr_print_srvsvc_NetTransportCtr1(struct ndr_print *ndr, const cha ndr->depth++; for (cntr_array_1=0;cntr_array_1<r->count;cntr_array_1++) { char *idx_1=NULL; - asprintf(&idx_1, "[%d]", cntr_array_1); - if (idx_1) { + if (asprintf(&idx_1, "[%d]", cntr_array_1) != -1) { ndr_print_srvsvc_NetTransportInfo1(ndr, "array", &r->array[cntr_array_1]); free(idx_1); } @@ -12282,8 +12256,7 @@ _PUBLIC_ void ndr_print_srvsvc_NetTransportCtr2(struct ndr_print *ndr, const cha ndr->depth++; for (cntr_array_1=0;cntr_array_1<r->count;cntr_array_1++) { char *idx_1=NULL; - asprintf(&idx_1, "[%d]", cntr_array_1); - if (idx_1) { + if (asprintf(&idx_1, "[%d]", cntr_array_1) != -1) { ndr_print_srvsvc_NetTransportInfo2(ndr, "array", &r->array[cntr_array_1]); free(idx_1); } @@ -12540,8 +12513,7 @@ _PUBLIC_ void ndr_print_srvsvc_NetTransportCtr3(struct ndr_print *ndr, const cha ndr->depth++; for (cntr_array_1=0;cntr_array_1<r->count;cntr_array_1++) { char *idx_1=NULL; - asprintf(&idx_1, "[%d]", cntr_array_1); - if (idx_1) { + if (asprintf(&idx_1, "[%d]", cntr_array_1) != -1) { ndr_print_srvsvc_NetTransportInfo3(ndr, "array", &r->array[cntr_array_1]); free(idx_1); } @@ -12558,24 +12530,24 @@ static enum ndr_err_code ndr_push_srvsvc_NetTransportCtr(struct ndr_push *ndr, i int level = ndr_push_get_switch_value(ndr, r); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, level)); switch (level) { - case 0: + case 0: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->ctr0)); - break; + break; } - case 1: + case 1: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->ctr1)); - break; + break; } - case 2: + case 2: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->ctr2)); - break; + break; } - case 3: + case 3: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->ctr3)); - break; + break; } - default: - break; + default: { + break; } } } @@ -12837,21 +12809,21 @@ static enum ndr_err_code ndr_push_srvsvc_NetTransportInfo(struct ndr_push *ndr, int level = ndr_push_get_switch_value(ndr, r); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, level)); switch (level) { - case 0: + case 0: { NDR_CHECK(ndr_push_srvsvc_NetTransportInfo0(ndr, NDR_SCALARS, &r->info0)); - break; + break; } - case 1: + case 1: { NDR_CHECK(ndr_push_srvsvc_NetTransportInfo1(ndr, NDR_SCALARS, &r->info1)); - break; + break; } - case 2: + case 2: { NDR_CHECK(ndr_push_srvsvc_NetTransportInfo2(ndr, NDR_SCALARS, &r->info2)); - break; + break; } - case 3: + case 3: { NDR_CHECK(ndr_push_srvsvc_NetTransportInfo3(ndr, NDR_SCALARS, &r->info3)); - break; + break; } default: return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); diff --git a/source3/librpc/gen_ndr/ndr_svcctl.c b/source3/librpc/gen_ndr/ndr_svcctl.c index b8d5dc186d..16e0416288 100644 --- a/source3/librpc/gen_ndr/ndr_svcctl.c +++ b/source3/librpc/gen_ndr/ndr_svcctl.c @@ -588,8 +588,23 @@ _PUBLIC_ void ndr_print_svcctl_LockServiceDatabase(struct ndr_print *ndr, const static enum ndr_err_code ndr_push_svcctl_QueryServiceObjectSecurity(struct ndr_push *ndr, int flags, const struct svcctl_QueryServiceObjectSecurity *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|NDR_BUFFERS, r->in.handle)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.security_flags)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.buffer_size)); } if (flags & NDR_OUT) { + if (r->out.buffer == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.buffer_size)); + NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->out.buffer, r->in.buffer_size)); + if (r->out.needed == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.needed)); NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); } return NDR_ERR_SUCCESS; @@ -597,10 +612,48 @@ static enum ndr_err_code ndr_push_svcctl_QueryServiceObjectSecurity(struct ndr_p static enum ndr_err_code ndr_pull_svcctl_QueryServiceObjectSecurity(struct ndr_pull *ndr, int flags, struct svcctl_QueryServiceObjectSecurity *r) { + TALLOC_CTX *_mem_save_handle_0; + TALLOC_CTX *_mem_save_needed_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|NDR_BUFFERS, r->in.handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.security_flags)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.buffer_size)); + if (r->in.buffer_size < 0 || r->in.buffer_size > 0x40000) { + return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range"); + } + NDR_PULL_ALLOC_N(ndr, r->out.buffer, r->in.buffer_size); + memset(r->out.buffer, 0, (r->in.buffer_size) * sizeof(*r->out.buffer)); + NDR_PULL_ALLOC(ndr, r->out.needed); + ZERO_STRUCTP(r->out.needed); } if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_array_size(ndr, &r->out.buffer)); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC_N(ndr, r->out.buffer, ndr_get_array_size(ndr, &r->out.buffer)); + } + NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->out.buffer, ndr_get_array_size(ndr, &r->out.buffer))); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.needed); + } + _mem_save_needed_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.needed, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.needed)); + if (*r->out.needed < 0 || *r->out.needed > 0x40000) { + return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range"); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_needed_0, LIBNDR_FLAG_REF_ALLOC); NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); + if (r->out.buffer) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->out.buffer, r->in.buffer_size)); + } } return NDR_ERR_SUCCESS; } @@ -615,11 +668,25 @@ _PUBLIC_ void ndr_print_svcctl_QueryServiceObjectSecurity(struct ndr_print *ndr, if (flags & NDR_IN) { ndr_print_struct(ndr, "in", "svcctl_QueryServiceObjectSecurity"); 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_uint32(ndr, "security_flags", r->in.security_flags); + ndr_print_uint32(ndr, "buffer_size", r->in.buffer_size); ndr->depth--; } if (flags & NDR_OUT) { ndr_print_struct(ndr, "out", "svcctl_QueryServiceObjectSecurity"); ndr->depth++; + ndr_print_ptr(ndr, "buffer", r->out.buffer); + ndr->depth++; + ndr_print_array_uint8(ndr, "buffer", r->out.buffer, r->in.buffer_size); + ndr->depth--; + ndr_print_ptr(ndr, "needed", r->out.needed); + ndr->depth++; + ndr_print_uint32(ndr, "needed", *r->out.needed); + ndr->depth--; ndr_print_WERROR(ndr, "result", r->out.result); ndr->depth--; } @@ -629,6 +696,17 @@ _PUBLIC_ void ndr_print_svcctl_QueryServiceObjectSecurity(struct ndr_print *ndr, static enum ndr_err_code ndr_push_svcctl_SetServiceObjectSecurity(struct ndr_push *ndr, int flags, const struct svcctl_SetServiceObjectSecurity *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|NDR_BUFFERS, r->in.handle)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.security_flags)); + if (r->in.buffer == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.buffer_size)); + NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->in.buffer, r->in.buffer_size)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.buffer_size)); } if (flags & NDR_OUT) { NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); @@ -638,7 +716,25 @@ static enum ndr_err_code ndr_push_svcctl_SetServiceObjectSecurity(struct ndr_pus static enum ndr_err_code ndr_pull_svcctl_SetServiceObjectSecurity(struct ndr_pull *ndr, int flags, struct svcctl_SetServiceObjectSecurity *r) { + TALLOC_CTX *_mem_save_handle_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|NDR_BUFFERS, r->in.handle)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.security_flags)); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.buffer)); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC_N(ndr, r->in.buffer, ndr_get_array_size(ndr, &r->in.buffer)); + } + NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->in.buffer, ndr_get_array_size(ndr, &r->in.buffer))); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.buffer_size)); + if (r->in.buffer) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->in.buffer, r->in.buffer_size)); + } } if (flags & NDR_OUT) { NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); @@ -656,6 +752,16 @@ _PUBLIC_ void ndr_print_svcctl_SetServiceObjectSecurity(struct ndr_print *ndr, c if (flags & NDR_IN) { ndr_print_struct(ndr, "in", "svcctl_SetServiceObjectSecurity"); 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_uint32(ndr, "security_flags", r->in.security_flags); + ndr_print_ptr(ndr, "buffer", r->in.buffer); + ndr->depth++; + ndr_print_array_uint8(ndr, "buffer", r->in.buffer, r->in.buffer_size); + ndr->depth--; + ndr_print_uint32(ndr, "buffer_size", r->in.buffer_size); ndr->depth--; } if (flags & NDR_OUT) { @@ -2380,14 +2486,13 @@ static enum ndr_err_code ndr_push_svcctl_GetServiceDisplayNameW(struct ndr_push if (r->out.display_name == NULL) { return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); } - if (*r->out.display_name == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.display_name)); + if (*r->out.display_name) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(*r->out.display_name, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(*r->out.display_name, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, *r->out.display_name, ndr_charset_length(*r->out.display_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); } - NDR_CHECK(ndr_push_ref_ptr(ndr)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(*r->out.display_name, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(*r->out.display_name, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, *r->out.display_name, ndr_charset_length(*r->out.display_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.display_name_length)); if (r->out.display_name_length) { NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.display_name_length)); @@ -2405,6 +2510,7 @@ static enum ndr_err_code ndr_pull_svcctl_GetServiceDisplayNameW(struct ndr_pull TALLOC_CTX *_mem_save_handle_0; TALLOC_CTX *_mem_save_service_name_0; TALLOC_CTX *_mem_save_display_name_0; + TALLOC_CTX *_mem_save_display_name_1; TALLOC_CTX *_mem_save_display_name_length_0; if (flags & NDR_IN) { ZERO_STRUCT(r->out); @@ -2455,14 +2561,24 @@ static enum ndr_err_code ndr_pull_svcctl_GetServiceDisplayNameW(struct ndr_pull } _mem_save_display_name_0 = NDR_PULL_GET_MEM_CTX(ndr); NDR_PULL_SET_MEM_CTX(ndr, r->out.display_name, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_ref_ptr(ndr, &_ptr_display_name)); - NDR_CHECK(ndr_pull_array_size(ndr, r->out.display_name)); - NDR_CHECK(ndr_pull_array_length(ndr, r->out.display_name)); - if (ndr_get_array_length(ndr, r->out.display_name) > ndr_get_array_size(ndr, r->out.display_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->out.display_name), ndr_get_array_length(ndr, r->out.display_name)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, r->out.display_name), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, r->out.display_name, ndr_get_array_length(ndr, r->out.display_name), sizeof(uint16_t), CH_UTF16)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_display_name)); + if (_ptr_display_name) { + NDR_PULL_ALLOC(ndr, *r->out.display_name); + } else { + *r->out.display_name = NULL; + } + if (*r->out.display_name) { + _mem_save_display_name_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, *r->out.display_name, 0); + NDR_CHECK(ndr_pull_array_size(ndr, r->out.display_name)); + NDR_CHECK(ndr_pull_array_length(ndr, r->out.display_name)); + if (ndr_get_array_length(ndr, r->out.display_name) > ndr_get_array_size(ndr, r->out.display_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->out.display_name), ndr_get_array_length(ndr, r->out.display_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, r->out.display_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, r->out.display_name, ndr_get_array_length(ndr, r->out.display_name), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_display_name_1, 0); + } NDR_PULL_SET_MEM_CTX(ndr, _mem_save_display_name_0, LIBNDR_FLAG_REF_ALLOC); NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_display_name_length)); if (_ptr_display_name_length) { @@ -2516,7 +2632,9 @@ _PUBLIC_ void ndr_print_svcctl_GetServiceDisplayNameW(struct ndr_print *ndr, con ndr->depth++; ndr_print_ptr(ndr, "display_name", *r->out.display_name); ndr->depth++; - ndr_print_string(ndr, "display_name", *r->out.display_name); + if (*r->out.display_name) { + ndr_print_string(ndr, "display_name", *r->out.display_name); + } ndr->depth--; ndr->depth--; ndr_print_ptr(ndr, "display_name_length", r->out.display_name_length); @@ -2554,14 +2672,13 @@ static enum ndr_err_code ndr_push_svcctl_GetServiceKeyNameW(struct ndr_push *ndr if (r->out.key_name == NULL) { return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); } - if (*r->out.key_name == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.key_name)); + if (*r->out.key_name) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(*r->out.key_name, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(*r->out.key_name, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, *r->out.key_name, ndr_charset_length(*r->out.key_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); } - NDR_CHECK(ndr_push_ref_ptr(ndr)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(*r->out.key_name, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(*r->out.key_name, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, *r->out.key_name, ndr_charset_length(*r->out.key_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.display_name_length)); if (r->out.display_name_length) { NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.display_name_length)); @@ -2579,6 +2696,7 @@ static enum ndr_err_code ndr_pull_svcctl_GetServiceKeyNameW(struct ndr_pull *ndr TALLOC_CTX *_mem_save_handle_0; TALLOC_CTX *_mem_save_service_name_0; TALLOC_CTX *_mem_save_key_name_0; + TALLOC_CTX *_mem_save_key_name_1; TALLOC_CTX *_mem_save_display_name_length_0; if (flags & NDR_IN) { ZERO_STRUCT(r->out); @@ -2629,14 +2747,24 @@ static enum ndr_err_code ndr_pull_svcctl_GetServiceKeyNameW(struct ndr_pull *ndr } _mem_save_key_name_0 = NDR_PULL_GET_MEM_CTX(ndr); NDR_PULL_SET_MEM_CTX(ndr, r->out.key_name, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_ref_ptr(ndr, &_ptr_key_name)); - NDR_CHECK(ndr_pull_array_size(ndr, r->out.key_name)); - NDR_CHECK(ndr_pull_array_length(ndr, r->out.key_name)); - if (ndr_get_array_length(ndr, r->out.key_name) > ndr_get_array_size(ndr, r->out.key_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->out.key_name), ndr_get_array_length(ndr, r->out.key_name)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, r->out.key_name), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, r->out.key_name, ndr_get_array_length(ndr, r->out.key_name), sizeof(uint16_t), CH_UTF16)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_key_name)); + if (_ptr_key_name) { + NDR_PULL_ALLOC(ndr, *r->out.key_name); + } else { + *r->out.key_name = NULL; + } + if (*r->out.key_name) { + _mem_save_key_name_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, *r->out.key_name, 0); + NDR_CHECK(ndr_pull_array_size(ndr, r->out.key_name)); + NDR_CHECK(ndr_pull_array_length(ndr, r->out.key_name)); + if (ndr_get_array_length(ndr, r->out.key_name) > ndr_get_array_size(ndr, r->out.key_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->out.key_name), ndr_get_array_length(ndr, r->out.key_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, r->out.key_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, r->out.key_name, ndr_get_array_length(ndr, r->out.key_name), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_key_name_1, 0); + } NDR_PULL_SET_MEM_CTX(ndr, _mem_save_key_name_0, LIBNDR_FLAG_REF_ALLOC); NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_display_name_length)); if (_ptr_display_name_length) { @@ -2690,7 +2818,9 @@ _PUBLIC_ void ndr_print_svcctl_GetServiceKeyNameW(struct ndr_print *ndr, const c ndr->depth++; ndr_print_ptr(ndr, "key_name", *r->out.key_name); ndr->depth++; - ndr_print_string(ndr, "key_name", *r->out.key_name); + if (*r->out.key_name) { + ndr_print_string(ndr, "key_name", *r->out.key_name); + } ndr->depth--; ndr->depth--; ndr_print_ptr(ndr, "display_name_length", r->out.display_name_length); @@ -4186,14 +4316,13 @@ static enum ndr_err_code ndr_push_svcctl_GetServiceDisplayNameA(struct ndr_push if (r->out.display_name == NULL) { return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); } - if (*r->out.display_name == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.display_name)); + if (*r->out.display_name) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(*r->out.display_name, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(*r->out.display_name, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, *r->out.display_name, ndr_charset_length(*r->out.display_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); } - NDR_CHECK(ndr_push_ref_ptr(ndr)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(*r->out.display_name, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(*r->out.display_name, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, *r->out.display_name, ndr_charset_length(*r->out.display_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.display_name_length)); if (r->out.display_name_length) { NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.display_name_length)); @@ -4211,6 +4340,7 @@ static enum ndr_err_code ndr_pull_svcctl_GetServiceDisplayNameA(struct ndr_pull TALLOC_CTX *_mem_save_handle_0; TALLOC_CTX *_mem_save_service_name_0; TALLOC_CTX *_mem_save_display_name_0; + TALLOC_CTX *_mem_save_display_name_1; TALLOC_CTX *_mem_save_display_name_length_0; if (flags & NDR_IN) { ZERO_STRUCT(r->out); @@ -4261,14 +4391,24 @@ static enum ndr_err_code ndr_pull_svcctl_GetServiceDisplayNameA(struct ndr_pull } _mem_save_display_name_0 = NDR_PULL_GET_MEM_CTX(ndr); NDR_PULL_SET_MEM_CTX(ndr, r->out.display_name, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_ref_ptr(ndr, &_ptr_display_name)); - NDR_CHECK(ndr_pull_array_size(ndr, r->out.display_name)); - NDR_CHECK(ndr_pull_array_length(ndr, r->out.display_name)); - if (ndr_get_array_length(ndr, r->out.display_name) > ndr_get_array_size(ndr, r->out.display_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->out.display_name), ndr_get_array_length(ndr, r->out.display_name)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, r->out.display_name), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, r->out.display_name, ndr_get_array_length(ndr, r->out.display_name), sizeof(uint16_t), CH_UTF16)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_display_name)); + if (_ptr_display_name) { + NDR_PULL_ALLOC(ndr, *r->out.display_name); + } else { + *r->out.display_name = NULL; + } + if (*r->out.display_name) { + _mem_save_display_name_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, *r->out.display_name, 0); + NDR_CHECK(ndr_pull_array_size(ndr, r->out.display_name)); + NDR_CHECK(ndr_pull_array_length(ndr, r->out.display_name)); + if (ndr_get_array_length(ndr, r->out.display_name) > ndr_get_array_size(ndr, r->out.display_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->out.display_name), ndr_get_array_length(ndr, r->out.display_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, r->out.display_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, r->out.display_name, ndr_get_array_length(ndr, r->out.display_name), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_display_name_1, 0); + } NDR_PULL_SET_MEM_CTX(ndr, _mem_save_display_name_0, LIBNDR_FLAG_REF_ALLOC); NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_display_name_length)); if (_ptr_display_name_length) { @@ -4322,7 +4462,9 @@ _PUBLIC_ void ndr_print_svcctl_GetServiceDisplayNameA(struct ndr_print *ndr, con ndr->depth++; ndr_print_ptr(ndr, "display_name", *r->out.display_name); ndr->depth++; - ndr_print_string(ndr, "display_name", *r->out.display_name); + if (*r->out.display_name) { + ndr_print_string(ndr, "display_name", *r->out.display_name); + } ndr->depth--; ndr->depth--; ndr_print_ptr(ndr, "display_name_length", r->out.display_name_length); @@ -4360,14 +4502,13 @@ static enum ndr_err_code ndr_push_svcctl_GetServiceKeyNameA(struct ndr_push *ndr if (r->out.key_name == NULL) { return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); } - if (*r->out.key_name == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.key_name)); + if (*r->out.key_name) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(*r->out.key_name, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(*r->out.key_name, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, *r->out.key_name, ndr_charset_length(*r->out.key_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); } - NDR_CHECK(ndr_push_ref_ptr(ndr)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(*r->out.key_name, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(*r->out.key_name, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, *r->out.key_name, ndr_charset_length(*r->out.key_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.display_name_length)); if (r->out.display_name_length) { NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.display_name_length)); @@ -4385,6 +4526,7 @@ static enum ndr_err_code ndr_pull_svcctl_GetServiceKeyNameA(struct ndr_pull *ndr TALLOC_CTX *_mem_save_handle_0; TALLOC_CTX *_mem_save_service_name_0; TALLOC_CTX *_mem_save_key_name_0; + TALLOC_CTX *_mem_save_key_name_1; TALLOC_CTX *_mem_save_display_name_length_0; if (flags & NDR_IN) { ZERO_STRUCT(r->out); @@ -4435,14 +4577,24 @@ static enum ndr_err_code ndr_pull_svcctl_GetServiceKeyNameA(struct ndr_pull *ndr } _mem_save_key_name_0 = NDR_PULL_GET_MEM_CTX(ndr); NDR_PULL_SET_MEM_CTX(ndr, r->out.key_name, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_ref_ptr(ndr, &_ptr_key_name)); - NDR_CHECK(ndr_pull_array_size(ndr, r->out.key_name)); - NDR_CHECK(ndr_pull_array_length(ndr, r->out.key_name)); - if (ndr_get_array_length(ndr, r->out.key_name) > ndr_get_array_size(ndr, r->out.key_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->out.key_name), ndr_get_array_length(ndr, r->out.key_name)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, r->out.key_name), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, r->out.key_name, ndr_get_array_length(ndr, r->out.key_name), sizeof(uint16_t), CH_UTF16)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_key_name)); + if (_ptr_key_name) { + NDR_PULL_ALLOC(ndr, *r->out.key_name); + } else { + *r->out.key_name = NULL; + } + if (*r->out.key_name) { + _mem_save_key_name_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, *r->out.key_name, 0); + NDR_CHECK(ndr_pull_array_size(ndr, r->out.key_name)); + NDR_CHECK(ndr_pull_array_length(ndr, r->out.key_name)); + if (ndr_get_array_length(ndr, r->out.key_name) > ndr_get_array_size(ndr, r->out.key_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->out.key_name), ndr_get_array_length(ndr, r->out.key_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, r->out.key_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, r->out.key_name, ndr_get_array_length(ndr, r->out.key_name), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_key_name_1, 0); + } NDR_PULL_SET_MEM_CTX(ndr, _mem_save_key_name_0, LIBNDR_FLAG_REF_ALLOC); NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_display_name_length)); if (_ptr_display_name_length) { @@ -4496,7 +4648,9 @@ _PUBLIC_ void ndr_print_svcctl_GetServiceKeyNameA(struct ndr_print *ndr, const c ndr->depth++; ndr_print_ptr(ndr, "key_name", *r->out.key_name); ndr->depth++; - ndr_print_string(ndr, "key_name", *r->out.key_name); + if (*r->out.key_name) { + ndr_print_string(ndr, "key_name", *r->out.key_name); + } ndr->depth--; ndr->depth--; ndr_print_ptr(ndr, "display_name_length", r->out.display_name_length); @@ -5055,14 +5209,13 @@ static enum ndr_err_code ndr_push_EnumServicesStatusExA(struct ndr_push *ndr, in if (r->out.group_name == NULL) { return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); } - if (*r->out.group_name == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.group_name)); + if (*r->out.group_name) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(*r->out.group_name, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(*r->out.group_name, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, *r->out.group_name, ndr_charset_length(*r->out.group_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); } - NDR_CHECK(ndr_push_ref_ptr(ndr)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(*r->out.group_name, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(*r->out.group_name, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, *r->out.group_name, ndr_charset_length(*r->out.group_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); } return NDR_ERR_SUCCESS; @@ -5077,6 +5230,7 @@ static enum ndr_err_code ndr_pull_EnumServicesStatusExA(struct ndr_pull *ndr, in TALLOC_CTX *_mem_save_service_returned_0; TALLOC_CTX *_mem_save_resume_handle_0; TALLOC_CTX *_mem_save_group_name_0; + TALLOC_CTX *_mem_save_group_name_1; if (flags & NDR_IN) { ZERO_STRUCT(r->out); @@ -5144,14 +5298,24 @@ static enum ndr_err_code ndr_pull_EnumServicesStatusExA(struct ndr_pull *ndr, in } _mem_save_group_name_0 = NDR_PULL_GET_MEM_CTX(ndr); NDR_PULL_SET_MEM_CTX(ndr, r->out.group_name, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_ref_ptr(ndr, &_ptr_group_name)); - NDR_CHECK(ndr_pull_array_size(ndr, r->out.group_name)); - NDR_CHECK(ndr_pull_array_length(ndr, r->out.group_name)); - if (ndr_get_array_length(ndr, r->out.group_name) > ndr_get_array_size(ndr, r->out.group_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->out.group_name), ndr_get_array_length(ndr, r->out.group_name)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, r->out.group_name), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, r->out.group_name, ndr_get_array_length(ndr, r->out.group_name), sizeof(uint16_t), CH_UTF16)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_group_name)); + if (_ptr_group_name) { + NDR_PULL_ALLOC(ndr, *r->out.group_name); + } else { + *r->out.group_name = NULL; + } + if (*r->out.group_name) { + _mem_save_group_name_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, *r->out.group_name, 0); + NDR_CHECK(ndr_pull_array_size(ndr, r->out.group_name)); + NDR_CHECK(ndr_pull_array_length(ndr, r->out.group_name)); + if (ndr_get_array_length(ndr, r->out.group_name) > ndr_get_array_size(ndr, r->out.group_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->out.group_name), ndr_get_array_length(ndr, r->out.group_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, r->out.group_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, r->out.group_name, ndr_get_array_length(ndr, r->out.group_name), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_group_name_1, 0); + } NDR_PULL_SET_MEM_CTX(ndr, _mem_save_group_name_0, LIBNDR_FLAG_REF_ALLOC); NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); } @@ -5206,7 +5370,9 @@ _PUBLIC_ void ndr_print_EnumServicesStatusExA(struct ndr_print *ndr, const char ndr->depth++; ndr_print_ptr(ndr, "group_name", *r->out.group_name); ndr->depth++; - ndr_print_string(ndr, "group_name", *r->out.group_name); + if (*r->out.group_name) { + ndr_print_string(ndr, "group_name", *r->out.group_name); + } ndr->depth--; ndr->depth--; ndr_print_WERROR(ndr, "result", r->out.result); @@ -5248,14 +5414,13 @@ static enum ndr_err_code ndr_push_EnumServicesStatusExW(struct ndr_push *ndr, in if (r->out.group_name == NULL) { return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); } - if (*r->out.group_name == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.group_name)); + if (*r->out.group_name) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(*r->out.group_name, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(*r->out.group_name, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, *r->out.group_name, ndr_charset_length(*r->out.group_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); } - NDR_CHECK(ndr_push_ref_ptr(ndr)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(*r->out.group_name, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(*r->out.group_name, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, *r->out.group_name, ndr_charset_length(*r->out.group_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); } return NDR_ERR_SUCCESS; @@ -5270,6 +5435,7 @@ static enum ndr_err_code ndr_pull_EnumServicesStatusExW(struct ndr_pull *ndr, in TALLOC_CTX *_mem_save_service_returned_0; TALLOC_CTX *_mem_save_resume_handle_0; TALLOC_CTX *_mem_save_group_name_0; + TALLOC_CTX *_mem_save_group_name_1; if (flags & NDR_IN) { ZERO_STRUCT(r->out); @@ -5337,14 +5503,24 @@ static enum ndr_err_code ndr_pull_EnumServicesStatusExW(struct ndr_pull *ndr, in } _mem_save_group_name_0 = NDR_PULL_GET_MEM_CTX(ndr); NDR_PULL_SET_MEM_CTX(ndr, r->out.group_name, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_ref_ptr(ndr, &_ptr_group_name)); - NDR_CHECK(ndr_pull_array_size(ndr, r->out.group_name)); - NDR_CHECK(ndr_pull_array_length(ndr, r->out.group_name)); - if (ndr_get_array_length(ndr, r->out.group_name) > ndr_get_array_size(ndr, r->out.group_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->out.group_name), ndr_get_array_length(ndr, r->out.group_name)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, r->out.group_name), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, r->out.group_name, ndr_get_array_length(ndr, r->out.group_name), sizeof(uint16_t), CH_UTF16)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_group_name)); + if (_ptr_group_name) { + NDR_PULL_ALLOC(ndr, *r->out.group_name); + } else { + *r->out.group_name = NULL; + } + if (*r->out.group_name) { + _mem_save_group_name_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, *r->out.group_name, 0); + NDR_CHECK(ndr_pull_array_size(ndr, r->out.group_name)); + NDR_CHECK(ndr_pull_array_length(ndr, r->out.group_name)); + if (ndr_get_array_length(ndr, r->out.group_name) > ndr_get_array_size(ndr, r->out.group_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->out.group_name), ndr_get_array_length(ndr, r->out.group_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, r->out.group_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, r->out.group_name, ndr_get_array_length(ndr, r->out.group_name), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_group_name_1, 0); + } NDR_PULL_SET_MEM_CTX(ndr, _mem_save_group_name_0, LIBNDR_FLAG_REF_ALLOC); NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); } @@ -5399,7 +5575,9 @@ _PUBLIC_ void ndr_print_EnumServicesStatusExW(struct ndr_print *ndr, const char ndr->depth++; ndr_print_ptr(ndr, "group_name", *r->out.group_name); ndr->depth++; - ndr_print_string(ndr, "group_name", *r->out.group_name); + if (*r->out.group_name) { + ndr_print_string(ndr, "group_name", *r->out.group_name); + } ndr->depth--; ndr->depth--; ndr_print_WERROR(ndr, "result", r->out.result); diff --git a/source3/librpc/gen_ndr/ndr_unixinfo.c b/source3/librpc/gen_ndr/ndr_unixinfo.c deleted file mode 100644 index 03a8d30f03..0000000000 --- a/source3/librpc/gen_ndr/ndr_unixinfo.c +++ /dev/null @@ -1,538 +0,0 @@ -/* parser auto-generated by pidl */ - -#include "includes.h" -#include "librpc/gen_ndr/ndr_unixinfo.h" - -#include "librpc/gen_ndr/ndr_security.h" -static enum ndr_err_code ndr_push_unixinfo_GetPWUidInfo(struct ndr_push *ndr, int ndr_flags, const struct unixinfo_GetPWUidInfo *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->status)); - { - uint32_t _flags_save_string = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_UTF8|LIBNDR_FLAG_STR_NULLTERM); - NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->homedir)); - ndr->flags = _flags_save_string; - } - { - uint32_t _flags_save_string = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_UTF8|LIBNDR_FLAG_STR_NULLTERM); - NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->shell)); - ndr->flags = _flags_save_string; - } - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_unixinfo_GetPWUidInfo(struct ndr_pull *ndr, int ndr_flags, struct unixinfo_GetPWUidInfo *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->status)); - { - uint32_t _flags_save_string = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_UTF8|LIBNDR_FLAG_STR_NULLTERM); - NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->homedir)); - ndr->flags = _flags_save_string; - } - { - uint32_t _flags_save_string = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_UTF8|LIBNDR_FLAG_STR_NULLTERM); - NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->shell)); - ndr->flags = _flags_save_string; - } - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_unixinfo_GetPWUidInfo(struct ndr_print *ndr, const char *name, const struct unixinfo_GetPWUidInfo *r) -{ - ndr_print_struct(ndr, name, "unixinfo_GetPWUidInfo"); - ndr->depth++; - ndr_print_NTSTATUS(ndr, "status", r->status); - ndr_print_string(ndr, "homedir", r->homedir); - ndr_print_string(ndr, "shell", r->shell); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_unixinfo_SidToUid(struct ndr_push *ndr, int flags, const struct unixinfo_SidToUid *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_push_dom_sid(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.sid)); - } - if (flags & NDR_OUT) { - if (r->out.uid == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, *r->out.uid)); - NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_unixinfo_SidToUid(struct ndr_pull *ndr, int flags, struct unixinfo_SidToUid *r) -{ - TALLOC_CTX *_mem_save_uid_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - NDR_CHECK(ndr_pull_dom_sid(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.sid)); - NDR_PULL_ALLOC(ndr, r->out.uid); - ZERO_STRUCTP(r->out.uid); - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.uid); - } - _mem_save_uid_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.uid, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, r->out.uid)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_uid_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_unixinfo_SidToUid(struct ndr_print *ndr, const char *name, int flags, const struct unixinfo_SidToUid *r) -{ - ndr_print_struct(ndr, name, "unixinfo_SidToUid"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "unixinfo_SidToUid"); - ndr->depth++; - ndr_print_dom_sid(ndr, "sid", &r->in.sid); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "unixinfo_SidToUid"); - ndr->depth++; - ndr_print_ptr(ndr, "uid", r->out.uid); - ndr->depth++; - ndr_print_hyper(ndr, "uid", *r->out.uid); - ndr->depth--; - ndr_print_NTSTATUS(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_unixinfo_UidToSid(struct ndr_push *ndr, int flags, const struct unixinfo_UidToSid *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->in.uid)); - } - 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_sid(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_unixinfo_UidToSid(struct ndr_pull *ndr, int flags, struct unixinfo_UidToSid *r) -{ - TALLOC_CTX *_mem_save_sid_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->in.uid)); - 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_sid(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_unixinfo_UidToSid(struct ndr_print *ndr, const char *name, int flags, const struct unixinfo_UidToSid *r) -{ - ndr_print_struct(ndr, name, "unixinfo_UidToSid"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "unixinfo_UidToSid"); - ndr->depth++; - ndr_print_hyper(ndr, "uid", r->in.uid); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "unixinfo_UidToSid"); - ndr->depth++; - ndr_print_ptr(ndr, "sid", r->out.sid); - ndr->depth++; - ndr_print_dom_sid(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_unixinfo_SidToGid(struct ndr_push *ndr, int flags, const struct unixinfo_SidToGid *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_push_dom_sid(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.sid)); - } - if (flags & NDR_OUT) { - if (r->out.gid == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, *r->out.gid)); - NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_unixinfo_SidToGid(struct ndr_pull *ndr, int flags, struct unixinfo_SidToGid *r) -{ - TALLOC_CTX *_mem_save_gid_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - NDR_CHECK(ndr_pull_dom_sid(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.sid)); - NDR_PULL_ALLOC(ndr, r->out.gid); - ZERO_STRUCTP(r->out.gid); - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.gid); - } - _mem_save_gid_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.gid, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, r->out.gid)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_gid_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_unixinfo_SidToGid(struct ndr_print *ndr, const char *name, int flags, const struct unixinfo_SidToGid *r) -{ - ndr_print_struct(ndr, name, "unixinfo_SidToGid"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "unixinfo_SidToGid"); - ndr->depth++; - ndr_print_dom_sid(ndr, "sid", &r->in.sid); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "unixinfo_SidToGid"); - ndr->depth++; - ndr_print_ptr(ndr, "gid", r->out.gid); - ndr->depth++; - ndr_print_hyper(ndr, "gid", *r->out.gid); - ndr->depth--; - ndr_print_NTSTATUS(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static enum ndr_err_code ndr_push_unixinfo_GidToSid(struct ndr_push *ndr, int flags, const struct unixinfo_GidToSid *r) -{ - if (flags & NDR_IN) { - NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->in.gid)); - } - 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_sid(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_unixinfo_GidToSid(struct ndr_pull *ndr, int flags, struct unixinfo_GidToSid *r) -{ - TALLOC_CTX *_mem_save_sid_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->in.gid)); - 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_sid(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_unixinfo_GidToSid(struct ndr_print *ndr, const char *name, int flags, const struct unixinfo_GidToSid *r) -{ - ndr_print_struct(ndr, name, "unixinfo_GidToSid"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "unixinfo_GidToSid"); - ndr->depth++; - ndr_print_hyper(ndr, "gid", r->in.gid); - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "unixinfo_GidToSid"); - ndr->depth++; - ndr_print_ptr(ndr, "sid", r->out.sid); - ndr->depth++; - ndr_print_dom_sid(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_unixinfo_GetPWUid(struct ndr_push *ndr, int flags, const struct unixinfo_GetPWUid *r) -{ - uint32_t cntr_uids_0; - uint32_t cntr_infos_0; - if (flags & NDR_IN) { - if (r->in.count == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.count)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.count)); - for (cntr_uids_0 = 0; cntr_uids_0 < *r->in.count; cntr_uids_0++) { - NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->in.uids[cntr_uids_0])); - } - } - if (flags & NDR_OUT) { - if (r->out.count == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.count)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.count)); - for (cntr_infos_0 = 0; cntr_infos_0 < *r->out.count; cntr_infos_0++) { - NDR_CHECK(ndr_push_unixinfo_GetPWUidInfo(ndr, NDR_SCALARS, &r->out.infos[cntr_infos_0])); - } - NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_unixinfo_GetPWUid(struct ndr_pull *ndr, int flags, struct unixinfo_GetPWUid *r) -{ - uint32_t cntr_uids_0; - uint32_t cntr_infos_0; - TALLOC_CTX *_mem_save_count_0; - TALLOC_CTX *_mem_save_uids_0; - TALLOC_CTX *_mem_save_infos_0; - if (flags & NDR_IN) { - ZERO_STRUCT(r->out); - - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->in.count); - } - _mem_save_count_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.count, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->in.count)); - if (*r->in.count < 0 || *r->in.count > 1023) { - return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range"); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_count_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_array_size(ndr, &r->in.uids)); - NDR_PULL_ALLOC_N(ndr, r->in.uids, ndr_get_array_size(ndr, &r->in.uids)); - _mem_save_uids_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.uids, 0); - for (cntr_uids_0 = 0; cntr_uids_0 < *r->in.count; cntr_uids_0++) { - NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->in.uids[cntr_uids_0])); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_uids_0, 0); - NDR_PULL_ALLOC(ndr, r->out.count); - *r->out.count = *r->in.count; - if (r->in.uids) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->in.uids, *r->in.count)); - } - } - if (flags & NDR_OUT) { - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.count); - } - _mem_save_count_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.count, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.count)); - if (*r->out.count < 0 || *r->out.count > 1023) { - return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range"); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_count_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_array_size(ndr, &r->out.infos)); - NDR_PULL_ALLOC_N(ndr, r->out.infos, ndr_get_array_size(ndr, &r->out.infos)); - _mem_save_infos_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.infos, 0); - for (cntr_infos_0 = 0; cntr_infos_0 < *r->out.count; cntr_infos_0++) { - NDR_CHECK(ndr_pull_unixinfo_GetPWUidInfo(ndr, NDR_SCALARS, &r->out.infos[cntr_infos_0])); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_infos_0, 0); - NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result)); - if (r->out.infos) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->out.infos, *r->out.count)); - } - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_unixinfo_GetPWUid(struct ndr_print *ndr, const char *name, int flags, const struct unixinfo_GetPWUid *r) -{ - uint32_t cntr_uids_0; - uint32_t cntr_infos_0; - ndr_print_struct(ndr, name, "unixinfo_GetPWUid"); - ndr->depth++; - if (flags & NDR_SET_VALUES) { - ndr->flags |= LIBNDR_PRINT_SET_VALUES; - } - if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "unixinfo_GetPWUid"); - ndr->depth++; - ndr_print_ptr(ndr, "count", r->in.count); - ndr->depth++; - ndr_print_uint32(ndr, "count", *r->in.count); - ndr->depth--; - ndr->print(ndr, "%s: ARRAY(%d)", "uids", *r->in.count); - ndr->depth++; - for (cntr_uids_0=0;cntr_uids_0<*r->in.count;cntr_uids_0++) { - char *idx_0=NULL; - asprintf(&idx_0, "[%d]", cntr_uids_0); - if (idx_0) { - ndr_print_hyper(ndr, "uids", r->in.uids[cntr_uids_0]); - free(idx_0); - } - } - ndr->depth--; - ndr->depth--; - } - if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "unixinfo_GetPWUid"); - ndr->depth++; - ndr_print_ptr(ndr, "count", r->out.count); - ndr->depth++; - ndr_print_uint32(ndr, "count", *r->out.count); - ndr->depth--; - ndr->print(ndr, "%s: ARRAY(%d)", "infos", *r->out.count); - ndr->depth++; - for (cntr_infos_0=0;cntr_infos_0<*r->out.count;cntr_infos_0++) { - char *idx_0=NULL; - asprintf(&idx_0, "[%d]", cntr_infos_0); - if (idx_0) { - ndr_print_unixinfo_GetPWUidInfo(ndr, "infos", &r->out.infos[cntr_infos_0]); - free(idx_0); - } - } - ndr->depth--; - ndr_print_NTSTATUS(ndr, "result", r->out.result); - ndr->depth--; - } - ndr->depth--; -} - -static const struct ndr_interface_call unixinfo_calls[] = { - { - "unixinfo_SidToUid", - sizeof(struct unixinfo_SidToUid), - (ndr_push_flags_fn_t) ndr_push_unixinfo_SidToUid, - (ndr_pull_flags_fn_t) ndr_pull_unixinfo_SidToUid, - (ndr_print_function_t) ndr_print_unixinfo_SidToUid, - false, - }, - { - "unixinfo_UidToSid", - sizeof(struct unixinfo_UidToSid), - (ndr_push_flags_fn_t) ndr_push_unixinfo_UidToSid, - (ndr_pull_flags_fn_t) ndr_pull_unixinfo_UidToSid, - (ndr_print_function_t) ndr_print_unixinfo_UidToSid, - false, - }, - { - "unixinfo_SidToGid", - sizeof(struct unixinfo_SidToGid), - (ndr_push_flags_fn_t) ndr_push_unixinfo_SidToGid, - (ndr_pull_flags_fn_t) ndr_pull_unixinfo_SidToGid, - (ndr_print_function_t) ndr_print_unixinfo_SidToGid, - false, - }, - { - "unixinfo_GidToSid", - sizeof(struct unixinfo_GidToSid), - (ndr_push_flags_fn_t) ndr_push_unixinfo_GidToSid, - (ndr_pull_flags_fn_t) ndr_pull_unixinfo_GidToSid, - (ndr_print_function_t) ndr_print_unixinfo_GidToSid, - false, - }, - { - "unixinfo_GetPWUid", - sizeof(struct unixinfo_GetPWUid), - (ndr_push_flags_fn_t) ndr_push_unixinfo_GetPWUid, - (ndr_pull_flags_fn_t) ndr_pull_unixinfo_GetPWUid, - (ndr_print_function_t) ndr_print_unixinfo_GetPWUid, - false, - }, - { NULL, 0, NULL, NULL, NULL, false } -}; - -static const char * const unixinfo_endpoint_strings[] = { - "ncacn_np:[\\pipe\\unixinfo]", - "ncacn_ip_tcp:", - "ncalrpc:", -}; - -static const struct ndr_interface_string_array unixinfo_endpoints = { - .count = 3, - .names = unixinfo_endpoint_strings -}; - -static const char * const unixinfo_authservice_strings[] = { - "host", -}; - -static const struct ndr_interface_string_array unixinfo_authservices = { - .count = 3, - .names = unixinfo_authservice_strings -}; - - -const struct ndr_interface_table ndr_table_unixinfo = { - .name = "unixinfo", - .syntax_id = { - {0x9c54e310,0xa955,0x4885,{0xbd,0x31},{0x78,0x78,0x71,0x47,0xdf,0xa6}}, - NDR_UNIXINFO_VERSION - }, - .helpstring = NDR_UNIXINFO_HELPSTRING, - .num_calls = 5, - .calls = unixinfo_calls, - .endpoints = &unixinfo_endpoints, - .authservices = &unixinfo_authservices -}; - diff --git a/source3/librpc/gen_ndr/ndr_unixinfo.h b/source3/librpc/gen_ndr/ndr_unixinfo.h deleted file mode 100644 index 17f8b811db..0000000000 --- a/source3/librpc/gen_ndr/ndr_unixinfo.h +++ /dev/null @@ -1,31 +0,0 @@ -/* header auto-generated by pidl */ - -#include "librpc/ndr/libndr.h" -#include "librpc/gen_ndr/unixinfo.h" - -#ifndef _HEADER_NDR_unixinfo -#define _HEADER_NDR_unixinfo - -#define NDR_UNIXINFO_UUID "9c54e310-a955-4885-bd31-78787147dfa6" -#define NDR_UNIXINFO_VERSION 0.0 -#define NDR_UNIXINFO_NAME "unixinfo" -#define NDR_UNIXINFO_HELPSTRING "Unixinfo specific stuff" -extern const struct ndr_interface_table ndr_table_unixinfo; -#define NDR_UNIXINFO_SIDTOUID (0x00) - -#define NDR_UNIXINFO_UIDTOSID (0x01) - -#define NDR_UNIXINFO_SIDTOGID (0x02) - -#define NDR_UNIXINFO_GIDTOSID (0x03) - -#define NDR_UNIXINFO_GETPWUID (0x04) - -#define NDR_UNIXINFO_CALL_COUNT (5) -void ndr_print_unixinfo_GetPWUidInfo(struct ndr_print *ndr, const char *name, const struct unixinfo_GetPWUidInfo *r); -void ndr_print_unixinfo_SidToUid(struct ndr_print *ndr, const char *name, int flags, const struct unixinfo_SidToUid *r); -void ndr_print_unixinfo_UidToSid(struct ndr_print *ndr, const char *name, int flags, const struct unixinfo_UidToSid *r); -void ndr_print_unixinfo_SidToGid(struct ndr_print *ndr, const char *name, int flags, const struct unixinfo_SidToGid *r); -void ndr_print_unixinfo_GidToSid(struct ndr_print *ndr, const char *name, int flags, const struct unixinfo_GidToSid *r); -void ndr_print_unixinfo_GetPWUid(struct ndr_print *ndr, const char *name, int flags, const struct unixinfo_GetPWUid *r); -#endif /* _HEADER_NDR_unixinfo */ diff --git a/source3/librpc/gen_ndr/ndr_winreg.c b/source3/librpc/gen_ndr/ndr_winreg.c index b63d410587..cd16a141b0 100644 --- a/source3/librpc/gen_ndr/ndr_winreg.c +++ b/source3/librpc/gen_ndr/ndr_winreg.c @@ -3700,7 +3700,7 @@ static enum ndr_err_code ndr_pull_winreg_QueryMultipleValues(struct ndr_pull *nd NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->in.buffer_size)); NDR_PULL_SET_MEM_CTX(ndr, _mem_save_buffer_size_0, LIBNDR_FLAG_REF_ALLOC); NDR_PULL_ALLOC_N(ndr, r->out.values, r->in.num_values); - memcpy(r->out.values, r->in.values, r->in.num_values * sizeof(*r->in.values)); + memcpy(r->out.values, r->in.values, (r->in.num_values) * sizeof(*r->in.values)); NDR_PULL_ALLOC(ndr, r->out.buffer_size); *r->out.buffer_size = *r->in.buffer_size; if (r->in.values) { @@ -3798,8 +3798,7 @@ _PUBLIC_ void ndr_print_winreg_QueryMultipleValues(struct ndr_print *ndr, const ndr->depth++; for (cntr_values_1=0;cntr_values_1<r->in.num_values;cntr_values_1++) { char *idx_1=NULL; - asprintf(&idx_1, "[%d]", cntr_values_1); - if (idx_1) { + if (asprintf(&idx_1, "[%d]", cntr_values_1) != -1) { ndr_print_QueryMultipleValue(ndr, "values", &r->in.values[cntr_values_1]); free(idx_1); } @@ -3828,8 +3827,7 @@ _PUBLIC_ void ndr_print_winreg_QueryMultipleValues(struct ndr_print *ndr, const ndr->depth++; for (cntr_values_1=0;cntr_values_1<r->in.num_values;cntr_values_1++) { char *idx_1=NULL; - asprintf(&idx_1, "[%d]", cntr_values_1); - if (idx_1) { + if (asprintf(&idx_1, "[%d]", cntr_values_1) != -1) { ndr_print_QueryMultipleValue(ndr, "values", &r->out.values[cntr_values_1]); free(idx_1); } diff --git a/source3/librpc/gen_ndr/ndr_wkssvc.c b/source3/librpc/gen_ndr/ndr_wkssvc.c index c3a1f706cd..80ea67526e 100644 --- a/source3/librpc/gen_ndr/ndr_wkssvc.c +++ b/source3/librpc/gen_ndr/ndr_wkssvc.c @@ -1478,152 +1478,152 @@ static enum ndr_err_code ndr_push_wkssvc_NetWkstaInfo(struct ndr_push *ndr, int int level = ndr_push_get_switch_value(ndr, r); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, level)); switch (level) { - case 100: + case 100: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->info100)); - break; + break; } - case 101: + case 101: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->info101)); - break; + break; } - case 102: + case 102: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->info102)); - break; + break; } - case 502: + case 502: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->info502)); - break; + break; } - case 1010: + case 1010: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1010)); - break; + break; } - case 1011: + case 1011: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1011)); - break; + break; } - case 1012: + case 1012: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1012)); - break; + break; } - case 1013: + case 1013: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1013)); - break; + break; } - case 1018: + case 1018: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1018)); - break; + break; } - case 1023: + case 1023: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1023)); - break; + break; } - case 1027: + case 1027: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1027)); - break; + break; } - case 1028: + case 1028: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1028)); - break; + break; } - case 1032: + case 1032: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1032)); - break; + break; } - case 1033: + case 1033: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1033)); - break; + break; } - case 1041: + case 1041: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1041)); - break; + break; } - case 1042: + case 1042: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1042)); - break; + break; } - case 1043: + case 1043: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1043)); - break; + break; } - case 1044: + case 1044: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1044)); - break; + break; } - case 1045: + case 1045: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1045)); - break; + break; } - case 1046: + case 1046: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1046)); - break; + break; } - case 1047: + case 1047: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1047)); - break; + break; } - case 1048: + case 1048: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1048)); - break; + break; } - case 1049: + case 1049: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1049)); - break; + break; } - case 1050: + case 1050: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1050)); - break; + break; } - case 1051: + case 1051: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1051)); - break; + break; } - case 1052: + case 1052: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1052)); - break; + break; } - case 1053: + case 1053: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1053)); - break; + break; } - case 1054: + case 1054: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1054)); - break; + break; } - case 1055: + case 1055: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1055)); - break; + break; } - case 1056: + case 1056: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1056)); - break; + break; } - case 1057: + case 1057: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1057)); - break; + break; } - case 1058: + case 1058: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1058)); - break; + break; } - case 1059: + case 1059: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1059)); - break; + break; } - case 1060: + case 1060: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1060)); - break; + break; } - case 1061: + case 1061: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1061)); - break; + break; } - case 1062: + case 1062: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1062)); - break; + break; } - default: - break; + default: { + break; } } } @@ -3071,8 +3071,7 @@ _PUBLIC_ void ndr_print_wkssvc_NetWkstaEnumUsersCtr0(struct ndr_print *ndr, cons ndr->depth++; for (cntr_user0_1=0;cntr_user0_1<r->entries_read;cntr_user0_1++) { char *idx_1=NULL; - asprintf(&idx_1, "[%d]", cntr_user0_1); - if (idx_1) { + if (asprintf(&idx_1, "[%d]", cntr_user0_1) != -1) { ndr_print_wkssvc_NetrWkstaUserInfo0(ndr, "user0", &r->user0[cntr_user0_1]); free(idx_1); } @@ -3317,8 +3316,7 @@ _PUBLIC_ void ndr_print_wkssvc_NetWkstaEnumUsersCtr1(struct ndr_print *ndr, cons ndr->depth++; for (cntr_user1_1=0;cntr_user1_1<r->entries_read;cntr_user1_1++) { char *idx_1=NULL; - asprintf(&idx_1, "[%d]", cntr_user1_1); - if (idx_1) { + if (asprintf(&idx_1, "[%d]", cntr_user1_1) != -1) { ndr_print_wkssvc_NetrWkstaUserInfo1(ndr, "user1", &r->user1[cntr_user1_1]); free(idx_1); } @@ -3335,13 +3333,13 @@ static enum ndr_err_code ndr_push_wkssvc_NetWkstaEnumUsersCtr(struct ndr_push *n int level = ndr_push_get_switch_value(ndr, r); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, level)); switch (level) { - case 0: + case 0: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->user0)); - break; + break; } - case 1: + case 1: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->user1)); - break; + break; } default: return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); @@ -3566,17 +3564,17 @@ static enum ndr_err_code ndr_push_wkssvc_NetrWkstaUserInfo(struct ndr_push *ndr, int level = ndr_push_get_switch_value(ndr, r); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, level)); switch (level) { - case 0: + case 0: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->info0)); - break; + break; } - case 1: + case 1: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1)); - break; + break; } - case 1101: + case 1101: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1101)); - break; + break; } default: return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); @@ -3909,8 +3907,7 @@ _PUBLIC_ void ndr_print_wkssvc_NetWkstaTransportCtr0(struct ndr_print *ndr, cons ndr->depth++; for (cntr_array_1=0;cntr_array_1<r->count;cntr_array_1++) { char *idx_1=NULL; - asprintf(&idx_1, "[%d]", cntr_array_1); - if (idx_1) { + if (asprintf(&idx_1, "[%d]", cntr_array_1) != -1) { ndr_print_wkssvc_NetWkstaTransportInfo0(ndr, "array", &r->array[cntr_array_1]); free(idx_1); } @@ -3927,9 +3924,9 @@ static enum ndr_err_code ndr_push_wkssvc_NetWkstaTransportCtr(struct ndr_push *n int level = ndr_push_get_switch_value(ndr, r); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, level)); switch (level) { - case 0: + case 0: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->ctr0)); - break; + break; } default: return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); @@ -4587,21 +4584,21 @@ static enum ndr_err_code ndr_push_wkssvc_NetrUseGetInfoCtr(struct ndr_push *ndr, int level = ndr_push_get_switch_value(ndr, r); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, level)); switch (level) { - case 0: + case 0: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->info0)); - break; + break; } - case 1: + case 1: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1)); - break; + break; } - case 2: + case 2: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->info2)); - break; + break; } - case 3: + case 3: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->info3)); - break; + break; } default: return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); @@ -4867,8 +4864,7 @@ _PUBLIC_ void ndr_print_wkssvc_NetrUseEnumCtr2(struct ndr_print *ndr, const char ndr->depth++; for (cntr_array_1=0;cntr_array_1<r->count;cntr_array_1++) { char *idx_1=NULL; - asprintf(&idx_1, "[%d]", cntr_array_1); - if (idx_1) { + if (asprintf(&idx_1, "[%d]", cntr_array_1) != -1) { ndr_print_wkssvc_NetrUseInfo2(ndr, "array", &r->array[cntr_array_1]); free(idx_1); } @@ -4954,8 +4950,7 @@ _PUBLIC_ void ndr_print_wkssvc_NetrUseEnumCtr1(struct ndr_print *ndr, const char ndr->depth++; for (cntr_array_1=0;cntr_array_1<r->count;cntr_array_1++) { char *idx_1=NULL; - asprintf(&idx_1, "[%d]", cntr_array_1); - if (idx_1) { + if (asprintf(&idx_1, "[%d]", cntr_array_1) != -1) { ndr_print_wkssvc_NetrUseInfo1(ndr, "array", &r->array[cntr_array_1]); free(idx_1); } @@ -5041,8 +5036,7 @@ _PUBLIC_ void ndr_print_wkssvc_NetrUseEnumCtr0(struct ndr_print *ndr, const char ndr->depth++; for (cntr_array_1=0;cntr_array_1<r->count;cntr_array_1++) { char *idx_1=NULL; - asprintf(&idx_1, "[%d]", cntr_array_1); - if (idx_1) { + if (asprintf(&idx_1, "[%d]", cntr_array_1) != -1) { ndr_print_wkssvc_NetrUseInfo0(ndr, "array", &r->array[cntr_array_1]); free(idx_1); } @@ -5059,17 +5053,17 @@ static enum ndr_err_code ndr_push_wkssvc_NetrUseEnumCtr(struct ndr_push *ndr, in int level = ndr_push_get_switch_value(ndr, r); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, level)); switch (level) { - case 0: + case 0: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->ctr0)); - break; + break; } - case 1: + case 1: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->ctr1)); - break; + break; } - case 2: + case 2: { NDR_CHECK(ndr_push_unique_ptr(ndr, r->ctr2)); - break; + break; } default: return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); @@ -5666,8 +5660,7 @@ _PUBLIC_ void ndr_print_wkssvc_ComputerNamesCtr(struct ndr_print *ndr, const cha ndr->depth++; for (cntr_computer_name_1=0;cntr_computer_name_1<r->count;cntr_computer_name_1++) { char *idx_1=NULL; - asprintf(&idx_1, "[%d]", cntr_computer_name_1); - if (idx_1) { + if (asprintf(&idx_1, "[%d]", cntr_computer_name_1) != -1) { ndr_print_lsa_String(ndr, "computer_name", &r->computer_name[cntr_computer_name_1]); free(idx_1); } @@ -7458,11 +7451,10 @@ static enum ndr_err_code ndr_push_wkssvc_NetrWorkstationStatisticsGet(struct ndr if (r->out.info == NULL) { return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); } - if (*r->out.info == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.info)); + if (*r->out.info) { + NDR_CHECK(ndr_push_wkssvc_NetrWorkstationStatistics(ndr, NDR_SCALARS, *r->out.info)); } - NDR_CHECK(ndr_push_ref_ptr(ndr)); - NDR_CHECK(ndr_push_wkssvc_NetrWorkstationStatistics(ndr, NDR_SCALARS, *r->out.info)); NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); } return NDR_ERR_SUCCESS; @@ -7527,14 +7519,18 @@ static enum ndr_err_code ndr_pull_wkssvc_NetrWorkstationStatisticsGet(struct ndr } _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_ref_ptr(ndr, &_ptr_info)); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info)); + if (_ptr_info) { NDR_PULL_ALLOC(ndr, *r->out.info); + } else { + *r->out.info = NULL; + } + if (*r->out.info) { + _mem_save_info_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, *r->out.info, 0); + NDR_CHECK(ndr_pull_wkssvc_NetrWorkstationStatistics(ndr, NDR_SCALARS, *r->out.info)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_1, 0); } - _mem_save_info_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, *r->out.info, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_wkssvc_NetrWorkstationStatistics(ndr, NDR_SCALARS, *r->out.info)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_1, LIBNDR_FLAG_REF_ALLOC); NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, LIBNDR_FLAG_REF_ALLOC); NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); } @@ -7574,7 +7570,9 @@ _PUBLIC_ void ndr_print_wkssvc_NetrWorkstationStatisticsGet(struct ndr_print *nd ndr->depth++; ndr_print_ptr(ndr, "info", *r->out.info); ndr->depth++; - ndr_print_wkssvc_NetrWorkstationStatistics(ndr, "info", *r->out.info); + if (*r->out.info) { + ndr_print_wkssvc_NetrWorkstationStatistics(ndr, "info", *r->out.info); + } ndr->depth--; ndr->depth--; ndr_print_WERROR(ndr, "result", r->out.result); @@ -8388,27 +8386,25 @@ static enum ndr_err_code ndr_push_wkssvc_NetrGetJoinInformation(struct ndr_push if (r->in.name_buffer == NULL) { return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); } - if (*r->in.name_buffer == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + NDR_CHECK(ndr_push_unique_ptr(ndr, *r->in.name_buffer)); + if (*r->in.name_buffer) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(*r->in.name_buffer, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(*r->in.name_buffer, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, *r->in.name_buffer, ndr_charset_length(*r->in.name_buffer, CH_UTF16), sizeof(uint16_t), CH_UTF16)); } - NDR_CHECK(ndr_push_ref_ptr(ndr)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(*r->in.name_buffer, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(*r->in.name_buffer, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, *r->in.name_buffer, ndr_charset_length(*r->in.name_buffer, CH_UTF16), sizeof(uint16_t), CH_UTF16)); } if (flags & NDR_OUT) { if (r->out.name_buffer == NULL) { return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); } - if (*r->out.name_buffer == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.name_buffer)); + if (*r->out.name_buffer) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(*r->out.name_buffer, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(*r->out.name_buffer, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, *r->out.name_buffer, ndr_charset_length(*r->out.name_buffer, CH_UTF16), sizeof(uint16_t), CH_UTF16)); } - NDR_CHECK(ndr_push_ref_ptr(ndr)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(*r->out.name_buffer, CH_UTF16))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(*r->out.name_buffer, CH_UTF16))); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, *r->out.name_buffer, ndr_charset_length(*r->out.name_buffer, CH_UTF16), sizeof(uint16_t), CH_UTF16)); if (r->out.name_type == NULL) { return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); } @@ -8424,6 +8420,7 @@ static enum ndr_err_code ndr_pull_wkssvc_NetrGetJoinInformation(struct ndr_pull uint32_t _ptr_name_buffer; TALLOC_CTX *_mem_save_server_name_0; TALLOC_CTX *_mem_save_name_buffer_0; + TALLOC_CTX *_mem_save_name_buffer_1; TALLOC_CTX *_mem_save_name_type_0; if (flags & NDR_IN) { ZERO_STRUCT(r->out); @@ -8451,14 +8448,24 @@ static enum ndr_err_code ndr_pull_wkssvc_NetrGetJoinInformation(struct ndr_pull } _mem_save_name_buffer_0 = NDR_PULL_GET_MEM_CTX(ndr); NDR_PULL_SET_MEM_CTX(ndr, r->in.name_buffer, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_ref_ptr(ndr, &_ptr_name_buffer)); - NDR_CHECK(ndr_pull_array_size(ndr, r->in.name_buffer)); - NDR_CHECK(ndr_pull_array_length(ndr, r->in.name_buffer)); - if (ndr_get_array_length(ndr, r->in.name_buffer) > ndr_get_array_size(ndr, r->in.name_buffer)) { - 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.name_buffer), ndr_get_array_length(ndr, r->in.name_buffer)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, r->in.name_buffer), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, r->in.name_buffer, ndr_get_array_length(ndr, r->in.name_buffer), sizeof(uint16_t), CH_UTF16)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_name_buffer)); + if (_ptr_name_buffer) { + NDR_PULL_ALLOC(ndr, *r->in.name_buffer); + } else { + *r->in.name_buffer = NULL; + } + if (*r->in.name_buffer) { + _mem_save_name_buffer_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, *r->in.name_buffer, 0); + NDR_CHECK(ndr_pull_array_size(ndr, r->in.name_buffer)); + NDR_CHECK(ndr_pull_array_length(ndr, r->in.name_buffer)); + if (ndr_get_array_length(ndr, r->in.name_buffer) > ndr_get_array_size(ndr, r->in.name_buffer)) { + 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.name_buffer), ndr_get_array_length(ndr, r->in.name_buffer)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, r->in.name_buffer), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, r->in.name_buffer, ndr_get_array_length(ndr, r->in.name_buffer), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_name_buffer_1, 0); + } NDR_PULL_SET_MEM_CTX(ndr, _mem_save_name_buffer_0, LIBNDR_FLAG_REF_ALLOC); NDR_PULL_ALLOC(ndr, r->out.name_buffer); *r->out.name_buffer = *r->in.name_buffer; @@ -8471,14 +8478,24 @@ static enum ndr_err_code ndr_pull_wkssvc_NetrGetJoinInformation(struct ndr_pull } _mem_save_name_buffer_0 = NDR_PULL_GET_MEM_CTX(ndr); NDR_PULL_SET_MEM_CTX(ndr, r->out.name_buffer, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_ref_ptr(ndr, &_ptr_name_buffer)); - NDR_CHECK(ndr_pull_array_size(ndr, r->out.name_buffer)); - NDR_CHECK(ndr_pull_array_length(ndr, r->out.name_buffer)); - if (ndr_get_array_length(ndr, r->out.name_buffer) > ndr_get_array_size(ndr, r->out.name_buffer)) { - return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, r->out.name_buffer), ndr_get_array_length(ndr, r->out.name_buffer)); - } - NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, r->out.name_buffer), sizeof(uint16_t))); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, r->out.name_buffer, ndr_get_array_length(ndr, r->out.name_buffer), sizeof(uint16_t), CH_UTF16)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_name_buffer)); + if (_ptr_name_buffer) { + NDR_PULL_ALLOC(ndr, *r->out.name_buffer); + } else { + *r->out.name_buffer = NULL; + } + if (*r->out.name_buffer) { + _mem_save_name_buffer_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, *r->out.name_buffer, 0); + NDR_CHECK(ndr_pull_array_size(ndr, r->out.name_buffer)); + NDR_CHECK(ndr_pull_array_length(ndr, r->out.name_buffer)); + if (ndr_get_array_length(ndr, r->out.name_buffer) > ndr_get_array_size(ndr, r->out.name_buffer)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, r->out.name_buffer), ndr_get_array_length(ndr, r->out.name_buffer)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, r->out.name_buffer), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, r->out.name_buffer, ndr_get_array_length(ndr, r->out.name_buffer), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_name_buffer_1, 0); + } NDR_PULL_SET_MEM_CTX(ndr, _mem_save_name_buffer_0, LIBNDR_FLAG_REF_ALLOC); if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { NDR_PULL_ALLOC(ndr, r->out.name_type); @@ -8512,7 +8529,9 @@ _PUBLIC_ void ndr_print_wkssvc_NetrGetJoinInformation(struct ndr_print *ndr, con ndr->depth++; ndr_print_ptr(ndr, "name_buffer", *r->in.name_buffer); ndr->depth++; - ndr_print_string(ndr, "name_buffer", *r->in.name_buffer); + if (*r->in.name_buffer) { + ndr_print_string(ndr, "name_buffer", *r->in.name_buffer); + } ndr->depth--; ndr->depth--; ndr->depth--; @@ -8524,7 +8543,9 @@ _PUBLIC_ void ndr_print_wkssvc_NetrGetJoinInformation(struct ndr_print *ndr, con ndr->depth++; ndr_print_ptr(ndr, "name_buffer", *r->out.name_buffer); ndr->depth++; - ndr_print_string(ndr, "name_buffer", *r->out.name_buffer); + if (*r->out.name_buffer) { + ndr_print_string(ndr, "name_buffer", *r->out.name_buffer); + } ndr->depth--; ndr->depth--; ndr_print_ptr(ndr, "name_type", r->out.name_type); @@ -8539,7 +8560,7 @@ _PUBLIC_ void ndr_print_wkssvc_NetrGetJoinInformation(struct ndr_print *ndr, con static enum ndr_err_code ndr_push_wkssvc_NetrGetJoinableOus(struct ndr_push *ndr, int flags, const struct wkssvc_NetrGetJoinableOus *r) { - uint32_t cntr_ous_1; + uint32_t cntr_ous_2; if (flags & NDR_IN) { NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_name)); if (r->in.server_name) { @@ -8582,12 +8603,20 @@ static enum ndr_err_code ndr_push_wkssvc_NetrGetJoinableOus(struct ndr_push *ndr if (r->out.ous == NULL) { return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); } - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.num_ous)); - for (cntr_ous_1 = 0; cntr_ous_1 < *r->out.num_ous; cntr_ous_1++) { - if (r->out.ous[cntr_ous_1] == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.ous)); + if (*r->out.ous) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.num_ous)); + for (cntr_ous_2 = 0; cntr_ous_2 < *r->out.num_ous; cntr_ous_2++) { + NDR_CHECK(ndr_push_unique_ptr(ndr, (*r->out.ous)[cntr_ous_2])); + } + for (cntr_ous_2 = 0; cntr_ous_2 < *r->out.num_ous; cntr_ous_2++) { + if ((*r->out.ous)[cntr_ous_2]) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length((*r->out.ous)[cntr_ous_2], CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length((*r->out.ous)[cntr_ous_2], CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, (*r->out.ous)[cntr_ous_2], ndr_charset_length((*r->out.ous)[cntr_ous_2], CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } } - NDR_CHECK(ndr_push_ref_ptr(ndr)); } NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); } @@ -8600,13 +8629,15 @@ static enum ndr_err_code ndr_pull_wkssvc_NetrGetJoinableOus(struct ndr_pull *ndr uint32_t _ptr_Account; uint32_t _ptr_unknown; uint32_t _ptr_ous; - uint32_t cntr_ous_1; + uint32_t cntr_ous_2; TALLOC_CTX *_mem_save_server_name_0; TALLOC_CTX *_mem_save_Account_0; TALLOC_CTX *_mem_save_unknown_0; TALLOC_CTX *_mem_save_num_ous_0; + TALLOC_CTX *_mem_save_ous_0; TALLOC_CTX *_mem_save_ous_1; TALLOC_CTX *_mem_save_ous_2; + TALLOC_CTX *_mem_save_ous_3; if (flags & NDR_IN) { ZERO_STRUCT(r->out); @@ -8680,8 +8711,8 @@ static enum ndr_err_code ndr_pull_wkssvc_NetrGetJoinableOus(struct ndr_pull *ndr NDR_PULL_SET_MEM_CTX(ndr, _mem_save_num_ous_0, LIBNDR_FLAG_REF_ALLOC); NDR_PULL_ALLOC(ndr, r->out.num_ous); *r->out.num_ous = *r->in.num_ous; - NDR_PULL_ALLOC_N(ndr, r->out.ous, *r->in.num_ous); - memset(r->out.ous, 0, *r->in.num_ous * sizeof(*r->out.ous)); + NDR_PULL_ALLOC(ndr, r->out.ous); + ZERO_STRUCTP(r->out.ous); } if (flags & NDR_OUT) { if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { @@ -8691,22 +8722,53 @@ static enum ndr_err_code ndr_pull_wkssvc_NetrGetJoinableOus(struct ndr_pull *ndr NDR_PULL_SET_MEM_CTX(ndr, r->out.num_ous, LIBNDR_FLAG_REF_ALLOC); NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.num_ous)); NDR_PULL_SET_MEM_CTX(ndr, _mem_save_num_ous_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_array_size(ndr, &r->out.ous)); if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC_N(ndr, r->out.ous, ndr_get_array_size(ndr, &r->out.ous)); + NDR_PULL_ALLOC(ndr, r->out.ous); } - _mem_save_ous_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.ous, 0); - for (cntr_ous_1 = 0; cntr_ous_1 < *r->out.num_ous; cntr_ous_1++) { - NDR_CHECK(ndr_pull_ref_ptr(ndr, &_ptr_ous)); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.ous[cntr_ous_1]); + _mem_save_ous_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.ous, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_ous)); + if (_ptr_ous) { + NDR_PULL_ALLOC(ndr, *r->out.ous); + } else { + *r->out.ous = NULL; + } + if (*r->out.ous) { + _mem_save_ous_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, *r->out.ous, 0); + NDR_CHECK(ndr_pull_array_size(ndr, r->out.ous)); + NDR_PULL_ALLOC_N(ndr, *r->out.ous, ndr_get_array_size(ndr, r->out.ous)); + _mem_save_ous_2 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, *r->out.ous, 0); + for (cntr_ous_2 = 0; cntr_ous_2 < *r->out.num_ous; cntr_ous_2++) { + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_ous)); + if (_ptr_ous) { + NDR_PULL_ALLOC(ndr, (*r->out.ous)[cntr_ous_2]); + } else { + (*r->out.ous)[cntr_ous_2] = NULL; + } + } + for (cntr_ous_2 = 0; cntr_ous_2 < *r->out.num_ous; cntr_ous_2++) { + if ((*r->out.ous)[cntr_ous_2]) { + _mem_save_ous_3 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, (*r->out.ous)[cntr_ous_2], 0); + NDR_CHECK(ndr_pull_array_size(ndr, &(*r->out.ous)[cntr_ous_2])); + NDR_CHECK(ndr_pull_array_length(ndr, &(*r->out.ous)[cntr_ous_2])); + if (ndr_get_array_length(ndr, &(*r->out.ous)[cntr_ous_2]) > ndr_get_array_size(ndr, &(*r->out.ous)[cntr_ous_2])) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &(*r->out.ous)[cntr_ous_2]), ndr_get_array_length(ndr, &(*r->out.ous)[cntr_ous_2])); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &(*r->out.ous)[cntr_ous_2]), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &(*r->out.ous)[cntr_ous_2], ndr_get_array_length(ndr, &(*r->out.ous)[cntr_ous_2]), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ous_3, 0); + } } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ous_2, 0); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ous_1, 0); } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ous_1, 0); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ous_0, LIBNDR_FLAG_REF_ALLOC); NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - if (r->out.ous) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->out.ous, *r->out.num_ous)); + if (*r->out.ous) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)r->out.ous, *r->out.num_ous)); } } return NDR_ERR_SUCCESS; @@ -8714,7 +8776,7 @@ static enum ndr_err_code ndr_pull_wkssvc_NetrGetJoinableOus(struct ndr_pull *ndr _PUBLIC_ void ndr_print_wkssvc_NetrGetJoinableOus(struct ndr_print *ndr, const char *name, int flags, const struct wkssvc_NetrGetJoinableOus *r) { - uint32_t cntr_ous_1; + uint32_t cntr_ous_2; ndr_print_struct(ndr, name, "wkssvc_NetrGetJoinableOus"); ndr->depth++; if (flags & NDR_SET_VALUES) { @@ -8760,21 +8822,24 @@ _PUBLIC_ void ndr_print_wkssvc_NetrGetJoinableOus(struct ndr_print *ndr, const c ndr->depth--; ndr_print_ptr(ndr, "ous", r->out.ous); ndr->depth++; - ndr->print(ndr, "%s: ARRAY(%d)", "ous", *r->out.num_ous); + ndr_print_ptr(ndr, "ous", *r->out.ous); ndr->depth++; - for (cntr_ous_1=0;cntr_ous_1<*r->out.num_ous;cntr_ous_1++) { - char *idx_1=NULL; - asprintf(&idx_1, "[%d]", cntr_ous_1); - if (idx_1) { - ndr_print_ptr(ndr, "ous", r->out.ous[cntr_ous_1]); - ndr->depth++; - ndr_print_ptr(ndr, "ous", *r->out.ous[cntr_ous_1]); - ndr->depth++; - ndr_print_string(ndr, "ous", *r->out.ous[cntr_ous_1]); - ndr->depth--; - ndr->depth--; - free(idx_1); + if (*r->out.ous) { + ndr->print(ndr, "%s: ARRAY(%d)", "ous", *r->out.num_ous); + ndr->depth++; + for (cntr_ous_2=0;cntr_ous_2<*r->out.num_ous;cntr_ous_2++) { + char *idx_2=NULL; + if (asprintf(&idx_2, "[%d]", cntr_ous_2) != -1) { + ndr_print_ptr(ndr, "ous", (*r->out.ous)[cntr_ous_2]); + ndr->depth++; + if ((*r->out.ous)[cntr_ous_2]) { + ndr_print_string(ndr, "ous", (*r->out.ous)[cntr_ous_2]); + } + ndr->depth--; + free(idx_2); + } } + ndr->depth--; } ndr->depth--; ndr->depth--; @@ -9424,7 +9489,7 @@ _PUBLIC_ void ndr_print_wkssvc_NetrValidateName2(struct ndr_print *ndr, const ch static enum ndr_err_code ndr_push_wkssvc_NetrGetJoinableOus2(struct ndr_push *ndr, int flags, const struct wkssvc_NetrGetJoinableOus2 *r) { - uint32_t cntr_ous_1; + uint32_t cntr_ous_2; if (flags & NDR_IN) { NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server_name)); if (r->in.server_name) { @@ -9464,12 +9529,20 @@ static enum ndr_err_code ndr_push_wkssvc_NetrGetJoinableOus2(struct ndr_push *nd if (r->out.ous == NULL) { return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); } - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.num_ous)); - for (cntr_ous_1 = 0; cntr_ous_1 < *r->out.num_ous; cntr_ous_1++) { - if (r->out.ous[cntr_ous_1] == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.ous)); + if (*r->out.ous) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.num_ous)); + for (cntr_ous_2 = 0; cntr_ous_2 < *r->out.num_ous; cntr_ous_2++) { + NDR_CHECK(ndr_push_unique_ptr(ndr, (*r->out.ous)[cntr_ous_2])); + } + for (cntr_ous_2 = 0; cntr_ous_2 < *r->out.num_ous; cntr_ous_2++) { + if ((*r->out.ous)[cntr_ous_2]) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length((*r->out.ous)[cntr_ous_2], CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length((*r->out.ous)[cntr_ous_2], CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, (*r->out.ous)[cntr_ous_2], ndr_charset_length((*r->out.ous)[cntr_ous_2], CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } } - NDR_CHECK(ndr_push_ref_ptr(ndr)); } NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); } @@ -9482,13 +9555,15 @@ static enum ndr_err_code ndr_pull_wkssvc_NetrGetJoinableOus2(struct ndr_pull *nd uint32_t _ptr_Account; uint32_t _ptr_EncryptedPassword; uint32_t _ptr_ous; - uint32_t cntr_ous_1; + uint32_t cntr_ous_2; TALLOC_CTX *_mem_save_server_name_0; TALLOC_CTX *_mem_save_Account_0; TALLOC_CTX *_mem_save_EncryptedPassword_0; TALLOC_CTX *_mem_save_num_ous_0; + TALLOC_CTX *_mem_save_ous_0; TALLOC_CTX *_mem_save_ous_1; TALLOC_CTX *_mem_save_ous_2; + TALLOC_CTX *_mem_save_ous_3; if (flags & NDR_IN) { ZERO_STRUCT(r->out); @@ -9556,8 +9631,8 @@ static enum ndr_err_code ndr_pull_wkssvc_NetrGetJoinableOus2(struct ndr_pull *nd NDR_PULL_SET_MEM_CTX(ndr, _mem_save_num_ous_0, LIBNDR_FLAG_REF_ALLOC); NDR_PULL_ALLOC(ndr, r->out.num_ous); *r->out.num_ous = *r->in.num_ous; - NDR_PULL_ALLOC_N(ndr, r->out.ous, *r->in.num_ous); - memset(r->out.ous, 0, *r->in.num_ous * sizeof(*r->out.ous)); + NDR_PULL_ALLOC(ndr, r->out.ous); + ZERO_STRUCTP(r->out.ous); } if (flags & NDR_OUT) { if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { @@ -9567,22 +9642,53 @@ static enum ndr_err_code ndr_pull_wkssvc_NetrGetJoinableOus2(struct ndr_pull *nd NDR_PULL_SET_MEM_CTX(ndr, r->out.num_ous, LIBNDR_FLAG_REF_ALLOC); NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.num_ous)); NDR_PULL_SET_MEM_CTX(ndr, _mem_save_num_ous_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_array_size(ndr, &r->out.ous)); if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC_N(ndr, r->out.ous, ndr_get_array_size(ndr, &r->out.ous)); + NDR_PULL_ALLOC(ndr, r->out.ous); } - _mem_save_ous_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.ous, 0); - for (cntr_ous_1 = 0; cntr_ous_1 < *r->out.num_ous; cntr_ous_1++) { - NDR_CHECK(ndr_pull_ref_ptr(ndr, &_ptr_ous)); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.ous[cntr_ous_1]); + _mem_save_ous_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.ous, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_ous)); + if (_ptr_ous) { + NDR_PULL_ALLOC(ndr, *r->out.ous); + } else { + *r->out.ous = NULL; + } + if (*r->out.ous) { + _mem_save_ous_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, *r->out.ous, 0); + NDR_CHECK(ndr_pull_array_size(ndr, r->out.ous)); + NDR_PULL_ALLOC_N(ndr, *r->out.ous, ndr_get_array_size(ndr, r->out.ous)); + _mem_save_ous_2 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, *r->out.ous, 0); + for (cntr_ous_2 = 0; cntr_ous_2 < *r->out.num_ous; cntr_ous_2++) { + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_ous)); + if (_ptr_ous) { + NDR_PULL_ALLOC(ndr, (*r->out.ous)[cntr_ous_2]); + } else { + (*r->out.ous)[cntr_ous_2] = NULL; + } + } + for (cntr_ous_2 = 0; cntr_ous_2 < *r->out.num_ous; cntr_ous_2++) { + if ((*r->out.ous)[cntr_ous_2]) { + _mem_save_ous_3 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, (*r->out.ous)[cntr_ous_2], 0); + NDR_CHECK(ndr_pull_array_size(ndr, &(*r->out.ous)[cntr_ous_2])); + NDR_CHECK(ndr_pull_array_length(ndr, &(*r->out.ous)[cntr_ous_2])); + if (ndr_get_array_length(ndr, &(*r->out.ous)[cntr_ous_2]) > ndr_get_array_size(ndr, &(*r->out.ous)[cntr_ous_2])) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &(*r->out.ous)[cntr_ous_2]), ndr_get_array_length(ndr, &(*r->out.ous)[cntr_ous_2])); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &(*r->out.ous)[cntr_ous_2]), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &(*r->out.ous)[cntr_ous_2], ndr_get_array_length(ndr, &(*r->out.ous)[cntr_ous_2]), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ous_3, 0); + } } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ous_2, 0); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ous_1, 0); } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ous_1, 0); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ous_0, LIBNDR_FLAG_REF_ALLOC); NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - if (r->out.ous) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->out.ous, *r->out.num_ous)); + if (*r->out.ous) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)r->out.ous, *r->out.num_ous)); } } return NDR_ERR_SUCCESS; @@ -9590,7 +9696,7 @@ static enum ndr_err_code ndr_pull_wkssvc_NetrGetJoinableOus2(struct ndr_pull *nd _PUBLIC_ void ndr_print_wkssvc_NetrGetJoinableOus2(struct ndr_print *ndr, const char *name, int flags, const struct wkssvc_NetrGetJoinableOus2 *r) { - uint32_t cntr_ous_1; + uint32_t cntr_ous_2; ndr_print_struct(ndr, name, "wkssvc_NetrGetJoinableOus2"); ndr->depth++; if (flags & NDR_SET_VALUES) { @@ -9636,21 +9742,24 @@ _PUBLIC_ void ndr_print_wkssvc_NetrGetJoinableOus2(struct ndr_print *ndr, const ndr->depth--; ndr_print_ptr(ndr, "ous", r->out.ous); ndr->depth++; - ndr->print(ndr, "%s: ARRAY(%d)", "ous", *r->out.num_ous); + ndr_print_ptr(ndr, "ous", *r->out.ous); ndr->depth++; - for (cntr_ous_1=0;cntr_ous_1<*r->out.num_ous;cntr_ous_1++) { - char *idx_1=NULL; - asprintf(&idx_1, "[%d]", cntr_ous_1); - if (idx_1) { - ndr_print_ptr(ndr, "ous", r->out.ous[cntr_ous_1]); - ndr->depth++; - ndr_print_ptr(ndr, "ous", *r->out.ous[cntr_ous_1]); - ndr->depth++; - ndr_print_string(ndr, "ous", *r->out.ous[cntr_ous_1]); - ndr->depth--; - ndr->depth--; - free(idx_1); + if (*r->out.ous) { + ndr->print(ndr, "%s: ARRAY(%d)", "ous", *r->out.num_ous); + ndr->depth++; + for (cntr_ous_2=0;cntr_ous_2<*r->out.num_ous;cntr_ous_2++) { + char *idx_2=NULL; + if (asprintf(&idx_2, "[%d]", cntr_ous_2) != -1) { + ndr_print_ptr(ndr, "ous", (*r->out.ous)[cntr_ous_2]); + ndr->depth++; + if ((*r->out.ous)[cntr_ous_2]) { + ndr_print_string(ndr, "ous", (*r->out.ous)[cntr_ous_2]); + } + ndr->depth--; + free(idx_2); + } } + ndr->depth--; } ndr->depth--; ndr->depth--; @@ -10178,11 +10287,10 @@ static enum ndr_err_code ndr_push_wkssvc_NetrEnumerateComputerNames(struct ndr_p if (r->out.ctr == NULL) { return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); } - if (*r->out.ctr == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.ctr)); + if (*r->out.ctr) { + NDR_CHECK(ndr_push_wkssvc_ComputerNamesCtr(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.ctr)); } - NDR_CHECK(ndr_push_ref_ptr(ndr)); - NDR_CHECK(ndr_push_wkssvc_ComputerNamesCtr(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.ctr)); NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); } return NDR_ERR_SUCCESS; @@ -10227,14 +10335,18 @@ static enum ndr_err_code ndr_pull_wkssvc_NetrEnumerateComputerNames(struct ndr_p } _mem_save_ctr_0 = NDR_PULL_GET_MEM_CTX(ndr); NDR_PULL_SET_MEM_CTX(ndr, r->out.ctr, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_ref_ptr(ndr, &_ptr_ctr)); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_ctr)); + if (_ptr_ctr) { NDR_PULL_ALLOC(ndr, *r->out.ctr); + } else { + *r->out.ctr = NULL; + } + if (*r->out.ctr) { + _mem_save_ctr_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, *r->out.ctr, 0); + NDR_CHECK(ndr_pull_wkssvc_ComputerNamesCtr(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.ctr)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ctr_1, 0); } - _mem_save_ctr_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, *r->out.ctr, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_wkssvc_ComputerNamesCtr(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.ctr)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ctr_1, LIBNDR_FLAG_REF_ALLOC); NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ctr_0, LIBNDR_FLAG_REF_ALLOC); NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); } @@ -10268,7 +10380,9 @@ _PUBLIC_ void ndr_print_wkssvc_NetrEnumerateComputerNames(struct ndr_print *ndr, ndr->depth++; ndr_print_ptr(ndr, "ctr", *r->out.ctr); ndr->depth++; - ndr_print_wkssvc_ComputerNamesCtr(ndr, "ctr", *r->out.ctr); + if (*r->out.ctr) { + ndr_print_wkssvc_ComputerNamesCtr(ndr, "ctr", *r->out.ctr); + } ndr->depth--; ndr->depth--; ndr_print_WERROR(ndr, "result", r->out.result); diff --git a/source3/librpc/gen_ndr/ndr_xattr.c b/source3/librpc/gen_ndr/ndr_xattr.c index 29a31a12b2..46c4249d21 100644 --- a/source3/librpc/gen_ndr/ndr_xattr.c +++ b/source3/librpc/gen_ndr/ndr_xattr.c @@ -91,8 +91,7 @@ _PUBLIC_ void ndr_print_tdb_xattrs(struct ndr_print *ndr, const char *name, cons ndr->depth++; for (cntr_xattrs_0=0;cntr_xattrs_0<r->num_xattrs;cntr_xattrs_0++) { char *idx_0=NULL; - asprintf(&idx_0, "[%d]", cntr_xattrs_0); - if (idx_0) { + if (asprintf(&idx_0, "[%d]", cntr_xattrs_0) != -1) { ndr_print_tdb_xattr(ndr, "xattrs", &r->xattrs[cntr_xattrs_0]); free(idx_0); } @@ -100,3 +99,4 @@ _PUBLIC_ void ndr_print_tdb_xattrs(struct ndr_print *ndr, const char *name, cons ndr->depth--; ndr->depth--; } + diff --git a/source3/librpc/gen_ndr/netlogon.h b/source3/librpc/gen_ndr/netlogon.h index e33818257d..058e5e7fb0 100644 --- a/source3/librpc/gen_ndr/netlogon.h +++ b/source3/librpc/gen_ndr/netlogon.h @@ -8,14 +8,10 @@ #ifndef _HEADER_netlogon #define _HEADER_netlogon -#define MSV1_0_CLEARTEXT_PASSWORD_ALLOWED ( 0x002 ) -#define MSV1_0_ALLOW_SERVER_TRUST_ACCOUNT ( 0x020 ) -#define MSV1_0_ALLOW_WORKSTATION_TRUST_ACCOUNT ( 0x800 ) #define NETLOGON_NEG_ARCFOUR ( 0x00000004 ) #define NETLOGON_NEG_128BIT ( 0x00004000 ) #define NETLOGON_NEG_SCHANNEL ( 0x40000000 ) -; - +#define DS_GFTI_UPDATE_TDO ( 0x1 ) struct netr_UasInfo { const char *account_name;/* [unique,charset(UTF16)] */ uint32_t priv; @@ -46,6 +42,14 @@ struct netr_AcctLockStr { uint16_t *bindata;/* [unique,length_is(length/2),size_is(size/2)] */ }; +/* bitmap netr_LogonParameterControl */ +#define MSV1_0_CLEARTEXT_PASSWORD_ALLOWED ( 0x00000002 ) +#define MSV1_0_UPDATE_LOGON_STATISTICS ( 0x00000004 ) +#define MSV1_0_RETURN_USER_PARAMETERS ( 0x00000008 ) +#define MSV1_0_ALLOW_SERVER_TRUST_ACCOUNT ( 0x00000020 ) +#define MSV1_0_RETURN_PROFILE_PATH ( 0x00000200 ) +#define MSV1_0_ALLOW_WORKSTATION_TRUST_ACCOUNT ( 0x00000800 ) + struct netr_IdentityInfo { struct lsa_String domain_name; uint32_t parameter_control; @@ -79,11 +83,6 @@ union netr_LogonLevel { struct netr_NetworkInfo *network;/* [unique,case(2)] */ }/* [public,switch_type(uint16)] */; -struct netr_GroupMembership { - uint32_t rid; - uint32_t attributes; -}/* [public] */; - struct netr_UserSessionKey { uint8_t key[16]; }/* [public,flag(LIBNDR_PRINT_ARRAY_HEX)] */; @@ -93,18 +92,17 @@ struct netr_LMSessionKey { }/* [public,flag(LIBNDR_PRINT_ARRAY_HEX)] */; /* bitmap netr_UserFlags */ -#define NETLOGON_GUEST ( 0x0001 ) -#define NETLOGON_NOENCRYPTION ( 0x0002 ) -#define NETLOGON_CACHED_ACCOUNT ( 0x0004 ) -#define NETLOGON_USED_LM_PASSWORD ( 0x0008 ) -#define NETLOGON_EXTRA_SIDS ( 0x0020 ) -#define NETLOGON_SUBAUTH_SESSION_KEY ( 0x0040 ) -#define NETLOGON_SERVER_TRUST_ACCOUNT ( 0x0080 ) -#define NETLOGON_NTLMV2_ENABLED ( 0x0100 ) -#define NETLOGON_RESOURCE_GROUPS ( 0x0200 ) -#define NETLOGON_PROFILE_PATH_RETURNED ( 0x0400 ) - -; +#define NETLOGON_GUEST ( 0x00000001 ) +#define NETLOGON_NOENCRYPTION ( 0x00000002 ) +#define NETLOGON_CACHED_ACCOUNT ( 0x00000004 ) +#define NETLOGON_USED_LM_PASSWORD ( 0x00000008 ) +#define NETLOGON_EXTRA_SIDS ( 0x00000020 ) +#define NETLOGON_SUBAUTH_SESSION_KEY ( 0x00000040 ) +#define NETLOGON_SERVER_TRUST_ACCOUNT ( 0x00000080 ) +#define NETLOGON_NTLMV2_ENABLED ( 0x00000100 ) +#define NETLOGON_RESOURCE_GROUPS ( 0x00000200 ) +#define NETLOGON_PROFILE_PATH_RETURNED ( 0x00000400 ) +#define NETLOGON_GRACE_LOGON ( 0x01000000 ) struct netr_SamBaseInfo { NTTIME last_logon; @@ -140,7 +138,7 @@ struct netr_SamInfo2 { struct netr_SidAttr { struct dom_sid2 *sid;/* [unique] */ - uint32_t attribute; + uint32_t attributes; }; struct netr_SamInfo3 { @@ -215,10 +213,10 @@ struct netr_USER_KEY16 { struct netr_PasswordHistory { uint16_t nt_length; - uint16_t nt_size; + uint16_t nt_size;/* [value(nt_length)] */ uint32_t nt_flags; uint16_t lm_length; - uint16_t lm_size; + uint16_t lm_size;/* [value(lm_length)] */ uint32_t lm_flags; uint8_t *nt_history; uint8_t *lm_history; @@ -227,7 +225,7 @@ struct netr_PasswordHistory { struct netr_USER_KEYS2 { struct netr_USER_KEY16 lmpassword; struct netr_USER_KEY16 ntpassword; - struct netr_PasswordHistory lmhistory; + struct netr_PasswordHistory history; }; struct netr_USER_KEY_UNION { @@ -605,6 +603,7 @@ union netr_CONTROL_QUERY_INFORMATION { enum netr_LogonControlCode #ifndef USE_UINT_ENUMS { + NETLOGON_CONTROL_SYNC=2, NETLOGON_CONTROL_REDISCOVER=5, NETLOGON_CONTROL_TC_QUERY=6, NETLOGON_CONTROL_TRANSPORT_NOTIFY=7, @@ -612,6 +611,7 @@ enum netr_LogonControlCode } #else { __donnot_use_enum_netr_LogonControlCode=0x7FFFFFFF} +#define NETLOGON_CONTROL_SYNC ( 2 ) #define NETLOGON_CONTROL_REDISCOVER ( 5 ) #define NETLOGON_CONTROL_TC_QUERY ( 6 ) #define NETLOGON_CONTROL_TRANSPORT_NOTIFY ( 7 ) @@ -624,10 +624,66 @@ union netr_CONTROL_DATA_INFORMATION { uint32_t debug_level;/* [case(NETLOGON_CONTROL_SET_DBFLAG)] */ }; +struct netr_Blob { + uint32_t length; + uint8_t *data;/* [unique,size_is(length)] */ +}; + +/* bitmap netr_DsRGetDCName_flags */ +#define DS_FORCE_REDISCOVERY ( 0x00000001 ) +#define DS_DIRECTORY_SERVICE_REQUIRED ( 0x00000010 ) +#define DS_DIRECTORY_SERVICE_PREFERRED ( 0x00000020 ) +#define DS_GC_SERVER_REQUIRED ( 0x00000040 ) +#define DS_PDC_REQUIRED ( 0x00000080 ) +#define DS_BACKGROUND_ONLY ( 0x00000100 ) +#define DS_IP_REQUIRED ( 0x00000200 ) +#define DS_KDC_REQUIRED ( 0x00000400 ) +#define DS_TIMESERV_REQUIRED ( 0x00000800 ) +#define DS_WRITABLE_REQUIRED ( 0x00001000 ) +#define DS_GOOD_TIMESERV_PREFERRED ( 0x00002000 ) +#define DS_AVOID_SELF ( 0x00004000 ) +#define DS_ONLY_LDAP_NEEDED ( 0x00008000 ) +#define DS_IS_FLAT_NAME ( 0x00010000 ) +#define DS_IS_DNS_NAME ( 0x00020000 ) +#define DS_TRY_NEXTCLOSEST_SITE ( 0x00040000 ) +#define DS_DIRECTORY_SERVICE_6_REQUIRED ( 0x00080000 ) +#define DS_RETURN_DNS_NAME ( 0x40000000 ) +#define DS_RETURN_FLAT_NAME ( 0x80000000 ) + +enum netr_DsRGetDCNameInfo_AddressType +#ifndef USE_UINT_ENUMS + { + DS_ADDRESS_TYPE_INET=1, + DS_ADDRESS_TYPE_NETBIOS=2 +} +#else + { __donnot_use_enum_netr_DsRGetDCNameInfo_AddressType=0x7FFFFFFF} +#define DS_ADDRESS_TYPE_INET ( 1 ) +#define DS_ADDRESS_TYPE_NETBIOS ( 2 ) +#endif +; + +/* bitmap netr_DsR_DcFlags */ +#define DS_SERVER_PDC ( 0x00000001 ) +#define DS_SERVER_GC ( 0x00000004 ) +#define DS_SERVER_LDAP ( 0x00000008 ) +#define DS_SERVER_DS ( 0x00000010 ) +#define DS_SERVER_KDC ( 0x00000020 ) +#define DS_SERVER_TIMESERV ( 0x00000040 ) +#define DS_SERVER_CLOSEST ( 0x00000080 ) +#define DS_SERVER_WRITABLE ( 0x00000100 ) +#define DS_SERVER_GOOD_TIMESERV ( 0x00000200 ) +#define DS_SERVER_NDNC ( 0x00000400 ) +#define DS_SERVER_SELECT_SECRET_DOMAIN_6 ( 0x00000800 ) +#define DS_SERVER_FULL_SECRET_DOMAIN_6 ( 0x00001000 ) +#define DS_DNS_CONTROLLER ( 0x20000000 ) +#define DS_DNS_DOMAIN ( 0x40000000 ) +#define DS_DNS_FOREST ( 0x80000000 ) + struct netr_DsRGetDCNameInfo { const char *dc_unc;/* [unique,charset(UTF16)] */ const char *dc_address;/* [unique,charset(UTF16)] */ - int32_t dc_address_type; + enum netr_DsRGetDCNameInfo_AddressType dc_address_type; struct GUID domain_guid; const char *domain_name;/* [unique,charset(UTF16)] */ const char *forest_name;/* [unique,charset(UTF16)] */ @@ -636,11 +692,6 @@ struct netr_DsRGetDCNameInfo { const char *client_site_name;/* [unique,charset(UTF16)] */ }; -struct netr_Blob { - uint32_t length; - uint8_t *data;/* [unique,size_is(length)] */ -}; - struct netr_BinaryString { uint16_t length; uint16_t size; @@ -692,6 +743,16 @@ struct netr_CryptPassword { uint32_t length; }/* [flag(LIBNDR_PRINT_ARRAY_HEX)] */; +struct netr_DsRAddressToSitenamesWCtr { + uint32_t count; + struct lsa_String *sitename;/* [unique,size_is(count)] */ +}; + +struct netr_DsRAddress { + uint8_t *buffer;/* [unique,size_is(size)] */ + uint32_t size; +}; + /* bitmap netr_TrustFlags */ #define NETR_TRUST_FLAG_IN_FOREST ( 0x00000001 ) #define NETR_TRUST_FLAG_OUTBOUND ( 0x00000002 ) @@ -700,8 +761,6 @@ struct netr_CryptPassword { #define NETR_TRUST_FLAG_NATIVE ( 0x00000010 ) #define NETR_TRUST_FLAG_INBOUND ( 0x00000020 ) -; - enum netr_TrustType #ifndef USE_UINT_ENUMS { @@ -728,8 +787,6 @@ enum netr_TrustType #define NETR_TRUST_ATTRIBUTE_WITHIN_FOREST ( 0x00000020 ) #define NETR_TRUST_ATTRIBUTE_TREAT_AS_EXTERNAL ( 0x00000040 ) -; - struct netr_DomainTrust { const char *netbios_name;/* [unique,charset(UTF16)] */ const char *dns_name;/* [unique,charset(UTF16)] */ @@ -741,6 +798,22 @@ struct netr_DomainTrust { struct GUID guid; }; +struct netr_DomainTrustList { + uint32_t count; + struct netr_DomainTrust *array;/* [unique,size_is(count)] */ +}; + +struct netr_DsRAddressToSitenamesExWCtr { + uint32_t count; + struct lsa_String *sitename;/* [unique,size_is(count)] */ + struct lsa_String *subnetname;/* [unique,size_is(count)] */ +}; + +struct DcSitesCtr { + uint32_t num_sites; + struct lsa_String *sites;/* [unique,size_is(num_sites)] */ +}; + struct netr_LogonUasLogon { struct { @@ -750,7 +823,7 @@ struct netr_LogonUasLogon { } in; struct { - struct netr_UasInfo *info;/* [unique] */ + struct netr_UasInfo *info;/* [ref] */ WERROR result; } out; @@ -778,7 +851,7 @@ struct netr_LogonSamLogon { const char *computer_name;/* [unique,charset(UTF16)] */ struct netr_Authenticator *credential;/* [unique] */ uint16_t logon_level; - union netr_LogonLevel logon;/* [switch_is(logon_level)] */ + union netr_LogonLevel *logon;/* [ref,switch_is(logon_level)] */ uint16_t validation_level; struct netr_Authenticator *return_authenticator;/* [unique] */ } in; @@ -819,7 +892,7 @@ struct netr_ServerReqChallenge { } in; struct { - struct netr_Credential *credentials;/* [ref] */ + struct netr_Credential *return_credentials;/* [ref] */ NTSTATUS result; } out; @@ -836,7 +909,7 @@ struct netr_ServerAuthenticate { } in; struct { - struct netr_Credential *credentials;/* [ref] */ + struct netr_Credential *return_credentials;/* [ref] */ NTSTATUS result; } out; @@ -849,8 +922,8 @@ struct netr_ServerPasswordSet { const char *account_name;/* [charset(UTF16)] */ enum netr_SchannelType secure_channel_type; const char *computer_name;/* [charset(UTF16)] */ - struct netr_Authenticator credential; - struct samr_Password new_password; + struct netr_Authenticator *credential;/* [ref] */ + struct samr_Password *new_password;/* [ref] */ } in; struct { @@ -865,7 +938,7 @@ struct netr_DatabaseDeltas { struct { const char *logon_server;/* [charset(UTF16)] */ const char *computername;/* [charset(UTF16)] */ - struct netr_Authenticator credential; + struct netr_Authenticator *credential;/* [ref] */ enum netr_SamDatabaseID database_id; uint32_t preferredmaximumlength; struct netr_Authenticator *return_authenticator;/* [ref] */ @@ -873,7 +946,7 @@ struct netr_DatabaseDeltas { } in; struct { - struct netr_DELTA_ENUM_ARRAY *delta_enum_array;/* [unique] */ + struct netr_DELTA_ENUM_ARRAY **delta_enum_array;/* [ref] */ struct netr_Authenticator *return_authenticator;/* [ref] */ uint64_t *sequence_num;/* [ref] */ NTSTATUS result; @@ -894,7 +967,7 @@ struct netr_DatabaseSync { } in; struct { - struct netr_DELTA_ENUM_ARRAY *delta_enum_array;/* [unique] */ + struct netr_DELTA_ENUM_ARRAY *delta_enum_array;/* [ref] */ struct netr_Authenticator *return_authenticator;/* [ref] */ uint32_t *sync_context;/* [ref] */ NTSTATUS result; @@ -960,7 +1033,7 @@ struct netr_GetDcName { struct { const char **dcname;/* [ref,charset(UTF16)] */ - NTSTATUS result; + WERROR result; } out; }; @@ -1000,7 +1073,7 @@ struct netr_LogonControl2 { const char *logon_server;/* [unique,charset(UTF16)] */ uint32_t function_code; uint32_t level; - union netr_CONTROL_DATA_INFORMATION data;/* [switch_is(function_code)] */ + union netr_CONTROL_DATA_INFORMATION *data;/* [ref,switch_is(function_code)] */ } in; struct { @@ -1022,7 +1095,7 @@ struct netr_ServerAuthenticate2 { } in; struct { - struct netr_Credential *credentials;/* [ref] */ + struct netr_Credential *return_credentials;/* [ref] */ uint32_t *negotiate_flags;/* [ref] */ NTSTATUS result; } out; @@ -1034,7 +1107,7 @@ struct netr_DatabaseSync2 { struct { const char *logon_server;/* [charset(UTF16)] */ const char *computername;/* [charset(UTF16)] */ - struct netr_Authenticator credential; + struct netr_Authenticator *credential;/* [ref] */ enum netr_SamDatabaseID database_id; uint16_t restart_state; uint32_t preferredmaximumlength; @@ -1043,7 +1116,7 @@ struct netr_DatabaseSync2 { } in; struct { - struct netr_DELTA_ENUM_ARRAY *delta_enum_array;/* [unique] */ + struct netr_DELTA_ENUM_ARRAY **delta_enum_array;/* [ref] */ struct netr_Authenticator *return_authenticator;/* [ref] */ uint32_t *sync_context;/* [ref] */ NTSTATUS result; @@ -1063,7 +1136,7 @@ struct netr_DatabaseRedo { } in; struct { - struct netr_DELTA_ENUM_ARRAY *delta_enum_array;/* [unique] */ + struct netr_DELTA_ENUM_ARRAY *delta_enum_array;/* [ref] */ struct netr_Authenticator *return_authenticator;/* [ref] */ NTSTATUS result; } out; @@ -1087,8 +1160,13 @@ struct netr_LogonControl2Ex { }; -struct netr_NETRENUMERATETRUSTEDDOMAINS { +struct netr_NetrEnumerateTrustedDomains { struct { + const char *server_name;/* [unique,charset(UTF16)] */ + } in; + + struct { + struct netr_Blob *trusted_domains_blob;/* [ref] */ WERROR result; } out; @@ -1105,7 +1183,7 @@ struct netr_DsRGetDCName { } in; struct { - struct netr_DsRGetDCNameInfo *info;/* [unique] */ + struct netr_DsRGetDCNameInfo **info;/* [ref] */ WERROR result; } out; @@ -1128,8 +1206,14 @@ struct netr_NETRLOGONSETSERVICEBITS { }; -struct netr_NETRLOGONGETTRUSTRID { +struct netr_LogonGetTrustRid { struct { + const char *server_name;/* [unique,charset(UTF16)] */ + const char *domain_name;/* [unique,charset(UTF16)] */ + } in; + + struct { + uint32_t *rid;/* [ref] */ WERROR result; } out; @@ -1182,7 +1266,7 @@ struct netr_DsRGetDCNameEx { } in; struct { - struct netr_DsRGetDCNameInfo *info;/* [unique] */ + struct netr_DsRGetDCNameInfo **info;/* [ref] */ WERROR result; } out; @@ -1239,8 +1323,18 @@ struct netr_ServerPasswordSet2 { }; -struct netr_NETRSERVERPASSWORDGET { +struct netr_ServerPasswordGet { struct { + const char *server_name;/* [unique,charset(UTF16)] */ + const char *account_name;/* [charset(UTF16)] */ + enum netr_SchannelType secure_channel_type; + const char *computer_name;/* [charset(UTF16)] */ + struct netr_Authenticator *credential;/* [ref] */ + } in; + + struct { + struct netr_Authenticator *return_authenticator;/* [ref] */ + struct samr_Password *password;/* [ref] */ WERROR result; } out; @@ -1255,8 +1349,15 @@ struct netr_NETRLOGONSENDTOSAM { }; -struct netr_DSRADDRESSTOSITENAMESW { +struct netr_DsRAddressToSitenamesW { + struct { + const char *server_name;/* [unique,charset(UTF16)] */ + uint32_t count;/* [range(0,32000)] */ + struct netr_DsRAddress *addresses;/* [ref,size_is(count)] */ + } in; + struct { + struct netr_DsRAddressToSitenamesWCtr **ctr;/* [ref] */ WERROR result; } out; @@ -1275,7 +1376,7 @@ struct netr_DsRGetDCNameEx2 { } in; struct { - struct netr_DsRGetDCNameInfo *info;/* [unique] */ + struct netr_DsRGetDCNameInfo **info;/* [ref] */ WERROR result; } out; @@ -1290,24 +1391,41 @@ struct netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN { }; -struct netr_NETRENUMERATETRUSTEDDOMAINSEX { +struct netr_NetrEnumerateTrustedDomainsEx { + struct { + const char *server_name;/* [unique,charset(UTF16)] */ + } in; + struct { + struct netr_DomainTrustList *dom_trust_list;/* [ref] */ WERROR result; } out; }; -struct netr_DSRADDRESSTOSITENAMESEXW { +struct netr_DsRAddressToSitenamesExW { struct { + const char *server_name;/* [unique,charset(UTF16)] */ + uint32_t count;/* [range(0,32000)] */ + struct netr_DsRAddress *addresses;/* [ref,size_is(count)] */ + } in; + + struct { + struct netr_DsRAddressToSitenamesExWCtr **ctr;/* [ref] */ WERROR result; } out; }; -struct netr_DSRGETDCSITECOVERAGEW { +struct netr_DsrGetDcSiteCoverageW { + struct { + const char *server_name;/* [unique,charset(UTF16)] */ + } in; + struct { + struct DcSitesCtr *ctr;/* [ref] */ WERROR result; } out; @@ -1319,7 +1437,7 @@ struct netr_LogonSamLogonEx { const char *server_name;/* [unique,charset(UTF16)] */ const char *computer_name;/* [unique,charset(UTF16)] */ uint16_t logon_level; - union netr_LogonLevel logon;/* [switch_is(logon_level)] */ + union netr_LogonLevel *logon;/* [ref,switch_is(logon_level)] */ uint16_t validation_level; uint32_t *flags;/* [ref] */ } in; @@ -1341,15 +1459,22 @@ struct netr_DsrEnumerateDomainTrusts { } in; struct { - uint32_t *count;/* [ref] */ - struct netr_DomainTrust **trusts;/* [ref,size_is(count)] */ + struct netr_DomainTrustList *trusts;/* [ref] */ WERROR result; } out; }; -struct netr_DSRDEREGISTERDNSHOSTRECORDS { +struct netr_DsrDeregisterDNSHostRecords { + struct { + const char *server_name;/* [unique,charset(UTF16)] */ + const char *domain;/* [unique,charset(UTF16)] */ + struct GUID *domain_guid;/* [unique] */ + struct GUID *dsa_guid;/* [unique] */ + const char *dns_host;/* [ref,charset(UTF16)] */ + } in; + struct { WERROR result; } out; @@ -1357,24 +1482,51 @@ struct netr_DSRDEREGISTERDNSHOSTRECORDS { }; -struct netr_NETRSERVERTRUSTPASSWORDSGET { +struct netr_ServerTrustPasswordsGet { struct { - WERROR result; + const char *server_name;/* [unique,charset(UTF16)] */ + const char *account_name;/* [charset(UTF16)] */ + enum netr_SchannelType secure_channel_type; + const char *computer_name;/* [charset(UTF16)] */ + struct netr_Authenticator *credential;/* [ref] */ + } in; + + struct { + struct netr_Authenticator *return_authenticator;/* [ref] */ + struct samr_Password *password;/* [ref] */ + struct samr_Password *password2;/* [ref] */ + NTSTATUS result; } out; }; -struct netr_DSRGETFORESTTRUSTINFORMATION { +struct netr_DsRGetForestTrustInformation { + struct { + const char *server_name;/* [unique,charset(UTF16)] */ + const char *trusted_domain_name;/* [unique,charset(UTF16)] */ + uint32_t flags; + } in; + struct { + struct lsa_ForestTrustInformation **forest_trust_info;/* [ref] */ WERROR result; } out; }; -struct netr_NETRGETFORESTTRUSTINFORMATION { +struct netr_GetForestTrustInformation { struct { + const char *server_name;/* [unique,charset(UTF16)] */ + const char *trusted_domain_name;/* [ref,charset(UTF16)] */ + struct netr_Authenticator *credential;/* [ref] */ + uint32_t flags; + } in; + + struct { + struct netr_Authenticator *return_authenticator;/* [ref] */ + struct lsa_ForestTrustInformation **forest_trust_info;/* [ref] */ WERROR result; } out; diff --git a/source3/librpc/gen_ndr/ntsvcs.h b/source3/librpc/gen_ndr/ntsvcs.h new file mode 100644 index 0000000000..9cdfa656b4 --- /dev/null +++ b/source3/librpc/gen_ndr/ntsvcs.h @@ -0,0 +1,568 @@ +/* header auto-generated by pidl */ + +#include <stdint.h> + +#ifndef _HEADER_ntsvcs +#define _HEADER_ntsvcs + +struct PNP_HwProfInfo { + uint32_t unknown1; + uint16_t unknown2[160]; + uint32_t unknown3; +}; + + +struct PNP_Disconnect { + struct { + WERROR result; + } out; + +}; + + +struct PNP_Connect { + struct { + WERROR result; + } out; + +}; + + +struct PNP_GetVersion { + struct { + uint16_t *version;/* [ref] */ + WERROR result; + } out; + +}; + + +struct PNP_GetGlobalState { + struct { + WERROR result; + } out; + +}; + + +struct PNP_InitDetection { + struct { + WERROR result; + } out; + +}; + + +struct PNP_ReportLogOn { + struct { + WERROR result; + } out; + +}; + + +struct PNP_ValidateDeviceInstance { + struct { + const char *devicepath;/* [ref,charset(UTF16)] */ + uint32_t flags; + } in; + + struct { + WERROR result; + } out; + +}; + + +struct PNP_GetRootDeviceInstance { + struct { + WERROR result; + } out; + +}; + + +struct PNP_GetRelatedDeviceInstance { + struct { + WERROR result; + } out; + +}; + + +struct PNP_EnumerateSubKeys { + struct { + WERROR result; + } out; + +}; + + +struct PNP_GetDeviceList { + struct { + WERROR result; + } out; + +}; + + +struct PNP_GetDeviceListSize { + struct { + const char *devicename;/* [unique,charset(UTF16)] */ + uint32_t flags; + } in; + + struct { + uint32_t *size;/* [ref] */ + WERROR result; + } out; + +}; + + +struct PNP_GetDepth { + struct { + WERROR result; + } out; + +}; + + +struct PNP_GetDeviceRegProp { + struct { + WERROR result; + } out; + +}; + + +struct PNP_SetDeviceRegProp { + struct { + WERROR result; + } out; + +}; + + +struct PNP_GetClassInstance { + struct { + WERROR result; + } out; + +}; + + +struct PNP_CreateKey { + struct { + WERROR result; + } out; + +}; + + +struct PNP_DeleteRegistryKey { + struct { + WERROR result; + } out; + +}; + + +struct PNP_GetClassCount { + struct { + WERROR result; + } out; + +}; + + +struct PNP_GetClassName { + struct { + WERROR result; + } out; + +}; + + +struct PNP_DeleteClassKey { + struct { + WERROR result; + } out; + +}; + + +struct PNP_GetInterfaceDeviceAlias { + struct { + WERROR result; + } out; + +}; + + +struct PNP_GetInterfaceDeviceList { + struct { + WERROR result; + } out; + +}; + + +struct PNP_GetInterfaceDeviceListSize { + struct { + WERROR result; + } out; + +}; + + +struct PNP_RegisterDeviceClassAssociation { + struct { + WERROR result; + } out; + +}; + + +struct PNP_UnregisterDeviceClassAssociation { + struct { + WERROR result; + } out; + +}; + + +struct PNP_GetClassRegProp { + struct { + WERROR result; + } out; + +}; + + +struct PNP_SetClassRegProp { + struct { + WERROR result; + } out; + +}; + + +struct PNP_CreateDevInst { + struct { + WERROR result; + } out; + +}; + + +struct PNP_DeviceInstanceAction { + struct { + WERROR result; + } out; + +}; + + +struct PNP_GetDeviceStatus { + struct { + WERROR result; + } out; + +}; + + +struct PNP_SetDeviceProblem { + struct { + WERROR result; + } out; + +}; + + +struct PNP_DisableDevInst { + struct { + WERROR result; + } out; + +}; + + +struct PNP_UninstallDevInst { + struct { + WERROR result; + } out; + +}; + + +struct PNP_AddID { + struct { + WERROR result; + } out; + +}; + + +struct PNP_RegisterDriver { + struct { + WERROR result; + } out; + +}; + + +struct PNP_QueryRemove { + struct { + WERROR result; + } out; + +}; + + +struct PNP_RequestDeviceEject { + struct { + WERROR result; + } out; + +}; + + +struct PNP_IsDockStationPresent { + struct { + WERROR result; + } out; + +}; + + +struct PNP_RequestEjectPC { + struct { + WERROR result; + } out; + +}; + + +struct PNP_HwProfFlags { + struct { + uint32_t unknown1; + const char *devicepath;/* [ref,charset(UTF16)] */ + uint32_t unknown2; + const char *unknown5;/* [unique,charset(UTF16)] */ + uint32_t unknown6; + uint32_t unknown7; + uint32_t *unknown3;/* [ref] */ + uint16_t *unknown4;/* [unique] */ + } in; + + struct { + const char **unknown5a;/* [unique,charset(UTF16)] */ + uint32_t *unknown3;/* [ref] */ + uint16_t *unknown4;/* [unique] */ + WERROR result; + } out; + +}; + + +struct PNP_GetHwProfInfo { + struct { + uint32_t idx; + uint32_t unknown1; + uint32_t unknown2; + struct PNP_HwProfInfo *info;/* [ref] */ + } in; + + struct { + struct PNP_HwProfInfo *info;/* [ref] */ + WERROR result; + } out; + +}; + + +struct PNP_AddEmptyLogConf { + struct { + WERROR result; + } out; + +}; + + +struct PNP_FreeLogConf { + struct { + WERROR result; + } out; + +}; + + +struct PNP_GetFirstLogConf { + struct { + WERROR result; + } out; + +}; + + +struct PNP_GetNextLogConf { + struct { + WERROR result; + } out; + +}; + + +struct PNP_GetLogConfPriority { + struct { + WERROR result; + } out; + +}; + + +struct PNP_AddResDes { + struct { + WERROR result; + } out; + +}; + + +struct PNP_FreeResDes { + struct { + WERROR result; + } out; + +}; + + +struct PNP_GetNextResDes { + struct { + WERROR result; + } out; + +}; + + +struct PNP_GetResDesData { + struct { + WERROR result; + } out; + +}; + + +struct PNP_GetResDesDataSize { + struct { + WERROR result; + } out; + +}; + + +struct PNP_ModifyResDes { + struct { + WERROR result; + } out; + +}; + + +struct PNP_DetectResourceLimit { + struct { + WERROR result; + } out; + +}; + + +struct PNP_QueryResConfList { + struct { + WERROR result; + } out; + +}; + + +struct PNP_SetHwProf { + struct { + WERROR result; + } out; + +}; + + +struct PNP_QueryArbitratorFreeData { + struct { + WERROR result; + } out; + +}; + + +struct PNP_QueryArbitratorFreeSize { + struct { + WERROR result; + } out; + +}; + + +struct PNP_RunDetection { + struct { + WERROR result; + } out; + +}; + + +struct PNP_RegisterNotification { + struct { + WERROR result; + } out; + +}; + + +struct PNP_UnregisterNotification { + struct { + WERROR result; + } out; + +}; + + +struct PNP_GetCustomDevProp { + struct { + WERROR result; + } out; + +}; + + +struct PNP_GetVersionInternal { + struct { + WERROR result; + } out; + +}; + + +struct PNP_GetBlockedDriverInfo { + struct { + WERROR result; + } out; + +}; + + +struct PNP_GetServerSideDeviceInstallFlags { + struct { + WERROR result; + } out; + +}; + +#endif /* _HEADER_ntsvcs */ diff --git a/source3/librpc/gen_ndr/samr.h b/source3/librpc/gen_ndr/samr.h new file mode 100644 index 0000000000..c0e2d9d9a9 --- /dev/null +++ b/source3/librpc/gen_ndr/samr.h @@ -0,0 +1,1759 @@ +/* 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 MAX_SAM_ENTRIES_W2K ( 0x400 ) +#define MAX_SAM_ENTRIES_W95 ( 50 ) +#define SAMR_ENUM_USERS_MULTIPLIER ( 54 ) +#define PASS_MUST_CHANGE_AT_NEXT_LOGON ( 0x01 ) +#define PASS_DONT_CHANGE_AT_NEXT_LOGON ( 0x00 ) +/* 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 SAMR_USER_ACCESS_GET_NAME_ETC ( 0x00000001 ) +#define SAMR_USER_ACCESS_GET_LOCALE ( 0x00000002 ) +#define SAMR_USER_ACCESS_SET_LOC_COM ( 0x00000004 ) +#define SAMR_USER_ACCESS_GET_LOGONINFO ( 0x00000008 ) +#define SAMR_USER_ACCESS_GET_ATTRIBUTES ( 0x00000010 ) +#define SAMR_USER_ACCESS_SET_ATTRIBUTES ( 0x00000020 ) +#define SAMR_USER_ACCESS_CHANGE_PASSWORD ( 0x00000040 ) +#define SAMR_USER_ACCESS_SET_PASSWORD ( 0x00000080 ) +#define SAMR_USER_ACCESS_GET_GROUPS ( 0x00000100 ) +#define SAMR_USER_ACCESS_GET_GROUP_MEMBERSHIP ( 0x00000200 ) +#define SAMR_USER_ACCESS_CHANGE_GROUP_MEMBERSHIP ( 0x00000400 ) + +/* bitmap samr_DomainAccessMask */ +#define SAMR_DOMAIN_ACCESS_LOOKUP_INFO_1 ( 0x00000001 ) +#define SAMR_DOMAIN_ACCESS_SET_INFO_1 ( 0x00000002 ) +#define SAMR_DOMAIN_ACCESS_LOOKUP_INFO_2 ( 0x00000004 ) +#define SAMR_DOMAIN_ACCESS_SET_INFO_2 ( 0x00000008 ) +#define SAMR_DOMAIN_ACCESS_CREATE_USER ( 0x00000010 ) +#define SAMR_DOMAIN_ACCESS_CREATE_GROUP ( 0x00000020 ) +#define SAMR_DOMAIN_ACCESS_CREATE_ALIAS ( 0x00000040 ) +#define SAMR_DOMAIN_ACCESS_LOOKUP_ALIAS ( 0x00000080 ) +#define SAMR_DOMAIN_ACCESS_ENUM_ACCOUNTS ( 0x00000100 ) +#define SAMR_DOMAIN_ACCESS_OPEN_ACCOUNT ( 0x00000200 ) +#define SAMR_DOMAIN_ACCESS_SET_INFO_3 ( 0x00000400 ) + +/* bitmap samr_GroupAccessMask */ +#define SAMR_GROUP_ACCESS_LOOKUP_INFO ( 0x00000001 ) +#define SAMR_GROUP_ACCESS_SET_INFO ( 0x00000002 ) +#define SAMR_GROUP_ACCESS_ADD_MEMBER ( 0x00000004 ) +#define SAMR_GROUP_ACCESS_REMOVE_MEMBER ( 0x00000008 ) +#define SAMR_GROUP_ACCESS_GET_MEMBERS ( 0x00000010 ) + +/* bitmap samr_AliasAccessMask */ +#define SAMR_ALIAS_ACCESS_ADD_MEMBER ( 0x00000001 ) +#define SAMR_ALIAS_ACCESS_REMOVE_MEMBER ( 0x00000002 ) +#define SAMR_ALIAS_ACCESS_GET_MEMBERS ( 0x00000004 ) +#define SAMR_ALIAS_ACCESS_LOOKUP_INFO ( 0x00000008 ) +#define SAMR_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_Password { + uint8_t hash[16]; +}/* [public,flag(LIBNDR_PRINT_ARRAY_HEX)] */; + +struct samr_UserInfo18 { + struct samr_Password lm_pwd; + struct samr_Password nt_pwd; + uint8_t lm_pwd_active; + uint8_t nt_pwd_active; +}; + +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_UserInfo18 info18;/* [case(18)] */ + 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_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_AsciiStringLarge 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_ConnectVersion +#ifndef USE_UINT_ENUMS + { + SAMR_CONNECT_PRE_W2K=1, + SAMR_CONNECT_W2K=2, + SAMR_CONNECT_AFTER_W2K=3 +} +#else + { __donnot_use_enum_samr_ConnectVersion=0x7FFFFFFF} +#define SAMR_CONNECT_PRE_W2K ( 1 ) +#define SAMR_CONNECT_W2K ( 2 ) +#define SAMR_CONNECT_AFTER_W2K ( 3 ) +#endif +; + +enum samr_RejectReason; + +struct samr_ChangeReject { + enum samr_RejectReason reason; + uint32_t unknown1; + uint32_t unknown2; +}; + +struct samr_ConnectInfo1 { + enum samr_ConnectVersion client_version; + 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 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_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)] */ + enum samr_ConnectVersion client_version; + 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/security.h b/source3/librpc/gen_ndr/security.h index 1c51af5b9c..a17fd512f7 100644 --- a/source3/librpc/gen_ndr/security.h +++ b/source3/librpc/gen_ndr/security.h @@ -1 +1,326 @@ -#include "ndr/security.h" +/* header auto-generated by pidl */ + +#include <stdint.h> + +#include "librpc/gen_ndr/misc.h" +#define dom_sid2 dom_sid +#define dom_sid28 dom_sid +#ifndef _HEADER_security +#define _HEADER_security + +#define SEC_MASK_GENERIC ( 0xF0000000 ) +#define SEC_MASK_FLAGS ( 0x0F000000 ) +#define SEC_MASK_STANDARD ( 0x00FF0000 ) +#define SEC_MASK_SPECIFIC ( 0x0000FFFF ) +#define SEC_GENERIC_ALL ( 0x10000000 ) +#define SEC_GENERIC_EXECUTE ( 0x20000000 ) +#define SEC_GENERIC_WRITE ( 0x40000000 ) +#define SEC_GENERIC_READ ( 0x80000000 ) +#define SEC_FLAG_SYSTEM_SECURITY ( 0x01000000 ) +#define SEC_FLAG_MAXIMUM_ALLOWED ( 0x02000000 ) +#define SEC_STD_DELETE ( 0x00010000 ) +#define SEC_STD_READ_CONTROL ( 0x00020000 ) +#define SEC_STD_WRITE_DAC ( 0x00040000 ) +#define SEC_STD_WRITE_OWNER ( 0x00080000 ) +#define SEC_STD_SYNCHRONIZE ( 0x00100000 ) +#define SEC_STD_REQUIRED ( 0x000F0000 ) +#define SEC_STD_ALL ( 0x001F0000 ) +#define SEC_FILE_READ_DATA ( 0x00000001 ) +#define SEC_FILE_WRITE_DATA ( 0x00000002 ) +#define SEC_FILE_APPEND_DATA ( 0x00000004 ) +#define SEC_FILE_READ_EA ( 0x00000008 ) +#define SEC_FILE_WRITE_EA ( 0x00000010 ) +#define SEC_FILE_EXECUTE ( 0x00000020 ) +#define SEC_FILE_READ_ATTRIBUTE ( 0x00000080 ) +#define SEC_FILE_WRITE_ATTRIBUTE ( 0x00000100 ) +#define SEC_FILE_ALL ( 0x000001ff ) +#define SEC_DIR_LIST ( 0x00000001 ) +#define SEC_DIR_ADD_FILE ( 0x00000002 ) +#define SEC_DIR_ADD_SUBDIR ( 0x00000004 ) +#define SEC_DIR_READ_EA ( 0x00000008 ) +#define SEC_DIR_WRITE_EA ( 0x00000010 ) +#define SEC_DIR_TRAVERSE ( 0x00000020 ) +#define SEC_DIR_DELETE_CHILD ( 0x00000040 ) +#define SEC_DIR_READ_ATTRIBUTE ( 0x00000080 ) +#define SEC_DIR_WRITE_ATTRIBUTE ( 0x00000100 ) +#define SEC_REG_QUERY_VALUE ( 0x00000001 ) +#define SEC_REG_SET_VALUE ( 0x00000002 ) +#define SEC_REG_CREATE_SUBKEY ( 0x00000004 ) +#define SEC_REG_ENUM_SUBKEYS ( 0x00000008 ) +#define SEC_REG_NOTIFY ( 0x00000010 ) +#define SEC_REG_CREATE_LINK ( 0x00000020 ) +#define SEC_ADS_CREATE_CHILD ( 0x00000001 ) +#define SEC_ADS_DELETE_CHILD ( 0x00000002 ) +#define SEC_ADS_LIST ( 0x00000004 ) +#define SEC_ADS_SELF_WRITE ( 0x00000008 ) +#define SEC_ADS_READ_PROP ( 0x00000010 ) +#define SEC_ADS_WRITE_PROP ( 0x00000020 ) +#define SEC_ADS_DELETE_TREE ( 0x00000040 ) +#define SEC_ADS_LIST_OBJECT ( 0x00000080 ) +#define SEC_ADS_CONTROL_ACCESS ( 0x00000100 ) +#define SEC_RIGHTS_FILE_READ ( SEC_STD_READ_CONTROL|SEC_STD_SYNCHRONIZE|SEC_FILE_READ_DATA|SEC_FILE_READ_ATTRIBUTE|SEC_FILE_READ_EA ) +#define SEC_RIGHTS_FILE_WRITE ( SEC_STD_READ_CONTROL|SEC_STD_SYNCHRONIZE|SEC_FILE_WRITE_DATA|SEC_FILE_WRITE_ATTRIBUTE|SEC_FILE_WRITE_EA|SEC_FILE_APPEND_DATA ) +#define SEC_RIGHTS_FILE_EXECUTE ( SEC_STD_SYNCHRONIZE|SEC_STD_READ_CONTROL|SEC_FILE_READ_ATTRIBUTE|SEC_FILE_EXECUTE ) +#define SEC_RIGHTS_FILE_ALL ( SEC_STD_ALL|SEC_FILE_ALL ) +#define SEC_RIGHTS_DIR_READ ( SEC_RIGHTS_FILE_READ ) +#define SEC_RIGHTS_DIR_WRITE ( SEC_RIGHTS_FILE_WRITE ) +#define SEC_RIGHTS_DIR_EXECUTE ( SEC_RIGHTS_FILE_EXECUTE ) +#define SEC_RIGHTS_DIR_ALL ( SEC_RIGHTS_FILE_ALL ) +#define SID_NULL ( "S-1-0-0" ) +#define NAME_WORLD ( "WORLD" ) +#define SID_WORLD_DOMAIN ( "S-1-1" ) +#define SID_WORLD ( "S-1-1-0" ) +#define SID_CREATOR_OWNER_DOMAIN ( "S-1-3" ) +#define SID_CREATOR_OWNER ( "S-1-3-0" ) +#define SID_CREATOR_GROUP ( "S-1-3-1" ) +#define NAME_NT_AUTHORITY ( "NT AUTHORITY" ) +#define SID_NT_AUTHORITY ( "S-1-5" ) +#define SID_NT_DIALUP ( "S-1-5-1" ) +#define SID_NT_NETWORK ( "S-1-5-2" ) +#define SID_NT_BATCH ( "S-1-5-3" ) +#define SID_NT_INTERACTIVE ( "S-1-5-4" ) +#define SID_NT_SERVICE ( "S-1-5-6" ) +#define SID_NT_ANONYMOUS ( "S-1-5-7" ) +#define SID_NT_PROXY ( "S-1-5-8" ) +#define SID_NT_ENTERPRISE_DCS ( "S-1-5-9" ) +#define SID_NT_SELF ( "S-1-5-10" ) +#define SID_NT_AUTHENTICATED_USERS ( "S-1-5-11" ) +#define SID_NT_RESTRICTED ( "S-1-5-12" ) +#define SID_NT_TERMINAL_SERVER_USERS ( "S-1-5-13" ) +#define SID_NT_REMOTE_INTERACTIVE ( "S-1-5-14" ) +#define SID_NT_THIS_ORGANISATION ( "S-1-5-15" ) +#define SID_NT_SYSTEM ( "S-1-5-18" ) +#define SID_NT_LOCAL_SERVICE ( "S-1-5-19" ) +#define SID_NT_NETWORK_SERVICE ( "S-1-5-20" ) +#define NAME_BUILTIN ( "BUILTIN" ) +#define SID_BUILTIN ( "S-1-5-32" ) +#define SID_BUILTIN_ADMINISTRATORS ( "S-1-5-32-544" ) +#define SID_BUILTIN_USERS ( "S-1-5-32-545" ) +#define SID_BUILTIN_GUESTS ( "S-1-5-32-546" ) +#define SID_BUILTIN_POWER_USERS ( "S-1-5-32-547" ) +#define SID_BUILTIN_ACCOUNT_OPERATORS ( "S-1-5-32-548" ) +#define SID_BUILTIN_SERVER_OPERATORS ( "S-1-5-32-549" ) +#define SID_BUILTIN_PRINT_OPERATORS ( "S-1-5-32-550" ) +#define SID_BUILTIN_BACKUP_OPERATORS ( "S-1-5-32-551" ) +#define SID_BUILTIN_REPLICATOR ( "S-1-5-32-552" ) +#define SID_BUILTIN_RAS_SERVERS ( "S-1-5-32-553" ) +#define SID_BUILTIN_PREW2K ( "S-1-5-32-554" ) +#define DOMAIN_RID_LOGON ( 9 ) +#define DOMAIN_RID_ADMINISTRATOR ( 500 ) +#define DOMAIN_RID_GUEST ( 501 ) +#define DOMAIN_RID_ADMINS ( 512 ) +#define DOMAIN_RID_USERS ( 513 ) +#define DOMAIN_RID_DOMAIN_MEMBERS ( 515 ) +#define DOMAIN_RID_DCS ( 516 ) +#define DOMAIN_RID_CERT_ADMINS ( 517 ) +#define DOMAIN_RID_SCHEMA_ADMINS ( 518 ) +#define DOMAIN_RID_ENTERPRISE_ADMINS ( 519 ) +#define NT4_ACL_REVISION ( SECURITY_ACL_REVISION_NT4 ) +#define SD_REVISION ( SECURITY_DESCRIPTOR_REVISION_1 ) +enum sec_privilege +#ifndef USE_UINT_ENUMS + { + SEC_PRIV_SECURITY=1, + SEC_PRIV_BACKUP=2, + SEC_PRIV_RESTORE=3, + SEC_PRIV_SYSTEMTIME=4, + SEC_PRIV_SHUTDOWN=5, + SEC_PRIV_REMOTE_SHUTDOWN=6, + SEC_PRIV_TAKE_OWNERSHIP=7, + SEC_PRIV_DEBUG=8, + SEC_PRIV_SYSTEM_ENVIRONMENT=9, + SEC_PRIV_SYSTEM_PROFILE=10, + SEC_PRIV_PROFILE_SINGLE_PROCESS=11, + SEC_PRIV_INCREASE_BASE_PRIORITY=12, + SEC_PRIV_LOAD_DRIVER=13, + SEC_PRIV_CREATE_PAGEFILE=14, + SEC_PRIV_INCREASE_QUOTA=15, + SEC_PRIV_CHANGE_NOTIFY=16, + SEC_PRIV_UNDOCK=17, + SEC_PRIV_MANAGE_VOLUME=18, + SEC_PRIV_IMPERSONATE=19, + SEC_PRIV_CREATE_GLOBAL=20, + SEC_PRIV_ENABLE_DELEGATION=21, + SEC_PRIV_INTERACTIVE_LOGON=22, + SEC_PRIV_NETWORK_LOGON=23, + SEC_PRIV_REMOTE_INTERACTIVE_LOGON=24 +} +#else + { __donnot_use_enum_sec_privilege=0x7FFFFFFF} +#define SEC_PRIV_SECURITY ( 1 ) +#define SEC_PRIV_BACKUP ( 2 ) +#define SEC_PRIV_RESTORE ( 3 ) +#define SEC_PRIV_SYSTEMTIME ( 4 ) +#define SEC_PRIV_SHUTDOWN ( 5 ) +#define SEC_PRIV_REMOTE_SHUTDOWN ( 6 ) +#define SEC_PRIV_TAKE_OWNERSHIP ( 7 ) +#define SEC_PRIV_DEBUG ( 8 ) +#define SEC_PRIV_SYSTEM_ENVIRONMENT ( 9 ) +#define SEC_PRIV_SYSTEM_PROFILE ( 10 ) +#define SEC_PRIV_PROFILE_SINGLE_PROCESS ( 11 ) +#define SEC_PRIV_INCREASE_BASE_PRIORITY ( 12 ) +#define SEC_PRIV_LOAD_DRIVER ( 13 ) +#define SEC_PRIV_CREATE_PAGEFILE ( 14 ) +#define SEC_PRIV_INCREASE_QUOTA ( 15 ) +#define SEC_PRIV_CHANGE_NOTIFY ( 16 ) +#define SEC_PRIV_UNDOCK ( 17 ) +#define SEC_PRIV_MANAGE_VOLUME ( 18 ) +#define SEC_PRIV_IMPERSONATE ( 19 ) +#define SEC_PRIV_CREATE_GLOBAL ( 20 ) +#define SEC_PRIV_ENABLE_DELEGATION ( 21 ) +#define SEC_PRIV_INTERACTIVE_LOGON ( 22 ) +#define SEC_PRIV_NETWORK_LOGON ( 23 ) +#define SEC_PRIV_REMOTE_INTERACTIVE_LOGON ( 24 ) +#endif +; + +/* bitmap security_ace_flags */ +#define SEC_ACE_FLAG_OBJECT_INHERIT ( 0x01 ) +#define SEC_ACE_FLAG_CONTAINER_INHERIT ( 0x02 ) +#define SEC_ACE_FLAG_NO_PROPAGATE_INHERIT ( 0x04 ) +#define SEC_ACE_FLAG_INHERIT_ONLY ( 0x08 ) +#define SEC_ACE_FLAG_INHERITED_ACE ( 0x10 ) +#define SEC_ACE_FLAG_VALID_INHERIT ( 0x0f ) +#define SEC_ACE_FLAG_SUCCESSFUL_ACCESS ( 0x40 ) +#define SEC_ACE_FLAG_FAILED_ACCESS ( 0x80 ) + +enum security_ace_type +#ifndef USE_UINT_ENUMS + { + SEC_ACE_TYPE_ACCESS_ALLOWED=0, + SEC_ACE_TYPE_ACCESS_DENIED=1, + SEC_ACE_TYPE_SYSTEM_AUDIT=2, + SEC_ACE_TYPE_SYSTEM_ALARM=3, + SEC_ACE_TYPE_ALLOWED_COMPOUND=4, + SEC_ACE_TYPE_ACCESS_ALLOWED_OBJECT=5, + SEC_ACE_TYPE_ACCESS_DENIED_OBJECT=6, + SEC_ACE_TYPE_SYSTEM_AUDIT_OBJECT=7, + SEC_ACE_TYPE_SYSTEM_ALARM_OBJECT=8 +} +#else + { __donnot_use_enum_security_ace_type=0x7FFFFFFF} +#define SEC_ACE_TYPE_ACCESS_ALLOWED ( 0 ) +#define SEC_ACE_TYPE_ACCESS_DENIED ( 1 ) +#define SEC_ACE_TYPE_SYSTEM_AUDIT ( 2 ) +#define SEC_ACE_TYPE_SYSTEM_ALARM ( 3 ) +#define SEC_ACE_TYPE_ALLOWED_COMPOUND ( 4 ) +#define SEC_ACE_TYPE_ACCESS_ALLOWED_OBJECT ( 5 ) +#define SEC_ACE_TYPE_ACCESS_DENIED_OBJECT ( 6 ) +#define SEC_ACE_TYPE_SYSTEM_AUDIT_OBJECT ( 7 ) +#define SEC_ACE_TYPE_SYSTEM_ALARM_OBJECT ( 8 ) +#endif +; + +/* bitmap security_ace_object_flags */ +#define SEC_ACE_OBJECT_TYPE_PRESENT ( 0x00000001 ) +#define SEC_ACE_INHERITED_OBJECT_TYPE_PRESENT ( 0x00000002 ) + +union security_ace_object_type { + struct GUID type;/* [case(SEC_ACE_OBJECT_TYPE_PRESENT)] */ +}/* [nodiscriminant] */; + +union security_ace_object_inherited_type { + struct GUID inherited_type;/* [case(SEC_ACE_INHERITED_OBJECT_TYPE_PRESENT)] */ +}/* [nodiscriminant] */; + +struct security_ace_object { + uint32_t flags; + union security_ace_object_type type;/* [switch_is(flags&SEC_ACE_OBJECT_TYPE_PRESENT)] */ + union security_ace_object_inherited_type inherited_type;/* [switch_is(flags&SEC_ACE_INHERITED_OBJECT_TYPE_PRESENT)] */ +}; + +union security_ace_object_ctr { + struct security_ace_object object;/* [case(SEC_ACE_TYPE_ACCESS_ALLOWED_OBJECT)] */ +}/* [nodiscriminant] */; + +struct security_ace { + enum security_ace_type type; + uint8_t flags; + uint16_t size;/* [value(ndr_size_security_ace(r,ndr->flags))] */ + uint32_t access_mask; + union security_ace_object_ctr object;/* [switch_is(type)] */ + struct dom_sid trustee; +}/* [gensize,public,nosize] */; + +enum security_acl_revision +#ifndef USE_UINT_ENUMS + { + SECURITY_ACL_REVISION_NT4=2, + SECURITY_ACL_REVISION_ADS=4 +} +#else + { __donnot_use_enum_security_acl_revision=0x7FFFFFFF} +#define SECURITY_ACL_REVISION_NT4 ( 2 ) +#define SECURITY_ACL_REVISION_ADS ( 4 ) +#endif +; + +struct security_acl { + enum security_acl_revision revision; + uint16_t size;/* [value(ndr_size_security_acl(r,ndr->flags))] */ + uint32_t num_aces;/* [range(0,1000)] */ + struct security_ace *aces; +}/* [gensize,public,nosize] */; + +enum security_descriptor_revision +#ifndef USE_UINT_ENUMS + { + SECURITY_DESCRIPTOR_REVISION_1=1 +} +#else + { __donnot_use_enum_security_descriptor_revision=0x7FFFFFFF} +#define SECURITY_DESCRIPTOR_REVISION_1 ( 1 ) +#endif +; + +/* bitmap security_descriptor_type */ +#define SEC_DESC_OWNER_DEFAULTED ( 0x0001 ) +#define SEC_DESC_GROUP_DEFAULTED ( 0x0002 ) +#define SEC_DESC_DACL_PRESENT ( 0x0004 ) +#define SEC_DESC_DACL_DEFAULTED ( 0x0008 ) +#define SEC_DESC_SACL_PRESENT ( 0x0010 ) +#define SEC_DESC_SACL_DEFAULTED ( 0x0020 ) +#define SEC_DESC_DACL_TRUSTED ( 0x0040 ) +#define SEC_DESC_SERVER_SECURITY ( 0x0080 ) +#define SEC_DESC_DACL_AUTO_INHERIT_REQ ( 0x0100 ) +#define SEC_DESC_SACL_AUTO_INHERIT_REQ ( 0x0200 ) +#define SEC_DESC_DACL_AUTO_INHERITED ( 0x0400 ) +#define SEC_DESC_SACL_AUTO_INHERITED ( 0x0800 ) +#define SEC_DESC_DACL_PROTECTED ( 0x1000 ) +#define SEC_DESC_SACL_PROTECTED ( 0x2000 ) +#define SEC_DESC_RM_CONTROL_VALID ( 0x4000 ) +#define SEC_DESC_SELF_RELATIVE ( 0x8000 ) + +struct security_descriptor { + enum security_descriptor_revision revision; + uint16_t type; + struct dom_sid *owner_sid;/* [relative] */ + struct dom_sid *group_sid;/* [relative] */ + struct security_acl *sacl;/* [relative] */ + struct security_acl *dacl;/* [relative] */ +}/* [gensize,public,flag(LIBNDR_FLAG_LITTLE_ENDIAN),nosize] */; + +struct sec_desc_buf { + uint32_t sd_size;/* [value(ndr_size_security_descriptor(sd,ndr->flags)),range(0,0x40000)] */ + struct security_descriptor *sd;/* [unique,subcontext(4)] */ +}/* [public] */; + +struct security_token { + struct dom_sid *user_sid;/* [unique] */ + struct dom_sid *group_sid;/* [unique] */ + uint32_t num_sids; + struct dom_sid **sids;/* [unique,size_is(num_sids)] */ + uint64_t privilege_mask; +}/* [public] */; + +/* bitmap security_secinfo */ +#define SECINFO_OWNER ( 0x00000001 ) +#define SECINFO_GROUP ( 0x00000002 ) +#define SECINFO_DACL ( 0x00000004 ) +#define SECINFO_SACL ( 0x00000008 ) +#define SECINFO_UNPROTECTED_SACL ( 0x10000000 ) +#define SECINFO_UNPROTECTED_DACL ( 0x20000000 ) +#define SECINFO_PROTECTED_SACL ( 0x40000000 ) +#define SECINFO_PROTECTED_DACL ( 0x80000000 ) + +#endif /* _HEADER_security */ diff --git a/source3/librpc/gen_ndr/srv_dfs.c b/source3/librpc/gen_ndr/srv_dfs.c index 384c2ba940..1ecd687e3a 100644 --- a/source3/librpc/gen_ndr/srv_dfs.c +++ b/source3/librpc/gen_ndr/srv_dfs.c @@ -17,7 +17,7 @@ static bool api_dfs_GetManagerVersion(pipes_struct *p) call = &ndr_table_netdfs.calls[NDR_DFS_GETMANAGERVERSION]; - r = talloc(NULL, struct dfs_GetManagerVersion); + r = talloc(talloc_tos(), struct dfs_GetManagerVersion); if (r == NULL) { return false; } @@ -97,7 +97,7 @@ static bool api_dfs_Add(pipes_struct *p) call = &ndr_table_netdfs.calls[NDR_DFS_ADD]; - r = talloc(NULL, struct dfs_Add); + r = talloc(talloc_tos(), struct dfs_Add); if (r == NULL) { return false; } @@ -170,7 +170,7 @@ static bool api_dfs_Remove(pipes_struct *p) call = &ndr_table_netdfs.calls[NDR_DFS_REMOVE]; - r = talloc(NULL, struct dfs_Remove); + r = talloc(talloc_tos(), struct dfs_Remove); if (r == NULL) { return false; } @@ -243,7 +243,7 @@ static bool api_dfs_SetInfo(pipes_struct *p) call = &ndr_table_netdfs.calls[NDR_DFS_SETINFO]; - r = talloc(NULL, struct dfs_SetInfo); + r = talloc(talloc_tos(), struct dfs_SetInfo); if (r == NULL) { return false; } @@ -316,7 +316,7 @@ static bool api_dfs_GetInfo(pipes_struct *p) call = &ndr_table_netdfs.calls[NDR_DFS_GETINFO]; - r = talloc(NULL, struct dfs_GetInfo); + r = talloc(talloc_tos(), struct dfs_GetInfo); if (r == NULL) { return false; } @@ -396,7 +396,7 @@ static bool api_dfs_Enum(pipes_struct *p) call = &ndr_table_netdfs.calls[NDR_DFS_ENUM]; - r = talloc(NULL, struct dfs_Enum); + r = talloc(talloc_tos(), struct dfs_Enum); if (r == NULL) { return false; } @@ -472,7 +472,7 @@ static bool api_dfs_Rename(pipes_struct *p) call = &ndr_table_netdfs.calls[NDR_DFS_RENAME]; - r = talloc(NULL, struct dfs_Rename); + r = talloc(talloc_tos(), struct dfs_Rename); if (r == NULL) { return false; } @@ -545,7 +545,7 @@ static bool api_dfs_Move(pipes_struct *p) call = &ndr_table_netdfs.calls[NDR_DFS_MOVE]; - r = talloc(NULL, struct dfs_Move); + r = talloc(talloc_tos(), struct dfs_Move); if (r == NULL) { return false; } @@ -618,7 +618,7 @@ static bool api_dfs_ManagerGetConfigInfo(pipes_struct *p) call = &ndr_table_netdfs.calls[NDR_DFS_MANAGERGETCONFIGINFO]; - r = talloc(NULL, struct dfs_ManagerGetConfigInfo); + r = talloc(talloc_tos(), struct dfs_ManagerGetConfigInfo); if (r == NULL) { return false; } @@ -691,7 +691,7 @@ static bool api_dfs_ManagerSendSiteInfo(pipes_struct *p) call = &ndr_table_netdfs.calls[NDR_DFS_MANAGERSENDSITEINFO]; - r = talloc(NULL, struct dfs_ManagerSendSiteInfo); + r = talloc(talloc_tos(), struct dfs_ManagerSendSiteInfo); if (r == NULL) { return false; } @@ -764,7 +764,7 @@ static bool api_dfs_AddFtRoot(pipes_struct *p) call = &ndr_table_netdfs.calls[NDR_DFS_ADDFTROOT]; - r = talloc(NULL, struct dfs_AddFtRoot); + r = talloc(talloc_tos(), struct dfs_AddFtRoot); if (r == NULL) { return false; } @@ -839,7 +839,7 @@ static bool api_dfs_RemoveFtRoot(pipes_struct *p) call = &ndr_table_netdfs.calls[NDR_DFS_REMOVEFTROOT]; - r = talloc(NULL, struct dfs_RemoveFtRoot); + r = talloc(talloc_tos(), struct dfs_RemoveFtRoot); if (r == NULL) { return false; } @@ -914,7 +914,7 @@ static bool api_dfs_AddStdRoot(pipes_struct *p) call = &ndr_table_netdfs.calls[NDR_DFS_ADDSTDROOT]; - r = talloc(NULL, struct dfs_AddStdRoot); + r = talloc(talloc_tos(), struct dfs_AddStdRoot); if (r == NULL) { return false; } @@ -987,7 +987,7 @@ static bool api_dfs_RemoveStdRoot(pipes_struct *p) call = &ndr_table_netdfs.calls[NDR_DFS_REMOVESTDROOT]; - r = talloc(NULL, struct dfs_RemoveStdRoot); + r = talloc(talloc_tos(), struct dfs_RemoveStdRoot); if (r == NULL) { return false; } @@ -1060,7 +1060,7 @@ static bool api_dfs_ManagerInitialize(pipes_struct *p) call = &ndr_table_netdfs.calls[NDR_DFS_MANAGERINITIALIZE]; - r = talloc(NULL, struct dfs_ManagerInitialize); + r = talloc(talloc_tos(), struct dfs_ManagerInitialize); if (r == NULL) { return false; } @@ -1133,7 +1133,7 @@ static bool api_dfs_AddStdRootForced(pipes_struct *p) call = &ndr_table_netdfs.calls[NDR_DFS_ADDSTDROOTFORCED]; - r = talloc(NULL, struct dfs_AddStdRootForced); + r = talloc(talloc_tos(), struct dfs_AddStdRootForced); if (r == NULL) { return false; } @@ -1206,7 +1206,7 @@ static bool api_dfs_GetDcAddress(pipes_struct *p) call = &ndr_table_netdfs.calls[NDR_DFS_GETDCADDRESS]; - r = talloc(NULL, struct dfs_GetDcAddress); + r = talloc(talloc_tos(), struct dfs_GetDcAddress); if (r == NULL) { return false; } @@ -1233,6 +1233,10 @@ static bool api_dfs_GetDcAddress(pipes_struct *p) NDR_PRINT_IN_DEBUG(dfs_GetDcAddress, r); } + ZERO_STRUCT(r->out); + r->out.server_fullname = r->in.server_fullname; + r->out.is_root = r->in.is_root; + r->out.ttl = r->in.ttl; r->out.result = _dfs_GetDcAddress(p, r); if (p->rng_fault_state) { @@ -1279,7 +1283,7 @@ static bool api_dfs_SetDcAddress(pipes_struct *p) call = &ndr_table_netdfs.calls[NDR_DFS_SETDCADDRESS]; - r = talloc(NULL, struct dfs_SetDcAddress); + r = talloc(talloc_tos(), struct dfs_SetDcAddress); if (r == NULL) { return false; } @@ -1352,7 +1356,7 @@ static bool api_dfs_FlushFtTable(pipes_struct *p) call = &ndr_table_netdfs.calls[NDR_DFS_FLUSHFTTABLE]; - r = talloc(NULL, struct dfs_FlushFtTable); + r = talloc(talloc_tos(), struct dfs_FlushFtTable); if (r == NULL) { return false; } @@ -1425,7 +1429,7 @@ static bool api_dfs_Add2(pipes_struct *p) call = &ndr_table_netdfs.calls[NDR_DFS_ADD2]; - r = talloc(NULL, struct dfs_Add2); + r = talloc(talloc_tos(), struct dfs_Add2); if (r == NULL) { return false; } @@ -1498,7 +1502,7 @@ static bool api_dfs_Remove2(pipes_struct *p) call = &ndr_table_netdfs.calls[NDR_DFS_REMOVE2]; - r = talloc(NULL, struct dfs_Remove2); + r = talloc(talloc_tos(), struct dfs_Remove2); if (r == NULL) { return false; } @@ -1571,7 +1575,7 @@ static bool api_dfs_EnumEx(pipes_struct *p) call = &ndr_table_netdfs.calls[NDR_DFS_ENUMEX]; - r = talloc(NULL, struct dfs_EnumEx); + r = talloc(talloc_tos(), struct dfs_EnumEx); if (r == NULL) { return false; } @@ -1647,7 +1651,7 @@ static bool api_dfs_SetInfo2(pipes_struct *p) call = &ndr_table_netdfs.calls[NDR_DFS_SETINFO2]; - r = talloc(NULL, struct dfs_SetInfo2); + r = talloc(talloc_tos(), struct dfs_SetInfo2); if (r == NULL) { return false; } diff --git a/source3/librpc/gen_ndr/srv_dssetup.c b/source3/librpc/gen_ndr/srv_dssetup.c new file mode 100644 index 0000000000..7a1cae9b5a --- /dev/null +++ b/source3/librpc/gen_ndr/srv_dssetup.c @@ -0,0 +1,845 @@ +/* + * Unix SMB/CIFS implementation. + * server auto-generated by pidl. DO NOT MODIFY! + */ + +#include "includes.h" +#include "librpc/gen_ndr/srv_dssetup.h" + +static bool api_dssetup_DsRoleGetPrimaryDomainInformation(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 dssetup_DsRoleGetPrimaryDomainInformation *r; + + call = &ndr_table_dssetup.calls[NDR_DSSETUP_DSROLEGETPRIMARYDOMAININFORMATION]; + + r = talloc(talloc_tos(), struct dssetup_DsRoleGetPrimaryDomainInformation); + 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(dssetup_DsRoleGetPrimaryDomainInformation, r); + } + + ZERO_STRUCT(r->out); + r->out.info = talloc_zero(r, union dssetup_DsRoleInfo); + if (r->out.info == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _dssetup_DsRoleGetPrimaryDomainInformation(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(dssetup_DsRoleGetPrimaryDomainInformation, 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_dssetup_DsRoleDnsNameToFlatName(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 dssetup_DsRoleDnsNameToFlatName *r; + + call = &ndr_table_dssetup.calls[NDR_DSSETUP_DSROLEDNSNAMETOFLATNAME]; + + r = talloc(talloc_tos(), struct dssetup_DsRoleDnsNameToFlatName); + 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(dssetup_DsRoleDnsNameToFlatName, r); + } + + r->out.result = _dssetup_DsRoleDnsNameToFlatName(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(dssetup_DsRoleDnsNameToFlatName, 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_dssetup_DsRoleDcAsDc(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 dssetup_DsRoleDcAsDc *r; + + call = &ndr_table_dssetup.calls[NDR_DSSETUP_DSROLEDCASDC]; + + r = talloc(talloc_tos(), struct dssetup_DsRoleDcAsDc); + 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(dssetup_DsRoleDcAsDc, r); + } + + r->out.result = _dssetup_DsRoleDcAsDc(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(dssetup_DsRoleDcAsDc, 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_dssetup_DsRoleDcAsReplica(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 dssetup_DsRoleDcAsReplica *r; + + call = &ndr_table_dssetup.calls[NDR_DSSETUP_DSROLEDCASREPLICA]; + + r = talloc(talloc_tos(), struct dssetup_DsRoleDcAsReplica); + 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(dssetup_DsRoleDcAsReplica, r); + } + + r->out.result = _dssetup_DsRoleDcAsReplica(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(dssetup_DsRoleDcAsReplica, 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_dssetup_DsRoleDemoteDc(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 dssetup_DsRoleDemoteDc *r; + + call = &ndr_table_dssetup.calls[NDR_DSSETUP_DSROLEDEMOTEDC]; + + r = talloc(talloc_tos(), struct dssetup_DsRoleDemoteDc); + 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(dssetup_DsRoleDemoteDc, r); + } + + r->out.result = _dssetup_DsRoleDemoteDc(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(dssetup_DsRoleDemoteDc, 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_dssetup_DsRoleGetDcOperationProgress(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 dssetup_DsRoleGetDcOperationProgress *r; + + call = &ndr_table_dssetup.calls[NDR_DSSETUP_DSROLEGETDCOPERATIONPROGRESS]; + + r = talloc(talloc_tos(), struct dssetup_DsRoleGetDcOperationProgress); + 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(dssetup_DsRoleGetDcOperationProgress, r); + } + + r->out.result = _dssetup_DsRoleGetDcOperationProgress(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(dssetup_DsRoleGetDcOperationProgress, 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_dssetup_DsRoleGetDcOperationResults(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 dssetup_DsRoleGetDcOperationResults *r; + + call = &ndr_table_dssetup.calls[NDR_DSSETUP_DSROLEGETDCOPERATIONRESULTS]; + + r = talloc(talloc_tos(), struct dssetup_DsRoleGetDcOperationResults); + 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(dssetup_DsRoleGetDcOperationResults, r); + } + + r->out.result = _dssetup_DsRoleGetDcOperationResults(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(dssetup_DsRoleGetDcOperationResults, 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_dssetup_DsRoleCancel(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 dssetup_DsRoleCancel *r; + + call = &ndr_table_dssetup.calls[NDR_DSSETUP_DSROLECANCEL]; + + r = talloc(talloc_tos(), struct dssetup_DsRoleCancel); + 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(dssetup_DsRoleCancel, r); + } + + r->out.result = _dssetup_DsRoleCancel(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(dssetup_DsRoleCancel, 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_dssetup_DsRoleServerSaveStateForUpgrade(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 dssetup_DsRoleServerSaveStateForUpgrade *r; + + call = &ndr_table_dssetup.calls[NDR_DSSETUP_DSROLESERVERSAVESTATEFORUPGRADE]; + + r = talloc(talloc_tos(), struct dssetup_DsRoleServerSaveStateForUpgrade); + 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(dssetup_DsRoleServerSaveStateForUpgrade, r); + } + + r->out.result = _dssetup_DsRoleServerSaveStateForUpgrade(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(dssetup_DsRoleServerSaveStateForUpgrade, 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_dssetup_DsRoleUpgradeDownlevelServer(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 dssetup_DsRoleUpgradeDownlevelServer *r; + + call = &ndr_table_dssetup.calls[NDR_DSSETUP_DSROLEUPGRADEDOWNLEVELSERVER]; + + r = talloc(talloc_tos(), struct dssetup_DsRoleUpgradeDownlevelServer); + 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(dssetup_DsRoleUpgradeDownlevelServer, r); + } + + r->out.result = _dssetup_DsRoleUpgradeDownlevelServer(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(dssetup_DsRoleUpgradeDownlevelServer, 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_dssetup_DsRoleAbortDownlevelServerUpgrade(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 dssetup_DsRoleAbortDownlevelServerUpgrade *r; + + call = &ndr_table_dssetup.calls[NDR_DSSETUP_DSROLEABORTDOWNLEVELSERVERUPGRADE]; + + r = talloc(talloc_tos(), struct dssetup_DsRoleAbortDownlevelServerUpgrade); + 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(dssetup_DsRoleAbortDownlevelServerUpgrade, r); + } + + r->out.result = _dssetup_DsRoleAbortDownlevelServerUpgrade(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(dssetup_DsRoleAbortDownlevelServerUpgrade, 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_dssetup_cmds[] = +{ + {"DSSETUP_DSROLEGETPRIMARYDOMAININFORMATION", NDR_DSSETUP_DSROLEGETPRIMARYDOMAININFORMATION, api_dssetup_DsRoleGetPrimaryDomainInformation}, + {"DSSETUP_DSROLEDNSNAMETOFLATNAME", NDR_DSSETUP_DSROLEDNSNAMETOFLATNAME, api_dssetup_DsRoleDnsNameToFlatName}, + {"DSSETUP_DSROLEDCASDC", NDR_DSSETUP_DSROLEDCASDC, api_dssetup_DsRoleDcAsDc}, + {"DSSETUP_DSROLEDCASREPLICA", NDR_DSSETUP_DSROLEDCASREPLICA, api_dssetup_DsRoleDcAsReplica}, + {"DSSETUP_DSROLEDEMOTEDC", NDR_DSSETUP_DSROLEDEMOTEDC, api_dssetup_DsRoleDemoteDc}, + {"DSSETUP_DSROLEGETDCOPERATIONPROGRESS", NDR_DSSETUP_DSROLEGETDCOPERATIONPROGRESS, api_dssetup_DsRoleGetDcOperationProgress}, + {"DSSETUP_DSROLEGETDCOPERATIONRESULTS", NDR_DSSETUP_DSROLEGETDCOPERATIONRESULTS, api_dssetup_DsRoleGetDcOperationResults}, + {"DSSETUP_DSROLECANCEL", NDR_DSSETUP_DSROLECANCEL, api_dssetup_DsRoleCancel}, + {"DSSETUP_DSROLESERVERSAVESTATEFORUPGRADE", NDR_DSSETUP_DSROLESERVERSAVESTATEFORUPGRADE, api_dssetup_DsRoleServerSaveStateForUpgrade}, + {"DSSETUP_DSROLEUPGRADEDOWNLEVELSERVER", NDR_DSSETUP_DSROLEUPGRADEDOWNLEVELSERVER, api_dssetup_DsRoleUpgradeDownlevelServer}, + {"DSSETUP_DSROLEABORTDOWNLEVELSERVERUPGRADE", NDR_DSSETUP_DSROLEABORTDOWNLEVELSERVERUPGRADE, api_dssetup_DsRoleAbortDownlevelServerUpgrade}, +}; + +void dssetup_get_pipe_fns(struct api_struct **fns, int *n_fns) +{ + *fns = api_dssetup_cmds; + *n_fns = sizeof(api_dssetup_cmds) / sizeof(struct api_struct); +} + +NTSTATUS rpc_dssetup_init(void) +{ + return rpc_pipe_register_commands(SMB_RPC_INTERFACE_VERSION, "dssetup", "dssetup", api_dssetup_cmds, sizeof(api_dssetup_cmds) / sizeof(struct api_struct)); +} diff --git a/source3/librpc/gen_ndr/srv_dssetup.h b/source3/librpc/gen_ndr/srv_dssetup.h new file mode 100644 index 0000000000..3233899eac --- /dev/null +++ b/source3/librpc/gen_ndr/srv_dssetup.h @@ -0,0 +1,17 @@ +#include "librpc/gen_ndr/ndr_dssetup.h" +#ifndef __SRV_DSSETUP__ +#define __SRV_DSSETUP__ +WERROR _dssetup_DsRoleGetPrimaryDomainInformation(pipes_struct *p, struct dssetup_DsRoleGetPrimaryDomainInformation *r); +WERROR _dssetup_DsRoleDnsNameToFlatName(pipes_struct *p, struct dssetup_DsRoleDnsNameToFlatName *r); +WERROR _dssetup_DsRoleDcAsDc(pipes_struct *p, struct dssetup_DsRoleDcAsDc *r); +WERROR _dssetup_DsRoleDcAsReplica(pipes_struct *p, struct dssetup_DsRoleDcAsReplica *r); +WERROR _dssetup_DsRoleDemoteDc(pipes_struct *p, struct dssetup_DsRoleDemoteDc *r); +WERROR _dssetup_DsRoleGetDcOperationProgress(pipes_struct *p, struct dssetup_DsRoleGetDcOperationProgress *r); +WERROR _dssetup_DsRoleGetDcOperationResults(pipes_struct *p, struct dssetup_DsRoleGetDcOperationResults *r); +WERROR _dssetup_DsRoleCancel(pipes_struct *p, struct dssetup_DsRoleCancel *r); +WERROR _dssetup_DsRoleServerSaveStateForUpgrade(pipes_struct *p, struct dssetup_DsRoleServerSaveStateForUpgrade *r); +WERROR _dssetup_DsRoleUpgradeDownlevelServer(pipes_struct *p, struct dssetup_DsRoleUpgradeDownlevelServer *r); +WERROR _dssetup_DsRoleAbortDownlevelServerUpgrade(pipes_struct *p, struct dssetup_DsRoleAbortDownlevelServerUpgrade *r); +void dssetup_get_pipe_fns(struct api_struct **fns, int *n_fns); +NTSTATUS rpc_dssetup_init(void); +#endif /* __SRV_DSSETUP__ */ diff --git a/source3/librpc/gen_ndr/srv_echo.c b/source3/librpc/gen_ndr/srv_echo.c index de5fc9cd46..3f725049cd 100644 --- a/source3/librpc/gen_ndr/srv_echo.c +++ b/source3/librpc/gen_ndr/srv_echo.c @@ -17,7 +17,7 @@ static bool api_echo_AddOne(pipes_struct *p) call = &ndr_table_rpcecho.calls[NDR_ECHO_ADDONE]; - r = talloc(NULL, struct echo_AddOne); + r = talloc(talloc_tos(), struct echo_AddOne); if (r == NULL) { return false; } @@ -97,7 +97,7 @@ static bool api_echo_EchoData(pipes_struct *p) call = &ndr_table_rpcecho.calls[NDR_ECHO_ECHODATA]; - r = talloc(NULL, struct echo_EchoData); + r = talloc(talloc_tos(), struct echo_EchoData); if (r == NULL) { return false; } @@ -177,7 +177,7 @@ static bool api_echo_SinkData(pipes_struct *p) call = &ndr_table_rpcecho.calls[NDR_ECHO_SINKDATA]; - r = talloc(NULL, struct echo_SinkData); + r = talloc(talloc_tos(), struct echo_SinkData); if (r == NULL) { return false; } @@ -250,7 +250,7 @@ static bool api_echo_SourceData(pipes_struct *p) call = &ndr_table_rpcecho.calls[NDR_ECHO_SOURCEDATA]; - r = talloc(NULL, struct echo_SourceData); + r = talloc(talloc_tos(), struct echo_SourceData); if (r == NULL) { return false; } @@ -330,7 +330,7 @@ static bool api_echo_TestCall(pipes_struct *p) call = &ndr_table_rpcecho.calls[NDR_ECHO_TESTCALL]; - r = talloc(NULL, struct echo_TestCall); + r = talloc(talloc_tos(), struct echo_TestCall); if (r == NULL) { return false; } @@ -410,7 +410,7 @@ static bool api_echo_TestCall2(pipes_struct *p) call = &ndr_table_rpcecho.calls[NDR_ECHO_TESTCALL2]; - r = talloc(NULL, struct echo_TestCall2); + r = talloc(talloc_tos(), struct echo_TestCall2); if (r == NULL) { return false; } @@ -490,7 +490,7 @@ static bool api_echo_TestSleep(pipes_struct *p) call = &ndr_table_rpcecho.calls[NDR_ECHO_TESTSLEEP]; - r = talloc(NULL, struct echo_TestSleep); + r = talloc(talloc_tos(), struct echo_TestSleep); if (r == NULL) { return false; } @@ -563,7 +563,7 @@ static bool api_echo_TestEnum(pipes_struct *p) call = &ndr_table_rpcecho.calls[NDR_ECHO_TESTENUM]; - r = talloc(NULL, struct echo_TestEnum); + r = talloc(talloc_tos(), struct echo_TestEnum); if (r == NULL) { return false; } @@ -640,7 +640,7 @@ static bool api_echo_TestSurrounding(pipes_struct *p) call = &ndr_table_rpcecho.calls[NDR_ECHO_TESTSURROUNDING]; - r = talloc(NULL, struct echo_TestSurrounding); + r = talloc(talloc_tos(), struct echo_TestSurrounding); if (r == NULL) { return false; } @@ -715,7 +715,7 @@ static bool api_echo_TestDoublePointer(pipes_struct *p) call = &ndr_table_rpcecho.calls[NDR_ECHO_TESTDOUBLEPOINTER]; - r = talloc(NULL, struct echo_TestDoublePointer); + r = talloc(talloc_tos(), struct echo_TestDoublePointer); if (r == NULL) { return false; } diff --git a/source3/librpc/gen_ndr/srv_epmapper.c b/source3/librpc/gen_ndr/srv_epmapper.c index af768d9555..e6c89a553f 100644 --- a/source3/librpc/gen_ndr/srv_epmapper.c +++ b/source3/librpc/gen_ndr/srv_epmapper.c @@ -17,7 +17,7 @@ static bool api_epm_Insert(pipes_struct *p) call = &ndr_table_epmapper.calls[NDR_EPM_INSERT]; - r = talloc(NULL, struct epm_Insert); + r = talloc(talloc_tos(), struct epm_Insert); if (r == NULL) { return false; } @@ -90,7 +90,7 @@ static bool api_epm_Delete(pipes_struct *p) call = &ndr_table_epmapper.calls[NDR_EPM_DELETE]; - r = talloc(NULL, struct epm_Delete); + r = talloc(talloc_tos(), struct epm_Delete); if (r == NULL) { return false; } @@ -163,7 +163,7 @@ static bool api_epm_Lookup(pipes_struct *p) call = &ndr_table_epmapper.calls[NDR_EPM_LOOKUP]; - r = talloc(NULL, struct epm_Lookup); + r = talloc(talloc_tos(), struct epm_Lookup); if (r == NULL) { return false; } @@ -250,7 +250,7 @@ static bool api_epm_Map(pipes_struct *p) call = &ndr_table_epmapper.calls[NDR_EPM_MAP]; - r = talloc(NULL, struct epm_Map); + r = talloc(talloc_tos(), struct epm_Map); if (r == NULL) { return false; } @@ -337,7 +337,7 @@ static bool api_epm_LookupHandleFree(pipes_struct *p) call = &ndr_table_epmapper.calls[NDR_EPM_LOOKUPHANDLEFREE]; - r = talloc(NULL, struct epm_LookupHandleFree); + r = talloc(talloc_tos(), struct epm_LookupHandleFree); if (r == NULL) { return false; } @@ -412,7 +412,7 @@ static bool api_epm_InqObject(pipes_struct *p) call = &ndr_table_epmapper.calls[NDR_EPM_INQOBJECT]; - r = talloc(NULL, struct epm_InqObject); + r = talloc(talloc_tos(), struct epm_InqObject); if (r == NULL) { return false; } @@ -485,7 +485,7 @@ static bool api_epm_MgmtDelete(pipes_struct *p) call = &ndr_table_epmapper.calls[NDR_EPM_MGMTDELETE]; - r = talloc(NULL, struct epm_MgmtDelete); + r = talloc(talloc_tos(), struct epm_MgmtDelete); if (r == NULL) { return false; } @@ -558,7 +558,7 @@ static bool api_epm_MapAuth(pipes_struct *p) call = &ndr_table_epmapper.calls[NDR_EPM_MAPAUTH]; - r = talloc(NULL, struct epm_MapAuth); + r = talloc(talloc_tos(), struct epm_MapAuth); if (r == NULL) { return false; } diff --git a/source3/librpc/gen_ndr/srv_eventlog.c b/source3/librpc/gen_ndr/srv_eventlog.c index d9310a8fbb..4d0722bdd7 100644 --- a/source3/librpc/gen_ndr/srv_eventlog.c +++ b/source3/librpc/gen_ndr/srv_eventlog.c @@ -17,7 +17,7 @@ static bool api_eventlog_ClearEventLogW(pipes_struct *p) call = &ndr_table_eventlog.calls[NDR_EVENTLOG_CLEAREVENTLOGW]; - r = talloc(NULL, struct eventlog_ClearEventLogW); + r = talloc(talloc_tos(), struct eventlog_ClearEventLogW); if (r == NULL) { return false; } @@ -90,7 +90,7 @@ static bool api_eventlog_BackupEventLogW(pipes_struct *p) call = &ndr_table_eventlog.calls[NDR_EVENTLOG_BACKUPEVENTLOGW]; - r = talloc(NULL, struct eventlog_BackupEventLogW); + r = talloc(talloc_tos(), struct eventlog_BackupEventLogW); if (r == NULL) { return false; } @@ -163,7 +163,7 @@ static bool api_eventlog_CloseEventLog(pipes_struct *p) call = &ndr_table_eventlog.calls[NDR_EVENTLOG_CLOSEEVENTLOG]; - r = talloc(NULL, struct eventlog_CloseEventLog); + r = talloc(talloc_tos(), struct eventlog_CloseEventLog); if (r == NULL) { return false; } @@ -238,7 +238,7 @@ static bool api_eventlog_DeregisterEventSource(pipes_struct *p) call = &ndr_table_eventlog.calls[NDR_EVENTLOG_DEREGISTEREVENTSOURCE]; - r = talloc(NULL, struct eventlog_DeregisterEventSource); + r = talloc(talloc_tos(), struct eventlog_DeregisterEventSource); if (r == NULL) { return false; } @@ -311,7 +311,7 @@ static bool api_eventlog_GetNumRecords(pipes_struct *p) call = &ndr_table_eventlog.calls[NDR_EVENTLOG_GETNUMRECORDS]; - r = talloc(NULL, struct eventlog_GetNumRecords); + r = talloc(talloc_tos(), struct eventlog_GetNumRecords); if (r == NULL) { return false; } @@ -391,7 +391,7 @@ static bool api_eventlog_GetOldestRecord(pipes_struct *p) call = &ndr_table_eventlog.calls[NDR_EVENTLOG_GETOLDESTRECORD]; - r = talloc(NULL, struct eventlog_GetOldestRecord); + r = talloc(talloc_tos(), struct eventlog_GetOldestRecord); if (r == NULL) { return false; } @@ -418,6 +418,13 @@ static bool api_eventlog_GetOldestRecord(pipes_struct *p) NDR_PRINT_IN_DEBUG(eventlog_GetOldestRecord, r); } + ZERO_STRUCT(r->out); + r->out.oldest_entry = talloc_zero(r, uint32_t); + if (r->out.oldest_entry == NULL) { + talloc_free(r); + return false; + } + r->out.result = _eventlog_GetOldestRecord(p, r); if (p->rng_fault_state) { @@ -464,7 +471,7 @@ static bool api_eventlog_ChangeNotify(pipes_struct *p) call = &ndr_table_eventlog.calls[NDR_EVENTLOG_CHANGENOTIFY]; - r = talloc(NULL, struct eventlog_ChangeNotify); + r = talloc(talloc_tos(), struct eventlog_ChangeNotify); if (r == NULL) { return false; } @@ -537,7 +544,7 @@ static bool api_eventlog_OpenEventLogW(pipes_struct *p) call = &ndr_table_eventlog.calls[NDR_EVENTLOG_OPENEVENTLOGW]; - r = talloc(NULL, struct eventlog_OpenEventLogW); + r = talloc(talloc_tos(), struct eventlog_OpenEventLogW); if (r == NULL) { return false; } @@ -617,7 +624,7 @@ static bool api_eventlog_RegisterEventSourceW(pipes_struct *p) call = &ndr_table_eventlog.calls[NDR_EVENTLOG_REGISTEREVENTSOURCEW]; - r = talloc(NULL, struct eventlog_RegisterEventSourceW); + r = talloc(talloc_tos(), struct eventlog_RegisterEventSourceW); if (r == NULL) { return false; } @@ -690,7 +697,7 @@ static bool api_eventlog_OpenBackupEventLogW(pipes_struct *p) call = &ndr_table_eventlog.calls[NDR_EVENTLOG_OPENBACKUPEVENTLOGW]; - r = talloc(NULL, struct eventlog_OpenBackupEventLogW); + r = talloc(talloc_tos(), struct eventlog_OpenBackupEventLogW); if (r == NULL) { return false; } @@ -763,7 +770,7 @@ static bool api_eventlog_ReadEventLogW(pipes_struct *p) call = &ndr_table_eventlog.calls[NDR_EVENTLOG_READEVENTLOGW]; - r = talloc(NULL, struct eventlog_ReadEventLogW); + r = talloc(talloc_tos(), struct eventlog_ReadEventLogW); if (r == NULL) { return false; } @@ -855,7 +862,7 @@ static bool api_eventlog_ReportEventW(pipes_struct *p) call = &ndr_table_eventlog.calls[NDR_EVENTLOG_REPORTEVENTW]; - r = talloc(NULL, struct eventlog_ReportEventW); + r = talloc(talloc_tos(), struct eventlog_ReportEventW); if (r == NULL) { return false; } @@ -928,7 +935,7 @@ static bool api_eventlog_ClearEventLogA(pipes_struct *p) call = &ndr_table_eventlog.calls[NDR_EVENTLOG_CLEAREVENTLOGA]; - r = talloc(NULL, struct eventlog_ClearEventLogA); + r = talloc(talloc_tos(), struct eventlog_ClearEventLogA); if (r == NULL) { return false; } @@ -1001,7 +1008,7 @@ static bool api_eventlog_BackupEventLogA(pipes_struct *p) call = &ndr_table_eventlog.calls[NDR_EVENTLOG_BACKUPEVENTLOGA]; - r = talloc(NULL, struct eventlog_BackupEventLogA); + r = talloc(talloc_tos(), struct eventlog_BackupEventLogA); if (r == NULL) { return false; } @@ -1074,7 +1081,7 @@ static bool api_eventlog_OpenEventLogA(pipes_struct *p) call = &ndr_table_eventlog.calls[NDR_EVENTLOG_OPENEVENTLOGA]; - r = talloc(NULL, struct eventlog_OpenEventLogA); + r = talloc(talloc_tos(), struct eventlog_OpenEventLogA); if (r == NULL) { return false; } @@ -1147,7 +1154,7 @@ static bool api_eventlog_RegisterEventSourceA(pipes_struct *p) call = &ndr_table_eventlog.calls[NDR_EVENTLOG_REGISTEREVENTSOURCEA]; - r = talloc(NULL, struct eventlog_RegisterEventSourceA); + r = talloc(talloc_tos(), struct eventlog_RegisterEventSourceA); if (r == NULL) { return false; } @@ -1220,7 +1227,7 @@ static bool api_eventlog_OpenBackupEventLogA(pipes_struct *p) call = &ndr_table_eventlog.calls[NDR_EVENTLOG_OPENBACKUPEVENTLOGA]; - r = talloc(NULL, struct eventlog_OpenBackupEventLogA); + r = talloc(talloc_tos(), struct eventlog_OpenBackupEventLogA); if (r == NULL) { return false; } @@ -1293,7 +1300,7 @@ static bool api_eventlog_ReadEventLogA(pipes_struct *p) call = &ndr_table_eventlog.calls[NDR_EVENTLOG_READEVENTLOGA]; - r = talloc(NULL, struct eventlog_ReadEventLogA); + r = talloc(talloc_tos(), struct eventlog_ReadEventLogA); if (r == NULL) { return false; } @@ -1366,7 +1373,7 @@ static bool api_eventlog_ReportEventA(pipes_struct *p) call = &ndr_table_eventlog.calls[NDR_EVENTLOG_REPORTEVENTA]; - r = talloc(NULL, struct eventlog_ReportEventA); + r = talloc(talloc_tos(), struct eventlog_ReportEventA); if (r == NULL) { return false; } @@ -1439,7 +1446,7 @@ static bool api_eventlog_RegisterClusterSvc(pipes_struct *p) call = &ndr_table_eventlog.calls[NDR_EVENTLOG_REGISTERCLUSTERSVC]; - r = talloc(NULL, struct eventlog_RegisterClusterSvc); + r = talloc(talloc_tos(), struct eventlog_RegisterClusterSvc); if (r == NULL) { return false; } @@ -1512,7 +1519,7 @@ static bool api_eventlog_DeregisterClusterSvc(pipes_struct *p) call = &ndr_table_eventlog.calls[NDR_EVENTLOG_DEREGISTERCLUSTERSVC]; - r = talloc(NULL, struct eventlog_DeregisterClusterSvc); + r = talloc(talloc_tos(), struct eventlog_DeregisterClusterSvc); if (r == NULL) { return false; } @@ -1585,7 +1592,7 @@ static bool api_eventlog_WriteClusterEvents(pipes_struct *p) call = &ndr_table_eventlog.calls[NDR_EVENTLOG_WRITECLUSTEREVENTS]; - r = talloc(NULL, struct eventlog_WriteClusterEvents); + r = talloc(talloc_tos(), struct eventlog_WriteClusterEvents); if (r == NULL) { return false; } @@ -1658,7 +1665,7 @@ static bool api_eventlog_GetLogIntormation(pipes_struct *p) call = &ndr_table_eventlog.calls[NDR_EVENTLOG_GETLOGINTORMATION]; - r = talloc(NULL, struct eventlog_GetLogIntormation); + r = talloc(talloc_tos(), struct eventlog_GetLogIntormation); if (r == NULL) { return false; } @@ -1731,7 +1738,7 @@ static bool api_eventlog_FlushEventLog(pipes_struct *p) call = &ndr_table_eventlog.calls[NDR_EVENTLOG_FLUSHEVENTLOG]; - r = talloc(NULL, struct eventlog_FlushEventLog); + r = talloc(talloc_tos(), struct eventlog_FlushEventLog); if (r == NULL) { return false; } diff --git a/source3/librpc/gen_ndr/srv_initshutdown.c b/source3/librpc/gen_ndr/srv_initshutdown.c index 794adea81b..f24530c1c1 100644 --- a/source3/librpc/gen_ndr/srv_initshutdown.c +++ b/source3/librpc/gen_ndr/srv_initshutdown.c @@ -17,7 +17,7 @@ static bool api_initshutdown_Init(pipes_struct *p) call = &ndr_table_initshutdown.calls[NDR_INITSHUTDOWN_INIT]; - r = talloc(NULL, struct initshutdown_Init); + r = talloc(talloc_tos(), struct initshutdown_Init); if (r == NULL) { return false; } @@ -90,7 +90,7 @@ static bool api_initshutdown_Abort(pipes_struct *p) call = &ndr_table_initshutdown.calls[NDR_INITSHUTDOWN_ABORT]; - r = talloc(NULL, struct initshutdown_Abort); + r = talloc(talloc_tos(), struct initshutdown_Abort); if (r == NULL) { return false; } @@ -163,7 +163,7 @@ static bool api_initshutdown_InitEx(pipes_struct *p) call = &ndr_table_initshutdown.calls[NDR_INITSHUTDOWN_INITEX]; - r = talloc(NULL, struct initshutdown_InitEx); + r = talloc(talloc_tos(), struct initshutdown_InitEx); if (r == NULL) { return false; } diff --git a/source3/librpc/gen_ndr/srv_lsa.c b/source3/librpc/gen_ndr/srv_lsa.c index 68dc32cef5..1ce0448469 100644 --- a/source3/librpc/gen_ndr/srv_lsa.c +++ b/source3/librpc/gen_ndr/srv_lsa.c @@ -17,7 +17,7 @@ static bool api_lsa_Close(pipes_struct *p) call = &ndr_table_lsarpc.calls[NDR_LSA_CLOSE]; - r = talloc(NULL, struct lsa_Close); + r = talloc(talloc_tos(), struct lsa_Close); if (r == NULL) { return false; } @@ -92,7 +92,7 @@ static bool api_lsa_Delete(pipes_struct *p) call = &ndr_table_lsarpc.calls[NDR_LSA_DELETE]; - r = talloc(NULL, struct lsa_Delete); + r = talloc(talloc_tos(), struct lsa_Delete); if (r == NULL) { return false; } @@ -165,7 +165,7 @@ static bool api_lsa_EnumPrivs(pipes_struct *p) call = &ndr_table_lsarpc.calls[NDR_LSA_ENUMPRIVS]; - r = talloc(NULL, struct lsa_EnumPrivs); + r = talloc(talloc_tos(), struct lsa_EnumPrivs); if (r == NULL) { return false; } @@ -246,7 +246,7 @@ static bool api_lsa_QuerySecurity(pipes_struct *p) call = &ndr_table_lsarpc.calls[NDR_LSA_QUERYSECURITY]; - r = talloc(NULL, struct lsa_QuerySecurity); + r = talloc(talloc_tos(), struct lsa_QuerySecurity); if (r == NULL) { return false; } @@ -274,7 +274,7 @@ static bool api_lsa_QuerySecurity(pipes_struct *p) } ZERO_STRUCT(r->out); - r->out.sdbuf = talloc_zero(r, struct sec_desc_buf); + r->out.sdbuf = talloc_zero(r, struct sec_desc_buf *); if (r->out.sdbuf == NULL) { talloc_free(r); return false; @@ -326,7 +326,7 @@ static bool api_lsa_SetSecObj(pipes_struct *p) call = &ndr_table_lsarpc.calls[NDR_LSA_SETSECOBJ]; - r = talloc(NULL, struct lsa_SetSecObj); + r = talloc(talloc_tos(), struct lsa_SetSecObj); if (r == NULL) { return false; } @@ -399,7 +399,7 @@ static bool api_lsa_ChangePassword(pipes_struct *p) call = &ndr_table_lsarpc.calls[NDR_LSA_CHANGEPASSWORD]; - r = talloc(NULL, struct lsa_ChangePassword); + r = talloc(talloc_tos(), struct lsa_ChangePassword); if (r == NULL) { return false; } @@ -472,7 +472,7 @@ static bool api_lsa_OpenPolicy(pipes_struct *p) call = &ndr_table_lsarpc.calls[NDR_LSA_OPENPOLICY]; - r = talloc(NULL, struct lsa_OpenPolicy); + r = talloc(talloc_tos(), struct lsa_OpenPolicy); if (r == NULL) { return false; } @@ -552,7 +552,7 @@ static bool api_lsa_QueryInfoPolicy(pipes_struct *p) call = &ndr_table_lsarpc.calls[NDR_LSA_QUERYINFOPOLICY]; - r = talloc(NULL, struct lsa_QueryInfoPolicy); + r = talloc(talloc_tos(), struct lsa_QueryInfoPolicy); if (r == NULL) { return false; } @@ -580,7 +580,7 @@ static bool api_lsa_QueryInfoPolicy(pipes_struct *p) } ZERO_STRUCT(r->out); - r->out.info = talloc_zero(r, union lsa_PolicyInformation); + r->out.info = talloc_zero(r, union lsa_PolicyInformation *); if (r->out.info == NULL) { talloc_free(r); return false; @@ -632,7 +632,7 @@ static bool api_lsa_SetInfoPolicy(pipes_struct *p) call = &ndr_table_lsarpc.calls[NDR_LSA_SETINFOPOLICY]; - r = talloc(NULL, struct lsa_SetInfoPolicy); + r = talloc(talloc_tos(), struct lsa_SetInfoPolicy); if (r == NULL) { return false; } @@ -705,7 +705,7 @@ static bool api_lsa_ClearAuditLog(pipes_struct *p) call = &ndr_table_lsarpc.calls[NDR_LSA_CLEARAUDITLOG]; - r = talloc(NULL, struct lsa_ClearAuditLog); + r = talloc(talloc_tos(), struct lsa_ClearAuditLog); if (r == NULL) { return false; } @@ -778,7 +778,7 @@ static bool api_lsa_CreateAccount(pipes_struct *p) call = &ndr_table_lsarpc.calls[NDR_LSA_CREATEACCOUNT]; - r = talloc(NULL, struct lsa_CreateAccount); + r = talloc(talloc_tos(), struct lsa_CreateAccount); if (r == NULL) { return false; } @@ -858,7 +858,7 @@ static bool api_lsa_EnumAccounts(pipes_struct *p) call = &ndr_table_lsarpc.calls[NDR_LSA_ENUMACCOUNTS]; - r = talloc(NULL, struct lsa_EnumAccounts); + r = talloc(talloc_tos(), struct lsa_EnumAccounts); if (r == NULL) { return false; } @@ -939,7 +939,7 @@ static bool api_lsa_CreateTrustedDomain(pipes_struct *p) call = &ndr_table_lsarpc.calls[NDR_LSA_CREATETRUSTEDDOMAIN]; - r = talloc(NULL, struct lsa_CreateTrustedDomain); + r = talloc(talloc_tos(), struct lsa_CreateTrustedDomain); if (r == NULL) { return false; } @@ -1019,7 +1019,7 @@ static bool api_lsa_EnumTrustDom(pipes_struct *p) call = &ndr_table_lsarpc.calls[NDR_LSA_ENUMTRUSTDOM]; - r = talloc(NULL, struct lsa_EnumTrustDom); + r = talloc(talloc_tos(), struct lsa_EnumTrustDom); if (r == NULL) { return false; } @@ -1100,7 +1100,7 @@ static bool api_lsa_LookupNames(pipes_struct *p) call = &ndr_table_lsarpc.calls[NDR_LSA_LOOKUPNAMES]; - r = talloc(NULL, struct lsa_LookupNames); + r = talloc(talloc_tos(), struct lsa_LookupNames); if (r == NULL) { return false; } @@ -1128,7 +1128,7 @@ static bool api_lsa_LookupNames(pipes_struct *p) } ZERO_STRUCT(r->out); - r->out.domains = talloc_zero(r, struct lsa_RefDomainList); + r->out.domains = talloc_zero(r, struct lsa_RefDomainList *); if (r->out.domains == NULL) { talloc_free(r); return false; @@ -1182,7 +1182,7 @@ static bool api_lsa_LookupSids(pipes_struct *p) call = &ndr_table_lsarpc.calls[NDR_LSA_LOOKUPSIDS]; - r = talloc(NULL, struct lsa_LookupSids); + r = talloc(talloc_tos(), struct lsa_LookupSids); if (r == NULL) { return false; } @@ -1210,7 +1210,7 @@ static bool api_lsa_LookupSids(pipes_struct *p) } ZERO_STRUCT(r->out); - r->out.domains = talloc_zero(r, struct lsa_RefDomainList); + r->out.domains = talloc_zero(r, struct lsa_RefDomainList *); if (r->out.domains == NULL) { talloc_free(r); return false; @@ -1264,7 +1264,7 @@ static bool api_lsa_CreateSecret(pipes_struct *p) call = &ndr_table_lsarpc.calls[NDR_LSA_CREATESECRET]; - r = talloc(NULL, struct lsa_CreateSecret); + r = talloc(talloc_tos(), struct lsa_CreateSecret); if (r == NULL) { return false; } @@ -1344,7 +1344,7 @@ static bool api_lsa_OpenAccount(pipes_struct *p) call = &ndr_table_lsarpc.calls[NDR_LSA_OPENACCOUNT]; - r = talloc(NULL, struct lsa_OpenAccount); + r = talloc(talloc_tos(), struct lsa_OpenAccount); if (r == NULL) { return false; } @@ -1424,7 +1424,7 @@ static bool api_lsa_EnumPrivsAccount(pipes_struct *p) call = &ndr_table_lsarpc.calls[NDR_LSA_ENUMPRIVSACCOUNT]; - r = talloc(NULL, struct lsa_EnumPrivsAccount); + r = talloc(talloc_tos(), struct lsa_EnumPrivsAccount); if (r == NULL) { return false; } @@ -1452,7 +1452,7 @@ static bool api_lsa_EnumPrivsAccount(pipes_struct *p) } ZERO_STRUCT(r->out); - r->out.privs = talloc_zero(r, struct lsa_PrivilegeSet); + r->out.privs = talloc_zero(r, struct lsa_PrivilegeSet *); if (r->out.privs == NULL) { talloc_free(r); return false; @@ -1504,7 +1504,7 @@ static bool api_lsa_AddPrivilegesToAccount(pipes_struct *p) call = &ndr_table_lsarpc.calls[NDR_LSA_ADDPRIVILEGESTOACCOUNT]; - r = talloc(NULL, struct lsa_AddPrivilegesToAccount); + r = talloc(talloc_tos(), struct lsa_AddPrivilegesToAccount); if (r == NULL) { return false; } @@ -1577,7 +1577,7 @@ static bool api_lsa_RemovePrivilegesFromAccount(pipes_struct *p) call = &ndr_table_lsarpc.calls[NDR_LSA_REMOVEPRIVILEGESFROMACCOUNT]; - r = talloc(NULL, struct lsa_RemovePrivilegesFromAccount); + r = talloc(talloc_tos(), struct lsa_RemovePrivilegesFromAccount); if (r == NULL) { return false; } @@ -1650,7 +1650,7 @@ static bool api_lsa_GetQuotasForAccount(pipes_struct *p) call = &ndr_table_lsarpc.calls[NDR_LSA_GETQUOTASFORACCOUNT]; - r = talloc(NULL, struct lsa_GetQuotasForAccount); + r = talloc(talloc_tos(), struct lsa_GetQuotasForAccount); if (r == NULL) { return false; } @@ -1723,7 +1723,7 @@ static bool api_lsa_SetQuotasForAccount(pipes_struct *p) call = &ndr_table_lsarpc.calls[NDR_LSA_SETQUOTASFORACCOUNT]; - r = talloc(NULL, struct lsa_SetQuotasForAccount); + r = talloc(talloc_tos(), struct lsa_SetQuotasForAccount); if (r == NULL) { return false; } @@ -1796,7 +1796,7 @@ static bool api_lsa_GetSystemAccessAccount(pipes_struct *p) call = &ndr_table_lsarpc.calls[NDR_LSA_GETSYSTEMACCESSACCOUNT]; - r = talloc(NULL, struct lsa_GetSystemAccessAccount); + r = talloc(talloc_tos(), struct lsa_GetSystemAccessAccount); if (r == NULL) { return false; } @@ -1823,6 +1823,13 @@ static bool api_lsa_GetSystemAccessAccount(pipes_struct *p) NDR_PRINT_IN_DEBUG(lsa_GetSystemAccessAccount, r); } + ZERO_STRUCT(r->out); + r->out.access_mask = talloc_zero(r, uint32_t); + if (r->out.access_mask == NULL) { + talloc_free(r); + return false; + } + r->out.result = _lsa_GetSystemAccessAccount(p, r); if (p->rng_fault_state) { @@ -1869,7 +1876,7 @@ static bool api_lsa_SetSystemAccessAccount(pipes_struct *p) call = &ndr_table_lsarpc.calls[NDR_LSA_SETSYSTEMACCESSACCOUNT]; - r = talloc(NULL, struct lsa_SetSystemAccessAccount); + r = talloc(talloc_tos(), struct lsa_SetSystemAccessAccount); if (r == NULL) { return false; } @@ -1942,7 +1949,7 @@ static bool api_lsa_OpenTrustedDomain(pipes_struct *p) call = &ndr_table_lsarpc.calls[NDR_LSA_OPENTRUSTEDDOMAIN]; - r = talloc(NULL, struct lsa_OpenTrustedDomain); + r = talloc(talloc_tos(), struct lsa_OpenTrustedDomain); if (r == NULL) { return false; } @@ -2022,7 +2029,7 @@ static bool api_lsa_QueryTrustedDomainInfo(pipes_struct *p) call = &ndr_table_lsarpc.calls[NDR_LSA_QUERYTRUSTEDDOMAININFO]; - r = talloc(NULL, struct lsa_QueryTrustedDomainInfo); + r = talloc(talloc_tos(), struct lsa_QueryTrustedDomainInfo); if (r == NULL) { return false; } @@ -2102,7 +2109,7 @@ static bool api_lsa_SetInformationTrustedDomain(pipes_struct *p) call = &ndr_table_lsarpc.calls[NDR_LSA_SETINFORMATIONTRUSTEDDOMAIN]; - r = talloc(NULL, struct lsa_SetInformationTrustedDomain); + r = talloc(talloc_tos(), struct lsa_SetInformationTrustedDomain); if (r == NULL) { return false; } @@ -2175,7 +2182,7 @@ static bool api_lsa_OpenSecret(pipes_struct *p) call = &ndr_table_lsarpc.calls[NDR_LSA_OPENSECRET]; - r = talloc(NULL, struct lsa_OpenSecret); + r = talloc(talloc_tos(), struct lsa_OpenSecret); if (r == NULL) { return false; } @@ -2255,7 +2262,7 @@ static bool api_lsa_SetSecret(pipes_struct *p) call = &ndr_table_lsarpc.calls[NDR_LSA_SETSECRET]; - r = talloc(NULL, struct lsa_SetSecret); + r = talloc(talloc_tos(), struct lsa_SetSecret); if (r == NULL) { return false; } @@ -2328,7 +2335,7 @@ static bool api_lsa_QuerySecret(pipes_struct *p) call = &ndr_table_lsarpc.calls[NDR_LSA_QUERYSECRET]; - r = talloc(NULL, struct lsa_QuerySecret); + r = talloc(talloc_tos(), struct lsa_QuerySecret); if (r == NULL) { return false; } @@ -2406,7 +2413,7 @@ static bool api_lsa_LookupPrivValue(pipes_struct *p) call = &ndr_table_lsarpc.calls[NDR_LSA_LOOKUPPRIVVALUE]; - r = talloc(NULL, struct lsa_LookupPrivValue); + r = talloc(talloc_tos(), struct lsa_LookupPrivValue); if (r == NULL) { return false; } @@ -2486,7 +2493,7 @@ static bool api_lsa_LookupPrivName(pipes_struct *p) call = &ndr_table_lsarpc.calls[NDR_LSA_LOOKUPPRIVNAME]; - r = talloc(NULL, struct lsa_LookupPrivName); + r = talloc(talloc_tos(), struct lsa_LookupPrivName); if (r == NULL) { return false; } @@ -2566,7 +2573,7 @@ static bool api_lsa_LookupPrivDisplayName(pipes_struct *p) call = &ndr_table_lsarpc.calls[NDR_LSA_LOOKUPPRIVDISPLAYNAME]; - r = talloc(NULL, struct lsa_LookupPrivDisplayName); + r = talloc(talloc_tos(), struct lsa_LookupPrivDisplayName); if (r == NULL) { return false; } @@ -2594,13 +2601,18 @@ static bool api_lsa_LookupPrivDisplayName(pipes_struct *p) } ZERO_STRUCT(r->out); - r->out.disp_name = talloc_zero(r, struct lsa_StringLarge); + r->out.disp_name = talloc_zero(r, struct lsa_StringLarge *); if (r->out.disp_name == NULL) { talloc_free(r); return false; } - r->out.language_id = r->in.language_id; + r->out.returned_language_id = talloc_zero(r, uint16_t); + if (r->out.returned_language_id == NULL) { + talloc_free(r); + return false; + } + r->out.result = _lsa_LookupPrivDisplayName(p, r); if (p->rng_fault_state) { @@ -2647,7 +2659,7 @@ static bool api_lsa_DeleteObject(pipes_struct *p) call = &ndr_table_lsarpc.calls[NDR_LSA_DELETEOBJECT]; - r = talloc(NULL, struct lsa_DeleteObject); + r = talloc(talloc_tos(), struct lsa_DeleteObject); if (r == NULL) { return false; } @@ -2674,6 +2686,8 @@ static bool api_lsa_DeleteObject(pipes_struct *p) NDR_PRINT_IN_DEBUG(lsa_DeleteObject, r); } + ZERO_STRUCT(r->out); + r->out.handle = r->in.handle; r->out.result = _lsa_DeleteObject(p, r); if (p->rng_fault_state) { @@ -2720,7 +2734,7 @@ static bool api_lsa_EnumAccountsWithUserRight(pipes_struct *p) call = &ndr_table_lsarpc.calls[NDR_LSA_ENUMACCOUNTSWITHUSERRIGHT]; - r = talloc(NULL, struct lsa_EnumAccountsWithUserRight); + r = talloc(talloc_tos(), struct lsa_EnumAccountsWithUserRight); if (r == NULL) { return false; } @@ -2800,7 +2814,7 @@ static bool api_lsa_EnumAccountRights(pipes_struct *p) call = &ndr_table_lsarpc.calls[NDR_LSA_ENUMACCOUNTRIGHTS]; - r = talloc(NULL, struct lsa_EnumAccountRights); + r = talloc(talloc_tos(), struct lsa_EnumAccountRights); if (r == NULL) { return false; } @@ -2880,7 +2894,7 @@ static bool api_lsa_AddAccountRights(pipes_struct *p) call = &ndr_table_lsarpc.calls[NDR_LSA_ADDACCOUNTRIGHTS]; - r = talloc(NULL, struct lsa_AddAccountRights); + r = talloc(talloc_tos(), struct lsa_AddAccountRights); if (r == NULL) { return false; } @@ -2953,7 +2967,7 @@ static bool api_lsa_RemoveAccountRights(pipes_struct *p) call = &ndr_table_lsarpc.calls[NDR_LSA_REMOVEACCOUNTRIGHTS]; - r = talloc(NULL, struct lsa_RemoveAccountRights); + r = talloc(talloc_tos(), struct lsa_RemoveAccountRights); if (r == NULL) { return false; } @@ -3026,7 +3040,7 @@ static bool api_lsa_QueryTrustedDomainInfoBySid(pipes_struct *p) call = &ndr_table_lsarpc.calls[NDR_LSA_QUERYTRUSTEDDOMAININFOBYSID]; - r = talloc(NULL, struct lsa_QueryTrustedDomainInfoBySid); + r = talloc(talloc_tos(), struct lsa_QueryTrustedDomainInfoBySid); if (r == NULL) { return false; } @@ -3106,7 +3120,7 @@ static bool api_lsa_SetTrustedDomainInfo(pipes_struct *p) call = &ndr_table_lsarpc.calls[NDR_LSA_SETTRUSTEDDOMAININFO]; - r = talloc(NULL, struct lsa_SetTrustedDomainInfo); + r = talloc(talloc_tos(), struct lsa_SetTrustedDomainInfo); if (r == NULL) { return false; } @@ -3179,7 +3193,7 @@ static bool api_lsa_DeleteTrustedDomain(pipes_struct *p) call = &ndr_table_lsarpc.calls[NDR_LSA_DELETETRUSTEDDOMAIN]; - r = talloc(NULL, struct lsa_DeleteTrustedDomain); + r = talloc(talloc_tos(), struct lsa_DeleteTrustedDomain); if (r == NULL) { return false; } @@ -3252,7 +3266,7 @@ static bool api_lsa_StorePrivateData(pipes_struct *p) call = &ndr_table_lsarpc.calls[NDR_LSA_STOREPRIVATEDATA]; - r = talloc(NULL, struct lsa_StorePrivateData); + r = talloc(talloc_tos(), struct lsa_StorePrivateData); if (r == NULL) { return false; } @@ -3325,7 +3339,7 @@ static bool api_lsa_RetrievePrivateData(pipes_struct *p) call = &ndr_table_lsarpc.calls[NDR_LSA_RETRIEVEPRIVATEDATA]; - r = talloc(NULL, struct lsa_RetrievePrivateData); + r = talloc(talloc_tos(), struct lsa_RetrievePrivateData); if (r == NULL) { return false; } @@ -3398,7 +3412,7 @@ static bool api_lsa_OpenPolicy2(pipes_struct *p) call = &ndr_table_lsarpc.calls[NDR_LSA_OPENPOLICY2]; - r = talloc(NULL, struct lsa_OpenPolicy2); + r = talloc(talloc_tos(), struct lsa_OpenPolicy2); if (r == NULL) { return false; } @@ -3478,7 +3492,7 @@ static bool api_lsa_GetUserName(pipes_struct *p) call = &ndr_table_lsarpc.calls[NDR_LSA_GETUSERNAME]; - r = talloc(NULL, struct lsa_GetUserName); + r = talloc(talloc_tos(), struct lsa_GetUserName); if (r == NULL) { return false; } @@ -3554,7 +3568,7 @@ static bool api_lsa_QueryInfoPolicy2(pipes_struct *p) call = &ndr_table_lsarpc.calls[NDR_LSA_QUERYINFOPOLICY2]; - r = talloc(NULL, struct lsa_QueryInfoPolicy2); + r = talloc(talloc_tos(), struct lsa_QueryInfoPolicy2); if (r == NULL) { return false; } @@ -3582,7 +3596,7 @@ static bool api_lsa_QueryInfoPolicy2(pipes_struct *p) } ZERO_STRUCT(r->out); - r->out.info = talloc_zero(r, union lsa_PolicyInformation); + r->out.info = talloc_zero(r, union lsa_PolicyInformation *); if (r->out.info == NULL) { talloc_free(r); return false; @@ -3634,7 +3648,7 @@ static bool api_lsa_SetInfoPolicy2(pipes_struct *p) call = &ndr_table_lsarpc.calls[NDR_LSA_SETINFOPOLICY2]; - r = talloc(NULL, struct lsa_SetInfoPolicy2); + r = talloc(talloc_tos(), struct lsa_SetInfoPolicy2); if (r == NULL) { return false; } @@ -3707,7 +3721,7 @@ static bool api_lsa_QueryTrustedDomainInfoByName(pipes_struct *p) call = &ndr_table_lsarpc.calls[NDR_LSA_QUERYTRUSTEDDOMAININFOBYNAME]; - r = talloc(NULL, struct lsa_QueryTrustedDomainInfoByName); + r = talloc(talloc_tos(), struct lsa_QueryTrustedDomainInfoByName); if (r == NULL) { return false; } @@ -3787,7 +3801,7 @@ static bool api_lsa_SetTrustedDomainInfoByName(pipes_struct *p) call = &ndr_table_lsarpc.calls[NDR_LSA_SETTRUSTEDDOMAININFOBYNAME]; - r = talloc(NULL, struct lsa_SetTrustedDomainInfoByName); + r = talloc(talloc_tos(), struct lsa_SetTrustedDomainInfoByName); if (r == NULL) { return false; } @@ -3860,7 +3874,7 @@ static bool api_lsa_EnumTrustedDomainsEx(pipes_struct *p) call = &ndr_table_lsarpc.calls[NDR_LSA_ENUMTRUSTEDDOMAINSEX]; - r = talloc(NULL, struct lsa_EnumTrustedDomainsEx); + r = talloc(talloc_tos(), struct lsa_EnumTrustedDomainsEx); if (r == NULL) { return false; } @@ -3941,7 +3955,7 @@ static bool api_lsa_CreateTrustedDomainEx(pipes_struct *p) call = &ndr_table_lsarpc.calls[NDR_LSA_CREATETRUSTEDDOMAINEX]; - r = talloc(NULL, struct lsa_CreateTrustedDomainEx); + r = talloc(talloc_tos(), struct lsa_CreateTrustedDomainEx); if (r == NULL) { return false; } @@ -4014,7 +4028,7 @@ static bool api_lsa_CloseTrustedDomainEx(pipes_struct *p) call = &ndr_table_lsarpc.calls[NDR_LSA_CLOSETRUSTEDDOMAINEX]; - r = talloc(NULL, struct lsa_CloseTrustedDomainEx); + r = talloc(talloc_tos(), struct lsa_CloseTrustedDomainEx); if (r == NULL) { return false; } @@ -4089,7 +4103,7 @@ static bool api_lsa_QueryDomainInformationPolicy(pipes_struct *p) call = &ndr_table_lsarpc.calls[NDR_LSA_QUERYDOMAININFORMATIONPOLICY]; - r = talloc(NULL, struct lsa_QueryDomainInformationPolicy); + r = talloc(talloc_tos(), struct lsa_QueryDomainInformationPolicy); if (r == NULL) { return false; } @@ -4169,7 +4183,7 @@ static bool api_lsa_SetDomainInformationPolicy(pipes_struct *p) call = &ndr_table_lsarpc.calls[NDR_LSA_SETDOMAININFORMATIONPOLICY]; - r = talloc(NULL, struct lsa_SetDomainInformationPolicy); + r = talloc(talloc_tos(), struct lsa_SetDomainInformationPolicy); if (r == NULL) { return false; } @@ -4242,7 +4256,7 @@ static bool api_lsa_OpenTrustedDomainByName(pipes_struct *p) call = &ndr_table_lsarpc.calls[NDR_LSA_OPENTRUSTEDDOMAINBYNAME]; - r = talloc(NULL, struct lsa_OpenTrustedDomainByName); + r = talloc(talloc_tos(), struct lsa_OpenTrustedDomainByName); if (r == NULL) { return false; } @@ -4322,7 +4336,7 @@ static bool api_lsa_TestCall(pipes_struct *p) call = &ndr_table_lsarpc.calls[NDR_LSA_TESTCALL]; - r = talloc(NULL, struct lsa_TestCall); + r = talloc(talloc_tos(), struct lsa_TestCall); if (r == NULL) { return false; } @@ -4395,7 +4409,7 @@ static bool api_lsa_LookupSids2(pipes_struct *p) call = &ndr_table_lsarpc.calls[NDR_LSA_LOOKUPSIDS2]; - r = talloc(NULL, struct lsa_LookupSids2); + r = talloc(talloc_tos(), struct lsa_LookupSids2); if (r == NULL) { return false; } @@ -4423,7 +4437,7 @@ static bool api_lsa_LookupSids2(pipes_struct *p) } ZERO_STRUCT(r->out); - r->out.domains = talloc_zero(r, struct lsa_RefDomainList); + r->out.domains = talloc_zero(r, struct lsa_RefDomainList *); if (r->out.domains == NULL) { talloc_free(r); return false; @@ -4477,7 +4491,7 @@ static bool api_lsa_LookupNames2(pipes_struct *p) call = &ndr_table_lsarpc.calls[NDR_LSA_LOOKUPNAMES2]; - r = talloc(NULL, struct lsa_LookupNames2); + r = talloc(talloc_tos(), struct lsa_LookupNames2); if (r == NULL) { return false; } @@ -4505,7 +4519,7 @@ static bool api_lsa_LookupNames2(pipes_struct *p) } ZERO_STRUCT(r->out); - r->out.domains = talloc_zero(r, struct lsa_RefDomainList); + r->out.domains = talloc_zero(r, struct lsa_RefDomainList *); if (r->out.domains == NULL) { talloc_free(r); return false; @@ -4559,7 +4573,7 @@ static bool api_lsa_CreateTrustedDomainEx2(pipes_struct *p) call = &ndr_table_lsarpc.calls[NDR_LSA_CREATETRUSTEDDOMAINEX2]; - r = talloc(NULL, struct lsa_CreateTrustedDomainEx2); + r = talloc(talloc_tos(), struct lsa_CreateTrustedDomainEx2); if (r == NULL) { return false; } @@ -4632,7 +4646,7 @@ static bool api_lsa_CREDRWRITE(pipes_struct *p) call = &ndr_table_lsarpc.calls[NDR_LSA_CREDRWRITE]; - r = talloc(NULL, struct lsa_CREDRWRITE); + r = talloc(talloc_tos(), struct lsa_CREDRWRITE); if (r == NULL) { return false; } @@ -4705,7 +4719,7 @@ static bool api_lsa_CREDRREAD(pipes_struct *p) call = &ndr_table_lsarpc.calls[NDR_LSA_CREDRREAD]; - r = talloc(NULL, struct lsa_CREDRREAD); + r = talloc(talloc_tos(), struct lsa_CREDRREAD); if (r == NULL) { return false; } @@ -4778,7 +4792,7 @@ static bool api_lsa_CREDRENUMERATE(pipes_struct *p) call = &ndr_table_lsarpc.calls[NDR_LSA_CREDRENUMERATE]; - r = talloc(NULL, struct lsa_CREDRENUMERATE); + r = talloc(talloc_tos(), struct lsa_CREDRENUMERATE); if (r == NULL) { return false; } @@ -4851,7 +4865,7 @@ static bool api_lsa_CREDRWRITEDOMAINCREDENTIALS(pipes_struct *p) call = &ndr_table_lsarpc.calls[NDR_LSA_CREDRWRITEDOMAINCREDENTIALS]; - r = talloc(NULL, struct lsa_CREDRWRITEDOMAINCREDENTIALS); + r = talloc(talloc_tos(), struct lsa_CREDRWRITEDOMAINCREDENTIALS); if (r == NULL) { return false; } @@ -4924,7 +4938,7 @@ static bool api_lsa_CREDRREADDOMAINCREDENTIALS(pipes_struct *p) call = &ndr_table_lsarpc.calls[NDR_LSA_CREDRREADDOMAINCREDENTIALS]; - r = talloc(NULL, struct lsa_CREDRREADDOMAINCREDENTIALS); + r = talloc(talloc_tos(), struct lsa_CREDRREADDOMAINCREDENTIALS); if (r == NULL) { return false; } @@ -4997,7 +5011,7 @@ static bool api_lsa_CREDRDELETE(pipes_struct *p) call = &ndr_table_lsarpc.calls[NDR_LSA_CREDRDELETE]; - r = talloc(NULL, struct lsa_CREDRDELETE); + r = talloc(talloc_tos(), struct lsa_CREDRDELETE); if (r == NULL) { return false; } @@ -5070,7 +5084,7 @@ static bool api_lsa_CREDRGETTARGETINFO(pipes_struct *p) call = &ndr_table_lsarpc.calls[NDR_LSA_CREDRGETTARGETINFO]; - r = talloc(NULL, struct lsa_CREDRGETTARGETINFO); + r = talloc(talloc_tos(), struct lsa_CREDRGETTARGETINFO); if (r == NULL) { return false; } @@ -5143,7 +5157,7 @@ static bool api_lsa_CREDRPROFILELOADED(pipes_struct *p) call = &ndr_table_lsarpc.calls[NDR_LSA_CREDRPROFILELOADED]; - r = talloc(NULL, struct lsa_CREDRPROFILELOADED); + r = talloc(talloc_tos(), struct lsa_CREDRPROFILELOADED); if (r == NULL) { return false; } @@ -5216,7 +5230,7 @@ static bool api_lsa_LookupNames3(pipes_struct *p) call = &ndr_table_lsarpc.calls[NDR_LSA_LOOKUPNAMES3]; - r = talloc(NULL, struct lsa_LookupNames3); + r = talloc(talloc_tos(), struct lsa_LookupNames3); if (r == NULL) { return false; } @@ -5244,7 +5258,7 @@ static bool api_lsa_LookupNames3(pipes_struct *p) } ZERO_STRUCT(r->out); - r->out.domains = talloc_zero(r, struct lsa_RefDomainList); + r->out.domains = talloc_zero(r, struct lsa_RefDomainList *); if (r->out.domains == NULL) { talloc_free(r); return false; @@ -5298,7 +5312,7 @@ static bool api_lsa_CREDRGETSESSIONTYPES(pipes_struct *p) call = &ndr_table_lsarpc.calls[NDR_LSA_CREDRGETSESSIONTYPES]; - r = talloc(NULL, struct lsa_CREDRGETSESSIONTYPES); + r = talloc(talloc_tos(), struct lsa_CREDRGETSESSIONTYPES); if (r == NULL) { return false; } @@ -5371,7 +5385,7 @@ static bool api_lsa_LSARREGISTERAUDITEVENT(pipes_struct *p) call = &ndr_table_lsarpc.calls[NDR_LSA_LSARREGISTERAUDITEVENT]; - r = talloc(NULL, struct lsa_LSARREGISTERAUDITEVENT); + r = talloc(talloc_tos(), struct lsa_LSARREGISTERAUDITEVENT); if (r == NULL) { return false; } @@ -5444,7 +5458,7 @@ static bool api_lsa_LSARGENAUDITEVENT(pipes_struct *p) call = &ndr_table_lsarpc.calls[NDR_LSA_LSARGENAUDITEVENT]; - r = talloc(NULL, struct lsa_LSARGENAUDITEVENT); + r = talloc(talloc_tos(), struct lsa_LSARGENAUDITEVENT); if (r == NULL) { return false; } @@ -5517,7 +5531,7 @@ static bool api_lsa_LSARUNREGISTERAUDITEVENT(pipes_struct *p) call = &ndr_table_lsarpc.calls[NDR_LSA_LSARUNREGISTERAUDITEVENT]; - r = talloc(NULL, struct lsa_LSARUNREGISTERAUDITEVENT); + r = talloc(talloc_tos(), struct lsa_LSARUNREGISTERAUDITEVENT); if (r == NULL) { return false; } @@ -5579,18 +5593,18 @@ static bool api_lsa_LSARUNREGISTERAUDITEVENT(pipes_struct *p) return true; } -static bool api_lsa_LSARQUERYFORESTTRUSTINFORMATION(pipes_struct *p) +static bool api_lsa_lsaRQueryForestTrustInformation(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 lsa_LSARQUERYFORESTTRUSTINFORMATION *r; + struct lsa_lsaRQueryForestTrustInformation *r; call = &ndr_table_lsarpc.calls[NDR_LSA_LSARQUERYFORESTTRUSTINFORMATION]; - r = talloc(NULL, struct lsa_LSARQUERYFORESTTRUSTINFORMATION); + r = talloc(talloc_tos(), struct lsa_lsaRQueryForestTrustInformation); if (r == NULL) { return false; } @@ -5614,10 +5628,17 @@ static bool api_lsa_LSARQUERYFORESTTRUSTINFORMATION(pipes_struct *p) } if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(lsa_LSARQUERYFORESTTRUSTINFORMATION, r); + NDR_PRINT_IN_DEBUG(lsa_lsaRQueryForestTrustInformation, r); + } + + ZERO_STRUCT(r->out); + r->out.forest_trust_info = talloc_zero(r, struct lsa_ForestTrustInformation *); + if (r->out.forest_trust_info == NULL) { + talloc_free(r); + return false; } - r->out.result = _lsa_LSARQUERYFORESTTRUSTINFORMATION(p, r); + r->out.result = _lsa_lsaRQueryForestTrustInformation(p, r); if (p->rng_fault_state) { talloc_free(r); @@ -5626,7 +5647,7 @@ static bool api_lsa_LSARQUERYFORESTTRUSTINFORMATION(pipes_struct *p) } if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(lsa_LSARQUERYFORESTTRUSTINFORMATION, r); + NDR_PRINT_OUT_DEBUG(lsa_lsaRQueryForestTrustInformation, r); } push = ndr_push_init_ctx(r); @@ -5663,7 +5684,7 @@ static bool api_lsa_LSARSETFORESTTRUSTINFORMATION(pipes_struct *p) call = &ndr_table_lsarpc.calls[NDR_LSA_LSARSETFORESTTRUSTINFORMATION]; - r = talloc(NULL, struct lsa_LSARSETFORESTTRUSTINFORMATION); + r = talloc(talloc_tos(), struct lsa_LSARSETFORESTTRUSTINFORMATION); if (r == NULL) { return false; } @@ -5736,7 +5757,7 @@ static bool api_lsa_CREDRRENAME(pipes_struct *p) call = &ndr_table_lsarpc.calls[NDR_LSA_CREDRRENAME]; - r = talloc(NULL, struct lsa_CREDRRENAME); + r = talloc(talloc_tos(), struct lsa_CREDRRENAME); if (r == NULL) { return false; } @@ -5809,7 +5830,7 @@ static bool api_lsa_LookupSids3(pipes_struct *p) call = &ndr_table_lsarpc.calls[NDR_LSA_LOOKUPSIDS3]; - r = talloc(NULL, struct lsa_LookupSids3); + r = talloc(talloc_tos(), struct lsa_LookupSids3); if (r == NULL) { return false; } @@ -5837,7 +5858,7 @@ static bool api_lsa_LookupSids3(pipes_struct *p) } ZERO_STRUCT(r->out); - r->out.domains = talloc_zero(r, struct lsa_RefDomainList); + r->out.domains = talloc_zero(r, struct lsa_RefDomainList *); if (r->out.domains == NULL) { talloc_free(r); return false; @@ -5891,7 +5912,7 @@ static bool api_lsa_LookupNames4(pipes_struct *p) call = &ndr_table_lsarpc.calls[NDR_LSA_LOOKUPNAMES4]; - r = talloc(NULL, struct lsa_LookupNames4); + r = talloc(talloc_tos(), struct lsa_LookupNames4); if (r == NULL) { return false; } @@ -5919,7 +5940,7 @@ static bool api_lsa_LookupNames4(pipes_struct *p) } ZERO_STRUCT(r->out); - r->out.domains = talloc_zero(r, struct lsa_RefDomainList); + r->out.domains = talloc_zero(r, struct lsa_RefDomainList *); if (r->out.domains == NULL) { talloc_free(r); return false; @@ -5973,7 +5994,7 @@ static bool api_lsa_LSAROPENPOLICYSCE(pipes_struct *p) call = &ndr_table_lsarpc.calls[NDR_LSA_LSAROPENPOLICYSCE]; - r = talloc(NULL, struct lsa_LSAROPENPOLICYSCE); + r = talloc(talloc_tos(), struct lsa_LSAROPENPOLICYSCE); if (r == NULL) { return false; } @@ -6046,7 +6067,7 @@ static bool api_lsa_LSARADTREGISTERSECURITYEVENTSOURCE(pipes_struct *p) call = &ndr_table_lsarpc.calls[NDR_LSA_LSARADTREGISTERSECURITYEVENTSOURCE]; - r = talloc(NULL, struct lsa_LSARADTREGISTERSECURITYEVENTSOURCE); + r = talloc(talloc_tos(), struct lsa_LSARADTREGISTERSECURITYEVENTSOURCE); if (r == NULL) { return false; } @@ -6119,7 +6140,7 @@ static bool api_lsa_LSARADTUNREGISTERSECURITYEVENTSOURCE(pipes_struct *p) call = &ndr_table_lsarpc.calls[NDR_LSA_LSARADTUNREGISTERSECURITYEVENTSOURCE]; - r = talloc(NULL, struct lsa_LSARADTUNREGISTERSECURITYEVENTSOURCE); + r = talloc(talloc_tos(), struct lsa_LSARADTUNREGISTERSECURITYEVENTSOURCE); if (r == NULL) { return false; } @@ -6192,7 +6213,7 @@ static bool api_lsa_LSARADTREPORTSECURITYEVENT(pipes_struct *p) call = &ndr_table_lsarpc.calls[NDR_LSA_LSARADTREPORTSECURITYEVENT]; - r = talloc(NULL, struct lsa_LSARADTREPORTSECURITYEVENT); + r = talloc(talloc_tos(), struct lsa_LSARADTREPORTSECURITYEVENT); if (r == NULL) { return false; } @@ -6331,7 +6352,7 @@ static struct api_struct api_lsarpc_cmds[] = {"LSA_LSARREGISTERAUDITEVENT", NDR_LSA_LSARREGISTERAUDITEVENT, api_lsa_LSARREGISTERAUDITEVENT}, {"LSA_LSARGENAUDITEVENT", NDR_LSA_LSARGENAUDITEVENT, api_lsa_LSARGENAUDITEVENT}, {"LSA_LSARUNREGISTERAUDITEVENT", NDR_LSA_LSARUNREGISTERAUDITEVENT, api_lsa_LSARUNREGISTERAUDITEVENT}, - {"LSA_LSARQUERYFORESTTRUSTINFORMATION", NDR_LSA_LSARQUERYFORESTTRUSTINFORMATION, api_lsa_LSARQUERYFORESTTRUSTINFORMATION}, + {"LSA_LSARQUERYFORESTTRUSTINFORMATION", NDR_LSA_LSARQUERYFORESTTRUSTINFORMATION, api_lsa_lsaRQueryForestTrustInformation}, {"LSA_LSARSETFORESTTRUSTINFORMATION", NDR_LSA_LSARSETFORESTTRUSTINFORMATION, api_lsa_LSARSETFORESTTRUSTINFORMATION}, {"LSA_CREDRRENAME", NDR_LSA_CREDRRENAME, api_lsa_CREDRRENAME}, {"LSA_LOOKUPSIDS3", NDR_LSA_LOOKUPSIDS3, api_lsa_LookupSids3}, diff --git a/source3/librpc/gen_ndr/srv_lsa.h b/source3/librpc/gen_ndr/srv_lsa.h index e3decb2862..223ee5e970 100644 --- a/source3/librpc/gen_ndr/srv_lsa.h +++ b/source3/librpc/gen_ndr/srv_lsa.h @@ -74,7 +74,7 @@ NTSTATUS _lsa_CREDRGETSESSIONTYPES(pipes_struct *p, struct lsa_CREDRGETSESSIONTY NTSTATUS _lsa_LSARREGISTERAUDITEVENT(pipes_struct *p, struct lsa_LSARREGISTERAUDITEVENT *r); NTSTATUS _lsa_LSARGENAUDITEVENT(pipes_struct *p, struct lsa_LSARGENAUDITEVENT *r); NTSTATUS _lsa_LSARUNREGISTERAUDITEVENT(pipes_struct *p, struct lsa_LSARUNREGISTERAUDITEVENT *r); -NTSTATUS _lsa_LSARQUERYFORESTTRUSTINFORMATION(pipes_struct *p, struct lsa_LSARQUERYFORESTTRUSTINFORMATION *r); +NTSTATUS _lsa_lsaRQueryForestTrustInformation(pipes_struct *p, struct lsa_lsaRQueryForestTrustInformation *r); NTSTATUS _lsa_LSARSETFORESTTRUSTINFORMATION(pipes_struct *p, struct lsa_LSARSETFORESTTRUSTINFORMATION *r); NTSTATUS _lsa_CREDRRENAME(pipes_struct *p, struct lsa_CREDRRENAME *r); NTSTATUS _lsa_LookupSids3(pipes_struct *p, struct lsa_LookupSids3 *r); diff --git a/source3/librpc/gen_ndr/srv_netlogon.c b/source3/librpc/gen_ndr/srv_netlogon.c index 163de46ca8..67876f11ef 100644 --- a/source3/librpc/gen_ndr/srv_netlogon.c +++ b/source3/librpc/gen_ndr/srv_netlogon.c @@ -17,7 +17,7 @@ static bool api_netr_LogonUasLogon(pipes_struct *p) call = &ndr_table_netlogon.calls[NDR_NETR_LOGONUASLOGON]; - r = talloc(NULL, struct netr_LogonUasLogon); + r = talloc(talloc_tos(), struct netr_LogonUasLogon); if (r == NULL) { return false; } @@ -97,7 +97,7 @@ static bool api_netr_LogonUasLogoff(pipes_struct *p) call = &ndr_table_netlogon.calls[NDR_NETR_LOGONUASLOGOFF]; - r = talloc(NULL, struct netr_LogonUasLogoff); + r = talloc(talloc_tos(), struct netr_LogonUasLogoff); if (r == NULL) { return false; } @@ -177,7 +177,7 @@ static bool api_netr_LogonSamLogon(pipes_struct *p) call = &ndr_table_netlogon.calls[NDR_NETR_LOGONSAMLOGON]; - r = talloc(NULL, struct netr_LogonSamLogon); + r = talloc(talloc_tos(), struct netr_LogonSamLogon); if (r == NULL) { return false; } @@ -264,7 +264,7 @@ static bool api_netr_LogonSamLogoff(pipes_struct *p) call = &ndr_table_netlogon.calls[NDR_NETR_LOGONSAMLOGOFF]; - r = talloc(NULL, struct netr_LogonSamLogoff); + r = talloc(talloc_tos(), struct netr_LogonSamLogoff); if (r == NULL) { return false; } @@ -339,7 +339,7 @@ static bool api_netr_ServerReqChallenge(pipes_struct *p) call = &ndr_table_netlogon.calls[NDR_NETR_SERVERREQCHALLENGE]; - r = talloc(NULL, struct netr_ServerReqChallenge); + r = talloc(talloc_tos(), struct netr_ServerReqChallenge); if (r == NULL) { return false; } @@ -367,7 +367,12 @@ static bool api_netr_ServerReqChallenge(pipes_struct *p) } ZERO_STRUCT(r->out); - r->out.credentials = r->in.credentials; + r->out.return_credentials = talloc_zero(r, struct netr_Credential); + if (r->out.return_credentials == NULL) { + talloc_free(r); + return false; + } + r->out.result = _netr_ServerReqChallenge(p, r); if (p->rng_fault_state) { @@ -414,7 +419,7 @@ static bool api_netr_ServerAuthenticate(pipes_struct *p) call = &ndr_table_netlogon.calls[NDR_NETR_SERVERAUTHENTICATE]; - r = talloc(NULL, struct netr_ServerAuthenticate); + r = talloc(talloc_tos(), struct netr_ServerAuthenticate); if (r == NULL) { return false; } @@ -442,7 +447,12 @@ static bool api_netr_ServerAuthenticate(pipes_struct *p) } ZERO_STRUCT(r->out); - r->out.credentials = r->in.credentials; + r->out.return_credentials = talloc_zero(r, struct netr_Credential); + if (r->out.return_credentials == NULL) { + talloc_free(r); + return false; + } + r->out.result = _netr_ServerAuthenticate(p, r); if (p->rng_fault_state) { @@ -489,7 +499,7 @@ static bool api_netr_ServerPasswordSet(pipes_struct *p) call = &ndr_table_netlogon.calls[NDR_NETR_SERVERPASSWORDSET]; - r = talloc(NULL, struct netr_ServerPasswordSet); + r = talloc(talloc_tos(), struct netr_ServerPasswordSet); if (r == NULL) { return false; } @@ -569,7 +579,7 @@ static bool api_netr_DatabaseDeltas(pipes_struct *p) call = &ndr_table_netlogon.calls[NDR_NETR_DATABASEDELTAS]; - r = talloc(NULL, struct netr_DatabaseDeltas); + r = talloc(talloc_tos(), struct netr_DatabaseDeltas); if (r == NULL) { return false; } @@ -599,7 +609,7 @@ static bool api_netr_DatabaseDeltas(pipes_struct *p) ZERO_STRUCT(r->out); r->out.return_authenticator = r->in.return_authenticator; r->out.sequence_num = r->in.sequence_num; - r->out.delta_enum_array = talloc_zero(r, struct netr_DELTA_ENUM_ARRAY); + r->out.delta_enum_array = talloc_zero(r, struct netr_DELTA_ENUM_ARRAY *); if (r->out.delta_enum_array == NULL) { talloc_free(r); return false; @@ -651,7 +661,7 @@ static bool api_netr_DatabaseSync(pipes_struct *p) call = &ndr_table_netlogon.calls[NDR_NETR_DATABASESYNC]; - r = talloc(NULL, struct netr_DatabaseSync); + r = talloc(talloc_tos(), struct netr_DatabaseSync); if (r == NULL) { return false; } @@ -733,7 +743,7 @@ static bool api_netr_AccountDeltas(pipes_struct *p) call = &ndr_table_netlogon.calls[NDR_NETR_ACCOUNTDELTAS]; - r = talloc(NULL, struct netr_AccountDeltas); + r = talloc(talloc_tos(), struct netr_AccountDeltas); if (r == NULL) { return false; } @@ -832,7 +842,7 @@ static bool api_netr_AccountSync(pipes_struct *p) call = &ndr_table_netlogon.calls[NDR_NETR_ACCOUNTSYNC]; - r = talloc(NULL, struct netr_AccountSync); + r = talloc(talloc_tos(), struct netr_AccountSync); if (r == NULL) { return false; } @@ -932,7 +942,7 @@ static bool api_netr_GetDcName(pipes_struct *p) call = &ndr_table_netlogon.calls[NDR_NETR_GETDCNAME]; - r = talloc(NULL, struct netr_GetDcName); + r = talloc(talloc_tos(), struct netr_GetDcName); if (r == NULL) { return false; } @@ -1012,7 +1022,7 @@ static bool api_netr_LogonControl(pipes_struct *p) call = &ndr_table_netlogon.calls[NDR_NETR_LOGONCONTROL]; - r = talloc(NULL, struct netr_LogonControl); + r = talloc(talloc_tos(), struct netr_LogonControl); if (r == NULL) { return false; } @@ -1092,7 +1102,7 @@ static bool api_netr_GetAnyDCName(pipes_struct *p) call = &ndr_table_netlogon.calls[NDR_NETR_GETANYDCNAME]; - r = talloc(NULL, struct netr_GetAnyDCName); + r = talloc(talloc_tos(), struct netr_GetAnyDCName); if (r == NULL) { return false; } @@ -1172,7 +1182,7 @@ static bool api_netr_LogonControl2(pipes_struct *p) call = &ndr_table_netlogon.calls[NDR_NETR_LOGONCONTROL2]; - r = talloc(NULL, struct netr_LogonControl2); + r = talloc(talloc_tos(), struct netr_LogonControl2); if (r == NULL) { return false; } @@ -1252,7 +1262,7 @@ static bool api_netr_ServerAuthenticate2(pipes_struct *p) call = &ndr_table_netlogon.calls[NDR_NETR_SERVERAUTHENTICATE2]; - r = talloc(NULL, struct netr_ServerAuthenticate2); + r = talloc(talloc_tos(), struct netr_ServerAuthenticate2); if (r == NULL) { return false; } @@ -1280,7 +1290,12 @@ static bool api_netr_ServerAuthenticate2(pipes_struct *p) } ZERO_STRUCT(r->out); - r->out.credentials = r->in.credentials; + r->out.return_credentials = talloc_zero(r, struct netr_Credential); + if (r->out.return_credentials == NULL) { + talloc_free(r); + return false; + } + r->out.negotiate_flags = r->in.negotiate_flags; r->out.result = _netr_ServerAuthenticate2(p, r); @@ -1328,7 +1343,7 @@ static bool api_netr_DatabaseSync2(pipes_struct *p) call = &ndr_table_netlogon.calls[NDR_NETR_DATABASESYNC2]; - r = talloc(NULL, struct netr_DatabaseSync2); + r = talloc(talloc_tos(), struct netr_DatabaseSync2); if (r == NULL) { return false; } @@ -1358,7 +1373,7 @@ static bool api_netr_DatabaseSync2(pipes_struct *p) ZERO_STRUCT(r->out); r->out.return_authenticator = r->in.return_authenticator; r->out.sync_context = r->in.sync_context; - r->out.delta_enum_array = talloc_zero(r, struct netr_DELTA_ENUM_ARRAY); + r->out.delta_enum_array = talloc_zero(r, struct netr_DELTA_ENUM_ARRAY *); if (r->out.delta_enum_array == NULL) { talloc_free(r); return false; @@ -1410,7 +1425,7 @@ static bool api_netr_DatabaseRedo(pipes_struct *p) call = &ndr_table_netlogon.calls[NDR_NETR_DATABASEREDO]; - r = talloc(NULL, struct netr_DatabaseRedo); + r = talloc(talloc_tos(), struct netr_DatabaseRedo); if (r == NULL) { return false; } @@ -1491,7 +1506,7 @@ static bool api_netr_LogonControl2Ex(pipes_struct *p) call = &ndr_table_netlogon.calls[NDR_NETR_LOGONCONTROL2EX]; - r = talloc(NULL, struct netr_LogonControl2Ex); + r = talloc(talloc_tos(), struct netr_LogonControl2Ex); if (r == NULL) { return false; } @@ -1560,18 +1575,18 @@ static bool api_netr_LogonControl2Ex(pipes_struct *p) return true; } -static bool api_netr_NETRENUMERATETRUSTEDDOMAINS(pipes_struct *p) +static bool api_netr_NetrEnumerateTrustedDomains(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 netr_NETRENUMERATETRUSTEDDOMAINS *r; + struct netr_NetrEnumerateTrustedDomains *r; call = &ndr_table_netlogon.calls[NDR_NETR_NETRENUMERATETRUSTEDDOMAINS]; - r = talloc(NULL, struct netr_NETRENUMERATETRUSTEDDOMAINS); + r = talloc(talloc_tos(), struct netr_NetrEnumerateTrustedDomains); if (r == NULL) { return false; } @@ -1595,10 +1610,17 @@ static bool api_netr_NETRENUMERATETRUSTEDDOMAINS(pipes_struct *p) } if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(netr_NETRENUMERATETRUSTEDDOMAINS, r); + NDR_PRINT_IN_DEBUG(netr_NetrEnumerateTrustedDomains, r); + } + + ZERO_STRUCT(r->out); + r->out.trusted_domains_blob = talloc_zero(r, struct netr_Blob); + if (r->out.trusted_domains_blob == NULL) { + talloc_free(r); + return false; } - r->out.result = _netr_NETRENUMERATETRUSTEDDOMAINS(p, r); + r->out.result = _netr_NetrEnumerateTrustedDomains(p, r); if (p->rng_fault_state) { talloc_free(r); @@ -1607,7 +1629,7 @@ static bool api_netr_NETRENUMERATETRUSTEDDOMAINS(pipes_struct *p) } if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(netr_NETRENUMERATETRUSTEDDOMAINS, r); + NDR_PRINT_OUT_DEBUG(netr_NetrEnumerateTrustedDomains, r); } push = ndr_push_init_ctx(r); @@ -1644,7 +1666,7 @@ static bool api_netr_DsRGetDCName(pipes_struct *p) call = &ndr_table_netlogon.calls[NDR_NETR_DSRGETDCNAME]; - r = talloc(NULL, struct netr_DsRGetDCName); + r = talloc(talloc_tos(), struct netr_DsRGetDCName); if (r == NULL) { return false; } @@ -1672,7 +1694,7 @@ static bool api_netr_DsRGetDCName(pipes_struct *p) } ZERO_STRUCT(r->out); - r->out.info = talloc_zero(r, struct netr_DsRGetDCNameInfo); + r->out.info = talloc_zero(r, struct netr_DsRGetDCNameInfo *); if (r->out.info == NULL) { talloc_free(r); return false; @@ -1724,7 +1746,7 @@ static bool api_netr_NETRLOGONDUMMYROUTINE1(pipes_struct *p) call = &ndr_table_netlogon.calls[NDR_NETR_NETRLOGONDUMMYROUTINE1]; - r = talloc(NULL, struct netr_NETRLOGONDUMMYROUTINE1); + r = talloc(talloc_tos(), struct netr_NETRLOGONDUMMYROUTINE1); if (r == NULL) { return false; } @@ -1797,7 +1819,7 @@ static bool api_netr_NETRLOGONSETSERVICEBITS(pipes_struct *p) call = &ndr_table_netlogon.calls[NDR_NETR_NETRLOGONSETSERVICEBITS]; - r = talloc(NULL, struct netr_NETRLOGONSETSERVICEBITS); + r = talloc(talloc_tos(), struct netr_NETRLOGONSETSERVICEBITS); if (r == NULL) { return false; } @@ -1859,18 +1881,18 @@ static bool api_netr_NETRLOGONSETSERVICEBITS(pipes_struct *p) return true; } -static bool api_netr_NETRLOGONGETTRUSTRID(pipes_struct *p) +static bool api_netr_LogonGetTrustRid(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 netr_NETRLOGONGETTRUSTRID *r; + struct netr_LogonGetTrustRid *r; - call = &ndr_table_netlogon.calls[NDR_NETR_NETRLOGONGETTRUSTRID]; + call = &ndr_table_netlogon.calls[NDR_NETR_LOGONGETTRUSTRID]; - r = talloc(NULL, struct netr_NETRLOGONGETTRUSTRID); + r = talloc(talloc_tos(), struct netr_LogonGetTrustRid); if (r == NULL) { return false; } @@ -1894,10 +1916,17 @@ static bool api_netr_NETRLOGONGETTRUSTRID(pipes_struct *p) } if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(netr_NETRLOGONGETTRUSTRID, r); + NDR_PRINT_IN_DEBUG(netr_LogonGetTrustRid, r); + } + + ZERO_STRUCT(r->out); + r->out.rid = talloc_zero(r, uint32_t); + if (r->out.rid == NULL) { + talloc_free(r); + return false; } - r->out.result = _netr_NETRLOGONGETTRUSTRID(p, r); + r->out.result = _netr_LogonGetTrustRid(p, r); if (p->rng_fault_state) { talloc_free(r); @@ -1906,7 +1935,7 @@ static bool api_netr_NETRLOGONGETTRUSTRID(pipes_struct *p) } if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(netr_NETRLOGONGETTRUSTRID, r); + NDR_PRINT_OUT_DEBUG(netr_LogonGetTrustRid, r); } push = ndr_push_init_ctx(r); @@ -1943,7 +1972,7 @@ static bool api_netr_NETRLOGONCOMPUTESERVERDIGEST(pipes_struct *p) call = &ndr_table_netlogon.calls[NDR_NETR_NETRLOGONCOMPUTESERVERDIGEST]; - r = talloc(NULL, struct netr_NETRLOGONCOMPUTESERVERDIGEST); + r = talloc(talloc_tos(), struct netr_NETRLOGONCOMPUTESERVERDIGEST); if (r == NULL) { return false; } @@ -2016,7 +2045,7 @@ static bool api_netr_NETRLOGONCOMPUTECLIENTDIGEST(pipes_struct *p) call = &ndr_table_netlogon.calls[NDR_NETR_NETRLOGONCOMPUTECLIENTDIGEST]; - r = talloc(NULL, struct netr_NETRLOGONCOMPUTECLIENTDIGEST); + r = talloc(talloc_tos(), struct netr_NETRLOGONCOMPUTECLIENTDIGEST); if (r == NULL) { return false; } @@ -2089,7 +2118,7 @@ static bool api_netr_ServerAuthenticate3(pipes_struct *p) call = &ndr_table_netlogon.calls[NDR_NETR_SERVERAUTHENTICATE3]; - r = talloc(NULL, struct netr_ServerAuthenticate3); + r = talloc(talloc_tos(), struct netr_ServerAuthenticate3); if (r == NULL) { return false; } @@ -2171,7 +2200,7 @@ static bool api_netr_DsRGetDCNameEx(pipes_struct *p) call = &ndr_table_netlogon.calls[NDR_NETR_DSRGETDCNAMEEX]; - r = talloc(NULL, struct netr_DsRGetDCNameEx); + r = talloc(talloc_tos(), struct netr_DsRGetDCNameEx); if (r == NULL) { return false; } @@ -2199,7 +2228,7 @@ static bool api_netr_DsRGetDCNameEx(pipes_struct *p) } ZERO_STRUCT(r->out); - r->out.info = talloc_zero(r, struct netr_DsRGetDCNameInfo); + r->out.info = talloc_zero(r, struct netr_DsRGetDCNameInfo *); if (r->out.info == NULL) { talloc_free(r); return false; @@ -2251,7 +2280,7 @@ static bool api_netr_DsRGetSiteName(pipes_struct *p) call = &ndr_table_netlogon.calls[NDR_NETR_DSRGETSITENAME]; - r = talloc(NULL, struct netr_DsRGetSiteName); + r = talloc(talloc_tos(), struct netr_DsRGetSiteName); if (r == NULL) { return false; } @@ -2331,7 +2360,7 @@ static bool api_netr_LogonGetDomainInfo(pipes_struct *p) call = &ndr_table_netlogon.calls[NDR_NETR_LOGONGETDOMAININFO]; - r = talloc(NULL, struct netr_LogonGetDomainInfo); + r = talloc(talloc_tos(), struct netr_LogonGetDomainInfo); if (r == NULL) { return false; } @@ -2412,7 +2441,7 @@ static bool api_netr_ServerPasswordSet2(pipes_struct *p) call = &ndr_table_netlogon.calls[NDR_NETR_SERVERPASSWORDSET2]; - r = talloc(NULL, struct netr_ServerPasswordSet2); + r = talloc(talloc_tos(), struct netr_ServerPasswordSet2); if (r == NULL) { return false; } @@ -2481,18 +2510,18 @@ static bool api_netr_ServerPasswordSet2(pipes_struct *p) return true; } -static bool api_netr_NETRSERVERPASSWORDGET(pipes_struct *p) +static bool api_netr_ServerPasswordGet(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 netr_NETRSERVERPASSWORDGET *r; + struct netr_ServerPasswordGet *r; - call = &ndr_table_netlogon.calls[NDR_NETR_NETRSERVERPASSWORDGET]; + call = &ndr_table_netlogon.calls[NDR_NETR_SERVERPASSWORDGET]; - r = talloc(NULL, struct netr_NETRSERVERPASSWORDGET); + r = talloc(talloc_tos(), struct netr_ServerPasswordGet); if (r == NULL) { return false; } @@ -2516,10 +2545,23 @@ static bool api_netr_NETRSERVERPASSWORDGET(pipes_struct *p) } if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(netr_NETRSERVERPASSWORDGET, r); + NDR_PRINT_IN_DEBUG(netr_ServerPasswordGet, r); + } + + ZERO_STRUCT(r->out); + r->out.return_authenticator = talloc_zero(r, struct netr_Authenticator); + if (r->out.return_authenticator == NULL) { + talloc_free(r); + return false; } - r->out.result = _netr_NETRSERVERPASSWORDGET(p, r); + r->out.password = talloc_zero(r, struct samr_Password); + if (r->out.password == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _netr_ServerPasswordGet(p, r); if (p->rng_fault_state) { talloc_free(r); @@ -2528,7 +2570,7 @@ static bool api_netr_NETRSERVERPASSWORDGET(pipes_struct *p) } if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(netr_NETRSERVERPASSWORDGET, r); + NDR_PRINT_OUT_DEBUG(netr_ServerPasswordGet, r); } push = ndr_push_init_ctx(r); @@ -2565,7 +2607,7 @@ static bool api_netr_NETRLOGONSENDTOSAM(pipes_struct *p) call = &ndr_table_netlogon.calls[NDR_NETR_NETRLOGONSENDTOSAM]; - r = talloc(NULL, struct netr_NETRLOGONSENDTOSAM); + r = talloc(talloc_tos(), struct netr_NETRLOGONSENDTOSAM); if (r == NULL) { return false; } @@ -2627,18 +2669,18 @@ static bool api_netr_NETRLOGONSENDTOSAM(pipes_struct *p) return true; } -static bool api_netr_DSRADDRESSTOSITENAMESW(pipes_struct *p) +static bool api_netr_DsRAddressToSitenamesW(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 netr_DSRADDRESSTOSITENAMESW *r; + struct netr_DsRAddressToSitenamesW *r; call = &ndr_table_netlogon.calls[NDR_NETR_DSRADDRESSTOSITENAMESW]; - r = talloc(NULL, struct netr_DSRADDRESSTOSITENAMESW); + r = talloc(talloc_tos(), struct netr_DsRAddressToSitenamesW); if (r == NULL) { return false; } @@ -2662,10 +2704,17 @@ static bool api_netr_DSRADDRESSTOSITENAMESW(pipes_struct *p) } if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(netr_DSRADDRESSTOSITENAMESW, r); + NDR_PRINT_IN_DEBUG(netr_DsRAddressToSitenamesW, r); + } + + ZERO_STRUCT(r->out); + r->out.ctr = talloc_zero(r, struct netr_DsRAddressToSitenamesWCtr *); + if (r->out.ctr == NULL) { + talloc_free(r); + return false; } - r->out.result = _netr_DSRADDRESSTOSITENAMESW(p, r); + r->out.result = _netr_DsRAddressToSitenamesW(p, r); if (p->rng_fault_state) { talloc_free(r); @@ -2674,7 +2723,7 @@ static bool api_netr_DSRADDRESSTOSITENAMESW(pipes_struct *p) } if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(netr_DSRADDRESSTOSITENAMESW, r); + NDR_PRINT_OUT_DEBUG(netr_DsRAddressToSitenamesW, r); } push = ndr_push_init_ctx(r); @@ -2711,7 +2760,7 @@ static bool api_netr_DsRGetDCNameEx2(pipes_struct *p) call = &ndr_table_netlogon.calls[NDR_NETR_DSRGETDCNAMEEX2]; - r = talloc(NULL, struct netr_DsRGetDCNameEx2); + r = talloc(talloc_tos(), struct netr_DsRGetDCNameEx2); if (r == NULL) { return false; } @@ -2739,7 +2788,7 @@ static bool api_netr_DsRGetDCNameEx2(pipes_struct *p) } ZERO_STRUCT(r->out); - r->out.info = talloc_zero(r, struct netr_DsRGetDCNameInfo); + r->out.info = talloc_zero(r, struct netr_DsRGetDCNameInfo *); if (r->out.info == NULL) { talloc_free(r); return false; @@ -2791,7 +2840,7 @@ static bool api_netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN(pipes_struct *p) call = &ndr_table_netlogon.calls[NDR_NETR_NETRLOGONGETTIMESERVICEPARENTDOMAIN]; - r = talloc(NULL, struct netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN); + r = talloc(talloc_tos(), struct netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN); if (r == NULL) { return false; } @@ -2853,18 +2902,18 @@ static bool api_netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN(pipes_struct *p) return true; } -static bool api_netr_NETRENUMERATETRUSTEDDOMAINSEX(pipes_struct *p) +static bool api_netr_NetrEnumerateTrustedDomainsEx(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 netr_NETRENUMERATETRUSTEDDOMAINSEX *r; + struct netr_NetrEnumerateTrustedDomainsEx *r; call = &ndr_table_netlogon.calls[NDR_NETR_NETRENUMERATETRUSTEDDOMAINSEX]; - r = talloc(NULL, struct netr_NETRENUMERATETRUSTEDDOMAINSEX); + r = talloc(talloc_tos(), struct netr_NetrEnumerateTrustedDomainsEx); if (r == NULL) { return false; } @@ -2888,10 +2937,17 @@ static bool api_netr_NETRENUMERATETRUSTEDDOMAINSEX(pipes_struct *p) } if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(netr_NETRENUMERATETRUSTEDDOMAINSEX, r); + NDR_PRINT_IN_DEBUG(netr_NetrEnumerateTrustedDomainsEx, r); } - r->out.result = _netr_NETRENUMERATETRUSTEDDOMAINSEX(p, r); + ZERO_STRUCT(r->out); + r->out.dom_trust_list = talloc_zero(r, struct netr_DomainTrustList); + if (r->out.dom_trust_list == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _netr_NetrEnumerateTrustedDomainsEx(p, r); if (p->rng_fault_state) { talloc_free(r); @@ -2900,7 +2956,7 @@ static bool api_netr_NETRENUMERATETRUSTEDDOMAINSEX(pipes_struct *p) } if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(netr_NETRENUMERATETRUSTEDDOMAINSEX, r); + NDR_PRINT_OUT_DEBUG(netr_NetrEnumerateTrustedDomainsEx, r); } push = ndr_push_init_ctx(r); @@ -2926,18 +2982,18 @@ static bool api_netr_NETRENUMERATETRUSTEDDOMAINSEX(pipes_struct *p) return true; } -static bool api_netr_DSRADDRESSTOSITENAMESEXW(pipes_struct *p) +static bool api_netr_DsRAddressToSitenamesExW(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 netr_DSRADDRESSTOSITENAMESEXW *r; + struct netr_DsRAddressToSitenamesExW *r; call = &ndr_table_netlogon.calls[NDR_NETR_DSRADDRESSTOSITENAMESEXW]; - r = talloc(NULL, struct netr_DSRADDRESSTOSITENAMESEXW); + r = talloc(talloc_tos(), struct netr_DsRAddressToSitenamesExW); if (r == NULL) { return false; } @@ -2961,10 +3017,17 @@ static bool api_netr_DSRADDRESSTOSITENAMESEXW(pipes_struct *p) } if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(netr_DSRADDRESSTOSITENAMESEXW, r); + NDR_PRINT_IN_DEBUG(netr_DsRAddressToSitenamesExW, r); + } + + ZERO_STRUCT(r->out); + r->out.ctr = talloc_zero(r, struct netr_DsRAddressToSitenamesExWCtr *); + if (r->out.ctr == NULL) { + talloc_free(r); + return false; } - r->out.result = _netr_DSRADDRESSTOSITENAMESEXW(p, r); + r->out.result = _netr_DsRAddressToSitenamesExW(p, r); if (p->rng_fault_state) { talloc_free(r); @@ -2973,7 +3036,7 @@ static bool api_netr_DSRADDRESSTOSITENAMESEXW(pipes_struct *p) } if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(netr_DSRADDRESSTOSITENAMESEXW, r); + NDR_PRINT_OUT_DEBUG(netr_DsRAddressToSitenamesExW, r); } push = ndr_push_init_ctx(r); @@ -2999,18 +3062,18 @@ static bool api_netr_DSRADDRESSTOSITENAMESEXW(pipes_struct *p) return true; } -static bool api_netr_DSRGETDCSITECOVERAGEW(pipes_struct *p) +static bool api_netr_DsrGetDcSiteCoverageW(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 netr_DSRGETDCSITECOVERAGEW *r; + struct netr_DsrGetDcSiteCoverageW *r; call = &ndr_table_netlogon.calls[NDR_NETR_DSRGETDCSITECOVERAGEW]; - r = talloc(NULL, struct netr_DSRGETDCSITECOVERAGEW); + r = talloc(talloc_tos(), struct netr_DsrGetDcSiteCoverageW); if (r == NULL) { return false; } @@ -3034,10 +3097,17 @@ static bool api_netr_DSRGETDCSITECOVERAGEW(pipes_struct *p) } if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(netr_DSRGETDCSITECOVERAGEW, r); + NDR_PRINT_IN_DEBUG(netr_DsrGetDcSiteCoverageW, r); + } + + ZERO_STRUCT(r->out); + r->out.ctr = talloc_zero(r, struct DcSitesCtr); + if (r->out.ctr == NULL) { + talloc_free(r); + return false; } - r->out.result = _netr_DSRGETDCSITECOVERAGEW(p, r); + r->out.result = _netr_DsrGetDcSiteCoverageW(p, r); if (p->rng_fault_state) { talloc_free(r); @@ -3046,7 +3116,7 @@ static bool api_netr_DSRGETDCSITECOVERAGEW(pipes_struct *p) } if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(netr_DSRGETDCSITECOVERAGEW, r); + NDR_PRINT_OUT_DEBUG(netr_DsrGetDcSiteCoverageW, r); } push = ndr_push_init_ctx(r); @@ -3083,7 +3153,7 @@ static bool api_netr_LogonSamLogonEx(pipes_struct *p) call = &ndr_table_netlogon.calls[NDR_NETR_LOGONSAMLOGONEX]; - r = talloc(NULL, struct netr_LogonSamLogonEx); + r = talloc(talloc_tos(), struct netr_LogonSamLogonEx); if (r == NULL) { return false; } @@ -3170,7 +3240,7 @@ static bool api_netr_DsrEnumerateDomainTrusts(pipes_struct *p) call = &ndr_table_netlogon.calls[NDR_NETR_DSRENUMERATEDOMAINTRUSTS]; - r = talloc(NULL, struct netr_DsrEnumerateDomainTrusts); + r = talloc(talloc_tos(), struct netr_DsrEnumerateDomainTrusts); if (r == NULL) { return false; } @@ -3198,13 +3268,7 @@ static bool api_netr_DsrEnumerateDomainTrusts(pipes_struct *p) } ZERO_STRUCT(r->out); - r->out.count = talloc_zero(r, uint32_t); - if (r->out.count == NULL) { - talloc_free(r); - return false; - } - - r->out.trusts = talloc_zero_array(r, struct netr_DomainTrust *, r->out.count); + r->out.trusts = talloc_zero(r, struct netr_DomainTrustList); if (r->out.trusts == NULL) { talloc_free(r); return false; @@ -3245,18 +3309,18 @@ static bool api_netr_DsrEnumerateDomainTrusts(pipes_struct *p) return true; } -static bool api_netr_DSRDEREGISTERDNSHOSTRECORDS(pipes_struct *p) +static bool api_netr_DsrDeregisterDNSHostRecords(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 netr_DSRDEREGISTERDNSHOSTRECORDS *r; + struct netr_DsrDeregisterDNSHostRecords *r; call = &ndr_table_netlogon.calls[NDR_NETR_DSRDEREGISTERDNSHOSTRECORDS]; - r = talloc(NULL, struct netr_DSRDEREGISTERDNSHOSTRECORDS); + r = talloc(talloc_tos(), struct netr_DsrDeregisterDNSHostRecords); if (r == NULL) { return false; } @@ -3280,10 +3344,10 @@ static bool api_netr_DSRDEREGISTERDNSHOSTRECORDS(pipes_struct *p) } if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(netr_DSRDEREGISTERDNSHOSTRECORDS, r); + NDR_PRINT_IN_DEBUG(netr_DsrDeregisterDNSHostRecords, r); } - r->out.result = _netr_DSRDEREGISTERDNSHOSTRECORDS(p, r); + r->out.result = _netr_DsrDeregisterDNSHostRecords(p, r); if (p->rng_fault_state) { talloc_free(r); @@ -3292,7 +3356,7 @@ static bool api_netr_DSRDEREGISTERDNSHOSTRECORDS(pipes_struct *p) } if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(netr_DSRDEREGISTERDNSHOSTRECORDS, r); + NDR_PRINT_OUT_DEBUG(netr_DsrDeregisterDNSHostRecords, r); } push = ndr_push_init_ctx(r); @@ -3318,18 +3382,18 @@ static bool api_netr_DSRDEREGISTERDNSHOSTRECORDS(pipes_struct *p) return true; } -static bool api_netr_NETRSERVERTRUSTPASSWORDSGET(pipes_struct *p) +static bool api_netr_ServerTrustPasswordsGet(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 netr_NETRSERVERTRUSTPASSWORDSGET *r; + struct netr_ServerTrustPasswordsGet *r; - call = &ndr_table_netlogon.calls[NDR_NETR_NETRSERVERTRUSTPASSWORDSGET]; + call = &ndr_table_netlogon.calls[NDR_NETR_SERVERTRUSTPASSWORDSGET]; - r = talloc(NULL, struct netr_NETRSERVERTRUSTPASSWORDSGET); + r = talloc(talloc_tos(), struct netr_ServerTrustPasswordsGet); if (r == NULL) { return false; } @@ -3353,10 +3417,29 @@ static bool api_netr_NETRSERVERTRUSTPASSWORDSGET(pipes_struct *p) } if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(netr_NETRSERVERTRUSTPASSWORDSGET, r); + NDR_PRINT_IN_DEBUG(netr_ServerTrustPasswordsGet, r); } - r->out.result = _netr_NETRSERVERTRUSTPASSWORDSGET(p, r); + ZERO_STRUCT(r->out); + r->out.return_authenticator = talloc_zero(r, struct netr_Authenticator); + if (r->out.return_authenticator == NULL) { + talloc_free(r); + return false; + } + + r->out.password = talloc_zero(r, struct samr_Password); + if (r->out.password == NULL) { + talloc_free(r); + return false; + } + + r->out.password2 = talloc_zero(r, struct samr_Password); + if (r->out.password2 == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _netr_ServerTrustPasswordsGet(p, r); if (p->rng_fault_state) { talloc_free(r); @@ -3365,7 +3448,7 @@ static bool api_netr_NETRSERVERTRUSTPASSWORDSGET(pipes_struct *p) } if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(netr_NETRSERVERTRUSTPASSWORDSGET, r); + NDR_PRINT_OUT_DEBUG(netr_ServerTrustPasswordsGet, r); } push = ndr_push_init_ctx(r); @@ -3391,18 +3474,18 @@ static bool api_netr_NETRSERVERTRUSTPASSWORDSGET(pipes_struct *p) return true; } -static bool api_netr_DSRGETFORESTTRUSTINFORMATION(pipes_struct *p) +static bool api_netr_DsRGetForestTrustInformation(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 netr_DSRGETFORESTTRUSTINFORMATION *r; + struct netr_DsRGetForestTrustInformation *r; call = &ndr_table_netlogon.calls[NDR_NETR_DSRGETFORESTTRUSTINFORMATION]; - r = talloc(NULL, struct netr_DSRGETFORESTTRUSTINFORMATION); + r = talloc(talloc_tos(), struct netr_DsRGetForestTrustInformation); if (r == NULL) { return false; } @@ -3426,10 +3509,17 @@ static bool api_netr_DSRGETFORESTTRUSTINFORMATION(pipes_struct *p) } if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(netr_DSRGETFORESTTRUSTINFORMATION, r); + NDR_PRINT_IN_DEBUG(netr_DsRGetForestTrustInformation, r); + } + + ZERO_STRUCT(r->out); + r->out.forest_trust_info = talloc_zero(r, struct lsa_ForestTrustInformation *); + if (r->out.forest_trust_info == NULL) { + talloc_free(r); + return false; } - r->out.result = _netr_DSRGETFORESTTRUSTINFORMATION(p, r); + r->out.result = _netr_DsRGetForestTrustInformation(p, r); if (p->rng_fault_state) { talloc_free(r); @@ -3438,7 +3528,7 @@ static bool api_netr_DSRGETFORESTTRUSTINFORMATION(pipes_struct *p) } if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(netr_DSRGETFORESTTRUSTINFORMATION, r); + NDR_PRINT_OUT_DEBUG(netr_DsRGetForestTrustInformation, r); } push = ndr_push_init_ctx(r); @@ -3464,18 +3554,18 @@ static bool api_netr_DSRGETFORESTTRUSTINFORMATION(pipes_struct *p) return true; } -static bool api_netr_NETRGETFORESTTRUSTINFORMATION(pipes_struct *p) +static bool api_netr_GetForestTrustInformation(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 netr_NETRGETFORESTTRUSTINFORMATION *r; + struct netr_GetForestTrustInformation *r; - call = &ndr_table_netlogon.calls[NDR_NETR_NETRGETFORESTTRUSTINFORMATION]; + call = &ndr_table_netlogon.calls[NDR_NETR_GETFORESTTRUSTINFORMATION]; - r = talloc(NULL, struct netr_NETRGETFORESTTRUSTINFORMATION); + r = talloc(talloc_tos(), struct netr_GetForestTrustInformation); if (r == NULL) { return false; } @@ -3499,10 +3589,23 @@ static bool api_netr_NETRGETFORESTTRUSTINFORMATION(pipes_struct *p) } if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(netr_NETRGETFORESTTRUSTINFORMATION, r); + NDR_PRINT_IN_DEBUG(netr_GetForestTrustInformation, r); + } + + ZERO_STRUCT(r->out); + r->out.return_authenticator = talloc_zero(r, struct netr_Authenticator); + if (r->out.return_authenticator == NULL) { + talloc_free(r); + return false; + } + + r->out.forest_trust_info = talloc_zero(r, struct lsa_ForestTrustInformation *); + if (r->out.forest_trust_info == NULL) { + talloc_free(r); + return false; } - r->out.result = _netr_NETRGETFORESTTRUSTINFORMATION(p, r); + r->out.result = _netr_GetForestTrustInformation(p, r); if (p->rng_fault_state) { talloc_free(r); @@ -3511,7 +3614,7 @@ static bool api_netr_NETRGETFORESTTRUSTINFORMATION(pipes_struct *p) } if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(netr_NETRGETFORESTTRUSTINFORMATION, r); + NDR_PRINT_OUT_DEBUG(netr_GetForestTrustInformation, r); } push = ndr_push_init_ctx(r); @@ -3548,7 +3651,7 @@ static bool api_netr_LogonSamLogonWithFlags(pipes_struct *p) call = &ndr_table_netlogon.calls[NDR_NETR_LOGONSAMLOGONWITHFLAGS]; - r = talloc(NULL, struct netr_LogonSamLogonWithFlags); + r = talloc(talloc_tos(), struct netr_LogonSamLogonWithFlags); if (r == NULL) { return false; } @@ -3636,7 +3739,7 @@ static bool api_netr_NETRSERVERGETTRUSTINFO(pipes_struct *p) call = &ndr_table_netlogon.calls[NDR_NETR_NETRSERVERGETTRUSTINFO]; - r = talloc(NULL, struct netr_NETRSERVERGETTRUSTINFO); + r = talloc(talloc_tos(), struct netr_NETRSERVERGETTRUSTINFO); if (r == NULL) { return false; } @@ -3721,11 +3824,11 @@ static struct api_struct api_netlogon_cmds[] = {"NETR_DATABASESYNC2", NDR_NETR_DATABASESYNC2, api_netr_DatabaseSync2}, {"NETR_DATABASEREDO", NDR_NETR_DATABASEREDO, api_netr_DatabaseRedo}, {"NETR_LOGONCONTROL2EX", NDR_NETR_LOGONCONTROL2EX, api_netr_LogonControl2Ex}, - {"NETR_NETRENUMERATETRUSTEDDOMAINS", NDR_NETR_NETRENUMERATETRUSTEDDOMAINS, api_netr_NETRENUMERATETRUSTEDDOMAINS}, + {"NETR_NETRENUMERATETRUSTEDDOMAINS", NDR_NETR_NETRENUMERATETRUSTEDDOMAINS, api_netr_NetrEnumerateTrustedDomains}, {"NETR_DSRGETDCNAME", NDR_NETR_DSRGETDCNAME, api_netr_DsRGetDCName}, {"NETR_NETRLOGONDUMMYROUTINE1", NDR_NETR_NETRLOGONDUMMYROUTINE1, api_netr_NETRLOGONDUMMYROUTINE1}, {"NETR_NETRLOGONSETSERVICEBITS", NDR_NETR_NETRLOGONSETSERVICEBITS, api_netr_NETRLOGONSETSERVICEBITS}, - {"NETR_NETRLOGONGETTRUSTRID", NDR_NETR_NETRLOGONGETTRUSTRID, api_netr_NETRLOGONGETTRUSTRID}, + {"NETR_LOGONGETTRUSTRID", NDR_NETR_LOGONGETTRUSTRID, api_netr_LogonGetTrustRid}, {"NETR_NETRLOGONCOMPUTESERVERDIGEST", NDR_NETR_NETRLOGONCOMPUTESERVERDIGEST, api_netr_NETRLOGONCOMPUTESERVERDIGEST}, {"NETR_NETRLOGONCOMPUTECLIENTDIGEST", NDR_NETR_NETRLOGONCOMPUTECLIENTDIGEST, api_netr_NETRLOGONCOMPUTECLIENTDIGEST}, {"NETR_SERVERAUTHENTICATE3", NDR_NETR_SERVERAUTHENTICATE3, api_netr_ServerAuthenticate3}, @@ -3733,20 +3836,20 @@ static struct api_struct api_netlogon_cmds[] = {"NETR_DSRGETSITENAME", NDR_NETR_DSRGETSITENAME, api_netr_DsRGetSiteName}, {"NETR_LOGONGETDOMAININFO", NDR_NETR_LOGONGETDOMAININFO, api_netr_LogonGetDomainInfo}, {"NETR_SERVERPASSWORDSET2", NDR_NETR_SERVERPASSWORDSET2, api_netr_ServerPasswordSet2}, - {"NETR_NETRSERVERPASSWORDGET", NDR_NETR_NETRSERVERPASSWORDGET, api_netr_NETRSERVERPASSWORDGET}, + {"NETR_SERVERPASSWORDGET", NDR_NETR_SERVERPASSWORDGET, api_netr_ServerPasswordGet}, {"NETR_NETRLOGONSENDTOSAM", NDR_NETR_NETRLOGONSENDTOSAM, api_netr_NETRLOGONSENDTOSAM}, - {"NETR_DSRADDRESSTOSITENAMESW", NDR_NETR_DSRADDRESSTOSITENAMESW, api_netr_DSRADDRESSTOSITENAMESW}, + {"NETR_DSRADDRESSTOSITENAMESW", NDR_NETR_DSRADDRESSTOSITENAMESW, api_netr_DsRAddressToSitenamesW}, {"NETR_DSRGETDCNAMEEX2", NDR_NETR_DSRGETDCNAMEEX2, api_netr_DsRGetDCNameEx2}, {"NETR_NETRLOGONGETTIMESERVICEPARENTDOMAIN", NDR_NETR_NETRLOGONGETTIMESERVICEPARENTDOMAIN, api_netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN}, - {"NETR_NETRENUMERATETRUSTEDDOMAINSEX", NDR_NETR_NETRENUMERATETRUSTEDDOMAINSEX, api_netr_NETRENUMERATETRUSTEDDOMAINSEX}, - {"NETR_DSRADDRESSTOSITENAMESEXW", NDR_NETR_DSRADDRESSTOSITENAMESEXW, api_netr_DSRADDRESSTOSITENAMESEXW}, - {"NETR_DSRGETDCSITECOVERAGEW", NDR_NETR_DSRGETDCSITECOVERAGEW, api_netr_DSRGETDCSITECOVERAGEW}, + {"NETR_NETRENUMERATETRUSTEDDOMAINSEX", NDR_NETR_NETRENUMERATETRUSTEDDOMAINSEX, api_netr_NetrEnumerateTrustedDomainsEx}, + {"NETR_DSRADDRESSTOSITENAMESEXW", NDR_NETR_DSRADDRESSTOSITENAMESEXW, api_netr_DsRAddressToSitenamesExW}, + {"NETR_DSRGETDCSITECOVERAGEW", NDR_NETR_DSRGETDCSITECOVERAGEW, api_netr_DsrGetDcSiteCoverageW}, {"NETR_LOGONSAMLOGONEX", NDR_NETR_LOGONSAMLOGONEX, api_netr_LogonSamLogonEx}, {"NETR_DSRENUMERATEDOMAINTRUSTS", NDR_NETR_DSRENUMERATEDOMAINTRUSTS, api_netr_DsrEnumerateDomainTrusts}, - {"NETR_DSRDEREGISTERDNSHOSTRECORDS", NDR_NETR_DSRDEREGISTERDNSHOSTRECORDS, api_netr_DSRDEREGISTERDNSHOSTRECORDS}, - {"NETR_NETRSERVERTRUSTPASSWORDSGET", NDR_NETR_NETRSERVERTRUSTPASSWORDSGET, api_netr_NETRSERVERTRUSTPASSWORDSGET}, - {"NETR_DSRGETFORESTTRUSTINFORMATION", NDR_NETR_DSRGETFORESTTRUSTINFORMATION, api_netr_DSRGETFORESTTRUSTINFORMATION}, - {"NETR_NETRGETFORESTTRUSTINFORMATION", NDR_NETR_NETRGETFORESTTRUSTINFORMATION, api_netr_NETRGETFORESTTRUSTINFORMATION}, + {"NETR_DSRDEREGISTERDNSHOSTRECORDS", NDR_NETR_DSRDEREGISTERDNSHOSTRECORDS, api_netr_DsrDeregisterDNSHostRecords}, + {"NETR_SERVERTRUSTPASSWORDSGET", NDR_NETR_SERVERTRUSTPASSWORDSGET, api_netr_ServerTrustPasswordsGet}, + {"NETR_DSRGETFORESTTRUSTINFORMATION", NDR_NETR_DSRGETFORESTTRUSTINFORMATION, api_netr_DsRGetForestTrustInformation}, + {"NETR_GETFORESTTRUSTINFORMATION", NDR_NETR_GETFORESTTRUSTINFORMATION, api_netr_GetForestTrustInformation}, {"NETR_LOGONSAMLOGONWITHFLAGS", NDR_NETR_LOGONSAMLOGONWITHFLAGS, api_netr_LogonSamLogonWithFlags}, {"NETR_NETRSERVERGETTRUSTINFO", NDR_NETR_NETRSERVERGETTRUSTINFO, api_netr_NETRSERVERGETTRUSTINFO}, }; diff --git a/source3/librpc/gen_ndr/srv_netlogon.h b/source3/librpc/gen_ndr/srv_netlogon.h index 8350f437cd..1fe16c603b 100644 --- a/source3/librpc/gen_ndr/srv_netlogon.h +++ b/source3/librpc/gen_ndr/srv_netlogon.h @@ -12,7 +12,7 @@ NTSTATUS _netr_DatabaseDeltas(pipes_struct *p, struct netr_DatabaseDeltas *r); NTSTATUS _netr_DatabaseSync(pipes_struct *p, struct netr_DatabaseSync *r); NTSTATUS _netr_AccountDeltas(pipes_struct *p, struct netr_AccountDeltas *r); NTSTATUS _netr_AccountSync(pipes_struct *p, struct netr_AccountSync *r); -NTSTATUS _netr_GetDcName(pipes_struct *p, struct netr_GetDcName *r); +WERROR _netr_GetDcName(pipes_struct *p, struct netr_GetDcName *r); WERROR _netr_LogonControl(pipes_struct *p, struct netr_LogonControl *r); WERROR _netr_GetAnyDCName(pipes_struct *p, struct netr_GetAnyDCName *r); WERROR _netr_LogonControl2(pipes_struct *p, struct netr_LogonControl2 *r); @@ -20,11 +20,11 @@ NTSTATUS _netr_ServerAuthenticate2(pipes_struct *p, struct netr_ServerAuthentica NTSTATUS _netr_DatabaseSync2(pipes_struct *p, struct netr_DatabaseSync2 *r); NTSTATUS _netr_DatabaseRedo(pipes_struct *p, struct netr_DatabaseRedo *r); WERROR _netr_LogonControl2Ex(pipes_struct *p, struct netr_LogonControl2Ex *r); -WERROR _netr_NETRENUMERATETRUSTEDDOMAINS(pipes_struct *p, struct netr_NETRENUMERATETRUSTEDDOMAINS *r); +WERROR _netr_NetrEnumerateTrustedDomains(pipes_struct *p, struct netr_NetrEnumerateTrustedDomains *r); WERROR _netr_DsRGetDCName(pipes_struct *p, struct netr_DsRGetDCName *r); WERROR _netr_NETRLOGONDUMMYROUTINE1(pipes_struct *p, struct netr_NETRLOGONDUMMYROUTINE1 *r); WERROR _netr_NETRLOGONSETSERVICEBITS(pipes_struct *p, struct netr_NETRLOGONSETSERVICEBITS *r); -WERROR _netr_NETRLOGONGETTRUSTRID(pipes_struct *p, struct netr_NETRLOGONGETTRUSTRID *r); +WERROR _netr_LogonGetTrustRid(pipes_struct *p, struct netr_LogonGetTrustRid *r); WERROR _netr_NETRLOGONCOMPUTESERVERDIGEST(pipes_struct *p, struct netr_NETRLOGONCOMPUTESERVERDIGEST *r); WERROR _netr_NETRLOGONCOMPUTECLIENTDIGEST(pipes_struct *p, struct netr_NETRLOGONCOMPUTECLIENTDIGEST *r); NTSTATUS _netr_ServerAuthenticate3(pipes_struct *p, struct netr_ServerAuthenticate3 *r); @@ -32,20 +32,20 @@ WERROR _netr_DsRGetDCNameEx(pipes_struct *p, struct netr_DsRGetDCNameEx *r); WERROR _netr_DsRGetSiteName(pipes_struct *p, struct netr_DsRGetSiteName *r); NTSTATUS _netr_LogonGetDomainInfo(pipes_struct *p, struct netr_LogonGetDomainInfo *r); NTSTATUS _netr_ServerPasswordSet2(pipes_struct *p, struct netr_ServerPasswordSet2 *r); -WERROR _netr_NETRSERVERPASSWORDGET(pipes_struct *p, struct netr_NETRSERVERPASSWORDGET *r); +WERROR _netr_ServerPasswordGet(pipes_struct *p, struct netr_ServerPasswordGet *r); WERROR _netr_NETRLOGONSENDTOSAM(pipes_struct *p, struct netr_NETRLOGONSENDTOSAM *r); -WERROR _netr_DSRADDRESSTOSITENAMESW(pipes_struct *p, struct netr_DSRADDRESSTOSITENAMESW *r); +WERROR _netr_DsRAddressToSitenamesW(pipes_struct *p, struct netr_DsRAddressToSitenamesW *r); WERROR _netr_DsRGetDCNameEx2(pipes_struct *p, struct netr_DsRGetDCNameEx2 *r); WERROR _netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN(pipes_struct *p, struct netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN *r); -WERROR _netr_NETRENUMERATETRUSTEDDOMAINSEX(pipes_struct *p, struct netr_NETRENUMERATETRUSTEDDOMAINSEX *r); -WERROR _netr_DSRADDRESSTOSITENAMESEXW(pipes_struct *p, struct netr_DSRADDRESSTOSITENAMESEXW *r); -WERROR _netr_DSRGETDCSITECOVERAGEW(pipes_struct *p, struct netr_DSRGETDCSITECOVERAGEW *r); +WERROR _netr_NetrEnumerateTrustedDomainsEx(pipes_struct *p, struct netr_NetrEnumerateTrustedDomainsEx *r); +WERROR _netr_DsRAddressToSitenamesExW(pipes_struct *p, struct netr_DsRAddressToSitenamesExW *r); +WERROR _netr_DsrGetDcSiteCoverageW(pipes_struct *p, struct netr_DsrGetDcSiteCoverageW *r); NTSTATUS _netr_LogonSamLogonEx(pipes_struct *p, struct netr_LogonSamLogonEx *r); WERROR _netr_DsrEnumerateDomainTrusts(pipes_struct *p, struct netr_DsrEnumerateDomainTrusts *r); -WERROR _netr_DSRDEREGISTERDNSHOSTRECORDS(pipes_struct *p, struct netr_DSRDEREGISTERDNSHOSTRECORDS *r); -WERROR _netr_NETRSERVERTRUSTPASSWORDSGET(pipes_struct *p, struct netr_NETRSERVERTRUSTPASSWORDSGET *r); -WERROR _netr_DSRGETFORESTTRUSTINFORMATION(pipes_struct *p, struct netr_DSRGETFORESTTRUSTINFORMATION *r); -WERROR _netr_NETRGETFORESTTRUSTINFORMATION(pipes_struct *p, struct netr_NETRGETFORESTTRUSTINFORMATION *r); +WERROR _netr_DsrDeregisterDNSHostRecords(pipes_struct *p, struct netr_DsrDeregisterDNSHostRecords *r); +NTSTATUS _netr_ServerTrustPasswordsGet(pipes_struct *p, struct netr_ServerTrustPasswordsGet *r); +WERROR _netr_DsRGetForestTrustInformation(pipes_struct *p, struct netr_DsRGetForestTrustInformation *r); +WERROR _netr_GetForestTrustInformation(pipes_struct *p, struct netr_GetForestTrustInformation *r); NTSTATUS _netr_LogonSamLogonWithFlags(pipes_struct *p, struct netr_LogonSamLogonWithFlags *r); WERROR _netr_NETRSERVERGETTRUSTINFO(pipes_struct *p, struct netr_NETRSERVERGETTRUSTINFO *r); void netlogon_get_pipe_fns(struct api_struct **fns, int *n_fns); diff --git a/source3/librpc/gen_ndr/srv_ntsvcs.c b/source3/librpc/gen_ndr/srv_ntsvcs.c new file mode 100644 index 0000000000..339de6c747 --- /dev/null +++ b/source3/librpc/gen_ndr/srv_ntsvcs.c @@ -0,0 +1,4859 @@ +/* + * Unix SMB/CIFS implementation. + * server auto-generated by pidl. DO NOT MODIFY! + */ + +#include "includes.h" +#include "librpc/gen_ndr/srv_ntsvcs.h" + +static bool api_PNP_Disconnect(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 PNP_Disconnect *r; + + call = &ndr_table_ntsvcs.calls[NDR_PNP_DISCONNECT]; + + r = talloc(talloc_tos(), struct PNP_Disconnect); + 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(PNP_Disconnect, r); + } + + r->out.result = _PNP_Disconnect(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(PNP_Disconnect, 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_PNP_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 PNP_Connect *r; + + call = &ndr_table_ntsvcs.calls[NDR_PNP_CONNECT]; + + r = talloc(talloc_tos(), struct PNP_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(PNP_Connect, r); + } + + r->out.result = _PNP_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(PNP_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_PNP_GetVersion(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 PNP_GetVersion *r; + + call = &ndr_table_ntsvcs.calls[NDR_PNP_GETVERSION]; + + r = talloc(talloc_tos(), struct PNP_GetVersion); + 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(PNP_GetVersion, r); + } + + ZERO_STRUCT(r->out); + r->out.version = talloc_zero(r, uint16_t); + if (r->out.version == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _PNP_GetVersion(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(PNP_GetVersion, 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_PNP_GetGlobalState(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 PNP_GetGlobalState *r; + + call = &ndr_table_ntsvcs.calls[NDR_PNP_GETGLOBALSTATE]; + + r = talloc(talloc_tos(), struct PNP_GetGlobalState); + 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(PNP_GetGlobalState, r); + } + + r->out.result = _PNP_GetGlobalState(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(PNP_GetGlobalState, 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_PNP_InitDetection(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 PNP_InitDetection *r; + + call = &ndr_table_ntsvcs.calls[NDR_PNP_INITDETECTION]; + + r = talloc(talloc_tos(), struct PNP_InitDetection); + 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(PNP_InitDetection, r); + } + + r->out.result = _PNP_InitDetection(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(PNP_InitDetection, 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_PNP_ReportLogOn(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 PNP_ReportLogOn *r; + + call = &ndr_table_ntsvcs.calls[NDR_PNP_REPORTLOGON]; + + r = talloc(talloc_tos(), struct PNP_ReportLogOn); + 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(PNP_ReportLogOn, r); + } + + r->out.result = _PNP_ReportLogOn(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(PNP_ReportLogOn, 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_PNP_ValidateDeviceInstance(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 PNP_ValidateDeviceInstance *r; + + call = &ndr_table_ntsvcs.calls[NDR_PNP_VALIDATEDEVICEINSTANCE]; + + r = talloc(talloc_tos(), struct PNP_ValidateDeviceInstance); + 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(PNP_ValidateDeviceInstance, r); + } + + r->out.result = _PNP_ValidateDeviceInstance(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(PNP_ValidateDeviceInstance, 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_PNP_GetRootDeviceInstance(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 PNP_GetRootDeviceInstance *r; + + call = &ndr_table_ntsvcs.calls[NDR_PNP_GETROOTDEVICEINSTANCE]; + + r = talloc(talloc_tos(), struct PNP_GetRootDeviceInstance); + 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(PNP_GetRootDeviceInstance, r); + } + + r->out.result = _PNP_GetRootDeviceInstance(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(PNP_GetRootDeviceInstance, 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_PNP_GetRelatedDeviceInstance(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 PNP_GetRelatedDeviceInstance *r; + + call = &ndr_table_ntsvcs.calls[NDR_PNP_GETRELATEDDEVICEINSTANCE]; + + r = talloc(talloc_tos(), struct PNP_GetRelatedDeviceInstance); + 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(PNP_GetRelatedDeviceInstance, r); + } + + r->out.result = _PNP_GetRelatedDeviceInstance(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(PNP_GetRelatedDeviceInstance, 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_PNP_EnumerateSubKeys(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 PNP_EnumerateSubKeys *r; + + call = &ndr_table_ntsvcs.calls[NDR_PNP_ENUMERATESUBKEYS]; + + r = talloc(talloc_tos(), struct PNP_EnumerateSubKeys); + 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(PNP_EnumerateSubKeys, r); + } + + r->out.result = _PNP_EnumerateSubKeys(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(PNP_EnumerateSubKeys, 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_PNP_GetDeviceList(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 PNP_GetDeviceList *r; + + call = &ndr_table_ntsvcs.calls[NDR_PNP_GETDEVICELIST]; + + r = talloc(talloc_tos(), struct PNP_GetDeviceList); + 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(PNP_GetDeviceList, r); + } + + r->out.result = _PNP_GetDeviceList(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(PNP_GetDeviceList, 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_PNP_GetDeviceListSize(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 PNP_GetDeviceListSize *r; + + call = &ndr_table_ntsvcs.calls[NDR_PNP_GETDEVICELISTSIZE]; + + r = talloc(talloc_tos(), struct PNP_GetDeviceListSize); + 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(PNP_GetDeviceListSize, r); + } + + ZERO_STRUCT(r->out); + r->out.size = talloc_zero(r, uint32_t); + if (r->out.size == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _PNP_GetDeviceListSize(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(PNP_GetDeviceListSize, 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_PNP_GetDepth(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 PNP_GetDepth *r; + + call = &ndr_table_ntsvcs.calls[NDR_PNP_GETDEPTH]; + + r = talloc(talloc_tos(), struct PNP_GetDepth); + 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(PNP_GetDepth, r); + } + + r->out.result = _PNP_GetDepth(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(PNP_GetDepth, 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_PNP_GetDeviceRegProp(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 PNP_GetDeviceRegProp *r; + + call = &ndr_table_ntsvcs.calls[NDR_PNP_GETDEVICEREGPROP]; + + r = talloc(talloc_tos(), struct PNP_GetDeviceRegProp); + 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(PNP_GetDeviceRegProp, r); + } + + r->out.result = _PNP_GetDeviceRegProp(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(PNP_GetDeviceRegProp, 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_PNP_SetDeviceRegProp(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 PNP_SetDeviceRegProp *r; + + call = &ndr_table_ntsvcs.calls[NDR_PNP_SETDEVICEREGPROP]; + + r = talloc(talloc_tos(), struct PNP_SetDeviceRegProp); + 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(PNP_SetDeviceRegProp, r); + } + + r->out.result = _PNP_SetDeviceRegProp(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(PNP_SetDeviceRegProp, 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_PNP_GetClassInstance(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 PNP_GetClassInstance *r; + + call = &ndr_table_ntsvcs.calls[NDR_PNP_GETCLASSINSTANCE]; + + r = talloc(talloc_tos(), struct PNP_GetClassInstance); + 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(PNP_GetClassInstance, r); + } + + r->out.result = _PNP_GetClassInstance(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(PNP_GetClassInstance, 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_PNP_CreateKey(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 PNP_CreateKey *r; + + call = &ndr_table_ntsvcs.calls[NDR_PNP_CREATEKEY]; + + r = talloc(talloc_tos(), struct PNP_CreateKey); + 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(PNP_CreateKey, r); + } + + r->out.result = _PNP_CreateKey(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(PNP_CreateKey, 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_PNP_DeleteRegistryKey(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 PNP_DeleteRegistryKey *r; + + call = &ndr_table_ntsvcs.calls[NDR_PNP_DELETEREGISTRYKEY]; + + r = talloc(talloc_tos(), struct PNP_DeleteRegistryKey); + 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(PNP_DeleteRegistryKey, r); + } + + r->out.result = _PNP_DeleteRegistryKey(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(PNP_DeleteRegistryKey, 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_PNP_GetClassCount(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 PNP_GetClassCount *r; + + call = &ndr_table_ntsvcs.calls[NDR_PNP_GETCLASSCOUNT]; + + r = talloc(talloc_tos(), struct PNP_GetClassCount); + 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(PNP_GetClassCount, r); + } + + r->out.result = _PNP_GetClassCount(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(PNP_GetClassCount, 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_PNP_GetClassName(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 PNP_GetClassName *r; + + call = &ndr_table_ntsvcs.calls[NDR_PNP_GETCLASSNAME]; + + r = talloc(talloc_tos(), struct PNP_GetClassName); + 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(PNP_GetClassName, r); + } + + r->out.result = _PNP_GetClassName(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(PNP_GetClassName, 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_PNP_DeleteClassKey(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 PNP_DeleteClassKey *r; + + call = &ndr_table_ntsvcs.calls[NDR_PNP_DELETECLASSKEY]; + + r = talloc(talloc_tos(), struct PNP_DeleteClassKey); + 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(PNP_DeleteClassKey, r); + } + + r->out.result = _PNP_DeleteClassKey(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(PNP_DeleteClassKey, 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_PNP_GetInterfaceDeviceAlias(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 PNP_GetInterfaceDeviceAlias *r; + + call = &ndr_table_ntsvcs.calls[NDR_PNP_GETINTERFACEDEVICEALIAS]; + + r = talloc(talloc_tos(), struct PNP_GetInterfaceDeviceAlias); + 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(PNP_GetInterfaceDeviceAlias, r); + } + + r->out.result = _PNP_GetInterfaceDeviceAlias(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(PNP_GetInterfaceDeviceAlias, 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_PNP_GetInterfaceDeviceList(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 PNP_GetInterfaceDeviceList *r; + + call = &ndr_table_ntsvcs.calls[NDR_PNP_GETINTERFACEDEVICELIST]; + + r = talloc(talloc_tos(), struct PNP_GetInterfaceDeviceList); + 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(PNP_GetInterfaceDeviceList, r); + } + + r->out.result = _PNP_GetInterfaceDeviceList(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(PNP_GetInterfaceDeviceList, 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_PNP_GetInterfaceDeviceListSize(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 PNP_GetInterfaceDeviceListSize *r; + + call = &ndr_table_ntsvcs.calls[NDR_PNP_GETINTERFACEDEVICELISTSIZE]; + + r = talloc(talloc_tos(), struct PNP_GetInterfaceDeviceListSize); + 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(PNP_GetInterfaceDeviceListSize, r); + } + + r->out.result = _PNP_GetInterfaceDeviceListSize(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(PNP_GetInterfaceDeviceListSize, 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_PNP_RegisterDeviceClassAssociation(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 PNP_RegisterDeviceClassAssociation *r; + + call = &ndr_table_ntsvcs.calls[NDR_PNP_REGISTERDEVICECLASSASSOCIATION]; + + r = talloc(talloc_tos(), struct PNP_RegisterDeviceClassAssociation); + 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(PNP_RegisterDeviceClassAssociation, r); + } + + r->out.result = _PNP_RegisterDeviceClassAssociation(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(PNP_RegisterDeviceClassAssociation, 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_PNP_UnregisterDeviceClassAssociation(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 PNP_UnregisterDeviceClassAssociation *r; + + call = &ndr_table_ntsvcs.calls[NDR_PNP_UNREGISTERDEVICECLASSASSOCIATION]; + + r = talloc(talloc_tos(), struct PNP_UnregisterDeviceClassAssociation); + 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(PNP_UnregisterDeviceClassAssociation, r); + } + + r->out.result = _PNP_UnregisterDeviceClassAssociation(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(PNP_UnregisterDeviceClassAssociation, 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_PNP_GetClassRegProp(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 PNP_GetClassRegProp *r; + + call = &ndr_table_ntsvcs.calls[NDR_PNP_GETCLASSREGPROP]; + + r = talloc(talloc_tos(), struct PNP_GetClassRegProp); + 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(PNP_GetClassRegProp, r); + } + + r->out.result = _PNP_GetClassRegProp(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(PNP_GetClassRegProp, 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_PNP_SetClassRegProp(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 PNP_SetClassRegProp *r; + + call = &ndr_table_ntsvcs.calls[NDR_PNP_SETCLASSREGPROP]; + + r = talloc(talloc_tos(), struct PNP_SetClassRegProp); + 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(PNP_SetClassRegProp, r); + } + + r->out.result = _PNP_SetClassRegProp(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(PNP_SetClassRegProp, 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_PNP_CreateDevInst(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 PNP_CreateDevInst *r; + + call = &ndr_table_ntsvcs.calls[NDR_PNP_CREATEDEVINST]; + + r = talloc(talloc_tos(), struct PNP_CreateDevInst); + 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(PNP_CreateDevInst, r); + } + + r->out.result = _PNP_CreateDevInst(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(PNP_CreateDevInst, 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_PNP_DeviceInstanceAction(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 PNP_DeviceInstanceAction *r; + + call = &ndr_table_ntsvcs.calls[NDR_PNP_DEVICEINSTANCEACTION]; + + r = talloc(talloc_tos(), struct PNP_DeviceInstanceAction); + 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(PNP_DeviceInstanceAction, r); + } + + r->out.result = _PNP_DeviceInstanceAction(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(PNP_DeviceInstanceAction, 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_PNP_GetDeviceStatus(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 PNP_GetDeviceStatus *r; + + call = &ndr_table_ntsvcs.calls[NDR_PNP_GETDEVICESTATUS]; + + r = talloc(talloc_tos(), struct PNP_GetDeviceStatus); + 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(PNP_GetDeviceStatus, r); + } + + r->out.result = _PNP_GetDeviceStatus(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(PNP_GetDeviceStatus, 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_PNP_SetDeviceProblem(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 PNP_SetDeviceProblem *r; + + call = &ndr_table_ntsvcs.calls[NDR_PNP_SETDEVICEPROBLEM]; + + r = talloc(talloc_tos(), struct PNP_SetDeviceProblem); + 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(PNP_SetDeviceProblem, r); + } + + r->out.result = _PNP_SetDeviceProblem(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(PNP_SetDeviceProblem, 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_PNP_DisableDevInst(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 PNP_DisableDevInst *r; + + call = &ndr_table_ntsvcs.calls[NDR_PNP_DISABLEDEVINST]; + + r = talloc(talloc_tos(), struct PNP_DisableDevInst); + 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(PNP_DisableDevInst, r); + } + + r->out.result = _PNP_DisableDevInst(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(PNP_DisableDevInst, 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_PNP_UninstallDevInst(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 PNP_UninstallDevInst *r; + + call = &ndr_table_ntsvcs.calls[NDR_PNP_UNINSTALLDEVINST]; + + r = talloc(talloc_tos(), struct PNP_UninstallDevInst); + 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(PNP_UninstallDevInst, r); + } + + r->out.result = _PNP_UninstallDevInst(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(PNP_UninstallDevInst, 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_PNP_AddID(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 PNP_AddID *r; + + call = &ndr_table_ntsvcs.calls[NDR_PNP_ADDID]; + + r = talloc(talloc_tos(), struct PNP_AddID); + 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(PNP_AddID, r); + } + + r->out.result = _PNP_AddID(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(PNP_AddID, 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_PNP_RegisterDriver(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 PNP_RegisterDriver *r; + + call = &ndr_table_ntsvcs.calls[NDR_PNP_REGISTERDRIVER]; + + r = talloc(talloc_tos(), struct PNP_RegisterDriver); + 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(PNP_RegisterDriver, r); + } + + r->out.result = _PNP_RegisterDriver(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(PNP_RegisterDriver, 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_PNP_QueryRemove(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 PNP_QueryRemove *r; + + call = &ndr_table_ntsvcs.calls[NDR_PNP_QUERYREMOVE]; + + r = talloc(talloc_tos(), struct PNP_QueryRemove); + 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(PNP_QueryRemove, r); + } + + r->out.result = _PNP_QueryRemove(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(PNP_QueryRemove, 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_PNP_RequestDeviceEject(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 PNP_RequestDeviceEject *r; + + call = &ndr_table_ntsvcs.calls[NDR_PNP_REQUESTDEVICEEJECT]; + + r = talloc(talloc_tos(), struct PNP_RequestDeviceEject); + 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(PNP_RequestDeviceEject, r); + } + + r->out.result = _PNP_RequestDeviceEject(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(PNP_RequestDeviceEject, 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_PNP_IsDockStationPresent(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 PNP_IsDockStationPresent *r; + + call = &ndr_table_ntsvcs.calls[NDR_PNP_ISDOCKSTATIONPRESENT]; + + r = talloc(talloc_tos(), struct PNP_IsDockStationPresent); + 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(PNP_IsDockStationPresent, r); + } + + r->out.result = _PNP_IsDockStationPresent(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(PNP_IsDockStationPresent, 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_PNP_RequestEjectPC(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 PNP_RequestEjectPC *r; + + call = &ndr_table_ntsvcs.calls[NDR_PNP_REQUESTEJECTPC]; + + r = talloc(talloc_tos(), struct PNP_RequestEjectPC); + 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(PNP_RequestEjectPC, r); + } + + r->out.result = _PNP_RequestEjectPC(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(PNP_RequestEjectPC, 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_PNP_HwProfFlags(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 PNP_HwProfFlags *r; + + call = &ndr_table_ntsvcs.calls[NDR_PNP_HWPROFFLAGS]; + + r = talloc(talloc_tos(), struct PNP_HwProfFlags); + 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(PNP_HwProfFlags, r); + } + + ZERO_STRUCT(r->out); + r->out.unknown3 = r->in.unknown3; + r->out.unknown4 = r->in.unknown4; + r->out.unknown5a = talloc_zero(r, const char *); + if (r->out.unknown5a == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _PNP_HwProfFlags(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(PNP_HwProfFlags, 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_PNP_GetHwProfInfo(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 PNP_GetHwProfInfo *r; + + call = &ndr_table_ntsvcs.calls[NDR_PNP_GETHWPROFINFO]; + + r = talloc(talloc_tos(), struct PNP_GetHwProfInfo); + 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(PNP_GetHwProfInfo, r); + } + + ZERO_STRUCT(r->out); + r->out.info = r->in.info; + r->out.result = _PNP_GetHwProfInfo(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(PNP_GetHwProfInfo, 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_PNP_AddEmptyLogConf(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 PNP_AddEmptyLogConf *r; + + call = &ndr_table_ntsvcs.calls[NDR_PNP_ADDEMPTYLOGCONF]; + + r = talloc(talloc_tos(), struct PNP_AddEmptyLogConf); + 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(PNP_AddEmptyLogConf, r); + } + + r->out.result = _PNP_AddEmptyLogConf(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(PNP_AddEmptyLogConf, 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_PNP_FreeLogConf(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 PNP_FreeLogConf *r; + + call = &ndr_table_ntsvcs.calls[NDR_PNP_FREELOGCONF]; + + r = talloc(talloc_tos(), struct PNP_FreeLogConf); + 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(PNP_FreeLogConf, r); + } + + r->out.result = _PNP_FreeLogConf(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(PNP_FreeLogConf, 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_PNP_GetFirstLogConf(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 PNP_GetFirstLogConf *r; + + call = &ndr_table_ntsvcs.calls[NDR_PNP_GETFIRSTLOGCONF]; + + r = talloc(talloc_tos(), struct PNP_GetFirstLogConf); + 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(PNP_GetFirstLogConf, r); + } + + r->out.result = _PNP_GetFirstLogConf(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(PNP_GetFirstLogConf, 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_PNP_GetNextLogConf(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 PNP_GetNextLogConf *r; + + call = &ndr_table_ntsvcs.calls[NDR_PNP_GETNEXTLOGCONF]; + + r = talloc(talloc_tos(), struct PNP_GetNextLogConf); + 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(PNP_GetNextLogConf, r); + } + + r->out.result = _PNP_GetNextLogConf(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(PNP_GetNextLogConf, 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_PNP_GetLogConfPriority(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 PNP_GetLogConfPriority *r; + + call = &ndr_table_ntsvcs.calls[NDR_PNP_GETLOGCONFPRIORITY]; + + r = talloc(talloc_tos(), struct PNP_GetLogConfPriority); + 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(PNP_GetLogConfPriority, r); + } + + r->out.result = _PNP_GetLogConfPriority(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(PNP_GetLogConfPriority, 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_PNP_AddResDes(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 PNP_AddResDes *r; + + call = &ndr_table_ntsvcs.calls[NDR_PNP_ADDRESDES]; + + r = talloc(talloc_tos(), struct PNP_AddResDes); + 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(PNP_AddResDes, r); + } + + r->out.result = _PNP_AddResDes(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(PNP_AddResDes, 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_PNP_FreeResDes(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 PNP_FreeResDes *r; + + call = &ndr_table_ntsvcs.calls[NDR_PNP_FREERESDES]; + + r = talloc(talloc_tos(), struct PNP_FreeResDes); + 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(PNP_FreeResDes, r); + } + + r->out.result = _PNP_FreeResDes(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(PNP_FreeResDes, 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_PNP_GetNextResDes(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 PNP_GetNextResDes *r; + + call = &ndr_table_ntsvcs.calls[NDR_PNP_GETNEXTRESDES]; + + r = talloc(talloc_tos(), struct PNP_GetNextResDes); + 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(PNP_GetNextResDes, r); + } + + r->out.result = _PNP_GetNextResDes(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(PNP_GetNextResDes, 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_PNP_GetResDesData(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 PNP_GetResDesData *r; + + call = &ndr_table_ntsvcs.calls[NDR_PNP_GETRESDESDATA]; + + r = talloc(talloc_tos(), struct PNP_GetResDesData); + 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(PNP_GetResDesData, r); + } + + r->out.result = _PNP_GetResDesData(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(PNP_GetResDesData, 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_PNP_GetResDesDataSize(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 PNP_GetResDesDataSize *r; + + call = &ndr_table_ntsvcs.calls[NDR_PNP_GETRESDESDATASIZE]; + + r = talloc(talloc_tos(), struct PNP_GetResDesDataSize); + 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(PNP_GetResDesDataSize, r); + } + + r->out.result = _PNP_GetResDesDataSize(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(PNP_GetResDesDataSize, 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_PNP_ModifyResDes(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 PNP_ModifyResDes *r; + + call = &ndr_table_ntsvcs.calls[NDR_PNP_MODIFYRESDES]; + + r = talloc(talloc_tos(), struct PNP_ModifyResDes); + 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(PNP_ModifyResDes, r); + } + + r->out.result = _PNP_ModifyResDes(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(PNP_ModifyResDes, 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_PNP_DetectResourceLimit(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 PNP_DetectResourceLimit *r; + + call = &ndr_table_ntsvcs.calls[NDR_PNP_DETECTRESOURCELIMIT]; + + r = talloc(talloc_tos(), struct PNP_DetectResourceLimit); + 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(PNP_DetectResourceLimit, r); + } + + r->out.result = _PNP_DetectResourceLimit(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(PNP_DetectResourceLimit, 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_PNP_QueryResConfList(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 PNP_QueryResConfList *r; + + call = &ndr_table_ntsvcs.calls[NDR_PNP_QUERYRESCONFLIST]; + + r = talloc(talloc_tos(), struct PNP_QueryResConfList); + 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(PNP_QueryResConfList, r); + } + + r->out.result = _PNP_QueryResConfList(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(PNP_QueryResConfList, 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_PNP_SetHwProf(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 PNP_SetHwProf *r; + + call = &ndr_table_ntsvcs.calls[NDR_PNP_SETHWPROF]; + + r = talloc(talloc_tos(), struct PNP_SetHwProf); + 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(PNP_SetHwProf, r); + } + + r->out.result = _PNP_SetHwProf(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(PNP_SetHwProf, 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_PNP_QueryArbitratorFreeData(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 PNP_QueryArbitratorFreeData *r; + + call = &ndr_table_ntsvcs.calls[NDR_PNP_QUERYARBITRATORFREEDATA]; + + r = talloc(talloc_tos(), struct PNP_QueryArbitratorFreeData); + 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(PNP_QueryArbitratorFreeData, r); + } + + r->out.result = _PNP_QueryArbitratorFreeData(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(PNP_QueryArbitratorFreeData, 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_PNP_QueryArbitratorFreeSize(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 PNP_QueryArbitratorFreeSize *r; + + call = &ndr_table_ntsvcs.calls[NDR_PNP_QUERYARBITRATORFREESIZE]; + + r = talloc(talloc_tos(), struct PNP_QueryArbitratorFreeSize); + 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(PNP_QueryArbitratorFreeSize, r); + } + + r->out.result = _PNP_QueryArbitratorFreeSize(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(PNP_QueryArbitratorFreeSize, 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_PNP_RunDetection(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 PNP_RunDetection *r; + + call = &ndr_table_ntsvcs.calls[NDR_PNP_RUNDETECTION]; + + r = talloc(talloc_tos(), struct PNP_RunDetection); + 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(PNP_RunDetection, r); + } + + r->out.result = _PNP_RunDetection(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(PNP_RunDetection, 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_PNP_RegisterNotification(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 PNP_RegisterNotification *r; + + call = &ndr_table_ntsvcs.calls[NDR_PNP_REGISTERNOTIFICATION]; + + r = talloc(talloc_tos(), struct PNP_RegisterNotification); + 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(PNP_RegisterNotification, r); + } + + r->out.result = _PNP_RegisterNotification(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(PNP_RegisterNotification, 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_PNP_UnregisterNotification(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 PNP_UnregisterNotification *r; + + call = &ndr_table_ntsvcs.calls[NDR_PNP_UNREGISTERNOTIFICATION]; + + r = talloc(talloc_tos(), struct PNP_UnregisterNotification); + 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(PNP_UnregisterNotification, r); + } + + r->out.result = _PNP_UnregisterNotification(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(PNP_UnregisterNotification, 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_PNP_GetCustomDevProp(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 PNP_GetCustomDevProp *r; + + call = &ndr_table_ntsvcs.calls[NDR_PNP_GETCUSTOMDEVPROP]; + + r = talloc(talloc_tos(), struct PNP_GetCustomDevProp); + 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(PNP_GetCustomDevProp, r); + } + + r->out.result = _PNP_GetCustomDevProp(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(PNP_GetCustomDevProp, 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_PNP_GetVersionInternal(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 PNP_GetVersionInternal *r; + + call = &ndr_table_ntsvcs.calls[NDR_PNP_GETVERSIONINTERNAL]; + + r = talloc(talloc_tos(), struct PNP_GetVersionInternal); + 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(PNP_GetVersionInternal, r); + } + + r->out.result = _PNP_GetVersionInternal(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(PNP_GetVersionInternal, 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_PNP_GetBlockedDriverInfo(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 PNP_GetBlockedDriverInfo *r; + + call = &ndr_table_ntsvcs.calls[NDR_PNP_GETBLOCKEDDRIVERINFO]; + + r = talloc(talloc_tos(), struct PNP_GetBlockedDriverInfo); + 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(PNP_GetBlockedDriverInfo, r); + } + + r->out.result = _PNP_GetBlockedDriverInfo(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(PNP_GetBlockedDriverInfo, 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_PNP_GetServerSideDeviceInstallFlags(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 PNP_GetServerSideDeviceInstallFlags *r; + + call = &ndr_table_ntsvcs.calls[NDR_PNP_GETSERVERSIDEDEVICEINSTALLFLAGS]; + + r = talloc(talloc_tos(), struct PNP_GetServerSideDeviceInstallFlags); + 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(PNP_GetServerSideDeviceInstallFlags, r); + } + + r->out.result = _PNP_GetServerSideDeviceInstallFlags(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(PNP_GetServerSideDeviceInstallFlags, 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_ntsvcs_cmds[] = +{ + {"PNP_DISCONNECT", NDR_PNP_DISCONNECT, api_PNP_Disconnect}, + {"PNP_CONNECT", NDR_PNP_CONNECT, api_PNP_Connect}, + {"PNP_GETVERSION", NDR_PNP_GETVERSION, api_PNP_GetVersion}, + {"PNP_GETGLOBALSTATE", NDR_PNP_GETGLOBALSTATE, api_PNP_GetGlobalState}, + {"PNP_INITDETECTION", NDR_PNP_INITDETECTION, api_PNP_InitDetection}, + {"PNP_REPORTLOGON", NDR_PNP_REPORTLOGON, api_PNP_ReportLogOn}, + {"PNP_VALIDATEDEVICEINSTANCE", NDR_PNP_VALIDATEDEVICEINSTANCE, api_PNP_ValidateDeviceInstance}, + {"PNP_GETROOTDEVICEINSTANCE", NDR_PNP_GETROOTDEVICEINSTANCE, api_PNP_GetRootDeviceInstance}, + {"PNP_GETRELATEDDEVICEINSTANCE", NDR_PNP_GETRELATEDDEVICEINSTANCE, api_PNP_GetRelatedDeviceInstance}, + {"PNP_ENUMERATESUBKEYS", NDR_PNP_ENUMERATESUBKEYS, api_PNP_EnumerateSubKeys}, + {"PNP_GETDEVICELIST", NDR_PNP_GETDEVICELIST, api_PNP_GetDeviceList}, + {"PNP_GETDEVICELISTSIZE", NDR_PNP_GETDEVICELISTSIZE, api_PNP_GetDeviceListSize}, + {"PNP_GETDEPTH", NDR_PNP_GETDEPTH, api_PNP_GetDepth}, + {"PNP_GETDEVICEREGPROP", NDR_PNP_GETDEVICEREGPROP, api_PNP_GetDeviceRegProp}, + {"PNP_SETDEVICEREGPROP", NDR_PNP_SETDEVICEREGPROP, api_PNP_SetDeviceRegProp}, + {"PNP_GETCLASSINSTANCE", NDR_PNP_GETCLASSINSTANCE, api_PNP_GetClassInstance}, + {"PNP_CREATEKEY", NDR_PNP_CREATEKEY, api_PNP_CreateKey}, + {"PNP_DELETEREGISTRYKEY", NDR_PNP_DELETEREGISTRYKEY, api_PNP_DeleteRegistryKey}, + {"PNP_GETCLASSCOUNT", NDR_PNP_GETCLASSCOUNT, api_PNP_GetClassCount}, + {"PNP_GETCLASSNAME", NDR_PNP_GETCLASSNAME, api_PNP_GetClassName}, + {"PNP_DELETECLASSKEY", NDR_PNP_DELETECLASSKEY, api_PNP_DeleteClassKey}, + {"PNP_GETINTERFACEDEVICEALIAS", NDR_PNP_GETINTERFACEDEVICEALIAS, api_PNP_GetInterfaceDeviceAlias}, + {"PNP_GETINTERFACEDEVICELIST", NDR_PNP_GETINTERFACEDEVICELIST, api_PNP_GetInterfaceDeviceList}, + {"PNP_GETINTERFACEDEVICELISTSIZE", NDR_PNP_GETINTERFACEDEVICELISTSIZE, api_PNP_GetInterfaceDeviceListSize}, + {"PNP_REGISTERDEVICECLASSASSOCIATION", NDR_PNP_REGISTERDEVICECLASSASSOCIATION, api_PNP_RegisterDeviceClassAssociation}, + {"PNP_UNREGISTERDEVICECLASSASSOCIATION", NDR_PNP_UNREGISTERDEVICECLASSASSOCIATION, api_PNP_UnregisterDeviceClassAssociation}, + {"PNP_GETCLASSREGPROP", NDR_PNP_GETCLASSREGPROP, api_PNP_GetClassRegProp}, + {"PNP_SETCLASSREGPROP", NDR_PNP_SETCLASSREGPROP, api_PNP_SetClassRegProp}, + {"PNP_CREATEDEVINST", NDR_PNP_CREATEDEVINST, api_PNP_CreateDevInst}, + {"PNP_DEVICEINSTANCEACTION", NDR_PNP_DEVICEINSTANCEACTION, api_PNP_DeviceInstanceAction}, + {"PNP_GETDEVICESTATUS", NDR_PNP_GETDEVICESTATUS, api_PNP_GetDeviceStatus}, + {"PNP_SETDEVICEPROBLEM", NDR_PNP_SETDEVICEPROBLEM, api_PNP_SetDeviceProblem}, + {"PNP_DISABLEDEVINST", NDR_PNP_DISABLEDEVINST, api_PNP_DisableDevInst}, + {"PNP_UNINSTALLDEVINST", NDR_PNP_UNINSTALLDEVINST, api_PNP_UninstallDevInst}, + {"PNP_ADDID", NDR_PNP_ADDID, api_PNP_AddID}, + {"PNP_REGISTERDRIVER", NDR_PNP_REGISTERDRIVER, api_PNP_RegisterDriver}, + {"PNP_QUERYREMOVE", NDR_PNP_QUERYREMOVE, api_PNP_QueryRemove}, + {"PNP_REQUESTDEVICEEJECT", NDR_PNP_REQUESTDEVICEEJECT, api_PNP_RequestDeviceEject}, + {"PNP_ISDOCKSTATIONPRESENT", NDR_PNP_ISDOCKSTATIONPRESENT, api_PNP_IsDockStationPresent}, + {"PNP_REQUESTEJECTPC", NDR_PNP_REQUESTEJECTPC, api_PNP_RequestEjectPC}, + {"PNP_HWPROFFLAGS", NDR_PNP_HWPROFFLAGS, api_PNP_HwProfFlags}, + {"PNP_GETHWPROFINFO", NDR_PNP_GETHWPROFINFO, api_PNP_GetHwProfInfo}, + {"PNP_ADDEMPTYLOGCONF", NDR_PNP_ADDEMPTYLOGCONF, api_PNP_AddEmptyLogConf}, + {"PNP_FREELOGCONF", NDR_PNP_FREELOGCONF, api_PNP_FreeLogConf}, + {"PNP_GETFIRSTLOGCONF", NDR_PNP_GETFIRSTLOGCONF, api_PNP_GetFirstLogConf}, + {"PNP_GETNEXTLOGCONF", NDR_PNP_GETNEXTLOGCONF, api_PNP_GetNextLogConf}, + {"PNP_GETLOGCONFPRIORITY", NDR_PNP_GETLOGCONFPRIORITY, api_PNP_GetLogConfPriority}, + {"PNP_ADDRESDES", NDR_PNP_ADDRESDES, api_PNP_AddResDes}, + {"PNP_FREERESDES", NDR_PNP_FREERESDES, api_PNP_FreeResDes}, + {"PNP_GETNEXTRESDES", NDR_PNP_GETNEXTRESDES, api_PNP_GetNextResDes}, + {"PNP_GETRESDESDATA", NDR_PNP_GETRESDESDATA, api_PNP_GetResDesData}, + {"PNP_GETRESDESDATASIZE", NDR_PNP_GETRESDESDATASIZE, api_PNP_GetResDesDataSize}, + {"PNP_MODIFYRESDES", NDR_PNP_MODIFYRESDES, api_PNP_ModifyResDes}, + {"PNP_DETECTRESOURCELIMIT", NDR_PNP_DETECTRESOURCELIMIT, api_PNP_DetectResourceLimit}, + {"PNP_QUERYRESCONFLIST", NDR_PNP_QUERYRESCONFLIST, api_PNP_QueryResConfList}, + {"PNP_SETHWPROF", NDR_PNP_SETHWPROF, api_PNP_SetHwProf}, + {"PNP_QUERYARBITRATORFREEDATA", NDR_PNP_QUERYARBITRATORFREEDATA, api_PNP_QueryArbitratorFreeData}, + {"PNP_QUERYARBITRATORFREESIZE", NDR_PNP_QUERYARBITRATORFREESIZE, api_PNP_QueryArbitratorFreeSize}, + {"PNP_RUNDETECTION", NDR_PNP_RUNDETECTION, api_PNP_RunDetection}, + {"PNP_REGISTERNOTIFICATION", NDR_PNP_REGISTERNOTIFICATION, api_PNP_RegisterNotification}, + {"PNP_UNREGISTERNOTIFICATION", NDR_PNP_UNREGISTERNOTIFICATION, api_PNP_UnregisterNotification}, + {"PNP_GETCUSTOMDEVPROP", NDR_PNP_GETCUSTOMDEVPROP, api_PNP_GetCustomDevProp}, + {"PNP_GETVERSIONINTERNAL", NDR_PNP_GETVERSIONINTERNAL, api_PNP_GetVersionInternal}, + {"PNP_GETBLOCKEDDRIVERINFO", NDR_PNP_GETBLOCKEDDRIVERINFO, api_PNP_GetBlockedDriverInfo}, + {"PNP_GETSERVERSIDEDEVICEINSTALLFLAGS", NDR_PNP_GETSERVERSIDEDEVICEINSTALLFLAGS, api_PNP_GetServerSideDeviceInstallFlags}, +}; + +void ntsvcs_get_pipe_fns(struct api_struct **fns, int *n_fns) +{ + *fns = api_ntsvcs_cmds; + *n_fns = sizeof(api_ntsvcs_cmds) / sizeof(struct api_struct); +} + +NTSTATUS rpc_ntsvcs_init(void) +{ + return rpc_pipe_register_commands(SMB_RPC_INTERFACE_VERSION, "ntsvcs", "ntsvcs", api_ntsvcs_cmds, sizeof(api_ntsvcs_cmds) / sizeof(struct api_struct)); +} diff --git a/source3/librpc/gen_ndr/srv_ntsvcs.h b/source3/librpc/gen_ndr/srv_ntsvcs.h new file mode 100644 index 0000000000..c3969b11da --- /dev/null +++ b/source3/librpc/gen_ndr/srv_ntsvcs.h @@ -0,0 +1,71 @@ +#include "librpc/gen_ndr/ndr_ntsvcs.h" +#ifndef __SRV_NTSVCS__ +#define __SRV_NTSVCS__ +WERROR _PNP_Disconnect(pipes_struct *p, struct PNP_Disconnect *r); +WERROR _PNP_Connect(pipes_struct *p, struct PNP_Connect *r); +WERROR _PNP_GetVersion(pipes_struct *p, struct PNP_GetVersion *r); +WERROR _PNP_GetGlobalState(pipes_struct *p, struct PNP_GetGlobalState *r); +WERROR _PNP_InitDetection(pipes_struct *p, struct PNP_InitDetection *r); +WERROR _PNP_ReportLogOn(pipes_struct *p, struct PNP_ReportLogOn *r); +WERROR _PNP_ValidateDeviceInstance(pipes_struct *p, struct PNP_ValidateDeviceInstance *r); +WERROR _PNP_GetRootDeviceInstance(pipes_struct *p, struct PNP_GetRootDeviceInstance *r); +WERROR _PNP_GetRelatedDeviceInstance(pipes_struct *p, struct PNP_GetRelatedDeviceInstance *r); +WERROR _PNP_EnumerateSubKeys(pipes_struct *p, struct PNP_EnumerateSubKeys *r); +WERROR _PNP_GetDeviceList(pipes_struct *p, struct PNP_GetDeviceList *r); +WERROR _PNP_GetDeviceListSize(pipes_struct *p, struct PNP_GetDeviceListSize *r); +WERROR _PNP_GetDepth(pipes_struct *p, struct PNP_GetDepth *r); +WERROR _PNP_GetDeviceRegProp(pipes_struct *p, struct PNP_GetDeviceRegProp *r); +WERROR _PNP_SetDeviceRegProp(pipes_struct *p, struct PNP_SetDeviceRegProp *r); +WERROR _PNP_GetClassInstance(pipes_struct *p, struct PNP_GetClassInstance *r); +WERROR _PNP_CreateKey(pipes_struct *p, struct PNP_CreateKey *r); +WERROR _PNP_DeleteRegistryKey(pipes_struct *p, struct PNP_DeleteRegistryKey *r); +WERROR _PNP_GetClassCount(pipes_struct *p, struct PNP_GetClassCount *r); +WERROR _PNP_GetClassName(pipes_struct *p, struct PNP_GetClassName *r); +WERROR _PNP_DeleteClassKey(pipes_struct *p, struct PNP_DeleteClassKey *r); +WERROR _PNP_GetInterfaceDeviceAlias(pipes_struct *p, struct PNP_GetInterfaceDeviceAlias *r); +WERROR _PNP_GetInterfaceDeviceList(pipes_struct *p, struct PNP_GetInterfaceDeviceList *r); +WERROR _PNP_GetInterfaceDeviceListSize(pipes_struct *p, struct PNP_GetInterfaceDeviceListSize *r); +WERROR _PNP_RegisterDeviceClassAssociation(pipes_struct *p, struct PNP_RegisterDeviceClassAssociation *r); +WERROR _PNP_UnregisterDeviceClassAssociation(pipes_struct *p, struct PNP_UnregisterDeviceClassAssociation *r); +WERROR _PNP_GetClassRegProp(pipes_struct *p, struct PNP_GetClassRegProp *r); +WERROR _PNP_SetClassRegProp(pipes_struct *p, struct PNP_SetClassRegProp *r); +WERROR _PNP_CreateDevInst(pipes_struct *p, struct PNP_CreateDevInst *r); +WERROR _PNP_DeviceInstanceAction(pipes_struct *p, struct PNP_DeviceInstanceAction *r); +WERROR _PNP_GetDeviceStatus(pipes_struct *p, struct PNP_GetDeviceStatus *r); +WERROR _PNP_SetDeviceProblem(pipes_struct *p, struct PNP_SetDeviceProblem *r); +WERROR _PNP_DisableDevInst(pipes_struct *p, struct PNP_DisableDevInst *r); +WERROR _PNP_UninstallDevInst(pipes_struct *p, struct PNP_UninstallDevInst *r); +WERROR _PNP_AddID(pipes_struct *p, struct PNP_AddID *r); +WERROR _PNP_RegisterDriver(pipes_struct *p, struct PNP_RegisterDriver *r); +WERROR _PNP_QueryRemove(pipes_struct *p, struct PNP_QueryRemove *r); +WERROR _PNP_RequestDeviceEject(pipes_struct *p, struct PNP_RequestDeviceEject *r); +WERROR _PNP_IsDockStationPresent(pipes_struct *p, struct PNP_IsDockStationPresent *r); +WERROR _PNP_RequestEjectPC(pipes_struct *p, struct PNP_RequestEjectPC *r); +WERROR _PNP_HwProfFlags(pipes_struct *p, struct PNP_HwProfFlags *r); +WERROR _PNP_GetHwProfInfo(pipes_struct *p, struct PNP_GetHwProfInfo *r); +WERROR _PNP_AddEmptyLogConf(pipes_struct *p, struct PNP_AddEmptyLogConf *r); +WERROR _PNP_FreeLogConf(pipes_struct *p, struct PNP_FreeLogConf *r); +WERROR _PNP_GetFirstLogConf(pipes_struct *p, struct PNP_GetFirstLogConf *r); +WERROR _PNP_GetNextLogConf(pipes_struct *p, struct PNP_GetNextLogConf *r); +WERROR _PNP_GetLogConfPriority(pipes_struct *p, struct PNP_GetLogConfPriority *r); +WERROR _PNP_AddResDes(pipes_struct *p, struct PNP_AddResDes *r); +WERROR _PNP_FreeResDes(pipes_struct *p, struct PNP_FreeResDes *r); +WERROR _PNP_GetNextResDes(pipes_struct *p, struct PNP_GetNextResDes *r); +WERROR _PNP_GetResDesData(pipes_struct *p, struct PNP_GetResDesData *r); +WERROR _PNP_GetResDesDataSize(pipes_struct *p, struct PNP_GetResDesDataSize *r); +WERROR _PNP_ModifyResDes(pipes_struct *p, struct PNP_ModifyResDes *r); +WERROR _PNP_DetectResourceLimit(pipes_struct *p, struct PNP_DetectResourceLimit *r); +WERROR _PNP_QueryResConfList(pipes_struct *p, struct PNP_QueryResConfList *r); +WERROR _PNP_SetHwProf(pipes_struct *p, struct PNP_SetHwProf *r); +WERROR _PNP_QueryArbitratorFreeData(pipes_struct *p, struct PNP_QueryArbitratorFreeData *r); +WERROR _PNP_QueryArbitratorFreeSize(pipes_struct *p, struct PNP_QueryArbitratorFreeSize *r); +WERROR _PNP_RunDetection(pipes_struct *p, struct PNP_RunDetection *r); +WERROR _PNP_RegisterNotification(pipes_struct *p, struct PNP_RegisterNotification *r); +WERROR _PNP_UnregisterNotification(pipes_struct *p, struct PNP_UnregisterNotification *r); +WERROR _PNP_GetCustomDevProp(pipes_struct *p, struct PNP_GetCustomDevProp *r); +WERROR _PNP_GetVersionInternal(pipes_struct *p, struct PNP_GetVersionInternal *r); +WERROR _PNP_GetBlockedDriverInfo(pipes_struct *p, struct PNP_GetBlockedDriverInfo *r); +WERROR _PNP_GetServerSideDeviceInstallFlags(pipes_struct *p, struct PNP_GetServerSideDeviceInstallFlags *r); +void ntsvcs_get_pipe_fns(struct api_struct **fns, int *n_fns); +NTSTATUS rpc_ntsvcs_init(void); +#endif /* __SRV_NTSVCS__ */ diff --git a/source3/librpc/gen_ndr/srv_samr.c b/source3/librpc/gen_ndr/srv_samr.c new file mode 100644 index 0000000000..3994587981 --- /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(talloc_tos(), 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(talloc_tos(), 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(talloc_tos(), 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(talloc_tos(), 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(talloc_tos(), 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(talloc_tos(), 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(talloc_tos(), 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(talloc_tos(), 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(talloc_tos(), 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(talloc_tos(), 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(talloc_tos(), 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(talloc_tos(), 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(talloc_tos(), 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(talloc_tos(), 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(talloc_tos(), 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(talloc_tos(), 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(talloc_tos(), 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(talloc_tos(), 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(talloc_tos(), 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(talloc_tos(), 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(talloc_tos(), 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(talloc_tos(), 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(talloc_tos(), 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(talloc_tos(), 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(talloc_tos(), 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(talloc_tos(), 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(talloc_tos(), 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(talloc_tos(), 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(talloc_tos(), 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(talloc_tos(), 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(talloc_tos(), 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(talloc_tos(), 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(talloc_tos(), 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(talloc_tos(), 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(talloc_tos(), 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(talloc_tos(), 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(talloc_tos(), 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(talloc_tos(), 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(talloc_tos(), 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(talloc_tos(), 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(talloc_tos(), 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(talloc_tos(), 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(talloc_tos(), 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(talloc_tos(), 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(talloc_tos(), 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(talloc_tos(), 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(talloc_tos(), 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(talloc_tos(), 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(talloc_tos(), 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(talloc_tos(), 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(talloc_tos(), 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(talloc_tos(), 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(talloc_tos(), 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(talloc_tos(), 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(talloc_tos(), 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(talloc_tos(), 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(talloc_tos(), 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(talloc_tos(), 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(talloc_tos(), 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(talloc_tos(), 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(talloc_tos(), 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(talloc_tos(), 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(talloc_tos(), 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(talloc_tos(), 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(talloc_tos(), 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(talloc_tos(), 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(talloc_tos(), 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(talloc_tos(), 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__ */ diff --git a/source3/librpc/gen_ndr/srv_srvsvc.c b/source3/librpc/gen_ndr/srv_srvsvc.c index 44fe358a84..afd458765e 100644 --- a/source3/librpc/gen_ndr/srv_srvsvc.c +++ b/source3/librpc/gen_ndr/srv_srvsvc.c @@ -17,7 +17,7 @@ static bool api_srvsvc_NetCharDevEnum(pipes_struct *p) call = &ndr_table_srvsvc.calls[NDR_SRVSVC_NETCHARDEVENUM]; - r = talloc(NULL, struct srvsvc_NetCharDevEnum); + r = talloc(talloc_tos(), struct srvsvc_NetCharDevEnum); if (r == NULL) { return false; } @@ -100,7 +100,7 @@ static bool api_srvsvc_NetCharDevGetInfo(pipes_struct *p) call = &ndr_table_srvsvc.calls[NDR_SRVSVC_NETCHARDEVGETINFO]; - r = talloc(NULL, struct srvsvc_NetCharDevGetInfo); + r = talloc(talloc_tos(), struct srvsvc_NetCharDevGetInfo); if (r == NULL) { return false; } @@ -180,7 +180,7 @@ static bool api_srvsvc_NetCharDevControl(pipes_struct *p) call = &ndr_table_srvsvc.calls[NDR_SRVSVC_NETCHARDEVCONTROL]; - r = talloc(NULL, struct srvsvc_NetCharDevControl); + r = talloc(talloc_tos(), struct srvsvc_NetCharDevControl); if (r == NULL) { return false; } @@ -253,7 +253,7 @@ static bool api_srvsvc_NetCharDevQEnum(pipes_struct *p) call = &ndr_table_srvsvc.calls[NDR_SRVSVC_NETCHARDEVQENUM]; - r = talloc(NULL, struct srvsvc_NetCharDevQEnum); + r = talloc(talloc_tos(), struct srvsvc_NetCharDevQEnum); if (r == NULL) { return false; } @@ -336,7 +336,7 @@ static bool api_srvsvc_NetCharDevQGetInfo(pipes_struct *p) call = &ndr_table_srvsvc.calls[NDR_SRVSVC_NETCHARDEVQGETINFO]; - r = talloc(NULL, struct srvsvc_NetCharDevQGetInfo); + r = talloc(talloc_tos(), struct srvsvc_NetCharDevQGetInfo); if (r == NULL) { return false; } @@ -416,7 +416,7 @@ static bool api_srvsvc_NetCharDevQSetInfo(pipes_struct *p) call = &ndr_table_srvsvc.calls[NDR_SRVSVC_NETCHARDEVQSETINFO]; - r = talloc(NULL, struct srvsvc_NetCharDevQSetInfo); + r = talloc(talloc_tos(), struct srvsvc_NetCharDevQSetInfo); if (r == NULL) { return false; } @@ -491,7 +491,7 @@ static bool api_srvsvc_NetCharDevQPurge(pipes_struct *p) call = &ndr_table_srvsvc.calls[NDR_SRVSVC_NETCHARDEVQPURGE]; - r = talloc(NULL, struct srvsvc_NetCharDevQPurge); + r = talloc(talloc_tos(), struct srvsvc_NetCharDevQPurge); if (r == NULL) { return false; } @@ -564,7 +564,7 @@ static bool api_srvsvc_NetCharDevQPurgeSelf(pipes_struct *p) call = &ndr_table_srvsvc.calls[NDR_SRVSVC_NETCHARDEVQPURGESELF]; - r = talloc(NULL, struct srvsvc_NetCharDevQPurgeSelf); + r = talloc(talloc_tos(), struct srvsvc_NetCharDevQPurgeSelf); if (r == NULL) { return false; } @@ -637,7 +637,7 @@ static bool api_srvsvc_NetConnEnum(pipes_struct *p) call = &ndr_table_srvsvc.calls[NDR_SRVSVC_NETCONNENUM]; - r = talloc(NULL, struct srvsvc_NetConnEnum); + r = talloc(talloc_tos(), struct srvsvc_NetConnEnum); if (r == NULL) { return false; } @@ -720,7 +720,7 @@ static bool api_srvsvc_NetFileEnum(pipes_struct *p) call = &ndr_table_srvsvc.calls[NDR_SRVSVC_NETFILEENUM]; - r = talloc(NULL, struct srvsvc_NetFileEnum); + r = talloc(talloc_tos(), struct srvsvc_NetFileEnum); if (r == NULL) { return false; } @@ -803,7 +803,7 @@ static bool api_srvsvc_NetFileGetInfo(pipes_struct *p) call = &ndr_table_srvsvc.calls[NDR_SRVSVC_NETFILEGETINFO]; - r = talloc(NULL, struct srvsvc_NetFileGetInfo); + r = talloc(talloc_tos(), struct srvsvc_NetFileGetInfo); if (r == NULL) { return false; } @@ -883,7 +883,7 @@ static bool api_srvsvc_NetFileClose(pipes_struct *p) call = &ndr_table_srvsvc.calls[NDR_SRVSVC_NETFILECLOSE]; - r = talloc(NULL, struct srvsvc_NetFileClose); + r = talloc(talloc_tos(), struct srvsvc_NetFileClose); if (r == NULL) { return false; } @@ -956,7 +956,7 @@ static bool api_srvsvc_NetSessEnum(pipes_struct *p) call = &ndr_table_srvsvc.calls[NDR_SRVSVC_NETSESSENUM]; - r = talloc(NULL, struct srvsvc_NetSessEnum); + r = talloc(talloc_tos(), struct srvsvc_NetSessEnum); if (r == NULL) { return false; } @@ -1039,7 +1039,7 @@ static bool api_srvsvc_NetSessDel(pipes_struct *p) call = &ndr_table_srvsvc.calls[NDR_SRVSVC_NETSESSDEL]; - r = talloc(NULL, struct srvsvc_NetSessDel); + r = talloc(talloc_tos(), struct srvsvc_NetSessDel); if (r == NULL) { return false; } @@ -1112,7 +1112,7 @@ static bool api_srvsvc_NetShareAdd(pipes_struct *p) call = &ndr_table_srvsvc.calls[NDR_SRVSVC_NETSHAREADD]; - r = talloc(NULL, struct srvsvc_NetShareAdd); + r = talloc(talloc_tos(), struct srvsvc_NetShareAdd); if (r == NULL) { return false; } @@ -1187,7 +1187,7 @@ static bool api_srvsvc_NetShareEnumAll(pipes_struct *p) call = &ndr_table_srvsvc.calls[NDR_SRVSVC_NETSHAREENUMALL]; - r = talloc(NULL, struct srvsvc_NetShareEnumAll); + r = talloc(talloc_tos(), struct srvsvc_NetShareEnumAll); if (r == NULL) { return false; } @@ -1270,7 +1270,7 @@ static bool api_srvsvc_NetShareGetInfo(pipes_struct *p) call = &ndr_table_srvsvc.calls[NDR_SRVSVC_NETSHAREGETINFO]; - r = talloc(NULL, struct srvsvc_NetShareGetInfo); + r = talloc(talloc_tos(), struct srvsvc_NetShareGetInfo); if (r == NULL) { return false; } @@ -1350,7 +1350,7 @@ static bool api_srvsvc_NetShareSetInfo(pipes_struct *p) call = &ndr_table_srvsvc.calls[NDR_SRVSVC_NETSHARESETINFO]; - r = talloc(NULL, struct srvsvc_NetShareSetInfo); + r = talloc(talloc_tos(), struct srvsvc_NetShareSetInfo); if (r == NULL) { return false; } @@ -1425,7 +1425,7 @@ static bool api_srvsvc_NetShareDel(pipes_struct *p) call = &ndr_table_srvsvc.calls[NDR_SRVSVC_NETSHAREDEL]; - r = talloc(NULL, struct srvsvc_NetShareDel); + r = talloc(talloc_tos(), struct srvsvc_NetShareDel); if (r == NULL) { return false; } @@ -1498,7 +1498,7 @@ static bool api_srvsvc_NetShareDelSticky(pipes_struct *p) call = &ndr_table_srvsvc.calls[NDR_SRVSVC_NETSHAREDELSTICKY]; - r = talloc(NULL, struct srvsvc_NetShareDelSticky); + r = talloc(talloc_tos(), struct srvsvc_NetShareDelSticky); if (r == NULL) { return false; } @@ -1571,7 +1571,7 @@ static bool api_srvsvc_NetShareCheck(pipes_struct *p) call = &ndr_table_srvsvc.calls[NDR_SRVSVC_NETSHARECHECK]; - r = talloc(NULL, struct srvsvc_NetShareCheck); + r = talloc(talloc_tos(), struct srvsvc_NetShareCheck); if (r == NULL) { return false; } @@ -1651,7 +1651,7 @@ static bool api_srvsvc_NetSrvGetInfo(pipes_struct *p) call = &ndr_table_srvsvc.calls[NDR_SRVSVC_NETSRVGETINFO]; - r = talloc(NULL, struct srvsvc_NetSrvGetInfo); + r = talloc(talloc_tos(), struct srvsvc_NetSrvGetInfo); if (r == NULL) { return false; } @@ -1731,7 +1731,7 @@ static bool api_srvsvc_NetSrvSetInfo(pipes_struct *p) call = &ndr_table_srvsvc.calls[NDR_SRVSVC_NETSRVSETINFO]; - r = talloc(NULL, struct srvsvc_NetSrvSetInfo); + r = talloc(talloc_tos(), struct srvsvc_NetSrvSetInfo); if (r == NULL) { return false; } @@ -1806,7 +1806,7 @@ static bool api_srvsvc_NetDiskEnum(pipes_struct *p) call = &ndr_table_srvsvc.calls[NDR_SRVSVC_NETDISKENUM]; - r = talloc(NULL, struct srvsvc_NetDiskEnum); + r = talloc(talloc_tos(), struct srvsvc_NetDiskEnum); if (r == NULL) { return false; } @@ -1888,7 +1888,7 @@ static bool api_srvsvc_NetServerStatisticsGet(pipes_struct *p) call = &ndr_table_srvsvc.calls[NDR_SRVSVC_NETSERVERSTATISTICSGET]; - r = talloc(NULL, struct srvsvc_NetServerStatisticsGet); + r = talloc(talloc_tos(), struct srvsvc_NetServerStatisticsGet); if (r == NULL) { return false; } @@ -1968,7 +1968,7 @@ static bool api_srvsvc_NetTransportAdd(pipes_struct *p) call = &ndr_table_srvsvc.calls[NDR_SRVSVC_NETTRANSPORTADD]; - r = talloc(NULL, struct srvsvc_NetTransportAdd); + r = talloc(talloc_tos(), struct srvsvc_NetTransportAdd); if (r == NULL) { return false; } @@ -2041,7 +2041,7 @@ static bool api_srvsvc_NetTransportEnum(pipes_struct *p) call = &ndr_table_srvsvc.calls[NDR_SRVSVC_NETTRANSPORTENUM]; - r = talloc(NULL, struct srvsvc_NetTransportEnum); + r = talloc(talloc_tos(), struct srvsvc_NetTransportEnum); if (r == NULL) { return false; } @@ -2124,7 +2124,7 @@ static bool api_srvsvc_NetTransportDel(pipes_struct *p) call = &ndr_table_srvsvc.calls[NDR_SRVSVC_NETTRANSPORTDEL]; - r = talloc(NULL, struct srvsvc_NetTransportDel); + r = talloc(talloc_tos(), struct srvsvc_NetTransportDel); if (r == NULL) { return false; } @@ -2197,7 +2197,7 @@ static bool api_srvsvc_NetRemoteTOD(pipes_struct *p) call = &ndr_table_srvsvc.calls[NDR_SRVSVC_NETREMOTETOD]; - r = talloc(NULL, struct srvsvc_NetRemoteTOD); + r = talloc(talloc_tos(), struct srvsvc_NetRemoteTOD); if (r == NULL) { return false; } @@ -2277,7 +2277,7 @@ static bool api_srvsvc_NetSetServiceBits(pipes_struct *p) call = &ndr_table_srvsvc.calls[NDR_SRVSVC_NETSETSERVICEBITS]; - r = talloc(NULL, struct srvsvc_NetSetServiceBits); + r = talloc(talloc_tos(), struct srvsvc_NetSetServiceBits); if (r == NULL) { return false; } @@ -2350,7 +2350,7 @@ static bool api_srvsvc_NetPathType(pipes_struct *p) call = &ndr_table_srvsvc.calls[NDR_SRVSVC_NETPATHTYPE]; - r = talloc(NULL, struct srvsvc_NetPathType); + r = talloc(talloc_tos(), struct srvsvc_NetPathType); if (r == NULL) { return false; } @@ -2430,7 +2430,7 @@ static bool api_srvsvc_NetPathCanonicalize(pipes_struct *p) call = &ndr_table_srvsvc.calls[NDR_SRVSVC_NETPATHCANONICALIZE]; - r = talloc(NULL, struct srvsvc_NetPathCanonicalize); + r = talloc(talloc_tos(), struct srvsvc_NetPathCanonicalize); if (r == NULL) { return false; } @@ -2511,7 +2511,7 @@ static bool api_srvsvc_NetPathCompare(pipes_struct *p) call = &ndr_table_srvsvc.calls[NDR_SRVSVC_NETPATHCOMPARE]; - r = talloc(NULL, struct srvsvc_NetPathCompare); + r = talloc(talloc_tos(), struct srvsvc_NetPathCompare); if (r == NULL) { return false; } @@ -2584,7 +2584,7 @@ static bool api_srvsvc_NetNameValidate(pipes_struct *p) call = &ndr_table_srvsvc.calls[NDR_SRVSVC_NETNAMEVALIDATE]; - r = talloc(NULL, struct srvsvc_NetNameValidate); + r = talloc(talloc_tos(), struct srvsvc_NetNameValidate); if (r == NULL) { return false; } @@ -2657,7 +2657,7 @@ static bool api_srvsvc_NETRPRNAMECANONICALIZE(pipes_struct *p) call = &ndr_table_srvsvc.calls[NDR_SRVSVC_NETRPRNAMECANONICALIZE]; - r = talloc(NULL, struct srvsvc_NETRPRNAMECANONICALIZE); + r = talloc(talloc_tos(), struct srvsvc_NETRPRNAMECANONICALIZE); if (r == NULL) { return false; } @@ -2730,7 +2730,7 @@ static bool api_srvsvc_NetPRNameCompare(pipes_struct *p) call = &ndr_table_srvsvc.calls[NDR_SRVSVC_NETPRNAMECOMPARE]; - r = talloc(NULL, struct srvsvc_NetPRNameCompare); + r = talloc(talloc_tos(), struct srvsvc_NetPRNameCompare); if (r == NULL) { return false; } @@ -2803,7 +2803,7 @@ static bool api_srvsvc_NetShareEnum(pipes_struct *p) call = &ndr_table_srvsvc.calls[NDR_SRVSVC_NETSHAREENUM]; - r = talloc(NULL, struct srvsvc_NetShareEnum); + r = talloc(talloc_tos(), struct srvsvc_NetShareEnum); if (r == NULL) { return false; } @@ -2886,7 +2886,7 @@ static bool api_srvsvc_NetShareDelStart(pipes_struct *p) call = &ndr_table_srvsvc.calls[NDR_SRVSVC_NETSHAREDELSTART]; - r = talloc(NULL, struct srvsvc_NetShareDelStart); + r = talloc(talloc_tos(), struct srvsvc_NetShareDelStart); if (r == NULL) { return false; } @@ -2966,7 +2966,7 @@ static bool api_srvsvc_NetShareDelCommit(pipes_struct *p) call = &ndr_table_srvsvc.calls[NDR_SRVSVC_NETSHAREDELCOMMIT]; - r = talloc(NULL, struct srvsvc_NetShareDelCommit); + r = talloc(talloc_tos(), struct srvsvc_NetShareDelCommit); if (r == NULL) { return false; } @@ -3041,7 +3041,7 @@ static bool api_srvsvc_NetGetFileSecurity(pipes_struct *p) call = &ndr_table_srvsvc.calls[NDR_SRVSVC_NETGETFILESECURITY]; - r = talloc(NULL, struct srvsvc_NetGetFileSecurity); + r = talloc(talloc_tos(), struct srvsvc_NetGetFileSecurity); if (r == NULL) { return false; } @@ -3121,7 +3121,7 @@ static bool api_srvsvc_NetSetFileSecurity(pipes_struct *p) call = &ndr_table_srvsvc.calls[NDR_SRVSVC_NETSETFILESECURITY]; - r = talloc(NULL, struct srvsvc_NetSetFileSecurity); + r = talloc(talloc_tos(), struct srvsvc_NetSetFileSecurity); if (r == NULL) { return false; } @@ -3194,7 +3194,7 @@ static bool api_srvsvc_NetServerTransportAddEx(pipes_struct *p) call = &ndr_table_srvsvc.calls[NDR_SRVSVC_NETSERVERTRANSPORTADDEX]; - r = talloc(NULL, struct srvsvc_NetServerTransportAddEx); + r = talloc(talloc_tos(), struct srvsvc_NetServerTransportAddEx); if (r == NULL) { return false; } @@ -3267,7 +3267,7 @@ static bool api_srvsvc_NetServerSetServiceBitsEx(pipes_struct *p) call = &ndr_table_srvsvc.calls[NDR_SRVSVC_NETSERVERSETSERVICEBITSEX]; - r = talloc(NULL, struct srvsvc_NetServerSetServiceBitsEx); + r = talloc(talloc_tos(), struct srvsvc_NetServerSetServiceBitsEx); if (r == NULL) { return false; } @@ -3340,7 +3340,7 @@ static bool api_srvsvc_NETRDFSGETVERSION(pipes_struct *p) call = &ndr_table_srvsvc.calls[NDR_SRVSVC_NETRDFSGETVERSION]; - r = talloc(NULL, struct srvsvc_NETRDFSGETVERSION); + r = talloc(talloc_tos(), struct srvsvc_NETRDFSGETVERSION); if (r == NULL) { return false; } @@ -3413,7 +3413,7 @@ static bool api_srvsvc_NETRDFSCREATELOCALPARTITION(pipes_struct *p) call = &ndr_table_srvsvc.calls[NDR_SRVSVC_NETRDFSCREATELOCALPARTITION]; - r = talloc(NULL, struct srvsvc_NETRDFSCREATELOCALPARTITION); + r = talloc(talloc_tos(), struct srvsvc_NETRDFSCREATELOCALPARTITION); if (r == NULL) { return false; } @@ -3486,7 +3486,7 @@ static bool api_srvsvc_NETRDFSDELETELOCALPARTITION(pipes_struct *p) call = &ndr_table_srvsvc.calls[NDR_SRVSVC_NETRDFSDELETELOCALPARTITION]; - r = talloc(NULL, struct srvsvc_NETRDFSDELETELOCALPARTITION); + r = talloc(talloc_tos(), struct srvsvc_NETRDFSDELETELOCALPARTITION); if (r == NULL) { return false; } @@ -3559,7 +3559,7 @@ static bool api_srvsvc_NETRDFSSETLOCALVOLUMESTATE(pipes_struct *p) call = &ndr_table_srvsvc.calls[NDR_SRVSVC_NETRDFSSETLOCALVOLUMESTATE]; - r = talloc(NULL, struct srvsvc_NETRDFSSETLOCALVOLUMESTATE); + r = talloc(talloc_tos(), struct srvsvc_NETRDFSSETLOCALVOLUMESTATE); if (r == NULL) { return false; } @@ -3632,7 +3632,7 @@ static bool api_srvsvc_NETRDFSSETSERVERINFO(pipes_struct *p) call = &ndr_table_srvsvc.calls[NDR_SRVSVC_NETRDFSSETSERVERINFO]; - r = talloc(NULL, struct srvsvc_NETRDFSSETSERVERINFO); + r = talloc(talloc_tos(), struct srvsvc_NETRDFSSETSERVERINFO); if (r == NULL) { return false; } @@ -3705,7 +3705,7 @@ static bool api_srvsvc_NETRDFSCREATEEXITPOINT(pipes_struct *p) call = &ndr_table_srvsvc.calls[NDR_SRVSVC_NETRDFSCREATEEXITPOINT]; - r = talloc(NULL, struct srvsvc_NETRDFSCREATEEXITPOINT); + r = talloc(talloc_tos(), struct srvsvc_NETRDFSCREATEEXITPOINT); if (r == NULL) { return false; } @@ -3778,7 +3778,7 @@ static bool api_srvsvc_NETRDFSDELETEEXITPOINT(pipes_struct *p) call = &ndr_table_srvsvc.calls[NDR_SRVSVC_NETRDFSDELETEEXITPOINT]; - r = talloc(NULL, struct srvsvc_NETRDFSDELETEEXITPOINT); + r = talloc(talloc_tos(), struct srvsvc_NETRDFSDELETEEXITPOINT); if (r == NULL) { return false; } @@ -3851,7 +3851,7 @@ static bool api_srvsvc_NETRDFSMODIFYPREFIX(pipes_struct *p) call = &ndr_table_srvsvc.calls[NDR_SRVSVC_NETRDFSMODIFYPREFIX]; - r = talloc(NULL, struct srvsvc_NETRDFSMODIFYPREFIX); + r = talloc(talloc_tos(), struct srvsvc_NETRDFSMODIFYPREFIX); if (r == NULL) { return false; } @@ -3924,7 +3924,7 @@ static bool api_srvsvc_NETRDFSFIXLOCALVOLUME(pipes_struct *p) call = &ndr_table_srvsvc.calls[NDR_SRVSVC_NETRDFSFIXLOCALVOLUME]; - r = talloc(NULL, struct srvsvc_NETRDFSFIXLOCALVOLUME); + r = talloc(talloc_tos(), struct srvsvc_NETRDFSFIXLOCALVOLUME); if (r == NULL) { return false; } @@ -3997,7 +3997,7 @@ static bool api_srvsvc_NETRDFSMANAGERREPORTSITEINFO(pipes_struct *p) call = &ndr_table_srvsvc.calls[NDR_SRVSVC_NETRDFSMANAGERREPORTSITEINFO]; - r = talloc(NULL, struct srvsvc_NETRDFSMANAGERREPORTSITEINFO); + r = talloc(talloc_tos(), struct srvsvc_NETRDFSMANAGERREPORTSITEINFO); if (r == NULL) { return false; } @@ -4070,7 +4070,7 @@ static bool api_srvsvc_NETRSERVERTRANSPORTDELEX(pipes_struct *p) call = &ndr_table_srvsvc.calls[NDR_SRVSVC_NETRSERVERTRANSPORTDELEX]; - r = talloc(NULL, struct srvsvc_NETRSERVERTRANSPORTDELEX); + r = talloc(talloc_tos(), struct srvsvc_NETRSERVERTRANSPORTDELEX); if (r == NULL) { return false; } diff --git a/source3/librpc/gen_ndr/srv_svcctl.c b/source3/librpc/gen_ndr/srv_svcctl.c index 4a0a2591ab..10db320452 100644 --- a/source3/librpc/gen_ndr/srv_svcctl.c +++ b/source3/librpc/gen_ndr/srv_svcctl.c @@ -17,7 +17,7 @@ static bool api_svcctl_CloseServiceHandle(pipes_struct *p) call = &ndr_table_svcctl.calls[NDR_SVCCTL_CLOSESERVICEHANDLE]; - r = talloc(NULL, struct svcctl_CloseServiceHandle); + r = talloc(talloc_tos(), struct svcctl_CloseServiceHandle); if (r == NULL) { return false; } @@ -92,7 +92,7 @@ static bool api_svcctl_ControlService(pipes_struct *p) call = &ndr_table_svcctl.calls[NDR_SVCCTL_CONTROLSERVICE]; - r = talloc(NULL, struct svcctl_ControlService); + r = talloc(talloc_tos(), struct svcctl_ControlService); if (r == NULL) { return false; } @@ -172,7 +172,7 @@ static bool api_svcctl_DeleteService(pipes_struct *p) call = &ndr_table_svcctl.calls[NDR_SVCCTL_DELETESERVICE]; - r = talloc(NULL, struct svcctl_DeleteService); + r = talloc(talloc_tos(), struct svcctl_DeleteService); if (r == NULL) { return false; } @@ -245,7 +245,7 @@ static bool api_svcctl_LockServiceDatabase(pipes_struct *p) call = &ndr_table_svcctl.calls[NDR_SVCCTL_LOCKSERVICEDATABASE]; - r = talloc(NULL, struct svcctl_LockServiceDatabase); + r = talloc(talloc_tos(), struct svcctl_LockServiceDatabase); if (r == NULL) { return false; } @@ -325,7 +325,7 @@ static bool api_svcctl_QueryServiceObjectSecurity(pipes_struct *p) call = &ndr_table_svcctl.calls[NDR_SVCCTL_QUERYSERVICEOBJECTSECURITY]; - r = talloc(NULL, struct svcctl_QueryServiceObjectSecurity); + r = talloc(talloc_tos(), struct svcctl_QueryServiceObjectSecurity); if (r == NULL) { return false; } @@ -352,6 +352,19 @@ static bool api_svcctl_QueryServiceObjectSecurity(pipes_struct *p) NDR_PRINT_IN_DEBUG(svcctl_QueryServiceObjectSecurity, r); } + ZERO_STRUCT(r->out); + r->out.buffer = talloc_zero_array(r, uint8_t, r->in.buffer_size); + if (r->out.buffer == NULL) { + talloc_free(r); + return false; + } + + r->out.needed = talloc_zero(r, uint32_t); + if (r->out.needed == NULL) { + talloc_free(r); + return false; + } + r->out.result = _svcctl_QueryServiceObjectSecurity(p, r); if (p->rng_fault_state) { @@ -398,7 +411,7 @@ static bool api_svcctl_SetServiceObjectSecurity(pipes_struct *p) call = &ndr_table_svcctl.calls[NDR_SVCCTL_SETSERVICEOBJECTSECURITY]; - r = talloc(NULL, struct svcctl_SetServiceObjectSecurity); + r = talloc(talloc_tos(), struct svcctl_SetServiceObjectSecurity); if (r == NULL) { return false; } @@ -471,7 +484,7 @@ static bool api_svcctl_QueryServiceStatus(pipes_struct *p) call = &ndr_table_svcctl.calls[NDR_SVCCTL_QUERYSERVICESTATUS]; - r = talloc(NULL, struct svcctl_QueryServiceStatus); + r = talloc(talloc_tos(), struct svcctl_QueryServiceStatus); if (r == NULL) { return false; } @@ -551,7 +564,7 @@ static bool api_svcctl_SetServiceStatus(pipes_struct *p) call = &ndr_table_svcctl.calls[NDR_SVCCTL_SETSERVICESTATUS]; - r = talloc(NULL, struct svcctl_SetServiceStatus); + r = talloc(talloc_tos(), struct svcctl_SetServiceStatus); if (r == NULL) { return false; } @@ -624,7 +637,7 @@ static bool api_svcctl_UnlockServiceDatabase(pipes_struct *p) call = &ndr_table_svcctl.calls[NDR_SVCCTL_UNLOCKSERVICEDATABASE]; - r = talloc(NULL, struct svcctl_UnlockServiceDatabase); + r = talloc(talloc_tos(), struct svcctl_UnlockServiceDatabase); if (r == NULL) { return false; } @@ -699,7 +712,7 @@ static bool api_svcctl_NotifyBootConfigStatus(pipes_struct *p) call = &ndr_table_svcctl.calls[NDR_SVCCTL_NOTIFYBOOTCONFIGSTATUS]; - r = talloc(NULL, struct svcctl_NotifyBootConfigStatus); + r = talloc(talloc_tos(), struct svcctl_NotifyBootConfigStatus); if (r == NULL) { return false; } @@ -772,7 +785,7 @@ static bool api_svcctl_SCSetServiceBitsW(pipes_struct *p) call = &ndr_table_svcctl.calls[NDR_SVCCTL_SCSETSERVICEBITSW]; - r = talloc(NULL, struct svcctl_SCSetServiceBitsW); + r = talloc(talloc_tos(), struct svcctl_SCSetServiceBitsW); if (r == NULL) { return false; } @@ -845,7 +858,7 @@ static bool api_svcctl_ChangeServiceConfigW(pipes_struct *p) call = &ndr_table_svcctl.calls[NDR_SVCCTL_CHANGESERVICECONFIGW]; - r = talloc(NULL, struct svcctl_ChangeServiceConfigW); + r = talloc(talloc_tos(), struct svcctl_ChangeServiceConfigW); if (r == NULL) { return false; } @@ -925,7 +938,7 @@ static bool api_svcctl_CreateServiceW(pipes_struct *p) call = &ndr_table_svcctl.calls[NDR_SVCCTL_CREATESERVICEW]; - r = talloc(NULL, struct svcctl_CreateServiceW); + r = talloc(talloc_tos(), struct svcctl_CreateServiceW); if (r == NULL) { return false; } @@ -1006,7 +1019,7 @@ static bool api_svcctl_EnumDependentServicesW(pipes_struct *p) call = &ndr_table_svcctl.calls[NDR_SVCCTL_ENUMDEPENDENTSERVICESW]; - r = talloc(NULL, struct svcctl_EnumDependentServicesW); + r = talloc(talloc_tos(), struct svcctl_EnumDependentServicesW); if (r == NULL) { return false; } @@ -1098,7 +1111,7 @@ static bool api_svcctl_EnumServicesStatusW(pipes_struct *p) call = &ndr_table_svcctl.calls[NDR_SVCCTL_ENUMSERVICESSTATUSW]; - r = talloc(NULL, struct svcctl_EnumServicesStatusW); + r = talloc(talloc_tos(), struct svcctl_EnumServicesStatusW); if (r == NULL) { return false; } @@ -1191,7 +1204,7 @@ static bool api_svcctl_OpenSCManagerW(pipes_struct *p) call = &ndr_table_svcctl.calls[NDR_SVCCTL_OPENSCMANAGERW]; - r = talloc(NULL, struct svcctl_OpenSCManagerW); + r = talloc(talloc_tos(), struct svcctl_OpenSCManagerW); if (r == NULL) { return false; } @@ -1271,7 +1284,7 @@ static bool api_svcctl_OpenServiceW(pipes_struct *p) call = &ndr_table_svcctl.calls[NDR_SVCCTL_OPENSERVICEW]; - r = talloc(NULL, struct svcctl_OpenServiceW); + r = talloc(talloc_tos(), struct svcctl_OpenServiceW); if (r == NULL) { return false; } @@ -1351,7 +1364,7 @@ static bool api_svcctl_QueryServiceConfigW(pipes_struct *p) call = &ndr_table_svcctl.calls[NDR_SVCCTL_QUERYSERVICECONFIGW]; - r = talloc(NULL, struct svcctl_QueryServiceConfigW); + r = talloc(talloc_tos(), struct svcctl_QueryServiceConfigW); if (r == NULL) { return false; } @@ -1437,7 +1450,7 @@ static bool api_svcctl_QueryServiceLockStatusW(pipes_struct *p) call = &ndr_table_svcctl.calls[NDR_SVCCTL_QUERYSERVICELOCKSTATUSW]; - r = talloc(NULL, struct svcctl_QueryServiceLockStatusW); + r = talloc(talloc_tos(), struct svcctl_QueryServiceLockStatusW); if (r == NULL) { return false; } @@ -1523,7 +1536,7 @@ static bool api_svcctl_StartServiceW(pipes_struct *p) call = &ndr_table_svcctl.calls[NDR_SVCCTL_STARTSERVICEW]; - r = talloc(NULL, struct svcctl_StartServiceW); + r = talloc(talloc_tos(), struct svcctl_StartServiceW); if (r == NULL) { return false; } @@ -1596,7 +1609,7 @@ static bool api_svcctl_GetServiceDisplayNameW(pipes_struct *p) call = &ndr_table_svcctl.calls[NDR_SVCCTL_GETSERVICEDISPLAYNAMEW]; - r = talloc(NULL, struct svcctl_GetServiceDisplayNameW); + r = talloc(talloc_tos(), struct svcctl_GetServiceDisplayNameW); if (r == NULL) { return false; } @@ -1677,7 +1690,7 @@ static bool api_svcctl_GetServiceKeyNameW(pipes_struct *p) call = &ndr_table_svcctl.calls[NDR_SVCCTL_GETSERVICEKEYNAMEW]; - r = talloc(NULL, struct svcctl_GetServiceKeyNameW); + r = talloc(talloc_tos(), struct svcctl_GetServiceKeyNameW); if (r == NULL) { return false; } @@ -1758,7 +1771,7 @@ static bool api_svcctl_SCSetServiceBitsA(pipes_struct *p) call = &ndr_table_svcctl.calls[NDR_SVCCTL_SCSETSERVICEBITSA]; - r = talloc(NULL, struct svcctl_SCSetServiceBitsA); + r = talloc(talloc_tos(), struct svcctl_SCSetServiceBitsA); if (r == NULL) { return false; } @@ -1831,7 +1844,7 @@ static bool api_svcctl_ChangeServiceConfigA(pipes_struct *p) call = &ndr_table_svcctl.calls[NDR_SVCCTL_CHANGESERVICECONFIGA]; - r = talloc(NULL, struct svcctl_ChangeServiceConfigA); + r = talloc(talloc_tos(), struct svcctl_ChangeServiceConfigA); if (r == NULL) { return false; } @@ -1911,7 +1924,7 @@ static bool api_svcctl_CreateServiceA(pipes_struct *p) call = &ndr_table_svcctl.calls[NDR_SVCCTL_CREATESERVICEA]; - r = talloc(NULL, struct svcctl_CreateServiceA); + r = talloc(talloc_tos(), struct svcctl_CreateServiceA); if (r == NULL) { return false; } @@ -1991,7 +2004,7 @@ static bool api_svcctl_EnumDependentServicesA(pipes_struct *p) call = &ndr_table_svcctl.calls[NDR_SVCCTL_ENUMDEPENDENTSERVICESA]; - r = talloc(NULL, struct svcctl_EnumDependentServicesA); + r = talloc(talloc_tos(), struct svcctl_EnumDependentServicesA); if (r == NULL) { return false; } @@ -2083,7 +2096,7 @@ static bool api_svcctl_EnumServicesStatusA(pipes_struct *p) call = &ndr_table_svcctl.calls[NDR_SVCCTL_ENUMSERVICESSTATUSA]; - r = talloc(NULL, struct svcctl_EnumServicesStatusA); + r = talloc(talloc_tos(), struct svcctl_EnumServicesStatusA); if (r == NULL) { return false; } @@ -2176,7 +2189,7 @@ static bool api_svcctl_OpenSCManagerA(pipes_struct *p) call = &ndr_table_svcctl.calls[NDR_SVCCTL_OPENSCMANAGERA]; - r = talloc(NULL, struct svcctl_OpenSCManagerA); + r = talloc(talloc_tos(), struct svcctl_OpenSCManagerA); if (r == NULL) { return false; } @@ -2256,7 +2269,7 @@ static bool api_svcctl_OpenServiceA(pipes_struct *p) call = &ndr_table_svcctl.calls[NDR_SVCCTL_OPENSERVICEA]; - r = talloc(NULL, struct svcctl_OpenServiceA); + r = talloc(talloc_tos(), struct svcctl_OpenServiceA); if (r == NULL) { return false; } @@ -2329,7 +2342,7 @@ static bool api_svcctl_QueryServiceConfigA(pipes_struct *p) call = &ndr_table_svcctl.calls[NDR_SVCCTL_QUERYSERVICECONFIGA]; - r = talloc(NULL, struct svcctl_QueryServiceConfigA); + r = talloc(talloc_tos(), struct svcctl_QueryServiceConfigA); if (r == NULL) { return false; } @@ -2415,7 +2428,7 @@ static bool api_svcctl_QueryServiceLockStatusA(pipes_struct *p) call = &ndr_table_svcctl.calls[NDR_SVCCTL_QUERYSERVICELOCKSTATUSA]; - r = talloc(NULL, struct svcctl_QueryServiceLockStatusA); + r = talloc(talloc_tos(), struct svcctl_QueryServiceLockStatusA); if (r == NULL) { return false; } @@ -2501,7 +2514,7 @@ static bool api_svcctl_StartServiceA(pipes_struct *p) call = &ndr_table_svcctl.calls[NDR_SVCCTL_STARTSERVICEA]; - r = talloc(NULL, struct svcctl_StartServiceA); + r = talloc(talloc_tos(), struct svcctl_StartServiceA); if (r == NULL) { return false; } @@ -2574,7 +2587,7 @@ static bool api_svcctl_GetServiceDisplayNameA(pipes_struct *p) call = &ndr_table_svcctl.calls[NDR_SVCCTL_GETSERVICEDISPLAYNAMEA]; - r = talloc(NULL, struct svcctl_GetServiceDisplayNameA); + r = talloc(talloc_tos(), struct svcctl_GetServiceDisplayNameA); if (r == NULL) { return false; } @@ -2655,7 +2668,7 @@ static bool api_svcctl_GetServiceKeyNameA(pipes_struct *p) call = &ndr_table_svcctl.calls[NDR_SVCCTL_GETSERVICEKEYNAMEA]; - r = talloc(NULL, struct svcctl_GetServiceKeyNameA); + r = talloc(talloc_tos(), struct svcctl_GetServiceKeyNameA); if (r == NULL) { return false; } @@ -2736,7 +2749,7 @@ static bool api_svcctl_GetCurrentGroupeStateW(pipes_struct *p) call = &ndr_table_svcctl.calls[NDR_SVCCTL_GETCURRENTGROUPESTATEW]; - r = talloc(NULL, struct svcctl_GetCurrentGroupeStateW); + r = talloc(talloc_tos(), struct svcctl_GetCurrentGroupeStateW); if (r == NULL) { return false; } @@ -2809,7 +2822,7 @@ static bool api_svcctl_EnumServiceGroupW(pipes_struct *p) call = &ndr_table_svcctl.calls[NDR_SVCCTL_ENUMSERVICEGROUPW]; - r = talloc(NULL, struct svcctl_EnumServiceGroupW); + r = talloc(talloc_tos(), struct svcctl_EnumServiceGroupW); if (r == NULL) { return false; } @@ -2882,7 +2895,7 @@ static bool api_svcctl_ChangeServiceConfig2A(pipes_struct *p) call = &ndr_table_svcctl.calls[NDR_SVCCTL_CHANGESERVICECONFIG2A]; - r = talloc(NULL, struct svcctl_ChangeServiceConfig2A); + r = talloc(talloc_tos(), struct svcctl_ChangeServiceConfig2A); if (r == NULL) { return false; } @@ -2955,7 +2968,7 @@ static bool api_svcctl_ChangeServiceConfig2W(pipes_struct *p) call = &ndr_table_svcctl.calls[NDR_SVCCTL_CHANGESERVICECONFIG2W]; - r = talloc(NULL, struct svcctl_ChangeServiceConfig2W); + r = talloc(talloc_tos(), struct svcctl_ChangeServiceConfig2W); if (r == NULL) { return false; } @@ -3028,7 +3041,7 @@ static bool api_svcctl_QueryServiceConfig2A(pipes_struct *p) call = &ndr_table_svcctl.calls[NDR_SVCCTL_QUERYSERVICECONFIG2A]; - r = talloc(NULL, struct svcctl_QueryServiceConfig2A); + r = talloc(talloc_tos(), struct svcctl_QueryServiceConfig2A); if (r == NULL) { return false; } @@ -3114,7 +3127,7 @@ static bool api_svcctl_QueryServiceConfig2W(pipes_struct *p) call = &ndr_table_svcctl.calls[NDR_SVCCTL_QUERYSERVICECONFIG2W]; - r = talloc(NULL, struct svcctl_QueryServiceConfig2W); + r = talloc(talloc_tos(), struct svcctl_QueryServiceConfig2W); if (r == NULL) { return false; } @@ -3200,7 +3213,7 @@ static bool api_svcctl_QueryServiceStatusEx(pipes_struct *p) call = &ndr_table_svcctl.calls[NDR_SVCCTL_QUERYSERVICESTATUSEX]; - r = talloc(NULL, struct svcctl_QueryServiceStatusEx); + r = talloc(talloc_tos(), struct svcctl_QueryServiceStatusEx); if (r == NULL) { return false; } @@ -3286,7 +3299,7 @@ static bool api_EnumServicesStatusExA(pipes_struct *p) call = &ndr_table_svcctl.calls[NDR_ENUMSERVICESSTATUSEXA]; - r = talloc(NULL, struct EnumServicesStatusExA); + r = talloc(talloc_tos(), struct EnumServicesStatusExA); if (r == NULL) { return false; } @@ -3385,7 +3398,7 @@ static bool api_EnumServicesStatusExW(pipes_struct *p) call = &ndr_table_svcctl.calls[NDR_ENUMSERVICESSTATUSEXW]; - r = talloc(NULL, struct EnumServicesStatusExW); + r = talloc(talloc_tos(), struct EnumServicesStatusExW); if (r == NULL) { return false; } @@ -3484,7 +3497,7 @@ static bool api_svcctl_SCSendTSMessage(pipes_struct *p) call = &ndr_table_svcctl.calls[NDR_SVCCTL_SCSENDTSMESSAGE]; - r = talloc(NULL, struct svcctl_SCSendTSMessage); + r = talloc(talloc_tos(), struct svcctl_SCSendTSMessage); if (r == NULL) { return false; } diff --git a/source3/librpc/gen_ndr/srv_unixinfo.c b/source3/librpc/gen_ndr/srv_unixinfo.c deleted file mode 100644 index 36a6250ad0..0000000000 --- a/source3/librpc/gen_ndr/srv_unixinfo.c +++ /dev/null @@ -1,430 +0,0 @@ -/* - * Unix SMB/CIFS implementation. - * server auto-generated by pidl. DO NOT MODIFY! - */ - -#include "includes.h" -#include "librpc/gen_ndr/srv_unixinfo.h" - -static bool api_unixinfo_SidToUid(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 unixinfo_SidToUid *r; - - call = &ndr_table_unixinfo.calls[NDR_UNIXINFO_SIDTOUID]; - - r = talloc(NULL, struct unixinfo_SidToUid); - 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(unixinfo_SidToUid, r); - } - - ZERO_STRUCT(r->out); - r->out.uid = talloc_zero(r, uint64_t); - if (r->out.uid == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _unixinfo_SidToUid(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(unixinfo_SidToUid, 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_unixinfo_UidToSid(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 unixinfo_UidToSid *r; - - call = &ndr_table_unixinfo.calls[NDR_UNIXINFO_UIDTOSID]; - - r = talloc(NULL, struct unixinfo_UidToSid); - 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(unixinfo_UidToSid, r); - } - - ZERO_STRUCT(r->out); - r->out.sid = talloc_zero(r, struct dom_sid); - if (r->out.sid == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _unixinfo_UidToSid(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(unixinfo_UidToSid, 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_unixinfo_SidToGid(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 unixinfo_SidToGid *r; - - call = &ndr_table_unixinfo.calls[NDR_UNIXINFO_SIDTOGID]; - - r = talloc(NULL, struct unixinfo_SidToGid); - 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(unixinfo_SidToGid, r); - } - - ZERO_STRUCT(r->out); - r->out.gid = talloc_zero(r, uint64_t); - if (r->out.gid == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _unixinfo_SidToGid(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(unixinfo_SidToGid, 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_unixinfo_GidToSid(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 unixinfo_GidToSid *r; - - call = &ndr_table_unixinfo.calls[NDR_UNIXINFO_GIDTOSID]; - - r = talloc(NULL, struct unixinfo_GidToSid); - 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(unixinfo_GidToSid, r); - } - - ZERO_STRUCT(r->out); - r->out.sid = talloc_zero(r, struct dom_sid); - if (r->out.sid == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _unixinfo_GidToSid(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(unixinfo_GidToSid, 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_unixinfo_GetPWUid(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 unixinfo_GetPWUid *r; - - call = &ndr_table_unixinfo.calls[NDR_UNIXINFO_GETPWUID]; - - r = talloc(NULL, struct unixinfo_GetPWUid); - 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(unixinfo_GetPWUid, r); - } - - ZERO_STRUCT(r->out); - r->out.count = r->in.count; - r->out.infos = talloc_zero_array(r, struct unixinfo_GetPWUidInfo, *r->out.count); - if (r->out.infos == NULL) { - talloc_free(r); - return false; - } - - r->out.result = _unixinfo_GetPWUid(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(unixinfo_GetPWUid, 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_unixinfo_cmds[] = -{ - {"UNIXINFO_SIDTOUID", NDR_UNIXINFO_SIDTOUID, api_unixinfo_SidToUid}, - {"UNIXINFO_UIDTOSID", NDR_UNIXINFO_UIDTOSID, api_unixinfo_UidToSid}, - {"UNIXINFO_SIDTOGID", NDR_UNIXINFO_SIDTOGID, api_unixinfo_SidToGid}, - {"UNIXINFO_GIDTOSID", NDR_UNIXINFO_GIDTOSID, api_unixinfo_GidToSid}, - {"UNIXINFO_GETPWUID", NDR_UNIXINFO_GETPWUID, api_unixinfo_GetPWUid}, -}; - -void unixinfo_get_pipe_fns(struct api_struct **fns, int *n_fns) -{ - *fns = api_unixinfo_cmds; - *n_fns = sizeof(api_unixinfo_cmds) / sizeof(struct api_struct); -} - -NTSTATUS rpc_unixinfo_init(void) -{ - return rpc_pipe_register_commands(SMB_RPC_INTERFACE_VERSION, "unixinfo", "unixinfo", api_unixinfo_cmds, sizeof(api_unixinfo_cmds) / sizeof(struct api_struct)); -} diff --git a/source3/librpc/gen_ndr/srv_unixinfo.h b/source3/librpc/gen_ndr/srv_unixinfo.h deleted file mode 100644 index 6e5c033b61..0000000000 --- a/source3/librpc/gen_ndr/srv_unixinfo.h +++ /dev/null @@ -1,11 +0,0 @@ -#include "librpc/gen_ndr/ndr_unixinfo.h" -#ifndef __SRV_UNIXINFO__ -#define __SRV_UNIXINFO__ -NTSTATUS _unixinfo_SidToUid(pipes_struct *p, struct unixinfo_SidToUid *r); -NTSTATUS _unixinfo_UidToSid(pipes_struct *p, struct unixinfo_UidToSid *r); -NTSTATUS _unixinfo_SidToGid(pipes_struct *p, struct unixinfo_SidToGid *r); -NTSTATUS _unixinfo_GidToSid(pipes_struct *p, struct unixinfo_GidToSid *r); -NTSTATUS _unixinfo_GetPWUid(pipes_struct *p, struct unixinfo_GetPWUid *r); -void unixinfo_get_pipe_fns(struct api_struct **fns, int *n_fns); -NTSTATUS rpc_unixinfo_init(void); -#endif /* __SRV_UNIXINFO__ */ diff --git a/source3/librpc/gen_ndr/srv_winreg.c b/source3/librpc/gen_ndr/srv_winreg.c index ecce99f67a..4672944ad0 100644 --- a/source3/librpc/gen_ndr/srv_winreg.c +++ b/source3/librpc/gen_ndr/srv_winreg.c @@ -17,7 +17,7 @@ static bool api_winreg_OpenHKCR(pipes_struct *p) call = &ndr_table_winreg.calls[NDR_WINREG_OPENHKCR]; - r = talloc(NULL, struct winreg_OpenHKCR); + r = talloc(talloc_tos(), struct winreg_OpenHKCR); if (r == NULL) { return false; } @@ -97,7 +97,7 @@ static bool api_winreg_OpenHKCU(pipes_struct *p) call = &ndr_table_winreg.calls[NDR_WINREG_OPENHKCU]; - r = talloc(NULL, struct winreg_OpenHKCU); + r = talloc(talloc_tos(), struct winreg_OpenHKCU); if (r == NULL) { return false; } @@ -177,7 +177,7 @@ static bool api_winreg_OpenHKLM(pipes_struct *p) call = &ndr_table_winreg.calls[NDR_WINREG_OPENHKLM]; - r = talloc(NULL, struct winreg_OpenHKLM); + r = talloc(talloc_tos(), struct winreg_OpenHKLM); if (r == NULL) { return false; } @@ -257,7 +257,7 @@ static bool api_winreg_OpenHKPD(pipes_struct *p) call = &ndr_table_winreg.calls[NDR_WINREG_OPENHKPD]; - r = talloc(NULL, struct winreg_OpenHKPD); + r = talloc(talloc_tos(), struct winreg_OpenHKPD); if (r == NULL) { return false; } @@ -337,7 +337,7 @@ static bool api_winreg_OpenHKU(pipes_struct *p) call = &ndr_table_winreg.calls[NDR_WINREG_OPENHKU]; - r = talloc(NULL, struct winreg_OpenHKU); + r = talloc(talloc_tos(), struct winreg_OpenHKU); if (r == NULL) { return false; } @@ -417,7 +417,7 @@ static bool api_winreg_CloseKey(pipes_struct *p) call = &ndr_table_winreg.calls[NDR_WINREG_CLOSEKEY]; - r = talloc(NULL, struct winreg_CloseKey); + r = talloc(talloc_tos(), struct winreg_CloseKey); if (r == NULL) { return false; } @@ -492,7 +492,7 @@ static bool api_winreg_CreateKey(pipes_struct *p) call = &ndr_table_winreg.calls[NDR_WINREG_CREATEKEY]; - r = talloc(NULL, struct winreg_CreateKey); + r = talloc(talloc_tos(), struct winreg_CreateKey); if (r == NULL) { return false; } @@ -573,7 +573,7 @@ static bool api_winreg_DeleteKey(pipes_struct *p) call = &ndr_table_winreg.calls[NDR_WINREG_DELETEKEY]; - r = talloc(NULL, struct winreg_DeleteKey); + r = talloc(talloc_tos(), struct winreg_DeleteKey); if (r == NULL) { return false; } @@ -646,7 +646,7 @@ static bool api_winreg_DeleteValue(pipes_struct *p) call = &ndr_table_winreg.calls[NDR_WINREG_DELETEVALUE]; - r = talloc(NULL, struct winreg_DeleteValue); + r = talloc(talloc_tos(), struct winreg_DeleteValue); if (r == NULL) { return false; } @@ -719,7 +719,7 @@ static bool api_winreg_EnumKey(pipes_struct *p) call = &ndr_table_winreg.calls[NDR_WINREG_ENUMKEY]; - r = talloc(NULL, struct winreg_EnumKey); + r = talloc(talloc_tos(), struct winreg_EnumKey); if (r == NULL) { return false; } @@ -796,7 +796,7 @@ static bool api_winreg_EnumValue(pipes_struct *p) call = &ndr_table_winreg.calls[NDR_WINREG_ENUMVALUE]; - r = talloc(NULL, struct winreg_EnumValue); + r = talloc(talloc_tos(), struct winreg_EnumValue); if (r == NULL) { return false; } @@ -875,7 +875,7 @@ static bool api_winreg_FlushKey(pipes_struct *p) call = &ndr_table_winreg.calls[NDR_WINREG_FLUSHKEY]; - r = talloc(NULL, struct winreg_FlushKey); + r = talloc(talloc_tos(), struct winreg_FlushKey); if (r == NULL) { return false; } @@ -948,7 +948,7 @@ static bool api_winreg_GetKeySecurity(pipes_struct *p) call = &ndr_table_winreg.calls[NDR_WINREG_GETKEYSECURITY]; - r = talloc(NULL, struct winreg_GetKeySecurity); + r = talloc(talloc_tos(), struct winreg_GetKeySecurity); if (r == NULL) { return false; } @@ -1023,7 +1023,7 @@ static bool api_winreg_LoadKey(pipes_struct *p) call = &ndr_table_winreg.calls[NDR_WINREG_LOADKEY]; - r = talloc(NULL, struct winreg_LoadKey); + r = talloc(talloc_tos(), struct winreg_LoadKey); if (r == NULL) { return false; } @@ -1096,7 +1096,7 @@ static bool api_winreg_NotifyChangeKeyValue(pipes_struct *p) call = &ndr_table_winreg.calls[NDR_WINREG_NOTIFYCHANGEKEYVALUE]; - r = talloc(NULL, struct winreg_NotifyChangeKeyValue); + r = talloc(talloc_tos(), struct winreg_NotifyChangeKeyValue); if (r == NULL) { return false; } @@ -1169,7 +1169,7 @@ static bool api_winreg_OpenKey(pipes_struct *p) call = &ndr_table_winreg.calls[NDR_WINREG_OPENKEY]; - r = talloc(NULL, struct winreg_OpenKey); + r = talloc(talloc_tos(), struct winreg_OpenKey); if (r == NULL) { return false; } @@ -1249,7 +1249,7 @@ static bool api_winreg_QueryInfoKey(pipes_struct *p) call = &ndr_table_winreg.calls[NDR_WINREG_QUERYINFOKEY]; - r = talloc(NULL, struct winreg_QueryInfoKey); + r = talloc(talloc_tos(), struct winreg_QueryInfoKey); if (r == NULL) { return false; } @@ -1372,7 +1372,7 @@ static bool api_winreg_QueryValue(pipes_struct *p) call = &ndr_table_winreg.calls[NDR_WINREG_QUERYVALUE]; - r = talloc(NULL, struct winreg_QueryValue); + r = talloc(talloc_tos(), struct winreg_QueryValue); if (r == NULL) { return false; } @@ -1450,7 +1450,7 @@ static bool api_winreg_ReplaceKey(pipes_struct *p) call = &ndr_table_winreg.calls[NDR_WINREG_REPLACEKEY]; - r = talloc(NULL, struct winreg_ReplaceKey); + r = talloc(talloc_tos(), struct winreg_ReplaceKey); if (r == NULL) { return false; } @@ -1523,7 +1523,7 @@ static bool api_winreg_RestoreKey(pipes_struct *p) call = &ndr_table_winreg.calls[NDR_WINREG_RESTOREKEY]; - r = talloc(NULL, struct winreg_RestoreKey); + r = talloc(talloc_tos(), struct winreg_RestoreKey); if (r == NULL) { return false; } @@ -1596,7 +1596,7 @@ static bool api_winreg_SaveKey(pipes_struct *p) call = &ndr_table_winreg.calls[NDR_WINREG_SAVEKEY]; - r = talloc(NULL, struct winreg_SaveKey); + r = talloc(talloc_tos(), struct winreg_SaveKey); if (r == NULL) { return false; } @@ -1669,7 +1669,7 @@ static bool api_winreg_SetKeySecurity(pipes_struct *p) call = &ndr_table_winreg.calls[NDR_WINREG_SETKEYSECURITY]; - r = talloc(NULL, struct winreg_SetKeySecurity); + r = talloc(talloc_tos(), struct winreg_SetKeySecurity); if (r == NULL) { return false; } @@ -1742,7 +1742,7 @@ static bool api_winreg_SetValue(pipes_struct *p) call = &ndr_table_winreg.calls[NDR_WINREG_SETVALUE]; - r = talloc(NULL, struct winreg_SetValue); + r = talloc(talloc_tos(), struct winreg_SetValue); if (r == NULL) { return false; } @@ -1815,7 +1815,7 @@ static bool api_winreg_UnLoadKey(pipes_struct *p) call = &ndr_table_winreg.calls[NDR_WINREG_UNLOADKEY]; - r = talloc(NULL, struct winreg_UnLoadKey); + r = talloc(talloc_tos(), struct winreg_UnLoadKey); if (r == NULL) { return false; } @@ -1888,7 +1888,7 @@ static bool api_winreg_InitiateSystemShutdown(pipes_struct *p) call = &ndr_table_winreg.calls[NDR_WINREG_INITIATESYSTEMSHUTDOWN]; - r = talloc(NULL, struct winreg_InitiateSystemShutdown); + r = talloc(talloc_tos(), struct winreg_InitiateSystemShutdown); if (r == NULL) { return false; } @@ -1961,7 +1961,7 @@ static bool api_winreg_AbortSystemShutdown(pipes_struct *p) call = &ndr_table_winreg.calls[NDR_WINREG_ABORTSYSTEMSHUTDOWN]; - r = talloc(NULL, struct winreg_AbortSystemShutdown); + r = talloc(talloc_tos(), struct winreg_AbortSystemShutdown); if (r == NULL) { return false; } @@ -2034,7 +2034,7 @@ static bool api_winreg_GetVersion(pipes_struct *p) call = &ndr_table_winreg.calls[NDR_WINREG_GETVERSION]; - r = talloc(NULL, struct winreg_GetVersion); + r = talloc(talloc_tos(), struct winreg_GetVersion); if (r == NULL) { return false; } @@ -2114,7 +2114,7 @@ static bool api_winreg_OpenHKCC(pipes_struct *p) call = &ndr_table_winreg.calls[NDR_WINREG_OPENHKCC]; - r = talloc(NULL, struct winreg_OpenHKCC); + r = talloc(talloc_tos(), struct winreg_OpenHKCC); if (r == NULL) { return false; } @@ -2194,7 +2194,7 @@ static bool api_winreg_OpenHKDD(pipes_struct *p) call = &ndr_table_winreg.calls[NDR_WINREG_OPENHKDD]; - r = talloc(NULL, struct winreg_OpenHKDD); + r = talloc(talloc_tos(), struct winreg_OpenHKDD); if (r == NULL) { return false; } @@ -2274,7 +2274,7 @@ static bool api_winreg_QueryMultipleValues(pipes_struct *p) call = &ndr_table_winreg.calls[NDR_WINREG_QUERYMULTIPLEVALUES]; - r = talloc(NULL, struct winreg_QueryMultipleValues); + r = talloc(talloc_tos(), struct winreg_QueryMultipleValues); if (r == NULL) { return false; } @@ -2351,7 +2351,7 @@ static bool api_winreg_InitiateSystemShutdownEx(pipes_struct *p) call = &ndr_table_winreg.calls[NDR_WINREG_INITIATESYSTEMSHUTDOWNEX]; - r = talloc(NULL, struct winreg_InitiateSystemShutdownEx); + r = talloc(talloc_tos(), struct winreg_InitiateSystemShutdownEx); if (r == NULL) { return false; } @@ -2424,7 +2424,7 @@ static bool api_winreg_SaveKeyEx(pipes_struct *p) call = &ndr_table_winreg.calls[NDR_WINREG_SAVEKEYEX]; - r = talloc(NULL, struct winreg_SaveKeyEx); + r = talloc(talloc_tos(), struct winreg_SaveKeyEx); if (r == NULL) { return false; } @@ -2497,7 +2497,7 @@ static bool api_winreg_OpenHKPT(pipes_struct *p) call = &ndr_table_winreg.calls[NDR_WINREG_OPENHKPT]; - r = talloc(NULL, struct winreg_OpenHKPT); + r = talloc(talloc_tos(), struct winreg_OpenHKPT); if (r == NULL) { return false; } @@ -2577,7 +2577,7 @@ static bool api_winreg_OpenHKPN(pipes_struct *p) call = &ndr_table_winreg.calls[NDR_WINREG_OPENHKPN]; - r = talloc(NULL, struct winreg_OpenHKPN); + r = talloc(talloc_tos(), struct winreg_OpenHKPN); if (r == NULL) { return false; } @@ -2657,7 +2657,7 @@ static bool api_winreg_QueryMultipleValues2(pipes_struct *p) call = &ndr_table_winreg.calls[NDR_WINREG_QUERYMULTIPLEVALUES2]; - r = talloc(NULL, struct winreg_QueryMultipleValues2); + r = talloc(talloc_tos(), struct winreg_QueryMultipleValues2); if (r == NULL) { return false; } diff --git a/source3/librpc/gen_ndr/srv_wkssvc.c b/source3/librpc/gen_ndr/srv_wkssvc.c index ddbf3aa373..90e6f482f4 100644 --- a/source3/librpc/gen_ndr/srv_wkssvc.c +++ b/source3/librpc/gen_ndr/srv_wkssvc.c @@ -17,7 +17,7 @@ static bool api_wkssvc_NetWkstaGetInfo(pipes_struct *p) call = &ndr_table_wkssvc.calls[NDR_WKSSVC_NETWKSTAGETINFO]; - r = talloc(NULL, struct wkssvc_NetWkstaGetInfo); + r = talloc(talloc_tos(), struct wkssvc_NetWkstaGetInfo); if (r == NULL) { return false; } @@ -97,7 +97,7 @@ static bool api_wkssvc_NetWkstaSetInfo(pipes_struct *p) call = &ndr_table_wkssvc.calls[NDR_WKSSVC_NETWKSTASETINFO]; - r = talloc(NULL, struct wkssvc_NetWkstaSetInfo); + r = talloc(talloc_tos(), struct wkssvc_NetWkstaSetInfo); if (r == NULL) { return false; } @@ -172,7 +172,7 @@ static bool api_wkssvc_NetWkstaEnumUsers(pipes_struct *p) call = &ndr_table_wkssvc.calls[NDR_WKSSVC_NETWKSTAENUMUSERS]; - r = talloc(NULL, struct wkssvc_NetWkstaEnumUsers); + r = talloc(talloc_tos(), struct wkssvc_NetWkstaEnumUsers); if (r == NULL) { return false; } @@ -254,7 +254,7 @@ static bool api_wkssvc_NetrWkstaUserGetInfo(pipes_struct *p) call = &ndr_table_wkssvc.calls[NDR_WKSSVC_NETRWKSTAUSERGETINFO]; - r = talloc(NULL, struct wkssvc_NetrWkstaUserGetInfo); + r = talloc(talloc_tos(), struct wkssvc_NetrWkstaUserGetInfo); if (r == NULL) { return false; } @@ -334,7 +334,7 @@ static bool api_wkssvc_NetrWkstaUserSetInfo(pipes_struct *p) call = &ndr_table_wkssvc.calls[NDR_WKSSVC_NETRWKSTAUSERSETINFO]; - r = talloc(NULL, struct wkssvc_NetrWkstaUserSetInfo); + r = talloc(talloc_tos(), struct wkssvc_NetrWkstaUserSetInfo); if (r == NULL) { return false; } @@ -409,7 +409,7 @@ static bool api_wkssvc_NetWkstaTransportEnum(pipes_struct *p) call = &ndr_table_wkssvc.calls[NDR_WKSSVC_NETWKSTATRANSPORTENUM]; - r = talloc(NULL, struct wkssvc_NetWkstaTransportEnum); + r = talloc(talloc_tos(), struct wkssvc_NetWkstaTransportEnum); if (r == NULL) { return false; } @@ -491,7 +491,7 @@ static bool api_wkssvc_NetrWkstaTransportAdd(pipes_struct *p) call = &ndr_table_wkssvc.calls[NDR_WKSSVC_NETRWKSTATRANSPORTADD]; - r = talloc(NULL, struct wkssvc_NetrWkstaTransportAdd); + r = talloc(talloc_tos(), struct wkssvc_NetrWkstaTransportAdd); if (r == NULL) { return false; } @@ -566,7 +566,7 @@ static bool api_wkssvc_NetrWkstaTransportDel(pipes_struct *p) call = &ndr_table_wkssvc.calls[NDR_WKSSVC_NETRWKSTATRANSPORTDEL]; - r = talloc(NULL, struct wkssvc_NetrWkstaTransportDel); + r = talloc(talloc_tos(), struct wkssvc_NetrWkstaTransportDel); if (r == NULL) { return false; } @@ -639,7 +639,7 @@ static bool api_wkssvc_NetrUseAdd(pipes_struct *p) call = &ndr_table_wkssvc.calls[NDR_WKSSVC_NETRUSEADD]; - r = talloc(NULL, struct wkssvc_NetrUseAdd); + r = talloc(talloc_tos(), struct wkssvc_NetrUseAdd); if (r == NULL) { return false; } @@ -714,7 +714,7 @@ static bool api_wkssvc_NetrUseGetInfo(pipes_struct *p) call = &ndr_table_wkssvc.calls[NDR_WKSSVC_NETRUSEGETINFO]; - r = talloc(NULL, struct wkssvc_NetrUseGetInfo); + r = talloc(talloc_tos(), struct wkssvc_NetrUseGetInfo); if (r == NULL) { return false; } @@ -794,7 +794,7 @@ static bool api_wkssvc_NetrUseDel(pipes_struct *p) call = &ndr_table_wkssvc.calls[NDR_WKSSVC_NETRUSEDEL]; - r = talloc(NULL, struct wkssvc_NetrUseDel); + r = talloc(talloc_tos(), struct wkssvc_NetrUseDel); if (r == NULL) { return false; } @@ -867,7 +867,7 @@ static bool api_wkssvc_NetrUseEnum(pipes_struct *p) call = &ndr_table_wkssvc.calls[NDR_WKSSVC_NETRUSEENUM]; - r = talloc(NULL, struct wkssvc_NetrUseEnum); + r = talloc(talloc_tos(), struct wkssvc_NetrUseEnum); if (r == NULL) { return false; } @@ -949,7 +949,7 @@ static bool api_wkssvc_NetrMessageBufferSend(pipes_struct *p) call = &ndr_table_wkssvc.calls[NDR_WKSSVC_NETRMESSAGEBUFFERSEND]; - r = talloc(NULL, struct wkssvc_NetrMessageBufferSend); + r = talloc(talloc_tos(), struct wkssvc_NetrMessageBufferSend); if (r == NULL) { return false; } @@ -1022,7 +1022,7 @@ static bool api_wkssvc_NetrWorkstationStatisticsGet(pipes_struct *p) call = &ndr_table_wkssvc.calls[NDR_WKSSVC_NETRWORKSTATIONSTATISTICSGET]; - r = talloc(NULL, struct wkssvc_NetrWorkstationStatisticsGet); + r = talloc(talloc_tos(), struct wkssvc_NetrWorkstationStatisticsGet); if (r == NULL) { return false; } @@ -1102,7 +1102,7 @@ static bool api_wkssvc_NetrLogonDomainNameAdd(pipes_struct *p) call = &ndr_table_wkssvc.calls[NDR_WKSSVC_NETRLOGONDOMAINNAMEADD]; - r = talloc(NULL, struct wkssvc_NetrLogonDomainNameAdd); + r = talloc(talloc_tos(), struct wkssvc_NetrLogonDomainNameAdd); if (r == NULL) { return false; } @@ -1175,7 +1175,7 @@ static bool api_wkssvc_NetrLogonDomainNameDel(pipes_struct *p) call = &ndr_table_wkssvc.calls[NDR_WKSSVC_NETRLOGONDOMAINNAMEDEL]; - r = talloc(NULL, struct wkssvc_NetrLogonDomainNameDel); + r = talloc(talloc_tos(), struct wkssvc_NetrLogonDomainNameDel); if (r == NULL) { return false; } @@ -1248,7 +1248,7 @@ static bool api_wkssvc_NetrJoinDomain(pipes_struct *p) call = &ndr_table_wkssvc.calls[NDR_WKSSVC_NETRJOINDOMAIN]; - r = talloc(NULL, struct wkssvc_NetrJoinDomain); + r = talloc(talloc_tos(), struct wkssvc_NetrJoinDomain); if (r == NULL) { return false; } @@ -1321,7 +1321,7 @@ static bool api_wkssvc_NetrUnjoinDomain(pipes_struct *p) call = &ndr_table_wkssvc.calls[NDR_WKSSVC_NETRUNJOINDOMAIN]; - r = talloc(NULL, struct wkssvc_NetrUnjoinDomain); + r = talloc(talloc_tos(), struct wkssvc_NetrUnjoinDomain); if (r == NULL) { return false; } @@ -1394,7 +1394,7 @@ static bool api_wkssvc_NetrRenameMachineInDomain(pipes_struct *p) call = &ndr_table_wkssvc.calls[NDR_WKSSVC_NETRRENAMEMACHINEINDOMAIN]; - r = talloc(NULL, struct wkssvc_NetrRenameMachineInDomain); + r = talloc(talloc_tos(), struct wkssvc_NetrRenameMachineInDomain); if (r == NULL) { return false; } @@ -1467,7 +1467,7 @@ static bool api_wkssvc_NetrValidateName(pipes_struct *p) call = &ndr_table_wkssvc.calls[NDR_WKSSVC_NETRVALIDATENAME]; - r = talloc(NULL, struct wkssvc_NetrValidateName); + r = talloc(talloc_tos(), struct wkssvc_NetrValidateName); if (r == NULL) { return false; } @@ -1540,7 +1540,7 @@ static bool api_wkssvc_NetrGetJoinInformation(pipes_struct *p) call = &ndr_table_wkssvc.calls[NDR_WKSSVC_NETRGETJOININFORMATION]; - r = talloc(NULL, struct wkssvc_NetrGetJoinInformation); + r = talloc(talloc_tos(), struct wkssvc_NetrGetJoinInformation); if (r == NULL) { return false; } @@ -1621,7 +1621,7 @@ static bool api_wkssvc_NetrGetJoinableOus(pipes_struct *p) call = &ndr_table_wkssvc.calls[NDR_WKSSVC_NETRGETJOINABLEOUS]; - r = talloc(NULL, struct wkssvc_NetrGetJoinableOus); + r = talloc(talloc_tos(), struct wkssvc_NetrGetJoinableOus); if (r == NULL) { return false; } @@ -1650,7 +1650,7 @@ static bool api_wkssvc_NetrGetJoinableOus(pipes_struct *p) ZERO_STRUCT(r->out); r->out.num_ous = r->in.num_ous; - r->out.ous = talloc_zero_array(r, const char **, *r->out.num_ous); + r->out.ous = talloc_zero(r, const char **); if (r->out.ous == NULL) { talloc_free(r); return false; @@ -1702,7 +1702,7 @@ static bool api_wkssvc_NetrJoinDomain2(pipes_struct *p) call = &ndr_table_wkssvc.calls[NDR_WKSSVC_NETRJOINDOMAIN2]; - r = talloc(NULL, struct wkssvc_NetrJoinDomain2); + r = talloc(talloc_tos(), struct wkssvc_NetrJoinDomain2); if (r == NULL) { return false; } @@ -1775,7 +1775,7 @@ static bool api_wkssvc_NetrUnjoinDomain2(pipes_struct *p) call = &ndr_table_wkssvc.calls[NDR_WKSSVC_NETRUNJOINDOMAIN2]; - r = talloc(NULL, struct wkssvc_NetrUnjoinDomain2); + r = talloc(talloc_tos(), struct wkssvc_NetrUnjoinDomain2); if (r == NULL) { return false; } @@ -1848,7 +1848,7 @@ static bool api_wkssvc_NetrRenameMachineInDomain2(pipes_struct *p) call = &ndr_table_wkssvc.calls[NDR_WKSSVC_NETRRENAMEMACHINEINDOMAIN2]; - r = talloc(NULL, struct wkssvc_NetrRenameMachineInDomain2); + r = talloc(talloc_tos(), struct wkssvc_NetrRenameMachineInDomain2); if (r == NULL) { return false; } @@ -1921,7 +1921,7 @@ static bool api_wkssvc_NetrValidateName2(pipes_struct *p) call = &ndr_table_wkssvc.calls[NDR_WKSSVC_NETRVALIDATENAME2]; - r = talloc(NULL, struct wkssvc_NetrValidateName2); + r = talloc(talloc_tos(), struct wkssvc_NetrValidateName2); if (r == NULL) { return false; } @@ -1994,7 +1994,7 @@ static bool api_wkssvc_NetrGetJoinableOus2(pipes_struct *p) call = &ndr_table_wkssvc.calls[NDR_WKSSVC_NETRGETJOINABLEOUS2]; - r = talloc(NULL, struct wkssvc_NetrGetJoinableOus2); + r = talloc(talloc_tos(), struct wkssvc_NetrGetJoinableOus2); if (r == NULL) { return false; } @@ -2023,7 +2023,7 @@ static bool api_wkssvc_NetrGetJoinableOus2(pipes_struct *p) ZERO_STRUCT(r->out); r->out.num_ous = r->in.num_ous; - r->out.ous = talloc_zero_array(r, const char **, *r->out.num_ous); + r->out.ous = talloc_zero(r, const char **); if (r->out.ous == NULL) { talloc_free(r); return false; @@ -2075,7 +2075,7 @@ static bool api_wkssvc_NetrAddAlternateComputerName(pipes_struct *p) call = &ndr_table_wkssvc.calls[NDR_WKSSVC_NETRADDALTERNATECOMPUTERNAME]; - r = talloc(NULL, struct wkssvc_NetrAddAlternateComputerName); + r = talloc(talloc_tos(), struct wkssvc_NetrAddAlternateComputerName); if (r == NULL) { return false; } @@ -2148,7 +2148,7 @@ static bool api_wkssvc_NetrRemoveAlternateComputerName(pipes_struct *p) call = &ndr_table_wkssvc.calls[NDR_WKSSVC_NETRREMOVEALTERNATECOMPUTERNAME]; - r = talloc(NULL, struct wkssvc_NetrRemoveAlternateComputerName); + r = talloc(talloc_tos(), struct wkssvc_NetrRemoveAlternateComputerName); if (r == NULL) { return false; } @@ -2221,7 +2221,7 @@ static bool api_wkssvc_NetrSetPrimaryComputername(pipes_struct *p) call = &ndr_table_wkssvc.calls[NDR_WKSSVC_NETRSETPRIMARYCOMPUTERNAME]; - r = talloc(NULL, struct wkssvc_NetrSetPrimaryComputername); + r = talloc(talloc_tos(), struct wkssvc_NetrSetPrimaryComputername); if (r == NULL) { return false; } @@ -2294,7 +2294,7 @@ static bool api_wkssvc_NetrEnumerateComputerNames(pipes_struct *p) call = &ndr_table_wkssvc.calls[NDR_WKSSVC_NETRENUMERATECOMPUTERNAMES]; - r = talloc(NULL, struct wkssvc_NetrEnumerateComputerNames); + r = talloc(talloc_tos(), struct wkssvc_NetrEnumerateComputerNames); if (r == NULL) { return false; } diff --git a/source3/librpc/gen_ndr/srvsvc.h b/source3/librpc/gen_ndr/srvsvc.h index bc167bb31c..6e6c7829a0 100644 --- a/source3/librpc/gen_ndr/srvsvc.h +++ b/source3/librpc/gen_ndr/srvsvc.h @@ -11,10 +11,6 @@ #define STYPE_HIDDEN ( 0x80000000 ) #define SHARE_1005_CSC_POLICY_MASK ( 0x00000030 ) #define SHARE_1005_CSC_POLICY_SHIFT ( 4 ) -; - -; - struct srvsvc_NetCharDevInfo0 { const char *device;/* [unique,charset(UTF16)] */ }; @@ -325,8 +321,6 @@ struct srvsvc_NetShareCtr1004 { #define SHARE_1005_IN_DFS ( 0x00000001 ) #define SHARE_1005_DFS_ROOT ( 0x00000002 ) -; - struct srvsvc_NetShareInfo1005 { uint32_t dfs_flags; }; diff --git a/source3/librpc/gen_ndr/svcctl.h b/source3/librpc/gen_ndr/svcctl.h index f0e476c105..c13e96b2a0 100644 --- a/source3/librpc/gen_ndr/svcctl.h +++ b/source3/librpc/gen_ndr/svcctl.h @@ -68,8 +68,6 @@ struct ENUM_SERVICE_STATUS { #define SV_TYPE_LOCAL_LIST_ONLY ( 0x40000000 ) #define SV_TYPE_DOMAIN_ENUM ( 0x80000000 ) -; - enum SERVICE_CONTROL #ifndef USE_UINT_ENUMS { @@ -136,6 +134,14 @@ struct svcctl_LockServiceDatabase { struct svcctl_QueryServiceObjectSecurity { struct { + struct policy_handle *handle;/* [ref] */ + uint32_t security_flags; + uint32_t buffer_size;/* [range(0,0x40000)] */ + } in; + + struct { + uint8_t *buffer;/* [ref,size_is(buffer_size)] */ + uint32_t *needed;/* [ref,range(0,0x40000)] */ WERROR result; } out; @@ -144,6 +150,13 @@ struct svcctl_QueryServiceObjectSecurity { struct svcctl_SetServiceObjectSecurity { struct { + struct policy_handle *handle;/* [ref] */ + uint32_t security_flags; + uint8_t *buffer;/* [ref,size_is(buffer_size)] */ + uint32_t buffer_size; + } in; + + struct { WERROR result; } out; diff --git a/source3/librpc/gen_ndr/unixinfo.h b/source3/librpc/gen_ndr/unixinfo.h deleted file mode 100644 index 34dc27f469..0000000000 --- a/source3/librpc/gen_ndr/unixinfo.h +++ /dev/null @@ -1,82 +0,0 @@ -/* header auto-generated by pidl */ - -#include <stdint.h> - -#include "librpc/gen_ndr/security.h" -#ifndef _HEADER_unixinfo -#define _HEADER_unixinfo - -struct unixinfo_GetPWUidInfo { - NTSTATUS status; - const char * homedir;/* [flag(LIBNDR_FLAG_STR_UTF8|LIBNDR_FLAG_STR_NULLTERM)] */ - const char * shell;/* [flag(LIBNDR_FLAG_STR_UTF8|LIBNDR_FLAG_STR_NULLTERM)] */ -}; - - -struct unixinfo_SidToUid { - struct { - struct dom_sid sid; - } in; - - struct { - uint64_t *uid;/* [ref] */ - NTSTATUS result; - } out; - -}; - - -struct unixinfo_UidToSid { - struct { - uint64_t uid; - } in; - - struct { - struct dom_sid *sid;/* [ref] */ - NTSTATUS result; - } out; - -}; - - -struct unixinfo_SidToGid { - struct { - struct dom_sid sid; - } in; - - struct { - uint64_t *gid;/* [ref] */ - NTSTATUS result; - } out; - -}; - - -struct unixinfo_GidToSid { - struct { - uint64_t gid; - } in; - - struct { - struct dom_sid *sid;/* [ref] */ - NTSTATUS result; - } out; - -}; - - -struct unixinfo_GetPWUid { - struct { - uint64_t *uids;/* [size_is(*count)] */ - uint32_t *count;/* [ref,range(0 1023)] */ - } in; - - struct { - struct unixinfo_GetPWUidInfo *infos;/* [size_is(*count)] */ - uint32_t *count;/* [ref,range(0 1023)] */ - NTSTATUS result; - } out; - -}; - -#endif /* _HEADER_unixinfo */ diff --git a/source3/librpc/gen_ndr/winreg.h b/source3/librpc/gen_ndr/winreg.h index 8c498963b6..5570b310cd 100644 --- a/source3/librpc/gen_ndr/winreg.h +++ b/source3/librpc/gen_ndr/winreg.h @@ -8,8 +8,6 @@ #ifndef _HEADER_winreg #define _HEADER_winreg -; - /* bitmap winreg_AccessMask */ #define KEY_QUERY_VALUE ( 0x00001 ) #define KEY_SET_VALUE ( 0x00002 ) @@ -20,8 +18,6 @@ #define KEY_WOW64_64KEY ( 0x00100 ) #define KEY_WOW64_32KEY ( 0x00200 ) -; - enum winreg_Type #ifndef USE_UINT_ENUMS { diff --git a/source3/librpc/gen_ndr/wkssvc.h b/source3/librpc/gen_ndr/wkssvc.h index b4df7c2d8f..088ad6632b 100644 --- a/source3/librpc/gen_ndr/wkssvc.h +++ b/source3/librpc/gen_ndr/wkssvc.h @@ -415,8 +415,6 @@ struct wkssvc_NetrWorkstationStatistics { /* bitmap wkssvc_renameflags */ #define WKSSVC_JOIN_FLAGS_ACCOUNT_CREATE ( 0x00000002 ) -; - enum wkssvc_NetValidateNameType #ifndef USE_UINT_ENUMS { @@ -471,8 +469,6 @@ struct wkssvc_PasswordBuffer { #define WKSSVC_JOIN_FLAGS_ACCOUNT_CREATE ( 0x00000002 ) #define WKSSVC_JOIN_FLAGS_JOIN_TYPE ( 0x00000001 ) -; - enum wkssvc_ComputerNameType #ifndef USE_UINT_ENUMS { @@ -830,7 +826,7 @@ struct wkssvc_NetrGetJoinableOus { } in; struct { - const char ***ous;/* [ref,charset(UTF16),size_is(*num_ous)] */ + const char ***ous;/* [ref,charset(UTF16),size_is(,*num_ous)] */ uint32_t *num_ous;/* [ref] */ WERROR result; } out; @@ -912,7 +908,7 @@ struct wkssvc_NetrGetJoinableOus2 { } in; struct { - const char ***ous;/* [ref,charset(UTF16),size_is(*num_ous)] */ + const char ***ous;/* [ref,charset(UTF16),size_is(,*num_ous)] */ uint32_t *num_ous;/* [ref] */ WERROR result; } out; diff --git a/source3/librpc/idl/dfs.idl b/source3/librpc/idl/dfs.idl index 2b519b15d5..d4c05f9936 100644 --- a/source3/librpc/idl/dfs.idl +++ b/source3/librpc/idl/dfs.idl @@ -5,7 +5,8 @@ [ uuid("4fc742e0-4a10-11cf-8273-00aa004ae673"), version(3.0), pointer_default(unique), - helpstring("Settings for Microsoft Distributed File System") + helpstring("Settings for Microsoft Distributed File System"), + endpoint("ncacn_np:[\\pipe\\netdfs]", "ncacn_ip_tcp:", "ncalrpc:") ] interface netdfs { /******************/ @@ -49,12 +50,11 @@ [string,charset(UTF16)] uint16 *path; } dfs_Info1; - /* first 4 bits unverified yet */ typedef [public,bitmap32bit] bitmap { DFS_VOLUME_STATE_OK = 0x1, DFS_VOLUME_STATE_INCONSISTENT = 0x2, - DFS_VOLUME_STATE_OFFLINE = 0x4, - DFS_VOLUME_STATE_ONLINE = 0x8, + DFS_VOLUME_STATE_OFFLINE = 0x3, + DFS_VOLUME_STATE_ONLINE = 0x4, DFS_VOLUME_STATE_STANDALONE = DFS_VOLUME_FLAVOR_STANDALONE, DFS_VOLUME_STATE_AD_BLOB = DFS_VOLUME_FLAVOR_AD_BLOB } dfs_VolumeState; @@ -263,6 +263,16 @@ typedef struct { uint32 count; + [size_is(count)] dfs_Info5 *s; + } dfs_EnumArray5; + + typedef struct { + uint32 count; + [size_is(count)] dfs_Info6 *s; + } dfs_EnumArray6; + + typedef struct { + uint32 count; [size_is(count)] dfs_Info200 *s; } dfs_EnumArray200; @@ -277,6 +287,8 @@ [case(2)] dfs_EnumArray2 *info2; [case(3)] dfs_EnumArray3 *info3; [case(4)] dfs_EnumArray4 *info4; + [case(5)] dfs_EnumArray5 *info5; + [case(6)] dfs_EnumArray6 *info6; [case(200)] dfs_EnumArray200 *info200; [case(300)] dfs_EnumArray300 *info300; } dfs_EnumInfo; @@ -363,10 +375,20 @@ ); /* Function 0x10 */ - WERROR dfs_GetDcAddress(); + WERROR dfs_GetDcAddress( + [in] [string,charset(UTF16)] uint16 servername[], + [in,out,ref] [string,charset(UTF16)] uint16 **server_fullname, + [in,out,ref] boolean8 *is_root, + [in,out,ref] uint32 *ttl + ); /* Function 0x11 */ - WERROR dfs_SetDcAddress(); + WERROR dfs_SetDcAddress( + [in] [string,charset(UTF16)] uint16 servername[], + [in] [string,charset(UTF16)] uint16 server_fullname[], + [in] uint32 flags, + [in] uint32 ttl + ); /* Function 0x12 */ WERROR dfs_FlushFtTable( diff --git a/source3/librpc/idl/dssetup.idl b/source3/librpc/idl/dssetup.idl new file mode 100644 index 0000000000..af6350cc43 --- /dev/null +++ b/source3/librpc/idl/dssetup.idl @@ -0,0 +1,101 @@ +/* + dssetup interface definition +*/ + +import "misc.idl"; + +[ + uuid("3919286a-b10c-11d0-9ba8-00c04fd92ef5"), + version(0.0), + endpoint("ncacn_np:[\\pipe\\lsarpc]", "ncacn_np:[\\pipe\\lsass]", "ncacn_ip_tcp:", "ncalrpc:"), + pointer_default(unique), + helpstring("Active Directory Setup") +] interface dssetup +{ + /**********************************************/ + /* Function 0x00 */ + + typedef enum { + DS_ROLE_STANDALONE_WORKSTATION = 0, + DS_ROLE_MEMBER_WORKSTATION = 1, + DS_ROLE_STANDALONE_SERVER = 2, + DS_ROLE_MEMBER_SERVER = 3, + DS_ROLE_BACKUP_DC = 4, + DS_ROLE_PRIMARY_DC = 5 + } dssetup_DsRole; + + typedef [bitmap32bit] bitmap { + DS_ROLE_PRIMARY_DS_RUNNING = 0x00000001, + DS_ROLE_PRIMARY_DS_MIXED_MODE = 0x00000002, + DS_ROLE_UPGRADE_IN_PROGRESS = 0x00000004, + DS_ROLE_PRIMARY_DOMAIN_GUID_PRESENT = 0x01000000 + } dssetup_DsRoleFlags; + + typedef struct { + dssetup_DsRole role; + dssetup_DsRoleFlags flags; + [charset(UTF16),string] uint16 *domain; + [charset(UTF16),string] uint16 *dns_domain; + [charset(UTF16),string] uint16 *forest; + GUID domain_guid; + } dssetup_DsRolePrimaryDomInfoBasic; + + typedef [v1_enum] enum { + DS_ROLE_NOT_UPGRADING = 0, + DS_ROLE_UPGRADING = 1 + } dssetup_DsUpgrade; + + typedef enum { + DS_ROLE_PREVIOUS_UNKNOWN = 0, + DS_ROLE_PREVIOUS_PRIMARY = 1, + DS_ROLE_PREVIOUS_BACKUP = 2 + } dssetup_DsPrevious; + + typedef struct { + dssetup_DsUpgrade upgrading; + dssetup_DsPrevious previous_role; + } dssetup_DsRoleUpgradeStatus; + + typedef enum { + DS_ROLE_OP_IDLE = 0, + DS_ROLE_OP_ACTIVE = 1, + DS_ROLE_OP_NEEDS_REBOOT = 2 + } dssetup_DsRoleOp; + + typedef struct { + dssetup_DsRoleOp status; + } dssetup_DsRoleOpStatus; + + typedef enum { + DS_ROLE_BASIC_INFORMATION = 1, + DS_ROLE_UPGRADE_STATUS = 2, + DS_ROLE_OP_STATUS = 3 + } dssetup_DsRoleInfoLevel; + + typedef [switch_type(dssetup_DsRoleInfoLevel)] union { + [case(DS_ROLE_BASIC_INFORMATION)] dssetup_DsRolePrimaryDomInfoBasic basic; + [case(DS_ROLE_UPGRADE_STATUS)] dssetup_DsRoleUpgradeStatus upgrade; + [case(DS_ROLE_OP_STATUS)] dssetup_DsRoleOpStatus opstatus; + } dssetup_DsRoleInfo; + + WERROR dssetup_DsRoleGetPrimaryDomainInformation( + [in] dssetup_DsRoleInfoLevel level, + [out,switch_is(level),unique] dssetup_DsRoleInfo *info + ); + + /* + w2k3 has removed all the calls below from their implementation. + These stubs are left here only as a way of documenting the names + of the calls in case they ever turn up on the wire. + */ + WERROR dssetup_DsRoleDnsNameToFlatName(); + WERROR dssetup_DsRoleDcAsDc(); + WERROR dssetup_DsRoleDcAsReplica(); + WERROR dssetup_DsRoleDemoteDc(); + WERROR dssetup_DsRoleGetDcOperationProgress(); + WERROR dssetup_DsRoleGetDcOperationResults(); + WERROR dssetup_DsRoleCancel(); + WERROR dssetup_DsRoleServerSaveStateForUpgrade(); + WERROR dssetup_DsRoleUpgradeDownlevelServer(); + WERROR dssetup_DsRoleAbortDownlevelServerUpgrade(); +} diff --git a/source3/librpc/idl/echo.idl b/source3/librpc/idl/echo.idl index fa030be761..5ea37f1ac1 100644 --- a/source3/librpc/idl/echo.idl +++ b/source3/librpc/idl/echo.idl @@ -50,9 +50,9 @@ interface rpcecho uint32 v; } echo_info3; - typedef struct { + struct echo_info4 { hyper v; - } echo_info4; + }; typedef struct { uint8 v1; @@ -66,14 +66,14 @@ interface rpcecho typedef struct { uint8 v1; - echo_info4 info4; + struct echo_info4 info4; } echo_info7; typedef [switch_type(uint16)] union { [case(1)] echo_info1 info1; [case(2)] echo_info2 info2; [case(3)] echo_info3 info3; - [case(4)] echo_info4 info4; + [case(4)] struct echo_info4 info4; [case(5)] echo_info5 info5; [case(6)] echo_info6 info6; [case(7)] echo_info7 info7; diff --git a/source3/librpc/idl/eventlog.idl b/source3/librpc/idl/eventlog.idl index e088137ccf..18b1a0e454 100644 --- a/source3/librpc/idl/eventlog.idl +++ b/source3/librpc/idl/eventlog.idl @@ -3,11 +3,11 @@ /* eventlog interface definition */ + import "lsa.idl", "security.idl"; [ uuid("82273fdc-e32a-18c3-3f78-827929dc23ea"), version(0.0), - pointer_default(unique), helpstring("Event Logger") ] interface eventlog { @@ -59,7 +59,7 @@ import "lsa.idl", "security.idl"; /* Function: 0x00 */ NTSTATUS eventlog_ClearEventLogW( [in] policy_handle *handle, - [in,unique] lsa_String *unknown + [in,unique] lsa_String *backupfile ); /******************/ @@ -80,12 +80,15 @@ import "lsa.idl", "security.idl"; /* Function: 0x04 */ NTSTATUS eventlog_GetNumRecords( [in] policy_handle *handle, - [out,ref] uint32 *number + [out] uint32 *number ); /******************/ /* Function: 0x05 */ - NTSTATUS eventlog_GetOldestRecord(); + NTSTATUS eventlog_GetOldestRecord( + [in] policy_handle *handle, + [out,ref] uint32 *oldest_entry + ); /******************/ /* Function: 0x06 */ @@ -95,8 +98,8 @@ import "lsa.idl", "security.idl"; /* Function: 0x07 */ NTSTATUS eventlog_OpenEventLogW( [in,unique] eventlog_OpenUnknown0 *unknown0, - [in] lsa_String logname, - [in] lsa_String servername, + [in,ref] lsa_String *logname, + [in,ref] lsa_String *servername, [in] uint32 unknown2, [in] uint32 unknown3, [out] policy_handle *handle @@ -116,8 +119,8 @@ import "lsa.idl", "security.idl"; [in] policy_handle *handle, [in] uint32 flags, [in] uint32 offset, - [in] uint32 number_of_bytes, - [out,size_is(number_of_bytes)] uint8 *data, + [in] [range(0,0x7FFFF)] uint32 number_of_bytes, + [out,ref,size_is(number_of_bytes)] uint8 *data, [out,ref] uint32 *sent_size, [out,ref] uint32 *real_size ); diff --git a/source3/librpc/idl/initshutdown.idl b/source3/librpc/idl/initshutdown.idl index 50d49637c2..868e48e28a 100644 --- a/source3/librpc/idl/initshutdown.idl +++ b/source3/librpc/idl/initshutdown.idl @@ -18,8 +18,8 @@ } initshutdown_String_sub; typedef [public] struct { - [value(strlen_m(r->name->name)*2)] uint16 name_len; - [value(strlen_m_term(r->name->name)*2)] uint16 name_size; + [value(strlen_m(name->name)*2)] uint16 name_len; + [value(strlen_m_term(name->name)*2)] uint16 name_size; initshutdown_String_sub *name; } initshutdown_String; diff --git a/source3/librpc/idl/krb5pac.idl b/source3/librpc/idl/krb5pac.idl new file mode 100644 index 0000000000..601e3e1a27 --- /dev/null +++ b/source3/librpc/idl/krb5pac.idl @@ -0,0 +1,104 @@ +/* + krb5 PAC +*/ + +#include "idl_types.h" + +import "security.idl", "netlogon.idl", "samr.idl"; + +[ + uuid("12345778-1234-abcd-0000-00000000"), + version(0.0), + pointer_default(unique), + helpstring("Active Directory KRB5 PAC") +] +interface krb5pac +{ + typedef struct { + NTTIME logon_time; + [value(2*strlen_m(account_name))] uint16 size; + [charset(UTF16)] uint8 account_name[size]; + } PAC_LOGON_NAME; + + typedef [public,flag(NDR_PAHEX)] struct { + uint32 type; + [flag(NDR_REMAINING)] DATA_BLOB signature; + } PAC_SIGNATURE_DATA; + + typedef [gensize] struct { + netr_SamInfo3 info3; + dom_sid2 *res_group_dom_sid; + samr_RidWithAttributeArray res_groups; + } PAC_LOGON_INFO; + + typedef [public] struct { + [value(0x00081001)] uint32 unknown1; + [value(0xCCCCCCCC)] uint32 unknown2; + [value(NDR_ROUND(ndr_size_PAC_LOGON_INFO(info, ndr->flags)+4,8))] uint32 _ndr_size; + [value(0x00000000)] uint32 unknown3; + PAC_LOGON_INFO *info; + } PAC_LOGON_INFO_CTR; + + typedef [public,v1_enum] enum { + PAC_TYPE_LOGON_INFO = 1, + PAC_TYPE_SRV_CHECKSUM = 6, + PAC_TYPE_KDC_CHECKSUM = 7, + PAC_TYPE_LOGON_NAME = 10, + PAC_TYPE_CONSTRAINED_DELEGATION = 11 + } PAC_TYPE; + + typedef [public,nodiscriminant,gensize] union { + [case(PAC_TYPE_LOGON_INFO)] PAC_LOGON_INFO_CTR logon_info; + [case(PAC_TYPE_SRV_CHECKSUM)] PAC_SIGNATURE_DATA srv_cksum; + [case(PAC_TYPE_KDC_CHECKSUM)] PAC_SIGNATURE_DATA kdc_cksum; + [case(PAC_TYPE_LOGON_NAME)] PAC_LOGON_NAME logon_name; + } PAC_INFO; + + typedef [public,nopush,nopull,noprint] struct { + PAC_TYPE type; + [value(_ndr_size_PAC_INFO(info, type, 0))] uint32 _ndr_size; + [relative,switch_is(type),subcontext(0),subcontext_size(_subcontext_size_PAC_INFO(r, ndr->flags)),flag(NDR_ALIGN8)] PAC_INFO *info; + [value(0)] uint32 _pad; /* Top half of a 64 bit pointer? */ + } PAC_BUFFER; + + typedef [public] struct { + uint32 num_buffers; + uint32 version; + PAC_BUFFER buffers[num_buffers]; + } PAC_DATA; + + typedef struct { + [flag(NDR_REMAINING)] DATA_BLOB remaining; + } DATA_BLOB_REM; + + typedef [public] struct { + PAC_TYPE type; + uint32 ndr_size; + [relative,subcontext(0),subcontext_size(NDR_ROUND(ndr_size,8)),flag(NDR_ALIGN8)] DATA_BLOB_REM *info; + [value(0)] uint32 _pad; /* Top half of a 64 bit pointer? */ + } PAC_BUFFER_RAW; + + typedef [public] struct { + uint32 num_buffers; + uint32 version; + PAC_BUFFER_RAW buffers[num_buffers]; + } PAC_DATA_RAW; + + void decode_pac( + [in] PAC_DATA pac + ); + + void decode_pac_raw( + [in] PAC_DATA_RAW pac + ); + + void decode_login_info( + [in] PAC_LOGON_INFO logon_info + ); + + /* used for samba3 netsamlogon cache */ + typedef [public] struct { + time_t timestamp; + netr_SamInfo3 info3; + } netsamlogoncache_entry; +} diff --git a/source3/librpc/idl/libnet_join.idl b/source3/librpc/idl/libnet_join.idl index 2741b7bd7b..65d17c9203 100644 --- a/source3/librpc/idl/libnet_join.idl +++ b/source3/librpc/idl/libnet_join.idl @@ -13,7 +13,7 @@ interface libnetjoin { typedef bitmap wkssvc_joinflags wkssvc_joinflags; - [nopush,nopull] WERROR libnet_JoinCtx( + [nopush,nopull,noopnum] WERROR libnet_JoinCtx( [in] string dc_name, [in] string machine_name, [in,ref] string *domain_name, @@ -39,7 +39,7 @@ interface libnetjoin [out] boolean8 domain_is_ad ); - [nopush,nopull] WERROR libnet_UnjoinCtx( + [nopush,nopull,noopnum] WERROR libnet_UnjoinCtx( [in] string dc_name, [in] string machine_name, [in] string domain_name, @@ -55,6 +55,8 @@ interface libnetjoin [out] string netbios_domain_name, [out] string dns_domain_name, [out] boolean8 modified_config, - [out] string error_string + [out] string error_string, + [out] boolean8 disabled_machine_account, + [out] boolean8 deleted_machine_account ); } diff --git a/source3/librpc/idl/lsa.idl b/source3/librpc/idl/lsa.idl index 7daf648a63..ee8a2fe6b2 100644 --- a/source3/librpc/idl/lsa.idl +++ b/source3/librpc/idl/lsa.idl @@ -23,7 +23,7 @@ import "security.idl"; typedef [public] struct { [value(2*strlen_m(string))] uint16 length; - [value(2*(strlen_m(string)+1))] uint16 size; + [value(2*strlen_m_term(string))] uint16 size; [charset(UTF16),size_is(size/2),length_is(length/2)] uint16 *string; } lsa_StringLarge; @@ -35,9 +35,15 @@ import "security.idl"; typedef [public] struct { [value(strlen_m(string))] uint16 length; [value(strlen_m(string))] uint16 size; - ascstr_noterm *string; + [charset(DOS),size_is(size),length_is(length)] uint8 *string; } lsa_AsciiString; + typedef [public] struct { + [value(strlen_m(string))] uint16 length; + [value(strlen_m_term(string))] uint16 size; + [charset(DOS),size_is(size),length_is(length)] uint8 *string; + } lsa_AsciiStringLarge; + /******************/ /* Function: 0x00 */ NTSTATUS lsa_Close ( @@ -47,7 +53,7 @@ import "security.idl"; /******************/ /* Function: 0x01 */ - NTSTATUS lsa_Delete ( + [public] NTSTATUS lsa_Delete ( [in] policy_handle *handle ); @@ -69,11 +75,11 @@ import "security.idl"; [size_is(count)] lsa_PrivEntry *privs; } lsa_PrivArray; - NTSTATUS lsa_EnumPrivs ( + [public] NTSTATUS lsa_EnumPrivs ( [in] policy_handle *handle, - [in,out] uint32 *resume_handle, - [in] uint32 max_count, - [out] lsa_PrivArray *privs + [in,out,ref] uint32 *resume_handle, + [out,ref] lsa_PrivArray *privs, + [in] uint32 max_count ); /******************/ @@ -82,14 +88,17 @@ import "security.idl"; NTSTATUS lsa_QuerySecurity ( [in] policy_handle *handle, [in] security_secinfo sec_info, - [out,unique] sec_desc_buf *sdbuf + [out,ref] sec_desc_buf **sdbuf ); /******************/ /* Function: 0x04 */ - NTSTATUS lsa_SetSecObj (); - + NTSTATUS lsa_SetSecObj( + [in] policy_handle *handle, + [in] security_secinfo sec_info, + [in,ref] sec_desc_buf *sdbuf + ); /******************/ /* Function: 0x05 */ @@ -114,12 +123,27 @@ import "security.idl"; lsa_QosInfo *sec_qos; } lsa_ObjectAttribute; + typedef [public,bitmap32bit] bitmap { + LSA_POLICY_VIEW_LOCAL_INFORMATION = 0x00000001, + LSA_POLICY_VIEW_AUDIT_INFORMATION = 0x00000002, + LSA_POLICY_GET_PRIVATE_INFORMATION = 0x00000004, + LSA_POLICY_TRUST_ADMIN = 0x00000008, + LSA_POLICY_CREATE_ACCOUNT = 0x00000010, + LSA_POLICY_CREATE_SECRET = 0x00000020, + LSA_POLICY_CREATE_PRIVILEGE = 0x00000040, + LSA_POLICY_SET_DEFAULT_QUOTA_LIMITS = 0x00000080, + LSA_POLICY_SET_AUDIT_REQUIREMENTS = 0x00000100, + LSA_POLICY_AUDIT_LOG_ADMIN = 0x00000200, + LSA_POLICY_SERVER_ADMIN = 0x00000400, + LSA_POLICY_LOOKUP_NAMES = 0x00000800 + } lsa_PolicyAccessMask; + /* notice the screwup with the system_name - thats why MS created OpenPolicy2 */ - NTSTATUS lsa_OpenPolicy ( + [public] NTSTATUS lsa_OpenPolicy ( [in,unique] uint16 *system_name, [in] lsa_ObjectAttribute *attr, - [in] uint32 access_mask, + [in] lsa_PolicyAccessMask access_mask, [out] policy_handle *handle ); @@ -138,9 +162,29 @@ import "security.idl"; uint32 unknown; } lsa_AuditLogInfo; + typedef [v1_enum] enum { + LSA_AUDIT_POLICY_NONE=0, + LSA_AUDIT_POLICY_SUCCESS=1, + LSA_AUDIT_POLICY_FAILURE=2, + LSA_AUDIT_POLICY_ALL=(LSA_AUDIT_POLICY_SUCCESS|LSA_AUDIT_POLICY_FAILURE), + LSA_AUDIT_POLICY_CLEAR=4 + } lsa_PolicyAuditPolicy; + + typedef enum { + LSA_AUDIT_CATEGORY_SYSTEM = 0, + LSA_AUDIT_CATEGORY_LOGON = 1, + LSA_AUDIT_CATEGORY_FILE_AND_OBJECT_ACCESS = 2, + LSA_AUDIT_CATEGORY_USE_OF_USER_RIGHTS = 3, + LSA_AUDIT_CATEGORY_PROCCESS_TRACKING = 4, + LSA_AUDIT_CATEGORY_SECURITY_POLICY_CHANGES = 5, + LSA_AUDIT_CATEGORY_ACCOUNT_MANAGEMENT = 6, + LSA_AUDIT_CATEGORY_DIRECTORY_SERVICE_ACCESS = 7, /* only in win2k/2k3 */ + LSA_AUDIT_CATEGORY_ACCOUNT_LOGON = 8 /* only in win2k/2k3 */ + } lsa_PolicyAuditEventType; + typedef struct { uint32 auditing_mode; - [size_is(count)] uint32 *settings; + [size_is(count)] lsa_PolicyAuditPolicy *settings; uint32 count; } lsa_AuditEventsInfo; @@ -231,10 +275,10 @@ import "security.idl"; [case(LSA_POLICY_INFO_DNS)] lsa_DnsDomainInfo dns; } lsa_PolicyInformation; - NTSTATUS lsa_QueryInfoPolicy ( + NTSTATUS lsa_QueryInfoPolicy( [in] policy_handle *handle, [in] lsa_PolicyInfo level, - [out,unique,switch_is(level)] lsa_PolicyInformation *info + [out,ref,switch_is(level)] lsa_PolicyInformation **info ); /******************/ @@ -251,9 +295,9 @@ import "security.idl"; /******************/ /* Function: 0x0a */ - NTSTATUS lsa_CreateAccount ( + [public] NTSTATUS lsa_CreateAccount ( [in] policy_handle *handle, - [in] dom_sid2 *sid, + [in,ref] dom_sid2 *sid, [in] uint32 access_mask, [out] policy_handle *acct_handle ); @@ -272,18 +316,18 @@ import "security.idl"; [size_is(num_sids)] lsa_SidPtr *sids; } lsa_SidArray; - NTSTATUS lsa_EnumAccounts ( + [public] NTSTATUS lsa_EnumAccounts ( [in] policy_handle *handle, - [in,out] uint32 *resume_handle, - [in,range(0,8192)] uint32 num_entries, - [out] lsa_SidArray *sids + [in,out,ref] uint32 *resume_handle, + [out,ref] lsa_SidArray *sids, + [in,range(0,8192)] uint32 num_entries ); /*************************************************/ /* Function: 0x0c */ - NTSTATUS lsa_CreateTrustedDomain( + [public] NTSTATUS lsa_CreateTrustedDomain( [in] policy_handle *handle, [in] lsa_DomainInfo *info, [in] uint32 access_mask, @@ -304,9 +348,9 @@ import "security.idl"; NTSTATUS lsa_EnumTrustDom ( [in] policy_handle *handle, - [in,out] uint32 *resume_handle, - [in,range(0,1000)] uint32 max_size, - [out] lsa_DomainList *domains + [in,out,ref] uint32 *resume_handle, + [out,ref] lsa_DomainList *domains, + [in] uint32 max_size ); @@ -337,20 +381,39 @@ import "security.idl"; } lsa_TransSidArray; const int LSA_REF_DOMAIN_LIST_MULTIPLIER = 32; + const int MAX_REF_DOMAINS = LSA_REF_DOMAIN_LIST_MULTIPLIER; + typedef struct { [range(0,1000)] uint32 count; [size_is(count)] lsa_DomainInfo *domains; uint32 max_size; } lsa_RefDomainList; - NTSTATUS lsa_LookupNames ( + /* Level 1: Ask everywhere + * Level 2: Ask domain and trusted domains, no builtin and wkn + * Level 3: Only ask domain + * Level 4: W2k3ad: Only ask AD trusts + * Level 5: Only ask transitive forest trusts + * Level 6: Like 4 + */ + + typedef enum { + LSA_LOOKUP_NAMES_ALL = 1, + LSA_LOOKUP_NAMES_DOMAINS_ONLY = 2, + LSA_LOOKUP_NAMES_PRIMARY_DOMAIN_ONLY = 3, + LSA_LOOKUP_NAMES_UPLEVEL_TRUSTS_ONLY = 4, + LSA_LOOKUP_NAMES_FOREST_TRUSTS_ONLY = 5, + LSA_LOOKUP_NAMES_UPLEVEL_TRUSTS_ONLY2 = 6 + } lsa_LookupNamesLevel; + + [public] NTSTATUS lsa_LookupNames ( [in] policy_handle *handle, [in,range(0,1000)] uint32 num_names, [in,size_is(num_names)] lsa_String names[], - [out,unique] lsa_RefDomainList *domains, - [in,out] lsa_TransSidArray *sids, - [in] uint16 level, - [in,out] uint32 *count + [out,ref] lsa_RefDomainList **domains, + [in,out,ref] lsa_TransSidArray *sids, + [in] lsa_LookupNamesLevel level, + [in,out,ref] uint32 *count ); @@ -368,18 +431,21 @@ import "security.idl"; [size_is(count)] lsa_TranslatedName *names; } lsa_TransNameArray; - NTSTATUS lsa_LookupSids ( + /* This number is based on Win2k and later maximum response allowed */ + const int MAX_LOOKUP_SIDS = 0x5000; /* 20480 */ + + [public] NTSTATUS lsa_LookupSids ( [in] policy_handle *handle, - [in] lsa_SidArray *sids, - [out,unique] lsa_RefDomainList *domains, - [in,out] lsa_TransNameArray *names, + [in,ref] lsa_SidArray *sids, + [out,ref] lsa_RefDomainList **domains, + [in,out,ref] lsa_TransNameArray *names, [in] uint16 level, - [in,out] uint32 *count + [in,out,ref] uint32 *count ); /* Function: 0x10 */ - NTSTATUS lsa_CreateSecret( + [public] NTSTATUS lsa_CreateSecret( [in] policy_handle *handle, [in] lsa_String name, [in] uint32 access_mask, @@ -389,9 +455,9 @@ import "security.idl"; /*****************************************/ /* Function: 0x11 */ - NTSTATUS lsa_OpenAccount ( + NTSTATUS lsa_OpenAccount( [in] policy_handle *handle, - [in] dom_sid2 *sid, + [in,ref] dom_sid2 *sid, [in] uint32 access_mask, [out] policy_handle *acct_handle ); @@ -413,7 +479,7 @@ import "security.idl"; NTSTATUS lsa_EnumPrivsAccount ( [in] policy_handle *handle, - [out,unique] lsa_PrivilegeSet *privs + [out,ref] lsa_PrivilegeSet **privs ); @@ -421,7 +487,7 @@ import "security.idl"; /* Function: 0x13 */ NTSTATUS lsa_AddPrivilegesToAccount( [in] policy_handle *handle, - [in] lsa_PrivilegeSet *privs + [in,ref] lsa_PrivilegeSet *privs ); @@ -440,9 +506,16 @@ import "security.idl"; NTSTATUS lsa_SetQuotasForAccount(); /* Function: 0x17 */ - NTSTATUS lsa_GetSystemAccessAccount(); + NTSTATUS lsa_GetSystemAccessAccount( + [in] policy_handle *handle, + [out,ref] uint32 *access_mask + ); + /* Function: 0x18 */ - NTSTATUS lsa_SetSystemAccessAccount(); + NTSTATUS lsa_SetSystemAccessAccount( + [in] policy_handle *handle, + [in] uint32 access_mask + ); /* Function: 0x19 */ NTSTATUS lsa_OpenTrustedDomain( @@ -559,7 +632,7 @@ import "security.idl"; NTSTATUS lsa_SetInformationTrustedDomain(); /* Function: 0x1c */ - NTSTATUS lsa_OpenSecret( + [public] NTSTATUS lsa_OpenSecret( [in] policy_handle *handle, [in] lsa_String name, [in] uint32 access_mask, @@ -568,7 +641,7 @@ import "security.idl"; /* Function: 0x1d */ - NTSTATUS lsa_SetSecret( + [public] NTSTATUS lsa_SetSecret( [in] policy_handle *sec_handle, [in,unique] lsa_DATA_BUF *new_val, [in,unique] lsa_DATA_BUF *old_val @@ -579,7 +652,7 @@ import "security.idl"; } lsa_DATA_BUF_PTR; /* Function: 0x1e */ - NTSTATUS lsa_QuerySecret ( + [public] NTSTATUS lsa_QuerySecret ( [in] policy_handle *sec_handle, [in,out,unique] lsa_DATA_BUF_PTR *new_val, [in,out,unique] NTTIME_hyper *new_mtime, @@ -590,8 +663,8 @@ import "security.idl"; /* Function: 0x1f */ NTSTATUS lsa_LookupPrivValue( [in] policy_handle *handle, - [in] lsa_String *name, - [out] lsa_LUID *luid + [in,ref] lsa_String *name, + [out,ref] lsa_LUID *luid ); @@ -606,19 +679,21 @@ import "security.idl"; /*******************/ /* Function: 0x21 */ NTSTATUS lsa_LookupPrivDisplayName ( - [in] policy_handle *handle, - [in] lsa_String *name, - [out,unique] lsa_StringLarge *disp_name, + [in] policy_handle *handle, + [in,ref] lsa_String *name, + [in] uint16 language_id, + [in] uint16 language_id_sys, + [out,ref] lsa_StringLarge **disp_name, /* see http://www.microsoft.com/globaldev/nlsweb/ for language definitions */ - [in,out] uint16 *language_id, - [in] uint16 unknown + [out,ref] uint16 *returned_language_id ); /* Function: 0x22 */ - NTSTATUS lsa_DeleteObject(); + NTSTATUS lsa_DeleteObject( + [in,out] policy_handle *handle + ); - /*******************/ /* Function: 0x23 */ NTSTATUS lsa_EnumAccountsWithUserRight ( @@ -633,14 +708,14 @@ import "security.idl"; } lsa_RightAttribute; typedef struct { - uint32 count; + [range(0,256)] uint32 count; [size_is(count)] lsa_StringLarge *names; } lsa_RightSet; NTSTATUS lsa_EnumAccountRights ( [in] policy_handle *handle, - [in] dom_sid2 *sid, - [out] lsa_RightSet *rights + [in,ref] dom_sid2 *sid, + [out,ref] lsa_RightSet *rights ); @@ -648,17 +723,17 @@ import "security.idl"; /* Function: 0x25 */ NTSTATUS lsa_AddAccountRights ( [in] policy_handle *handle, - [in] dom_sid2 *sid, - [in] lsa_RightSet *rights + [in,ref] dom_sid2 *sid, + [in,ref] lsa_RightSet *rights ); /**********************/ /* Function: 0x26 */ NTSTATUS lsa_RemoveAccountRights ( [in] policy_handle *handle, - [in] dom_sid2 *sid, - [in] uint32 unknown, - [in] lsa_RightSet *rights + [in,ref] dom_sid2 *sid, + [in] uint8 remove_all, + [in,ref] lsa_RightSet *rights ); /* Function: 0x27 */ @@ -685,32 +760,28 @@ import "security.idl"; /**********************/ /* Function: 0x2c */ - NTSTATUS lsa_OpenPolicy2 ( + [public] NTSTATUS lsa_OpenPolicy2 ( [in,unique] [string,charset(UTF16)] uint16 *system_name, [in] lsa_ObjectAttribute *attr, - [in] uint32 access_mask, + [in] lsa_PolicyAccessMask access_mask, [out] policy_handle *handle ); /**********************/ /* Function: 0x2d */ - typedef struct { - lsa_String *string; - } lsa_StringPointer; - NTSTATUS lsa_GetUserName( [in,unique] [string,charset(UTF16)] uint16 *system_name, - [in,out,unique] lsa_String *account_name, - [in,out,unique] lsa_StringPointer *authority_name + [in,out,ref] lsa_String **account_name, + [in,out,unique] lsa_String **authority_name ); /**********************/ /* Function: 0x2e */ NTSTATUS lsa_QueryInfoPolicy2( - [in] policy_handle *handle, - [in] lsa_PolicyInfo level, - [out,unique,switch_is(level)] lsa_PolicyInformation *info + [in] policy_handle *handle, + [in] lsa_PolicyInfo level, + [out,ref,switch_is(level)] lsa_PolicyInformation **info ); /* Function 0x2f */ @@ -723,10 +794,10 @@ import "security.idl"; /**********************/ /* Function 0x30 */ NTSTATUS lsa_QueryTrustedDomainInfoByName( - [in] policy_handle *handle, - [in] lsa_String trusted_domain, - [in] lsa_TrustDomInfoEnum level, - [out,unique,switch_is(level)] lsa_TrustedDomainInfo *info + [in] policy_handle *handle, + [in,ref] lsa_String *trusted_domain, + [in] lsa_TrustDomInfoEnum level, + [out,ref,switch_is(level)] lsa_TrustedDomainInfo *info ); /**********************/ @@ -832,13 +903,13 @@ import "security.idl"; [size_is(count)] lsa_TranslatedName2 *names; } lsa_TransNameArray2; - NTSTATUS lsa_LookupSids2( + [public] NTSTATUS lsa_LookupSids2( [in] policy_handle *handle, - [in] lsa_SidArray *sids, - [out,unique] lsa_RefDomainList *domains, - [in,out] lsa_TransNameArray2 *names, + [in,ref] lsa_SidArray *sids, + [out,ref] lsa_RefDomainList **domains, + [in,out,ref] lsa_TransNameArray2 *names, [in] uint16 level, - [in,out] uint32 *count, + [in,out,ref] uint32 *count, [in] uint32 unknown1, [in] uint32 unknown2 ); @@ -858,14 +929,14 @@ import "security.idl"; [size_is(count)] lsa_TranslatedSid2 *sids; } lsa_TransSidArray2; - NTSTATUS lsa_LookupNames2 ( + [public] NTSTATUS lsa_LookupNames2 ( [in] policy_handle *handle, [in,range(0,1000)] uint32 num_names, [in,size_is(num_names)] lsa_String names[], - [out,unique] lsa_RefDomainList *domains, - [in,out] lsa_TransSidArray2 *sids, - [in] uint16 level, - [in,out] uint32 *count, + [out,ref] lsa_RefDomainList **domains, + [in,out,ref] lsa_TransSidArray2 *sids, + [in] lsa_LookupNamesLevel level, + [in,out,ref] uint32 *count, [in] uint32 unknown1, [in] uint32 unknown2 ); @@ -911,14 +982,14 @@ import "security.idl"; [size_is(count)] lsa_TranslatedSid3 *sids; } lsa_TransSidArray3; - NTSTATUS lsa_LookupNames3 ( + [public] NTSTATUS lsa_LookupNames3 ( [in] policy_handle *handle, [in,range(0,1000)] uint32 num_names, [in,size_is(num_names)] lsa_String names[], - [out,unique] lsa_RefDomainList *domains, - [in,out] lsa_TransSidArray3 *sids, - [in] uint16 level, - [in,out] uint32 *count, + [out,ref] lsa_RefDomainList **domains, + [in,out,ref] lsa_TransSidArray3 *sids, + [in] lsa_LookupNamesLevel level, + [in,out,ref] uint32 *count, [in] uint32 unknown1, [in] uint32 unknown2 ); @@ -936,7 +1007,49 @@ import "security.idl"; NTSTATUS lsa_LSARUNREGISTERAUDITEVENT(); /* Function 0x49 */ - NTSTATUS lsa_LSARQUERYFORESTTRUSTINFORMATION(); + typedef struct { + [range(0,131072)] uint32 length; + [size_is(length)] uint8 *data; + } lsa_ForestTrustBinaryData; + + typedef struct { + dom_sid2 *domain_sid; + lsa_StringLarge dns_domain_name; + lsa_StringLarge netbios_domain_name; + } lsa_ForestTrustDomainInfo; + + typedef [switch_type(uint32)] union { + [case(LSA_FOREST_TRUST_TOP_LEVEL_NAME)] lsa_String top_level_name; + [case(LSA_FOREST_TRUST_TOP_LEVEL_NAME_EX)] lsa_StringLarge top_level_name_ex; + [case(LSA_FOREST_TRUST_DOMAIN_INFO)] lsa_ForestTrustDomainInfo domain_info; + [default] lsa_ForestTrustBinaryData data; + } lsa_ForestTrustData; + + typedef [v1_enum] enum { + LSA_FOREST_TRUST_TOP_LEVEL_NAME = 0, + LSA_FOREST_TRUST_TOP_LEVEL_NAME_EX = 1, + LSA_FOREST_TRUST_DOMAIN_INFO = 2, + LSA_FOREST_TRUST_RECORD_TYPE_LAST = 3 + } lsa_ForestTrustRecordType; + + typedef struct { + uint32 flags; + lsa_ForestTrustRecordType level; + hyper unknown; + [switch_is(level)] lsa_ForestTrustData forest_trust_data; + } lsa_ForestTrustRecord; + + typedef [public] struct { + [range(0,4000)] uint32 count; + [size_is(count)] lsa_ForestTrustRecord **entries; + } lsa_ForestTrustInformation; + + NTSTATUS lsa_lsaRQueryForestTrustInformation( + [in] policy_handle *handle, + [in,ref] lsa_String *trusted_domain_name, + [in] uint16 unknown, /* level ? */ + [out,ref] lsa_ForestTrustInformation **forest_trust_info + ); /* Function 0x4a */ NTSTATUS lsa_LSARSETFORESTTRUSTINFORMATION(); @@ -947,12 +1060,12 @@ import "security.idl"; /*****************/ /* Function 0x4c */ - NTSTATUS lsa_LookupSids3( - [in] lsa_SidArray *sids, - [out,unique] lsa_RefDomainList *domains, - [in,out] lsa_TransNameArray2 *names, + [public] NTSTATUS lsa_LookupSids3( + [in,ref] lsa_SidArray *sids, + [out,ref] lsa_RefDomainList **domains, + [in,out,ref] lsa_TransNameArray2 *names, [in] uint16 level, - [in,out] uint32 *count, + [in,out,ref] uint32 *count, [in] uint32 unknown1, [in] uint32 unknown2 ); @@ -961,10 +1074,10 @@ import "security.idl"; NTSTATUS lsa_LookupNames4( [in,range(0,1000)] uint32 num_names, [in,size_is(num_names)] lsa_String names[], - [out,unique] lsa_RefDomainList *domains, - [in,out] lsa_TransSidArray3 *sids, - [in] uint16 level, - [in,out] uint32 *count, + [out,ref] lsa_RefDomainList **domains, + [in,out,ref] lsa_TransSidArray3 *sids, + [in] lsa_LookupNamesLevel level, + [in,out,ref] uint32 *count, [in] uint32 unknown1, [in] uint32 unknown2 ); diff --git a/source3/librpc/idl/misc.idl b/source3/librpc/idl/misc.idl index ae098d09ac..132a81f138 100644 --- a/source3/librpc/idl/misc.idl +++ b/source3/librpc/idl/misc.idl @@ -45,8 +45,7 @@ interface misc typedef [public,v1_enum] enum { SAMR_REJECT_OTHER = 0, SAMR_REJECT_TOO_SHORT = 1, - SAMR_REJECT_COMPLEXITY = 2 + SAMR_REJECT_IN_HISTORY = 2, + SAMR_REJECT_COMPLEXITY = 5 } samr_RejectReason; - - } diff --git a/source3/librpc/idl/netlogon.idl b/source3/librpc/idl/netlogon.idl index 72feb2f9ed..5979701703 100644 --- a/source3/librpc/idl/netlogon.idl +++ b/source3/librpc/idl/netlogon.idl @@ -4,22 +4,21 @@ who contributed! */ -#include "idl_types.h" - import "lsa.idl", "samr.idl", "security.idl"; +#include "idl_types.h" [ uuid("12345678-1234-abcd-ef00-01234567cffb"), version(1.0), endpoint("ncacn_np:[\\pipe\\netlogon]","ncacn_ip_tcp:","ncalrpc:"), - pointer_default(unique), - pointer_default_top(unique) + pointer_default(unique) ] interface netlogon { typedef bitmap samr_AcctFlags samr_AcctFlags; + typedef bitmap samr_GroupAttrs samr_GroupAttrs; /*****************/ /* Function 0x00 */ @@ -44,10 +43,10 @@ interface netlogon } netr_UasInfo; WERROR netr_LogonUasLogon( - [in] [string,charset(UTF16)] uint16 *server_name, + [in,unique] [string,charset(UTF16)] uint16 *server_name, [in] [string,charset(UTF16)] uint16 account_name[], [in] [string,charset(UTF16)] uint16 workstation[], - [out] netr_UasInfo *info + [out,ref] netr_UasInfo *info ); @@ -60,7 +59,7 @@ interface netlogon } netr_UasLogoffInfo; WERROR netr_LogonUasLogoff( - [in] [string,charset(UTF16)] uint16 *server_name, + [in,unique] [string,charset(UTF16)] uint16 *server_name, [in] [string,charset(UTF16)] uint16 account_name[], [in] [string,charset(UTF16)] uint16 workstation[], [out,ref] netr_UasLogoffInfo *info @@ -87,13 +86,18 @@ interface netlogon [size_is(size/2),length_is(length/2)] uint16 *bindata; } netr_AcctLockStr; - const int MSV1_0_CLEARTEXT_PASSWORD_ALLOWED = 0x002; - const int MSV1_0_ALLOW_SERVER_TRUST_ACCOUNT = 0x020; - const int MSV1_0_ALLOW_WORKSTATION_TRUST_ACCOUNT = 0x800; + typedef [public,bitmap32bit] bitmap { + MSV1_0_CLEARTEXT_PASSWORD_ALLOWED = 0x00000002, + MSV1_0_UPDATE_LOGON_STATISTICS = 0x00000004, + MSV1_0_RETURN_USER_PARAMETERS = 0x00000008, + MSV1_0_ALLOW_SERVER_TRUST_ACCOUNT = 0x00000020, + MSV1_0_RETURN_PROFILE_PATH = 0x00000200, + MSV1_0_ALLOW_WORKSTATION_TRUST_ACCOUNT = 0x00000800 + } netr_LogonParameterControl; typedef struct { lsa_String domain_name; - uint32 parameter_control; /* see MSV1_0_* */ + netr_LogonParameterControl parameter_control; /* see MSV1_0_* */ uint32 logon_id_low; uint32 logon_id_high; lsa_String account_name; @@ -127,11 +131,6 @@ interface netlogon [case(6)] netr_NetworkInfo *network; } netr_LogonLevel; - typedef [public] struct { - uint32 rid; - uint32 attributes; - } netr_GroupMembership; - typedef [public,flag(NDR_PAHEX)] struct { uint8 key[16]; } netr_UserSessionKey; @@ -142,16 +141,17 @@ interface netlogon /* Flags for user_flags below */ typedef [public,bitmap32bit] bitmap { - NETLOGON_GUEST = 0x0001, - NETLOGON_NOENCRYPTION = 0x0002, - NETLOGON_CACHED_ACCOUNT = 0x0004, - NETLOGON_USED_LM_PASSWORD = 0x0008, - NETLOGON_EXTRA_SIDS = 0x0020, - NETLOGON_SUBAUTH_SESSION_KEY = 0x0040, - NETLOGON_SERVER_TRUST_ACCOUNT = 0x0080, - NETLOGON_NTLMV2_ENABLED = 0x0100, - NETLOGON_RESOURCE_GROUPS = 0x0200, - NETLOGON_PROFILE_PATH_RETURNED = 0x0400 + NETLOGON_GUEST = 0x00000001, + NETLOGON_NOENCRYPTION = 0x00000002, + NETLOGON_CACHED_ACCOUNT = 0x00000004, + NETLOGON_USED_LM_PASSWORD = 0x00000008, + NETLOGON_EXTRA_SIDS = 0x00000020, + NETLOGON_SUBAUTH_SESSION_KEY = 0x00000040, + NETLOGON_SERVER_TRUST_ACCOUNT = 0x00000080, + NETLOGON_NTLMV2_ENABLED = 0x00000100, + NETLOGON_RESOURCE_GROUPS = 0x00000200, + NETLOGON_PROFILE_PATH_RETURNED = 0x00000400, + NETLOGON_GRACE_LOGON = 0x01000000 } netr_UserFlags; typedef struct { @@ -188,7 +188,7 @@ interface netlogon typedef struct { dom_sid2 *sid; - uint32 attribute; + samr_GroupAttrs attributes; } netr_SidAttr; typedef [public] struct { @@ -240,12 +240,12 @@ interface netlogon } netr_Authenticator; NTSTATUS netr_LogonSamLogon( - [in] [string,charset(UTF16)] uint16 *server_name, - [in] [string,charset(UTF16)] uint16 *computer_name, - [in] netr_Authenticator *credential, - [in][out] netr_Authenticator *return_authenticator, + [in,unique] [string,charset(UTF16)] uint16 *server_name, + [in,unique] [string,charset(UTF16)] uint16 *computer_name, + [in,unique] netr_Authenticator *credential, + [in,out,unique] netr_Authenticator *return_authenticator, [in] uint16 logon_level, - [in] [switch_is(logon_level)] netr_LogonLevel logon, + [in,ref] [switch_is(logon_level)] netr_LogonLevel *logon, [in] uint16 validation_level, [out,ref] [switch_is(validation_level)] netr_Validation *validation, [out,ref] uint8 *authoritative @@ -256,10 +256,10 @@ interface netlogon /* Function 0x03 */ NTSTATUS netr_LogonSamLogoff( - [in] [string,charset(UTF16)] uint16 *server_name, - [in] [string,charset(UTF16)] uint16 *computer_name, - [in] netr_Authenticator *credential, - [in][out] netr_Authenticator *return_authenticator, + [in,unique] [string,charset(UTF16)] uint16 *server_name, + [in,unique] [string,charset(UTF16)] uint16 *computer_name, + [in,unique] netr_Authenticator *credential, + [in,out,unique] netr_Authenticator *return_authenticator, [in] uint16 logon_level, [in] [switch_is(logon_level)] netr_LogonLevel logon ); @@ -270,9 +270,10 @@ interface netlogon /* Function 0x04 */ NTSTATUS netr_ServerReqChallenge( - [in,string,charset(UTF16)] uint16 *server_name, + [in,unique,string,charset(UTF16)] uint16 *server_name, [in,string,charset(UTF16)] uint16 computer_name[], - [in,out,ref] netr_Credential *credentials + [in,ref] netr_Credential *credentials, + [out,ref] netr_Credential *return_credentials ); @@ -282,11 +283,12 @@ interface netlogon typedef enum netr_SchannelType netr_SchannelType; NTSTATUS netr_ServerAuthenticate( - [in,string,charset(UTF16)] uint16 *server_name, + [in,unique,string,charset(UTF16)] uint16 *server_name, [in,string,charset(UTF16)] uint16 account_name[], [in] netr_SchannelType secure_channel_type, [in,string,charset(UTF16)] uint16 computer_name[], - [in,out,ref] netr_Credential *credentials + [in,ref] netr_Credential *credentials, + [out,ref] netr_Credential *return_credentials ); @@ -294,13 +296,13 @@ interface netlogon /* Function 0x06 */ NTSTATUS netr_ServerPasswordSet( - [in] [string,charset(UTF16)] uint16 *server_name, + [in,unique] [string,charset(UTF16)] uint16 *server_name, [in] [string,charset(UTF16)] uint16 account_name[], [in] netr_SchannelType secure_channel_type, [in] [string,charset(UTF16)] uint16 computer_name[], - [in] netr_Authenticator credential, - [in] samr_Password new_password, - [out,ref] netr_Authenticator *return_authenticator + [in,ref] netr_Authenticator *credential, + [out,ref] netr_Authenticator *return_authenticator, + [in,ref] samr_Password *new_password ); @@ -330,10 +332,10 @@ interface netlogon typedef struct { uint16 nt_length; - uint16 nt_size; + [value(nt_length)] uint16 nt_size; uint32 nt_flags; uint16 lm_length; - uint16 lm_size; + [value(lm_length)] uint16 lm_size; uint32 lm_flags; uint8 nt_history[nt_length]; uint8 lm_history[lm_length]; @@ -342,10 +344,10 @@ interface netlogon typedef struct { netr_USER_KEY16 lmpassword; netr_USER_KEY16 ntpassword; - netr_PasswordHistory lmhistory; + netr_PasswordHistory history; } netr_USER_KEYS2; - typedef struct { + typedef struct { /* TODO: make this a union! */ netr_USER_KEYS2 keys2; } netr_USER_KEY_UNION; @@ -680,12 +682,12 @@ interface netlogon NTSTATUS netr_DatabaseDeltas( [in] [string,charset(UTF16)] uint16 logon_server[], [in] [string,charset(UTF16)] uint16 computername[], - [in] netr_Authenticator credential, + [in,ref] netr_Authenticator *credential, [in,out,ref] netr_Authenticator *return_authenticator, [in] netr_SamDatabaseID database_id, [in,out,ref] udlong *sequence_num, - [in] uint32 preferredmaximumlength, - [out] netr_DELTA_ENUM_ARRAY *delta_enum_array + [out,ref] netr_DELTA_ENUM_ARRAY **delta_enum_array, + [in] uint32 preferredmaximumlength ); @@ -700,7 +702,7 @@ interface netlogon [in] netr_SamDatabaseID database_id, [in,out,ref] uint32 *sync_context, [in] uint32 preferredmaximumlength, - [out] netr_DELTA_ENUM_ARRAY *delta_enum_array + [out,ref] netr_DELTA_ENUM_ARRAY *delta_enum_array ); @@ -720,7 +722,7 @@ interface netlogon } netr_AccountBuffer; NTSTATUS netr_AccountDeltas( - [in] [string,charset(UTF16)] uint16 *logon_server, + [in,unique] [string,charset(UTF16)] uint16 *logon_server, [in] [string,charset(UTF16)] uint16 computername[], [in] netr_Authenticator credential, [in,out,ref] netr_Authenticator *return_authenticator, @@ -739,7 +741,7 @@ interface netlogon /* Function 0x0A */ NTSTATUS netr_AccountSync( - [in] [string,charset(UTF16)] uint16 *logon_server, + [in,unique] [string,charset(UTF16)] uint16 *logon_server, [in] [string,charset(UTF16)] uint16 computername[], [in] netr_Authenticator credential, [in,out,ref] netr_Authenticator *return_authenticator, @@ -757,9 +759,9 @@ interface netlogon /*****************/ /* Function 0x0B */ - NTSTATUS netr_GetDcName( + WERROR netr_GetDcName( [in] [string,charset(UTF16)] uint16 logon_server[], - [in] [string,charset(UTF16)] uint16 *domainname, + [in,unique] [string,charset(UTF16)] uint16 *domainname, [out,ref] [string,charset(UTF16)] uint16 **dcname ); @@ -796,6 +798,7 @@ interface netlogon /* function_code values */ typedef [v1_enum] enum { + NETLOGON_CONTROL_SYNC = 2, NETLOGON_CONTROL_REDISCOVER = 5, NETLOGON_CONTROL_TC_QUERY = 6, NETLOGON_CONTROL_TRANSPORT_NOTIFY = 7, @@ -803,7 +806,7 @@ interface netlogon } netr_LogonControlCode; WERROR netr_LogonControl( - [in] [string,charset(UTF16)] uint16 *logon_server, + [in,unique] [string,charset(UTF16)] uint16 *logon_server, [in] netr_LogonControlCode function_code, [in] uint32 level, [out,ref,switch_is(level)] netr_CONTROL_QUERY_INFORMATION *info @@ -814,8 +817,8 @@ interface netlogon /* Function 0x0D */ WERROR netr_GetAnyDCName( - [in] [string,charset(UTF16)] uint16 *logon_server, - [in] [string,charset(UTF16)] uint16 *domainname, + [in,unique] [string,charset(UTF16)] uint16 *logon_server, + [in,unique] [string,charset(UTF16)] uint16 *domainname, [out,ref] [string,charset(UTF16)] uint16 **dcname ); @@ -831,10 +834,10 @@ interface netlogon } netr_CONTROL_DATA_INFORMATION; WERROR netr_LogonControl2( - [in] [string,charset(UTF16)] uint16 *logon_server, + [in,unique] [string,charset(UTF16)] uint16 *logon_server, [in] uint32 function_code, [in] uint32 level, - [in][switch_is(function_code)] netr_CONTROL_DATA_INFORMATION data, + [in,ref][switch_is(function_code)] netr_CONTROL_DATA_INFORMATION *data, [out,ref][switch_is(level)] netr_CONTROL_QUERY_INFORMATION *query ); @@ -850,11 +853,12 @@ interface netlogon /* Function 0x0F */ NTSTATUS netr_ServerAuthenticate2( - [in] [string,charset(UTF16)] uint16 *server_name, + [in,unique] [string,charset(UTF16)] uint16 *server_name, [in] [string,charset(UTF16)] uint16 account_name[], [in] netr_SchannelType secure_channel_type, [in] [string,charset(UTF16)] uint16 computer_name[], - [in,out,ref] netr_Credential *credentials, + [in,ref] netr_Credential *credentials, + [out,ref] netr_Credential *return_credentials, [in,out,ref] uint32 *negotiate_flags ); @@ -865,13 +869,13 @@ interface netlogon NTSTATUS netr_DatabaseSync2( [in] [string,charset(UTF16)] uint16 logon_server[], [in] [string,charset(UTF16)] uint16 computername[], - [in] netr_Authenticator credential, + [in] netr_Authenticator *credential, [in,out,ref] netr_Authenticator *return_authenticator, [in] netr_SamDatabaseID database_id, [in] uint16 restart_state, [in,out,ref] uint32 *sync_context, - [in] uint32 preferredmaximumlength, - [out] netr_DELTA_ENUM_ARRAY *delta_enum_array + [out,ref] netr_DELTA_ENUM_ARRAY **delta_enum_array, + [in] uint32 preferredmaximumlength ); @@ -885,9 +889,9 @@ interface netlogon [in] [string,charset(UTF16)] uint16 computername[], [in] netr_Authenticator credential, [in,out,ref] netr_Authenticator *return_authenticator, - [in][size_is(change_log_entry_size)] uint8 *change_log_entry, + [in,unique][size_is(change_log_entry_size)] uint8 *change_log_entry, [in] uint32 change_log_entry_size, - [out] netr_DELTA_ENUM_ARRAY *delta_enum_array + [out,ref] netr_DELTA_ENUM_ARRAY *delta_enum_array ); @@ -895,38 +899,94 @@ interface netlogon /* Function 0x12 */ WERROR netr_LogonControl2Ex( - [in] [string,charset(UTF16)] uint16 *logon_server, + [in,unique] [string,charset(UTF16)] uint16 *logon_server, [in] uint32 function_code, [in] uint32 level, [in][switch_is(function_code)] netr_CONTROL_DATA_INFORMATION data, - [out,ref][switch_is(level)] netr_CONTROL_QUERY_INFORMATION *query + [out,ref][switch_is(level)] netr_CONTROL_QUERY_INFORMATION *query ); /*****************/ /* Function 0x13 */ - WERROR netr_NETRENUMERATETRUSTEDDOMAINS() ; + typedef struct { + uint32 length; + [size_is(length)] uint8 *data; + } netr_Blob; + + WERROR netr_NetrEnumerateTrustedDomains( + [in,unique] [string,charset(UTF16)] uint16 *server_name, + [out,ref] netr_Blob *trusted_domains_blob + ); /*****************/ - /* Function 0x14 */ + /* Function 0x14 */ + + /* one unkown bit still: DS_IP_VERSION_AGNOSTIC - gd*/ + + typedef [bitmap32bit] bitmap { + DS_FORCE_REDISCOVERY = 0x00000001, + DS_DIRECTORY_SERVICE_REQUIRED = 0x00000010, + DS_DIRECTORY_SERVICE_PREFERRED = 0x00000020, + DS_GC_SERVER_REQUIRED = 0x00000040, + DS_PDC_REQUIRED = 0x00000080, + DS_BACKGROUND_ONLY = 0x00000100, + DS_IP_REQUIRED = 0x00000200, + DS_KDC_REQUIRED = 0x00000400, + DS_TIMESERV_REQUIRED = 0x00000800, + DS_WRITABLE_REQUIRED = 0x00001000, + DS_GOOD_TIMESERV_PREFERRED = 0x00002000, + DS_AVOID_SELF = 0x00004000, + DS_ONLY_LDAP_NEEDED = 0x00008000, + DS_IS_FLAT_NAME = 0x00010000, + DS_IS_DNS_NAME = 0x00020000, + DS_TRY_NEXTCLOSEST_SITE = 0x00040000, + DS_DIRECTORY_SERVICE_6_REQUIRED = 0x00080000, + DS_RETURN_DNS_NAME = 0x40000000, + DS_RETURN_FLAT_NAME = 0x80000000 + } netr_DsRGetDCName_flags; + + typedef [v1_enum] enum { + DS_ADDRESS_TYPE_INET = 1, + DS_ADDRESS_TYPE_NETBIOS = 2 + } netr_DsRGetDCNameInfo_AddressType; + + typedef [bitmap32bit] bitmap { + DS_SERVER_PDC = 0x00000001 /* NBT_SERVER_PDC */, + DS_SERVER_GC = 0x00000004 /* NBT_SERVER_GC */, + DS_SERVER_LDAP = 0x00000008 /* NBT_SERVER_LDAP */, + DS_SERVER_DS = 0x00000010 /* NBT_SERVER_DS */, + DS_SERVER_KDC = 0x00000020 /* NBT_SERVER_KDC */, + DS_SERVER_TIMESERV = 0x00000040 /* NBT_SERVER_TIMESERV */, + DS_SERVER_CLOSEST = 0x00000080 /* NBT_SERVER_CLOSEST */, + DS_SERVER_WRITABLE = 0x00000100 /* NBT_SERVER_WRITABLE */, + DS_SERVER_GOOD_TIMESERV = 0x00000200 /* NBT_SERVER_GOOD_TIMESERV */, + DS_SERVER_NDNC = 0x00000400, + DS_SERVER_SELECT_SECRET_DOMAIN_6 = 0x00000800, + DS_SERVER_FULL_SECRET_DOMAIN_6 = 0x00001000, + DS_DNS_CONTROLLER = 0x20000000, + DS_DNS_DOMAIN = 0x40000000, + DS_DNS_FOREST = 0x80000000 + } netr_DsR_DcFlags; + typedef struct { [string,charset(UTF16)] uint16 *dc_unc; [string,charset(UTF16)] uint16 *dc_address; - int32 dc_address_type; + netr_DsRGetDCNameInfo_AddressType dc_address_type; GUID domain_guid; [string,charset(UTF16)] uint16 *domain_name; [string,charset(UTF16)] uint16 *forest_name; - uint32 dc_flags; + netr_DsR_DcFlags dc_flags; [string,charset(UTF16)] uint16 *dc_site_name; [string,charset(UTF16)] uint16 *client_site_name; } netr_DsRGetDCNameInfo; WERROR netr_DsRGetDCName( - [in] [string,charset(UTF16)] uint16 *server_unc, - [in] [string,charset(UTF16)] uint16 *domain_name, - [in] GUID *domain_guid, - [in] GUID *site_guid, - [in] uint32 flags, - [out] netr_DsRGetDCNameInfo *info + [in,unique] [string,charset(UTF16)] uint16 *server_unc, + [in,unique] [string,charset(UTF16)] uint16 *domain_name, + [in,unique] GUID *domain_guid, + [in,unique] GUID *site_guid, + [in] netr_DsRGetDCName_flags flags, + [out,ref] netr_DsRGetDCNameInfo **info ); /*****************/ @@ -939,7 +999,11 @@ interface netlogon /****************/ /* Function 0x17 */ - WERROR netr_NETRLOGONGETTRUSTRID(); + WERROR netr_LogonGetTrustRid( + [in,unique] [string,charset(UTF16)] uint16 *server_name, + [in,unique] [string,charset(UTF16)] uint16 *domain_name, + [out,ref] uint32 *rid + ); /****************/ /* Function 0x18 */ @@ -952,7 +1016,7 @@ interface netlogon /****************/ /* Function 0x1a */ NTSTATUS netr_ServerAuthenticate3( - [in] [string,charset(UTF16)] uint16 *server_name, + [in,unique] [string,charset(UTF16)] uint16 *server_name, [in] [string,charset(UTF16)] uint16 account_name[], [in] netr_SchannelType secure_channel_type, [in] [string,charset(UTF16)] uint16 computer_name[], @@ -965,29 +1029,24 @@ interface netlogon /* Function 0x1b */ WERROR netr_DsRGetDCNameEx( - [in] [string,charset(UTF16)] uint16 *server_unc, - [in] [string,charset(UTF16)] uint16 *domain_name, - [in] GUID *domain_guid, - [in] [string,charset(UTF16)] uint16 *site_name, - [in] uint32 flags, - [out] netr_DsRGetDCNameInfo *info + [in,unique] [string,charset(UTF16)] uint16 *server_unc, + [in,unique] [string,charset(UTF16)] uint16 *domain_name, + [in,unique] GUID *domain_guid, + [in,unique] [string,charset(UTF16)] uint16 *site_name, + [in] netr_DsRGetDCName_flags flags, + [out,ref] netr_DsRGetDCNameInfo **info ); /****************/ /* Function 0x1c */ WERROR netr_DsRGetSiteName( - [in] [string,charset(UTF16)] uint16 *computer_name, + [in,unique] [string,charset(UTF16)] uint16 *computer_name, [out,ref] [string,charset(UTF16)] uint16 **site ); /****************/ /* Function 0x1d */ - typedef struct { - uint32 length; - [size_is(length)] uint8 *data; - } netr_Blob; - typedef [flag(NDR_PAHEX)] struct { uint16 length; uint16 size; @@ -1038,7 +1097,7 @@ interface netlogon NTSTATUS netr_LogonGetDomainInfo( [in] [string,charset(UTF16)] uint16 server_name[], - [in] [string,charset(UTF16)] uint16 *computer_name, + [in,unique] [string,charset(UTF16)] uint16 *computer_name, [in,ref] netr_Authenticator *credential, [in,out,ref] netr_Authenticator *return_authenticator, [in] uint32 level, @@ -1054,7 +1113,7 @@ interface netlogon /*****************/ /* Function 0x1e */ NTSTATUS netr_ServerPasswordSet2( - [in] [string,charset(UTF16)] uint16 *server_name, + [in,unique] [string,charset(UTF16)] uint16 *server_name, [in] [string,charset(UTF16)] uint16 account_name[], [in] netr_SchannelType secure_channel_type, [in] [string,charset(UTF16)] uint16 computer_name[], @@ -1065,7 +1124,15 @@ interface netlogon /****************/ /* Function 0x1f */ - WERROR netr_NETRSERVERPASSWORDGET(); + WERROR netr_ServerPasswordGet( + [in,unique] [string,charset(UTF16)] uint16 *server_name, + [in] [string,charset(UTF16)] uint16 account_name[], + [in] netr_SchannelType secure_channel_type, + [in] [string,charset(UTF16)] uint16 computer_name[], + [in,ref] netr_Authenticator *credential, + [out,ref] netr_Authenticator *return_authenticator, + [out,ref] samr_Password *password + ); /****************/ /* Function 0x20 */ @@ -1073,19 +1140,34 @@ interface netlogon /****************/ /* Function 0x21 */ - WERROR netr_DSRADDRESSTOSITENAMESW(); + typedef struct { + uint32 count; + [size_is(count)] lsa_String *sitename; + } netr_DsRAddressToSitenamesWCtr; + + typedef struct { + [size_is(size)] uint8 *buffer; + uint32 size; + } netr_DsRAddress; + + WERROR netr_DsRAddressToSitenamesW( + [in,unique] [string,charset(UTF16)] uint16 *server_name, + [in] [range(0,32000)] uint32 count, + [in] [size_is(count)] [ref] netr_DsRAddress *addresses, + [out] [ref] netr_DsRAddressToSitenamesWCtr **ctr + ); /****************/ /* Function 0x22 */ WERROR netr_DsRGetDCNameEx2( - [in] [string,charset(UTF16)] uint16 *server_unc, - [in] [string,charset(UTF16)] uint16 *client_account, - [in] uint32 mask, - [in] [string,charset(UTF16)] uint16 *domain_name, - [in] GUID *domain_guid, - [in] [string,charset(UTF16)] uint16 *site_name, - [in] uint32 flags, - [out] netr_DsRGetDCNameInfo *info + [in,unique] [string,charset(UTF16)] uint16 *server_unc, + [in,unique] [string,charset(UTF16)] uint16 *client_account, + [in] samr_AcctFlags mask, + [in,unique] [string,charset(UTF16)] uint16 *domain_name, + [in,unique] GUID *domain_guid, + [in,unique] [string,charset(UTF16)] uint16 *site_name, + [in] netr_DsRGetDCName_flags flags, + [out,ref] netr_DsRGetDCNameInfo **info ); /****************/ @@ -1094,32 +1176,6 @@ interface netlogon /****************/ /* Function 0x24 */ - WERROR netr_NETRENUMERATETRUSTEDDOMAINSEX(); - - /****************/ - /* Function 0x25 */ - WERROR netr_DSRADDRESSTOSITENAMESEXW(); - - /****************/ - /* Function 0x26 */ - WERROR netr_DSRGETDCSITECOVERAGEW(); - - /****************/ - /* Function 0x27 */ - NTSTATUS netr_LogonSamLogonEx( - [in] [string,charset(UTF16)] uint16 *server_name, - [in] [string,charset(UTF16)] uint16 *computer_name, - [in] uint16 logon_level, - [in] [switch_is(logon_level)] netr_LogonLevel logon, - [in] uint16 validation_level, - [out,ref] [switch_is(validation_level)] netr_Validation *validation, - [out,ref] uint8 *authoritative, - [in,out,ref] uint32 *flags - ); - - /****************/ - /* Function 0x28 */ - typedef [bitmap32bit] bitmap { NETR_TRUST_FLAG_IN_FOREST = 0x00000001, NETR_TRUST_FLAG_OUTBOUND = 0x00000002, @@ -1157,39 +1213,122 @@ interface netlogon GUID guid; } netr_DomainTrust; + typedef struct { + uint32 count; + [size_is(count)] netr_DomainTrust *array; + } netr_DomainTrustList; + + WERROR netr_NetrEnumerateTrustedDomainsEx( + [in,unique] [string,charset(UTF16)] uint16 *server_name, + [out,ref] netr_DomainTrustList *dom_trust_list + ); + + /****************/ + /* Function 0x25 */ + typedef struct { + uint32 count; + [size_is(count)] lsa_String *sitename; + [size_is(count)] lsa_String *subnetname; + } netr_DsRAddressToSitenamesExWCtr; + + WERROR netr_DsRAddressToSitenamesExW( + [in,unique] [string,charset(UTF16)] uint16 *server_name, + [in] [range(0,32000)] uint32 count, + [in] [size_is(count)] [ref] netr_DsRAddress *addresses, + [out] [ref] netr_DsRAddressToSitenamesExWCtr **ctr + ); + + /****************/ + /* Function 0x26 */ + + typedef struct { + uint32 num_sites; + [size_is(num_sites)] [unique] lsa_String *sites; + } DcSitesCtr; + + WERROR netr_DsrGetDcSiteCoverageW( + [in,unique] [string,charset(UTF16)] uint16 *server_name, + [out,ref] DcSitesCtr *ctr + ); + + /****************/ + /* Function 0x27 */ + NTSTATUS netr_LogonSamLogonEx( + [in,unique] [string,charset(UTF16)] uint16 *server_name, + [in,unique] [string,charset(UTF16)] uint16 *computer_name, + [in] uint16 logon_level, + [in,ref] [switch_is(logon_level)] netr_LogonLevel *logon, + [in] uint16 validation_level, + [out,ref] [switch_is(validation_level)] netr_Validation *validation, + [out,ref] uint8 *authoritative, + [in,out,ref] uint32 *flags + ); + + /****************/ + /* Function 0x28 */ + WERROR netr_DsrEnumerateDomainTrusts( - [in] [string,charset(UTF16)] uint16 *server_name, + [in,unique] [string,charset(UTF16)] uint16 *server_name, [in] netr_TrustFlags trust_flags, - [out,ref] uint32 *count, - [out,ref,size_is(count)] netr_DomainTrust **trusts + [out,ref] netr_DomainTrustList *trusts ); /****************/ /* Function 0x29 */ - WERROR netr_DSRDEREGISTERDNSHOSTRECORDS(); + WERROR netr_DsrDeregisterDNSHostRecords( + [in,unique] [string,charset(UTF16)] uint16 *server_name, + [in,unique] [string,charset(UTF16)] uint16 *domain, + [in,unique] GUID *domain_guid, + [in,unique] GUID *dsa_guid, + [in,ref] [string,charset(UTF16)] uint16 *dns_host + ); /****************/ /* Function 0x2a */ - WERROR netr_NETRSERVERTRUSTPASSWORDSGET(); + NTSTATUS netr_ServerTrustPasswordsGet( + [in,unique] [string,charset(UTF16)] uint16 *server_name, + [in] [string,charset(UTF16)] uint16 account_name[], + [in] netr_SchannelType secure_channel_type, + [in] [string,charset(UTF16)] uint16 computer_name[], + [in,ref] netr_Authenticator *credential, + [out,ref] netr_Authenticator *return_authenticator, + [out,ref] samr_Password *password, + [out,ref] samr_Password *password2 + ); /****************/ /* Function 0x2b */ - WERROR netr_DSRGETFORESTTRUSTINFORMATION(); + + const int DS_GFTI_UPDATE_TDO = 0x1; + + WERROR netr_DsRGetForestTrustInformation( + [in,unique] [string,charset(UTF16)] uint16 *server_name, + [in,unique] [string,charset(UTF16)] uint16 *trusted_domain_name, + [in] uint32 flags, + [out,ref] lsa_ForestTrustInformation **forest_trust_info + ); /****************/ /* Function 0x2c */ - WERROR netr_NETRGETFORESTTRUSTINFORMATION(); + WERROR netr_GetForestTrustInformation( + [in,unique] [string,charset(UTF16)] uint16 *server_name, + [in,ref] [string,charset(UTF16)] uint16 *trusted_domain_name, + [in,ref] netr_Authenticator *credential, + [out,ref] netr_Authenticator *return_authenticator, + [in] uint32 flags, + [out,ref] lsa_ForestTrustInformation **forest_trust_info + ); /****************/ /* Function 0x2d */ /* this is the ADS varient. I don't yet know what the "flags" are for */ NTSTATUS netr_LogonSamLogonWithFlags( - [in] [string,charset(UTF16)] uint16 *server_name, - [in] [string,charset(UTF16)] uint16 *computer_name, - [in] netr_Authenticator *credential, - [in][out] netr_Authenticator *return_authenticator, + [in,unique] [string,charset(UTF16)] uint16 *server_name, + [in,unique] [string,charset(UTF16)] uint16 *computer_name, + [in,unique] netr_Authenticator *credential, + [in,out,unique] netr_Authenticator *return_authenticator, [in] uint16 logon_level, [in] [switch_is(logon_level)] netr_LogonLevel logon, [in] uint16 validation_level, diff --git a/source3/librpc/idl/ntsvcs.idl b/source3/librpc/idl/ntsvcs.idl index 05ba68e727..af0c7032da 100644 --- a/source3/librpc/idl/ntsvcs.idl +++ b/source3/librpc/idl/ntsvcs.idl @@ -9,69 +9,358 @@ ] interface ntsvcs { - void PNP_Disconnect(); - void PNP_Connect(); - void PNP_GetVersion(); - void PNP_GetGlobalState(); - void PNP_InitDetection(); - void PNP_ReportLogOn(); - void PNP_ValidateDeviceInstance(); - void PNP_GetRootDeviceInstance(); - void PNP_GetRelatedDeviceInstance(); - void PNP_EnumerateSubKeys(); - void PNP_GetDeviceList(); - void PNP_GetDeviceListSize(); - void PNP_GetDepth(); - void PNP_GetDeviceRegProp(); - void PNP_SetDeviceRegProp(); - void PNP_GetClassInstance(); - void PNP_CreateKey(); - void PNP_DeleteRegistryKey(); - void PNP_GetClassCount(); - void PNP_GetClassName(); - void PNP_DeleteClassKey(); - void PNP_GetInterfaceDeviceAlias(); - void PNP_GetInterfaceDeviceList(); - void PNP_GetInterfaceDeviceListSize(); - void PNP_RegisterDeviceClassAssociation(); - void PNP_UnregisterDeviceClassAssociation(); - void PNP_GetClassRegProp(); - void PNP_SetClassRegProp(); - void PNP_CreateDevInst(); - void PNP_DeviceInstanceAction(); - void PNP_GetDeviceStatus(); - void PNP_SetDeviceProblem(); - void PNP_DisableDevInst(); - void PNP_UninstallDevInst(); - void PNP_AddID(); - void PNP_RegisterDriver(); - void PNP_QueryRemove(); - void PNP_RequestDeviceEject(); - void PNP_IsDockStationPresent(); - void PNP_RequestEjectPC(); - void PNP_HwProfFlags(); - void PNP_GetHwProfInfo(); - void PNP_AddEmptyLogConf(); - void PNP_FreeLogConf(); - void PNP_GetFirstLogConf(); - void PNP_GetNextLogConf(); - void PNP_GetLogConfPriority(); - void PNP_AddResDes(); - void PNP_FreeResDes(); - void PNP_GetNextResDes(); - void PNP_GetResDesData(); - void PNP_GetResDesDataSize(); - void PNP_ModifyResDes(); - void PNP_DetectResourceLimit(); - void PNP_QueryResConfList(); - void PNP_SetHwProf(); - void PNP_QueryArbitratorFreeData(); - void PNP_QueryArbitratorFreeSize(); - void PNP_RunDetection(); - void PNP_RegisterNotification(); - void PNP_UnregisterNotification(); - void PNP_GetCustomDevProp(); - void PNP_GetVersionInternal(); - void PNP_GetBlockedDriverInfo(); - void PNP_GetServerSideDeviceInstallFlags(); + /******************/ + /* Function: 0x00 */ + + WERROR PNP_Disconnect(); + + /******************/ + /* Function: 0x01 */ + + WERROR PNP_Connect(); + + /******************/ + /* Function: 0x02 */ + + WERROR PNP_GetVersion( + [out,ref] uint16 *version + ); + + /******************/ + /* Function: 0x03 */ + + WERROR PNP_GetGlobalState(); + + /******************/ + /* Function: 0x04 */ + + WERROR PNP_InitDetection(); + + /******************/ + /* Function: 0x05 */ + + WERROR PNP_ReportLogOn(); + + /******************/ + /* Function: 0x06 */ + + WERROR PNP_ValidateDeviceInstance( + [in,ref] [string,charset(UTF16)] uint16 *devicepath, + [in] uint32 flags + ); + + /******************/ + /* Function: 0x07 */ + + WERROR PNP_GetRootDeviceInstance(); + + /******************/ + /* Function: 0x08 */ + + WERROR PNP_GetRelatedDeviceInstance(); + + /******************/ + /* Function: 0x09 */ + + WERROR PNP_EnumerateSubKeys(); + + /******************/ + /* Function: 0x0a */ + + WERROR PNP_GetDeviceList(); + + /******************/ + /* Function: 0x0b */ + + WERROR PNP_GetDeviceListSize( + [in,unique] [string,charset(UTF16)] uint16 *devicename, + [out,ref] uint32 *size, + [in] uint32 flags + ); + + /******************/ + /* Function: 0x0c */ + + WERROR PNP_GetDepth(); + + /******************/ + /* Function: 0x0d */ + + WERROR PNP_GetDeviceRegProp(); + + /******************/ + /* Function: 0x0e */ + + WERROR PNP_SetDeviceRegProp(); + + /******************/ + /* Function: 0x0f */ + + WERROR PNP_GetClassInstance(); + + /******************/ + /* Function: 0x10 */ + + WERROR PNP_CreateKey(); + + /******************/ + /* Function: 0x11 */ + + WERROR PNP_DeleteRegistryKey(); + + /******************/ + /* Function: 0x12 */ + + WERROR PNP_GetClassCount(); + + /******************/ + /* Function: 0x13 */ + + WERROR PNP_GetClassName(); + + /******************/ + /* Function: 0x14 */ + + WERROR PNP_DeleteClassKey(); + + /******************/ + /* Function: 0x15 */ + + WERROR PNP_GetInterfaceDeviceAlias(); + + /******************/ + /* Function: 0x16 */ + + WERROR PNP_GetInterfaceDeviceList(); + + /******************/ + /* Function: 0x17 */ + + WERROR PNP_GetInterfaceDeviceListSize(); + + /******************/ + /* Function: 0x18 */ + + WERROR PNP_RegisterDeviceClassAssociation(); + + /******************/ + /* Function: 0x19 */ + + WERROR PNP_UnregisterDeviceClassAssociation(); + + /******************/ + /* Function: 0x1a */ + + WERROR PNP_GetClassRegProp(); + + /******************/ + /* Function: 0x1b */ + + WERROR PNP_SetClassRegProp(); + + /******************/ + /* Function: 0x1c */ + + WERROR PNP_CreateDevInst(); + + /******************/ + /* Function: 0x1d */ + + WERROR PNP_DeviceInstanceAction(); + + /******************/ + /* Function: 0x1e */ + + WERROR PNP_GetDeviceStatus(); + + /******************/ + /* Function: 0x1f */ + + WERROR PNP_SetDeviceProblem(); + + /******************/ + /* Function: 0x20 */ + + WERROR PNP_DisableDevInst(); + + /******************/ + /* Function: 0x21 */ + + WERROR PNP_UninstallDevInst(); + + /******************/ + /* Function: 0x22 */ + + WERROR PNP_AddID(); + + /******************/ + /* Function: 0x23 */ + + WERROR PNP_RegisterDriver(); + + /******************/ + /* Function: 0x24 */ + + WERROR PNP_QueryRemove(); + + /******************/ + /* Function: 0x25 */ + + WERROR PNP_RequestDeviceEject(); + + /******************/ + /* Function: 0x26 */ + + WERROR PNP_IsDockStationPresent(); + + /******************/ + /* Function: 0x27 */ + + WERROR PNP_RequestEjectPC(); + + /******************/ + /* Function: 0x28 */ + + WERROR PNP_HwProfFlags( + [in] uint32 unknown1, + [in,ref] [string,charset(UTF16)] uint16 *devicepath, + [in] uint32 unknown2, + [in,out,ref] uint32 *unknown3, + [in,out,unique] uint16 *unknown4, + [in,unique] [string,charset(UTF16)] uint16 *unknown5, + [out,unique] [string,charset(UTF16)] uint16 **unknown5a, + [in] uint32 unknown6, + [in] uint32 unknown7 + ); + + /******************/ + /* Function: 0x29 */ + + typedef struct { + uint32 unknown1; + uint16 unknown2[160]; + uint32 unknown3; + } PNP_HwProfInfo; + + WERROR PNP_GetHwProfInfo( + [in] uint32 idx, + [in,out,ref] PNP_HwProfInfo *info, + [in] uint32 unknown1, + [in] uint32 unknown2 + ); + + /******************/ + /* Function: 0x2a */ + + WERROR PNP_AddEmptyLogConf(); + + /******************/ + /* Function: 0x2b */ + + WERROR PNP_FreeLogConf(); + + /******************/ + /* Function: 0x2c */ + + WERROR PNP_GetFirstLogConf(); + + /******************/ + /* Function: 0x2d */ + + WERROR PNP_GetNextLogConf(); + + /******************/ + /* Function: 0x2e */ + + WERROR PNP_GetLogConfPriority(); + + /******************/ + /* Function: 0x2f */ + + WERROR PNP_AddResDes(); + + /******************/ + /* Function: 0x30 */ + + WERROR PNP_FreeResDes(); + + /******************/ + /* Function: 0x31 */ + + WERROR PNP_GetNextResDes(); + + /******************/ + /* Function: 0x32 */ + + WERROR PNP_GetResDesData(); + + /******************/ + /* Function: 0x33 */ + + WERROR PNP_GetResDesDataSize(); + + /******************/ + /* Function: 0x34 */ + + WERROR PNP_ModifyResDes(); + + /******************/ + /* Function: 0x35 */ + + WERROR PNP_DetectResourceLimit(); + + /******************/ + /* Function: 0x36 */ + + WERROR PNP_QueryResConfList(); + + /******************/ + /* Function: 0x37 */ + + WERROR PNP_SetHwProf(); + + /******************/ + /* Function: 0x38 */ + + WERROR PNP_QueryArbitratorFreeData(); + + /******************/ + /* Function: 0x39 */ + + WERROR PNP_QueryArbitratorFreeSize(); + + /******************/ + /* Function: 0x3a */ + + WERROR PNP_RunDetection(); + + /******************/ + /* Function: 0x3b */ + + WERROR PNP_RegisterNotification(); + + /******************/ + /* Function: 0x3c */ + + WERROR PNP_UnregisterNotification(); + + /******************/ + /* Function: 0x3d */ + + WERROR PNP_GetCustomDevProp(); + + /******************/ + /* Function: 0x3e */ + + WERROR PNP_GetVersionInternal(); + + /******************/ + /* Function: 0x3f */ + + WERROR PNP_GetBlockedDriverInfo(); + + /******************/ + /* Function: 0x40 */ + + WERROR PNP_GetServerSideDeviceInstallFlags(); } diff --git a/source3/librpc/idl/samr.idl b/source3/librpc/idl/samr.idl index afeca3edd6..c2449d3088 100644 --- a/source3/librpc/idl/samr.idl +++ b/source3/librpc/idl/samr.idl @@ -3,6 +3,7 @@ /* samr interface definition */ +import "misc.idl", "lsa.idl", "security.idl"; /* Thanks to Todd Sabin for some information from his samr.idl in acltools @@ -11,9 +12,7 @@ [ uuid("12345778-1234-abcd-ef00-0123456789ac"), version(1.0), endpoint("ncacn_np:[\\pipe\\samr]","ncacn_ip_tcp:", "ncalrpc:"), - pointer_default(unique), - pointer_default_top(unique), - depends(misc,lsa,security) + pointer_default(unique) ] interface samr { typedef bitmap security_secinfo security_secinfo; @@ -41,19 +40,72 @@ ACB_NO_AUTH_DATA_REQD = 0x00080000 /* 1 = No authorization data required */ } samr_AcctFlags; + typedef [bitmap32bit] bitmap { + SAMR_ACCESS_CONNECT_TO_SERVER = 0x00000001, + SAMR_ACCESS_SHUTDOWN_SERVER = 0x00000002, + SAMR_ACCESS_INITIALIZE_SERVER = 0x00000004, + SAMR_ACCESS_CREATE_DOMAIN = 0x00000008, + SAMR_ACCESS_ENUM_DOMAINS = 0x00000010, + SAMR_ACCESS_OPEN_DOMAIN = 0x00000020 + } samr_ConnectAccessMask; + + typedef [bitmap32bit] bitmap { + SAMR_USER_ACCESS_GET_NAME_ETC = 0x00000001, + SAMR_USER_ACCESS_GET_LOCALE = 0x00000002, + SAMR_USER_ACCESS_SET_LOC_COM = 0x00000004, + SAMR_USER_ACCESS_GET_LOGONINFO = 0x00000008, + SAMR_USER_ACCESS_GET_ATTRIBUTES = 0x00000010, + SAMR_USER_ACCESS_SET_ATTRIBUTES = 0x00000020, + SAMR_USER_ACCESS_CHANGE_PASSWORD = 0x00000040, + SAMR_USER_ACCESS_SET_PASSWORD = 0x00000080, + SAMR_USER_ACCESS_GET_GROUPS = 0x00000100, + SAMR_USER_ACCESS_GET_GROUP_MEMBERSHIP = 0x00000200, + SAMR_USER_ACCESS_CHANGE_GROUP_MEMBERSHIP = 0x00000400 + } samr_UserAccessMask; + + typedef [bitmap32bit] bitmap { + SAMR_DOMAIN_ACCESS_LOOKUP_INFO_1 = 0x00000001, + SAMR_DOMAIN_ACCESS_SET_INFO_1 = 0x00000002, + SAMR_DOMAIN_ACCESS_LOOKUP_INFO_2 = 0x00000004, + SAMR_DOMAIN_ACCESS_SET_INFO_2 = 0x00000008, + SAMR_DOMAIN_ACCESS_CREATE_USER = 0x00000010, + SAMR_DOMAIN_ACCESS_CREATE_GROUP = 0x00000020, + SAMR_DOMAIN_ACCESS_CREATE_ALIAS = 0x00000040, + SAMR_DOMAIN_ACCESS_LOOKUP_ALIAS = 0x00000080, + SAMR_DOMAIN_ACCESS_ENUM_ACCOUNTS = 0x00000100, + SAMR_DOMAIN_ACCESS_OPEN_ACCOUNT = 0x00000200, + SAMR_DOMAIN_ACCESS_SET_INFO_3 = 0x00000400 + } samr_DomainAccessMask; + + typedef [bitmap32bit] bitmap { + SAMR_GROUP_ACCESS_LOOKUP_INFO = 0x00000001, + SAMR_GROUP_ACCESS_SET_INFO = 0x00000002, + SAMR_GROUP_ACCESS_ADD_MEMBER = 0x00000004, + SAMR_GROUP_ACCESS_REMOVE_MEMBER = 0x00000008, + SAMR_GROUP_ACCESS_GET_MEMBERS = 0x00000010 + } samr_GroupAccessMask; + + typedef [bitmap32bit] bitmap { + SAMR_ALIAS_ACCESS_ADD_MEMBER = 0x00000001, + SAMR_ALIAS_ACCESS_REMOVE_MEMBER = 0x00000002, + SAMR_ALIAS_ACCESS_GET_MEMBERS = 0x00000004, + SAMR_ALIAS_ACCESS_LOOKUP_INFO = 0x00000008, + SAMR_ALIAS_ACCESS_SET_INFO = 0x00000010 + } samr_AliasAccessMask; + /******************/ /* Function: 0x00 */ NTSTATUS samr_Connect ( /* notice the lack of [string] */ - [in] uint16 *system_name, - [in] uint32 access_mask, + [in,unique] uint16 *system_name, + [in] samr_ConnectAccessMask access_mask, [out,ref] policy_handle *connect_handle ); /******************/ /* Function: 0x01 */ - NTSTATUS samr_Close ( + [public] NTSTATUS samr_Close ( [in,out,ref] policy_handle *handle ); @@ -72,7 +124,7 @@ NTSTATUS samr_QuerySecurity ( [in,ref] policy_handle *handle, [in] security_secinfo sec_info, - [out] sec_desc_buf *sdbuf + [out,ref] sec_desc_buf **sdbuf ); /******************/ @@ -88,9 +140,9 @@ /******************/ /* Function: 0x05 */ NTSTATUS samr_LookupDomain ( - [in,ref] policy_handle *connect_handle, + [in,ref] policy_handle *connect_handle, [in,ref] lsa_String *domain_name, - [out] dom_sid2 *sid + [out,ref] dom_sid2 **sid ); @@ -108,19 +160,19 @@ } samr_SamArray; NTSTATUS samr_EnumDomains ( - [in,ref] policy_handle *connect_handle, + [in] policy_handle *connect_handle, [in,out,ref] uint32 *resume_handle, + [out,ref] samr_SamArray **sam, [in] uint32 buf_size, - [out] samr_SamArray *sam, - [out] uint32 num_entries + [out,ref] uint32 *num_entries ); /************************/ /* Function 0x07 */ - NTSTATUS samr_OpenDomain( + [public] NTSTATUS samr_OpenDomain( [in,ref] policy_handle *connect_handle, - [in] uint32 access_mask, + [in] samr_DomainAccessMask access_mask, [in,ref] dom_sid2 *sid, [out,ref] policy_handle *domain_handle ); @@ -129,10 +181,10 @@ /* Function 0x08 */ /* server roles */ typedef [v1_enum] enum { - ROLE_STANDALONE = 0, - ROLE_DOMAIN_MEMBER = 1, - ROLE_DOMAIN_BDC = 2, - ROLE_DOMAIN_PDC = 3 + SAMR_ROLE_STANDALONE = 0, + SAMR_ROLE_DOMAIN_MEMBER = 1, + SAMR_ROLE_DOMAIN_BDC = 2, + SAMR_ROLE_DOMAIN_PDC = 3 } samr_Role; /* password properties flags */ @@ -235,7 +287,7 @@ NTSTATUS samr_QueryDomainInfo( [in,ref] policy_handle *domain_handle, [in] uint16 level, - [out,switch_is(level)] samr_DomainInfo *info + [out,ref,switch_is(level)] samr_DomainInfo **info ); /************************/ @@ -256,7 +308,7 @@ NTSTATUS samr_CreateDomainGroup( [in,ref] policy_handle *domain_handle, [in,ref] lsa_String *name, - [in] uint32 access_mask, + [in] samr_GroupAccessMask access_mask, [out,ref] policy_handle *group_handle, [out,ref] uint32 *rid ); @@ -264,12 +316,16 @@ /************************/ /* Function 0x0b */ + + const int MAX_SAM_ENTRIES_W2K = 0x400; /* 1024 */ + const int MAX_SAM_ENTRIES_W95 = 50; + NTSTATUS samr_EnumDomainGroups( - [in,ref] policy_handle *domain_handle, + [in] policy_handle *domain_handle, [in,out,ref] uint32 *resume_handle, + [out,ref] samr_SamArray **sam, [in] uint32 max_size, - [out] samr_SamArray *sam, - [out] uint32 num_entries + [out,ref] uint32 *num_entries ); /************************/ @@ -277,7 +333,7 @@ NTSTATUS samr_CreateUser( [in,ref] policy_handle *domain_handle, [in,ref] lsa_String *account_name, - [in] uint32 access_mask, + [in] samr_UserAccessMask access_mask, [out,ref] policy_handle *user_handle, [out,ref] uint32 *rid ); @@ -292,12 +348,12 @@ const int SAMR_ENUM_USERS_MULTIPLIER = 54; NTSTATUS samr_EnumDomainUsers( - [in,ref] policy_handle *domain_handle, + [in] policy_handle *domain_handle, [in,out,ref] uint32 *resume_handle, [in] samr_AcctFlags acct_flags, + [out,ref] samr_SamArray **sam, [in] uint32 max_size, - [out] samr_SamArray *sam, - [out] uint32 num_entries + [out,ref] uint32 *num_entries ); /************************/ @@ -305,7 +361,7 @@ NTSTATUS samr_CreateDomAlias( [in,ref] policy_handle *domain_handle, [in,ref] lsa_String *alias_name, - [in] uint32 access_mask, + [in] samr_AliasAccessMask access_mask, [out,ref] policy_handle *alias_handle, [out,ref] uint32 *rid ); @@ -313,11 +369,11 @@ /************************/ /* Function 0x0f */ NTSTATUS samr_EnumDomainAliases( - [in,ref] policy_handle *domain_handle, + [in] policy_handle *domain_handle, [in,out,ref] uint32 *resume_handle, - [in] samr_AcctFlags acct_flags, - [out] samr_SamArray *sam, - [out] uint32 num_entries + [out,ref] samr_SamArray **sam, + [in] uint32 max_size, + [out,ref] uint32 *num_entries ); /************************/ @@ -337,12 +393,12 @@ /************************/ /* Function 0x11 */ - NTSTATUS samr_LookupNames( + [public] NTSTATUS samr_LookupNames( [in,ref] policy_handle *domain_handle, [in,range(0,1000)] uint32 num_names, [in,size_is(1000),length_is(num_names)] lsa_String names[], - [out] samr_Ids rids, - [out] samr_Ids types + [out,ref] samr_Ids *rids, + [out,ref] samr_Ids *types ); @@ -352,15 +408,15 @@ [in,ref] policy_handle *domain_handle, [in,range(0,1000)] uint32 num_rids, [in,size_is(1000),length_is(num_rids)] uint32 rids[], - [out] lsa_Strings names, - [out] samr_Ids types + [out,ref] lsa_Strings *names, + [out,ref] samr_Ids *types ); /************************/ /* Function 0x13 */ NTSTATUS samr_OpenGroup( [in,ref] policy_handle *domain_handle, - [in] uint32 access_mask, + [in] samr_GroupAccessMask access_mask, [in] uint32 rid, [out,ref] policy_handle *group_handle ); @@ -413,7 +469,7 @@ NTSTATUS samr_QueryGroupInfo( [in,ref] policy_handle *group_handle, [in] samr_GroupInfoEnum level, - [out,switch_is(level)] samr_GroupInfo *info + [out,ref,switch_is(level)] samr_GroupInfo **info ); /************************/ @@ -456,7 +512,7 @@ NTSTATUS samr_QueryGroupMember( [in,ref] policy_handle *group_handle, - [out] samr_RidTypeArray *rids + [out,ref] samr_RidTypeArray **rids ); @@ -480,7 +536,7 @@ /* Function 0x1b */ NTSTATUS samr_OpenAlias ( [in,ref] policy_handle *domain_handle, - [in] uint32 access_mask, + [in] samr_AliasAccessMask access_mask, [in] uint32 rid, [out,ref] policy_handle *alias_handle ); @@ -510,7 +566,7 @@ NTSTATUS samr_QueryAliasInfo( [in,ref] policy_handle *alias_handle, [in] samr_AliasInfoEnum level, - [out,switch_is(level)] samr_AliasInfo *info + [out,ref,switch_is(level)] samr_AliasInfo **info ); /************************/ @@ -550,9 +606,9 @@ /************************/ /* Function 0x22 */ - NTSTATUS samr_OpenUser( + [public] NTSTATUS samr_OpenUser( [in,ref] policy_handle *domain_handle, - [in] uint32 access_mask, + [in] samr_UserAccessMask access_mask, [in] uint32 rid, [out,ref] policy_handle *user_handle ); @@ -678,28 +734,59 @@ NTTIME acct_expiry; } samr_UserInfo17; + typedef [public, flag(NDR_PAHEX)] struct { + uint8 hash[16]; + } samr_Password; + + typedef struct { + samr_Password lm_pwd; + samr_Password nt_pwd; + boolean8 lm_pwd_active; + boolean8 nt_pwd_active; + } samr_UserInfo18; + typedef struct { lsa_String parameters; } samr_UserInfo20; /* this defines the bits used for fields_present in info21 */ typedef [bitmap32bit] bitmap { - SAMR_FIELD_ACCOUNT_NAME = 0x00000001, - SAMR_FIELD_FULL_NAME = 0x00000002, - SAMR_FIELD_DESCRIPTION = 0x00000010, - SAMR_FIELD_COMMENT = 0x00000020, - SAMR_FIELD_LOGON_SCRIPT = 0x00000100, - SAMR_FIELD_PROFILE_PATH = 0x00000200, - SAMR_FIELD_WORKSTATIONS = 0x00000400, - SAMR_FIELD_LOGON_HOURS = 0x00002000, - SAMR_FIELD_ACCT_FLAGS = 0x00100000, - SAMR_FIELD_PARAMETERS = 0x00200000, - SAMR_FIELD_COUNTRY_CODE = 0x00400000, - SAMR_FIELD_CODE_PAGE = 0x00800000, - SAMR_FIELD_PASSWORD = 0x01000000, /* either of these */ - SAMR_FIELD_PASSWORD2 = 0x02000000 /* two bits seems to work */ + SAMR_FIELD_ACCOUNT_NAME = 0x00000001, + SAMR_FIELD_FULL_NAME = 0x00000002, + SAMR_FIELD_RID = 0x00000004, + SAMR_FIELD_PRIMARY_GID = 0x00000008, + SAMR_FIELD_DESCRIPTION = 0x00000010, + SAMR_FIELD_COMMENT = 0x00000020, + SAMR_FIELD_HOME_DIRECTORY = 0x00000040, + SAMR_FIELD_HOME_DRIVE = 0x00000080, + SAMR_FIELD_LOGON_SCRIPT = 0x00000100, + SAMR_FIELD_PROFILE_PATH = 0x00000200, + SAMR_FIELD_WORKSTATIONS = 0x00000400, + SAMR_FIELD_LAST_LOGON = 0x00000800, + SAMR_FIELD_LAST_LOGOFF = 0x00001000, + SAMR_FIELD_LOGON_HOURS = 0x00002000, + SAMR_FIELD_BAD_PWD_COUNT = 0x00004000, + SAMR_FIELD_NUM_LOGONS = 0x00008000, + SAMR_FIELD_ALLOW_PWD_CHANGE = 0x00010000, + SAMR_FIELD_FORCE_PWD_CHANGE = 0x00020000, + SAMR_FIELD_LAST_PWD_CHANGE = 0x00040000, + SAMR_FIELD_ACCT_EXPIRY = 0x00080000, + SAMR_FIELD_ACCT_FLAGS = 0x00100000, + SAMR_FIELD_PARAMETERS = 0x00200000, + SAMR_FIELD_COUNTRY_CODE = 0x00400000, + SAMR_FIELD_CODE_PAGE = 0x00800000, + SAMR_FIELD_PASSWORD = 0x01000000, /* either of these */ + SAMR_FIELD_PASSWORD2 = 0x02000000, /* two bits seems to work */ + SAMR_FIELD_PRIVATE_DATA = 0x04000000, + SAMR_FIELD_EXPIRED_FLAG = 0x08000000, + SAMR_FIELD_SEC_DESC = 0x10000000, + SAMR_FIELD_OWF_PWD = 0x20000000 } samr_FieldsPresent; + /* used for 'password_expired' in samr_UserInfo21 */ + const int PASS_MUST_CHANGE_AT_NEXT_LOGON = 0x01; + const int PASS_DONT_CHANGE_AT_NEXT_LOGON = 0x00; + typedef struct { NTTIME last_logon; NTTIME last_logoff; @@ -782,6 +869,7 @@ [case(14)] samr_UserInfo14 info14; [case(16)] samr_UserInfo16 info16; [case(17)] samr_UserInfo17 info17; + [case(18)] samr_UserInfo18 info18; [case(20)] samr_UserInfo20 info20; [case(21)] samr_UserInfo21 info21; [case(23)] samr_UserInfo23 info23; @@ -790,16 +878,16 @@ [case(26)] samr_UserInfo26 info26; } samr_UserInfo; - NTSTATUS samr_QueryUserInfo( + [public] NTSTATUS samr_QueryUserInfo( [in,ref] policy_handle *user_handle, [in] uint16 level, - [out,switch_is(level)] samr_UserInfo *info + [out,ref,switch_is(level)] samr_UserInfo **info ); /************************/ /* Function 0x25 */ - NTSTATUS samr_SetUserInfo( + [public] NTSTATUS samr_SetUserInfo( [in,ref] policy_handle *user_handle, [in] uint16 level, [in,ref,switch_is(level)] samr_UserInfo *info @@ -807,10 +895,6 @@ /************************/ /* Function 0x26 */ - typedef [public, flag(NDR_PAHEX)] struct { - uint8 hash[16]; - } samr_Password; - /* this is a password change interface that doesn't give the server the plaintext password. Depricated. @@ -818,15 +902,15 @@ NTSTATUS samr_ChangePasswordUser( [in,ref] policy_handle *user_handle, [in] boolean8 lm_present, - [in] samr_Password *old_lm_crypted, - [in] samr_Password *new_lm_crypted, + [in,unique] samr_Password *old_lm_crypted, + [in,unique] samr_Password *new_lm_crypted, [in] boolean8 nt_present, - [in] samr_Password *old_nt_crypted, - [in] samr_Password *new_nt_crypted, + [in,unique] samr_Password *old_nt_crypted, + [in,unique] samr_Password *new_nt_crypted, [in] boolean8 cross1_present, - [in] samr_Password *nt_cross, + [in,unique] samr_Password *nt_cross, [in] boolean8 cross2_present, - [in] samr_Password *lm_cross + [in,unique] samr_Password *lm_cross ); /************************/ @@ -844,7 +928,7 @@ NTSTATUS samr_GetGroupsForUser( [in,ref] policy_handle *user_handle, - [out] samr_RidWithAttributeArray *rids + [out,ref] samr_RidWithAttributeArray **rids ); /************************/ @@ -855,8 +939,8 @@ uint32 rid; samr_AcctFlags acct_flags; lsa_String account_name; - lsa_String full_name; lsa_String description; + lsa_String full_name; } samr_DispEntryGeneral; typedef struct { @@ -879,7 +963,20 @@ typedef struct { uint32 idx; - lsa_AsciiString account_name; + uint32 rid; + samr_GroupAttrs acct_flags; + lsa_String account_name; + lsa_String description; + } samr_DispEntryFullGroup; + + typedef struct { + uint32 count; + [size_is(count)] samr_DispEntryFullGroup *entries; + } samr_DispInfoFullGroups; + + typedef struct { + uint32 idx; + lsa_AsciiStringLarge account_name; } samr_DispEntryAscii; typedef struct { @@ -890,7 +987,7 @@ typedef [switch_type(uint16)] union { [case(1)] samr_DispInfoGeneral info1;/* users */ [case(2)] samr_DispInfoFull info2; /* trust accounts? */ - [case(3)] samr_DispInfoFull info3; /* groups */ + [case(3)] samr_DispInfoFullGroups info3; /* groups */ [case(4)] samr_DispInfoAscii info4; /* users */ [case(5)] samr_DispInfoAscii info5; /* groups */ } samr_DispInfo; @@ -901,9 +998,9 @@ [in] uint32 start_idx, [in] uint32 max_entries, [in] uint32 buf_size, - [out] uint32 total_size, - [out] uint32 returned_size, - [out,switch_is(level)] samr_DispInfo info + [out,ref] uint32 *total_size, + [out,ref] uint32 *returned_size, + [out,ref,switch_is(level)] samr_DispInfo *info ); @@ -923,7 +1020,7 @@ [in,ref] policy_handle *domain_handle, [in] uint16 level, [in] lsa_String name, - [out] uint32 idx + [out,ref] uint32 *idx ); @@ -958,9 +1055,9 @@ samr_PasswordProperties password_properties; } samr_PwInfo; - NTSTATUS samr_GetUserPwInfo( + [public] NTSTATUS samr_GetUserPwInfo( [in,ref] policy_handle *user_handle, - [out] samr_PwInfo info + [out,ref] samr_PwInfo *info ); /************************/ @@ -979,7 +1076,7 @@ NTSTATUS samr_QueryDomainInfo2( [in,ref] policy_handle *domain_handle, [in] uint16 level, - [out,switch_is(level)] samr_DomainInfo *info + [out,ref,switch_is(level)] samr_DomainInfo **info ); /************************/ @@ -991,7 +1088,7 @@ NTSTATUS samr_QueryUserInfo2( [in,ref] policy_handle *user_handle, [in] uint16 level, - [out,switch_is(level)] samr_UserInfo *info + [out,ref,switch_is(level)] samr_UserInfo *info ); /************************/ @@ -1006,9 +1103,9 @@ [in] uint32 start_idx, [in] uint32 max_entries, [in] uint32 buf_size, - [out] uint32 total_size, - [out] uint32 returned_size, - [out,switch_is(level)] samr_DispInfo info + [out,ref] uint32 *total_size, + [out,ref] uint32 *returned_size, + [out,ref,switch_is(level)] samr_DispInfo *info ); /************************/ @@ -1021,7 +1118,7 @@ [in,ref] policy_handle *domain_handle, [in] uint16 level, [in] lsa_String name, - [out] uint32 idx + [out,ref] uint32 *idx ); @@ -1031,7 +1128,7 @@ [in,ref] policy_handle *domain_handle, [in,ref] lsa_String *account_name, [in] samr_AcctFlags acct_flags, - [in] uint32 access_mask, + [in] samr_UserAccessMask access_mask, [out,ref] policy_handle *user_handle, [out,ref] uint32 *access_granted, [out,ref] uint32 *rid @@ -1050,9 +1147,9 @@ [in] uint32 start_idx, [in] uint32 max_entries, [in] uint32 buf_size, - [out] uint32 total_size, - [out] uint32 returned_size, - [out,switch_is(level)] samr_DispInfo info + [out,ref] uint32 *total_size, + [out,ref] uint32 *returned_size, + [out,ref,switch_is(level)] samr_DispInfo *info ); /************************/ @@ -1073,36 +1170,36 @@ /* Function 0x36 */ NTSTATUS samr_OemChangePasswordUser2( - [in] lsa_AsciiString *server, + [in,unique] lsa_AsciiString *server, [in,ref] lsa_AsciiString *account, - [in] samr_CryptPassword *password, - [in] samr_Password *hash + [in,unique] samr_CryptPassword *password, + [in,unique] samr_Password *hash ); /************************/ /* Function 0x37 */ NTSTATUS samr_ChangePasswordUser2( - [in] lsa_String *server, + [in,unique] lsa_String *server, [in,ref] lsa_String *account, - [in] samr_CryptPassword *nt_password, - [in] samr_Password *nt_verifier, + [in,unique] samr_CryptPassword *nt_password, + [in,unique] samr_Password *nt_verifier, [in] boolean8 lm_change, - [in] samr_CryptPassword *lm_password, - [in] samr_Password *lm_verifier + [in,unique] samr_CryptPassword *lm_password, + [in,unique] samr_Password *lm_verifier ); /************************/ /* Function 0x38 */ NTSTATUS samr_GetDomPwInfo( - [in] lsa_String *domain_name, - [out] samr_PwInfo info + [in,unique] lsa_String *domain_name, + [out,ref] samr_PwInfo *info ); /************************/ /* Function 0x39 */ NTSTATUS samr_Connect2( - [in,string,charset(UTF16)] uint16 *system_name, - [in] uint32 access_mask, + [in,unique,string,charset(UTF16)] uint16 *system_name, + [in] samr_ConnectAccessMask access_mask, [out,ref] policy_handle *connect_handle ); @@ -1111,7 +1208,7 @@ /* seems to be an exact alias for samr_SetUserInfo() */ - NTSTATUS samr_SetUserInfo2( + [public] NTSTATUS samr_SetUserInfo2( [in,ref] policy_handle *user_handle, [in] uint16 level, [in,ref,switch_is(level)] samr_UserInfo *info @@ -1133,25 +1230,32 @@ /* Function 0x3c */ NTSTATUS samr_GetBootKeyInformation( [in,ref] policy_handle *domain_handle, - [out] uint32 unknown + [out,ref] uint32 *unknown ); /************************/ /* Function 0x3d */ NTSTATUS samr_Connect3( - [in,string,charset(UTF16)] uint16 *system_name, + [in,unique,string,charset(UTF16)] uint16 *system_name, /* this unknown value seems to be completely ignored by w2k3 */ [in] uint32 unknown, - [in] uint32 access_mask, + [in] samr_ConnectAccessMask access_mask, [out,ref] policy_handle *connect_handle ); /************************/ /* Function 0x3e */ + + typedef enum { + SAMR_CONNECT_PRE_W2K = 1, + SAMR_CONNECT_W2K = 2, + SAMR_CONNECT_AFTER_W2K = 3 + } samr_ConnectVersion; + NTSTATUS samr_Connect4( - [in,string,charset(UTF16)] uint16 *system_name, - [in] uint32 unknown, - [in] uint32 access_mask, + [in,unique,string,charset(UTF16)] uint16 *system_name, + [in] samr_ConnectVersion client_version, + [in] samr_ConnectAccessMask access_mask, [out,ref] policy_handle *connect_handle ); @@ -1167,23 +1271,23 @@ } samr_ChangeReject; NTSTATUS samr_ChangePasswordUser3( - [in] lsa_String *server, + [in,unique] lsa_String *server, [in,ref] lsa_String *account, - [in] samr_CryptPassword *nt_password, - [in] samr_Password *nt_verifier, + [in,unique] samr_CryptPassword *nt_password, + [in,unique] samr_Password *nt_verifier, [in] boolean8 lm_change, - [in] samr_CryptPassword *lm_password, - [in] samr_Password *lm_verifier, - [in] samr_CryptPassword *password3, - [out] samr_DomInfo1 *dominfo, - [out] samr_ChangeReject *reject + [in,unique] samr_CryptPassword *lm_password, + [in,unique] samr_Password *lm_verifier, + [in,unique] samr_CryptPassword *password3, + [out,ref] samr_DomInfo1 **dominfo, + [out,ref] samr_ChangeReject **reject ); /************************/ /* Function 0x40 */ typedef struct { - uint32 unknown1; /* w2k3 gives 3 */ + samr_ConnectVersion client_version; /* w2k3 gives 3 */ uint32 unknown2; /* w2k3 gives 0 */ } samr_ConnectInfo1; @@ -1191,11 +1295,13 @@ [case(1)] samr_ConnectInfo1 info1; } samr_ConnectInfo; - NTSTATUS samr_Connect5( - [in,string,charset(UTF16)] uint16 *system_name, - [in] uint32 access_mask, - [in,out] uint32 level, - [in,out,switch_is(level),ref] samr_ConnectInfo *info, + [public] NTSTATUS samr_Connect5( + [in,unique,string,charset(UTF16)] uint16 *system_name, + [in] samr_ConnectAccessMask access_mask, + [in] uint32 level_in, + [in,ref,switch_is(level_in)] samr_ConnectInfo *info_in, + [out,ref] uint32 *level_out, + [out,ref,switch_is(*level_out)] samr_ConnectInfo *info_out, [out,ref] policy_handle *connect_handle ); @@ -1204,7 +1310,7 @@ NTSTATUS samr_RidToSid( [in,ref] policy_handle *domain_handle, [in] uint32 rid, - [out] dom_sid2 *sid + [out,ref] dom_sid2 *sid ); @@ -1218,17 +1324,107 @@ */ NTSTATUS samr_SetDsrmPassword( - [in] lsa_String *name, + [in,unique] lsa_String *name, [in] uint32 unknown, - [in] samr_Password *hash + [in,unique] samr_Password *hash ); /************************/ /* Function 0x43 */ - /* - I haven't been able to work out the format of this one yet. - Seems to start with a switch level for a union? - */ - NTSTATUS samr_ValidatePassword(); + /************************/ + typedef [bitmap32bit] bitmap { + SAMR_VALIDATE_FIELD_PASSWORD_LAST_SET = 0x00000001, + SAMR_VALIDATE_FIELD_BAD_PASSWORD_TIME = 0x00000002, + SAMR_VALIDATE_FIELD_LOCKOUT_TIME = 0x00000004, + SAMR_VALIDATE_FIELD_BAD_PASSWORD_COUNT = 0x00000008, + SAMR_VALIDATE_FIELD_PASSWORD_HISTORY_LENGTH = 0x00000010, + SAMR_VALIDATE_FIELD_PASSWORD_HISTORY = 0x00000020 + } samr_ValidateFieldsPresent; + + typedef enum { + NetValidateAuthentication = 1, + NetValidatePasswordChange= 2, + NetValidatePasswordReset = 3 + } samr_ValidatePasswordLevel; + + /* NetApi maps samr_ValidationStatus errors to WERRORs. Haven't + * identified the mapping of + * - NERR_PasswordFilterError + * - NERR_PasswordExpired and + * - NERR_PasswordCantChange + * yet - Guenther + */ + + typedef enum { + 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 + } samr_ValidationStatus; + + typedef struct { + uint32 length; + [size_is(length)] uint8 *data; + } samr_ValidationBlob; + + typedef struct { + samr_ValidateFieldsPresent fields_present; + NTTIME_hyper last_password_change; + NTTIME_hyper bad_password_time; + NTTIME_hyper lockout_time; + uint32 bad_pwd_count; + uint32 pwd_history_len; + [size_is(pwd_history_len)] samr_ValidationBlob *pwd_history; + } samr_ValidatePasswordInfo; + + typedef struct { + samr_ValidatePasswordInfo info; + samr_ValidationStatus status; + } samr_ValidatePasswordRepCtr; + + typedef [switch_type(uint16)] union { + [case(1)] samr_ValidatePasswordRepCtr ctr1; + [case(2)] samr_ValidatePasswordRepCtr ctr2; + [case(3)] samr_ValidatePasswordRepCtr ctr3; + } samr_ValidatePasswordRep; + + typedef struct { + samr_ValidatePasswordInfo info; + lsa_StringLarge password; + lsa_StringLarge account; + samr_ValidationBlob hash; + boolean8 pwd_must_change_at_next_logon; + boolean8 clear_lockout; + } samr_ValidatePasswordReq3; + + typedef struct { + samr_ValidatePasswordInfo info; + lsa_StringLarge password; + lsa_StringLarge account; + samr_ValidationBlob hash; + boolean8 password_matched; + } samr_ValidatePasswordReq2; + + typedef struct { + samr_ValidatePasswordInfo info; + boolean8 password_matched; + } samr_ValidatePasswordReq1; + + typedef [switch_type(uint16)] union { + [case(1)] samr_ValidatePasswordReq1 req1; + [case(2)] samr_ValidatePasswordReq2 req2; + [case(3)] samr_ValidatePasswordReq3 req3; + } samr_ValidatePasswordReq; + + NTSTATUS samr_ValidatePassword( + [in] samr_ValidatePasswordLevel level, + [in,switch_is(level)] samr_ValidatePasswordReq req, + [out,ref,switch_is(level)] samr_ValidatePasswordRep *rep + ); } diff --git a/source3/librpc/idl/security.idl b/source3/librpc/idl/security.idl index 8a0d36a696..c4c30e9b5a 100644 --- a/source3/librpc/idl/security.idl +++ b/source3/librpc/idl/security.idl @@ -4,9 +4,26 @@ security IDL structures */ +import "misc.idl"; + +/* + use the same structure for dom_sid2 as dom_sid. A dom_sid2 is really + just a dom sid, but with the sub_auths represented as a conformant + array. As with all in-structure conformant arrays, the array length + is placed before the start of the structure. That's what gives rise + to the extra num_auths elemenent. We don't want the Samba code to + have to bother with such esoteric NDR details, so its easier to just + define it as a dom_sid and use pidl magic to make it all work. It + just means you need to mark a sid as a "dom_sid2" in the IDL when you + know it is of the conformant array variety +*/ +cpp_quote("#define dom_sid2 dom_sid") + +/* same struct as dom_sid but inside a 28 bytes fixed buffer in NDR */ +cpp_quote("#define dom_sid28 dom_sid") + [ - pointer_default(unique), - depends(misc,security) + pointer_default(unique) ] interface security { @@ -121,6 +138,8 @@ interface security const string SID_NULL = "S-1-0-0"; /* the world domain */ + const string NAME_WORLD = "WORLD"; + const string SID_WORLD_DOMAIN = "S-1-1"; const string SID_WORLD = "S-1-1-0"; @@ -130,6 +149,8 @@ interface security const string SID_CREATOR_GROUP = "S-1-3-1"; /* SECURITY_NT_AUTHORITY */ + const string NAME_NT_AUTHORITY = "NT AUTHORITY"; + const string SID_NT_AUTHORITY = "S-1-5"; const string SID_NT_DIALUP = "S-1-5-1"; const string SID_NT_NETWORK = "S-1-5-2"; @@ -150,6 +171,8 @@ interface security const string SID_NT_NETWORK_SERVICE = "S-1-5-20"; /* SECURITY_BUILTIN_DOMAIN_RID */ + const string NAME_BUILTIN = "BUILTIN"; + const string SID_BUILTIN = "S-1-5-32"; const string SID_BUILTIN_ADMINISTRATORS = "S-1-5-32-544"; const string SID_BUILTIN_USERS = "S-1-5-32-545"; @@ -169,6 +192,7 @@ interface security const int DOMAIN_RID_GUEST = 501; const int DOMAIN_RID_ADMINS = 512; const int DOMAIN_RID_USERS = 513; + const int DOMAIN_RID_DOMAIN_MEMBERS = 515; const int DOMAIN_RID_DCS = 516; const int DOMAIN_RID_CERT_ADMINS = 517; const int DOMAIN_RID_SCHEMA_ADMINS = 518; @@ -206,16 +230,6 @@ interface security SEC_PRIV_REMOTE_INTERACTIVE_LOGON = 24 } sec_privilege; - - /* a domain SID. Note that unlike Samba3 this contains a pointer, - so you can't copy them using assignment */ - typedef [public,gensize,noprint,noejs,nosize] struct { - uint8 sid_rev_num; /**< SID revision number */ - [range(0,15)] int8 num_auths; /**< Number of sub-authorities */ - uint8 id_auth[6]; /**< Identifier Authority */ - uint32 sub_auths[num_auths]; - } dom_sid; - typedef [bitmap8bit] bitmap { SEC_ACE_FLAG_OBJECT_INHERIT = 0x01, SEC_ACE_FLAG_CONTAINER_INHERIT = 0x02, @@ -239,7 +253,7 @@ interface security SEC_ACE_TYPE_SYSTEM_ALARM_OBJECT = 8 } security_ace_type; - typedef bitmap { + typedef [bitmap32bit] bitmap { SEC_ACE_OBJECT_TYPE_PRESENT = 0x00000001, SEC_ACE_INHERITED_OBJECT_TYPE_PRESENT = 0x00000002 } security_ace_object_flags; diff --git a/source3/librpc/idl/spoolss.idl b/source3/librpc/idl/spoolss.idl index 104c0e32e5..2144393ebd 100644 --- a/source3/librpc/idl/spoolss.idl +++ b/source3/librpc/idl/spoolss.idl @@ -3,17 +3,17 @@ /* spoolss interface definitions */ +import "security.idl", "winreg.idl"; [ uuid("12345678-1234-abcd-ef00-0123456789ab"), version(1.0), endpoint("ncacn_np:[\\pipe\\spoolss]"), pointer_default(unique), - pointer_default_top(unique), helpstring("Spooler SubSystem"), - depends(security), helper("librpc/ndr/ndr_spoolss_buf.h") ] interface spoolss { + typedef [v1_enum] enum winreg_Type winreg_Type; typedef struct { uint16 year; uint16 month; @@ -58,7 +58,7 @@ } spoolss_PrinterInfo0; typedef [public,gensize] struct { - string32 devicename; + [charset(UTF16)] uint16 devicename[32]; uint16 specversion; uint16 driverversion; uint16 size; @@ -77,7 +77,7 @@ uint16 yresolution; uint16 ttoption; uint16 collate; - string32 formname; + [charset(UTF16)] uint16 formname[32]; uint16 logpixels; uint32 bitsperpel; uint32 pelswidth; @@ -104,7 +104,6 @@ PRINTER_ENUM_REMOTE = 0x00000010, PRINTER_ENUM_SHARED = 0x00000020, PRINTER_ENUM_NETWORK = 0x00000040, - PRINTER_ENUM_UNKNOWN_8 = 0x00000008, PRINTER_ENUM_EXPAND = 0x00004000, PRINTER_ENUM_CONTAINER = 0x00008000, PRINTER_ENUM_ICON1 = 0x00010000, @@ -254,13 +253,13 @@ /* we are using this as internal parsing code */ [public,noopnum,noprint] WERROR _spoolss_EnumPrinters( [in] spoolss_EnumPrinterFlags flags, - [in] [string,charset(UTF16)] uint16 *server, + [in,unique] [string,charset(UTF16)] uint16 *server, [in] uint32 level, - [in] DATA_BLOB *buffer, + [in,unique] DATA_BLOB *buffer, [in] uint32 offered, - [out] DATA_BLOB *info, - [out] uint32 *needed, - [out] uint32 *count + [out,unique] DATA_BLOB *info, + [out] uint32 needed, + [out] uint32 count ); [public,noopnum,noprint] void __spoolss_EnumPrinters( [in] uint32 level, @@ -269,16 +268,16 @@ ); [nopull,nopush] WERROR spoolss_EnumPrinters( [in] spoolss_EnumPrinterFlags flags, - [in] [string,charset(UTF16)] uint16 *server, + [in,unique] [string,charset(UTF16)] uint16 *server, [in] uint32 level, - [in] DATA_BLOB *buffer, + [in,unique] DATA_BLOB *buffer, [in] uint32 offered, /* what we have here is a subcontext containing an array of no discriminant unions * and the array has no size in front */ - [out,switch_is(level),size_is(count)] spoolss_PrinterInfo *info, - [out] uint32 *needed, - [out] uint32 *count + [out,unique,switch_is(level),size_is(count)] spoolss_PrinterInfo *info, + [out] uint32 needed, + [out] uint32 count ); /******************/ @@ -288,9 +287,9 @@ [subcontext(4),subcontext_size(_ndr_size)] spoolss_DeviceMode *devmode; } spoolss_DevmodeContainer; - WERROR spoolss_OpenPrinter( - [in] [string,charset(UTF16)] uint16 *printername, - [in] [string,charset(UTF16)] uint16 *datatype, + [public] WERROR spoolss_OpenPrinter( + [in,unique] [string,charset(UTF16)] uint16 *printername, + [in,unique] [string,charset(UTF16)] uint16 *datatype, [in] spoolss_DevmodeContainer devmode_ctr, [in] uint32 access_mask, [out,ref] policy_handle *handle @@ -339,7 +338,7 @@ WERROR spoolss_SetJob( [in,ref] policy_handle *handle, [in] uint32 job_id, - [in] spoolss_JobInfoContainer *ctr, + [in,unique] spoolss_JobInfoContainer *ctr, [in] spoolss_JobControl command ); @@ -349,10 +348,10 @@ [in,ref] policy_handle *handle, [in] uint32 job_id, [in] uint32 level, - [in] DATA_BLOB *buffer, + [in,unique] DATA_BLOB *buffer, [in] uint32 offered, - [out,subcontext(4),subcontext_size(offered),switch_is(level)] spoolss_JobInfo *info, - [out] uint32 *needed + [out,unique,subcontext(4),subcontext_size(offered),switch_is(level)] spoolss_JobInfo *info, + [out] uint32 needed ); /******************/ @@ -362,11 +361,11 @@ [in] uint32 firstjob, [in] uint32 numjobs, [in] uint32 level, - [in] DATA_BLOB *buffer, + [in,unique] DATA_BLOB *buffer, [in] uint32 offered, - [out] DATA_BLOB *info, - [out] uint32 *needed, - [out] uint32 *count + [out,unique] DATA_BLOB *info, + [out] uint32 needed, + [out] uint32 count ); [public,noopnum,noprint] void __spoolss_EnumJobs( [in] uint32 level, @@ -378,11 +377,11 @@ [in] uint32 firstjob, [in] uint32 numjobs, [in] uint32 level, - [in] DATA_BLOB *buffer, + [in,unique] DATA_BLOB *buffer, [in] uint32 offered, - [out,switch_is(level),size_is(count)] spoolss_JobInfo *info, - [out] uint32 *needed, - [out] uint32 *count + [out,unique,switch_is(level),size_is(count)] spoolss_JobInfo *info, + [out] uint32 needed, + [out] uint32 count ); /******************/ @@ -432,13 +431,13 @@ /******************/ /* Function: 0x08 */ - WERROR spoolss_GetPrinter( + [public] WERROR spoolss_GetPrinter( [in,ref] policy_handle *handle, [in] uint32 level, - [in] DATA_BLOB *buffer, + [in,unique] DATA_BLOB *buffer, [in] uint32 offered, - [out,subcontext(4),subcontext_size(offered),switch_is(level)] spoolss_PrinterInfo *info, - [out] uint32 *needed + [out,unique,subcontext(4),subcontext_size(offered),switch_is(level)] spoolss_PrinterInfo *info, + [out] uint32 needed ); /******************/ @@ -538,14 +537,14 @@ /******************/ /* Function: 0x0a */ [public,noopnum,noprint] WERROR _spoolss_EnumPrinterDrivers( - [in] [string,charset(UTF16)] uint16 *server, - [in] [string,charset(UTF16)] uint16 *environment, + [in,unique] [string,charset(UTF16)] uint16 *server, + [in,unique] [string,charset(UTF16)] uint16 *environment, [in] uint32 level, - [in] DATA_BLOB *buffer, + [in,unique] DATA_BLOB *buffer, [in] uint32 offered, - [out] DATA_BLOB *info, - [out] uint32 *needed, - [out] uint32 *count + [out,unique] DATA_BLOB *info, + [out] uint32 needed, + [out] uint32 count ); [public,noopnum,noprint] void __spoolss_EnumPrinterDrivers( [in] uint32 level, @@ -553,14 +552,14 @@ [out,switch_is(level)] spoolss_DriverInfo info[count] ); [nopull,nopush] WERROR spoolss_EnumPrinterDrivers( - [in] [string,charset(UTF16)] uint16 *server, - [in] [string,charset(UTF16)] uint16 *environment, + [in,unique] [string,charset(UTF16)] uint16 *server, + [in,unique] [string,charset(UTF16)] uint16 *environment, [in] uint32 level, - [in] DATA_BLOB *buffer, + [in,unique] DATA_BLOB *buffer, [in] uint32 offered, - [out,switch_is(level),size_is(count)] spoolss_DriverInfo *info, - [out] uint32 *needed, - [out] uint32 *count + [out,unique,switch_is(level),size_is(count)] spoolss_DriverInfo *info, + [out] uint32 needed, + [out] uint32 count ); /******************/ @@ -582,21 +581,21 @@ [default] spoolss_DriverDirectoryInfo1 info1; } spoolss_DriverDirectoryInfo; - WERROR spoolss_GetPrinterDriverDirectory( - [in] [string,charset(UTF16)] uint16 *server, - [in] [string,charset(UTF16)] uint16 *environment, + [public] WERROR spoolss_GetPrinterDriverDirectory( + [in,unique] [string,charset(UTF16)] uint16 *server, + [in,unique] [string,charset(UTF16)] uint16 *environment, [in] uint32 level, - [in] DATA_BLOB *buffer, + [in,unique] DATA_BLOB *buffer, [in] uint32 offered, - [out,subcontext(4),subcontext_size(offered),switch_is(level)] spoolss_DriverDirectoryInfo *info, - [out] uint32 *needed + [out,unique,subcontext(4),subcontext_size(offered),switch_is(level)] spoolss_DriverDirectoryInfo *info, + [out] uint32 needed ); /******************/ /* Function: 0x0d */ WERROR spoolss_DeletePrinterDriver( [in,ref] policy_handle *handle, - [in] [string,charset(UTF16)] uint16 *server, + [in,unique] [string,charset(UTF16)] uint16 *server, [in] [string,charset(UTF16)] uint16 architecture[], [in] [string,charset(UTF16)] uint16 driver[] ); @@ -618,14 +617,14 @@ } spoolss_PrintProcessorInfo; [public,noopnum,noprint] WERROR _spoolss_EnumPrintProcessors( - [in] [string,charset(UTF16)] uint16 *servername, - [in] [string,charset(UTF16)] uint16 *environment, + [in,unique] [string,charset(UTF16)] uint16 *servername, + [in,unique] [string,charset(UTF16)] uint16 *environment, [in] uint32 level, - [in] DATA_BLOB *buffer, + [in,unique] DATA_BLOB *buffer, [in] uint32 offered, - [out] DATA_BLOB *info, - [out] uint32 *needed, - [out] uint32 *count + [out,unique] DATA_BLOB *info, + [out] uint32 needed, + [out] uint32 count ); [public,noopnum,noprint] void __spoolss_EnumPrintProcessors( [in] uint32 level, @@ -633,14 +632,14 @@ [out,switch_is(level)] spoolss_PrintProcessorInfo info[count] ); [nopull,nopush] WERROR spoolss_EnumPrintProcessors( - [in] [string,charset(UTF16)] uint16 *servername, - [in] [string,charset(UTF16)] uint16 *environment, + [in,unique] [string,charset(UTF16)] uint16 *servername, + [in,unique] [string,charset(UTF16)] uint16 *environment, [in] uint32 level, - [in] DATA_BLOB *buffer, + [in,unique] DATA_BLOB *buffer, [in] uint32 offered, - [out,switch_is(level),size_is(count)] spoolss_PrintProcessorInfo *info, - [out] uint32 *needed, - [out] uint32 *count + [out,unique,switch_is(level),size_is(count)] spoolss_PrintProcessorInfo *info, + [out] uint32 needed, + [out] uint32 count ); /******************/ @@ -667,7 +666,7 @@ [in,ref] policy_handle *handle, [in] uint32 level, [in,switch_is(level)] spoolss_DocumentInfo info, - [out] uint32 *job_id + [out] uint32 job_id ); /******************/ @@ -682,7 +681,7 @@ [in,ref] policy_handle *handle, [in] DATA_BLOB data, [in,value(r->in.data.length)] uint32 _data_size, - [out] uint32 *num_written + [out] uint32 num_written ); /******************/ @@ -702,8 +701,8 @@ WERROR spoolss_ReadPrinter( [in,ref] policy_handle *handle, [in] uint32 data_size, - [out] DATA_BLOB *data, - [out,value(r->out.data.length)] uint32 *_data_size + [out] DATA_BLOB data, + [out,value(r->out.data.length)] uint32 _data_size ); /******************/ @@ -767,21 +766,21 @@ [in,ref] policy_handle *handle, [in] [string,charset(UTF16)] uint16 value_name[], [in] uint32 offered, - [out] spoolss_PrinterDataType *type, - [out] DATA_BLOB *data, - [out] uint32 *needed + [out] spoolss_PrinterDataType type, + [out] DATA_BLOB data, + [out] uint32 needed ); [noopnum,noprint,public] void __spoolss_GetPrinterData( [in] spoolss_PrinterDataType type, - [out,switch_is(type)] spoolss_PrinterData *data + [out,switch_is(type)] spoolss_PrinterData data ); - [nopull,nopush] WERROR spoolss_GetPrinterData( + [nopull,nopush,public] WERROR spoolss_GetPrinterData( [in,ref] policy_handle *handle, [in] [string,charset(UTF16)] uint16 value_name[], [in] uint32 offered, - [out] spoolss_PrinterDataType *type, - [out,subcontext(4),subcontext_size(offered),switch_is(type)] spoolss_PrinterData *data, - [out] uint32 *needed + [out] spoolss_PrinterDataType type, + [out,subcontext(4),subcontext_size(offered),switch_is(type)] spoolss_PrinterData data, + [out] uint32 needed ); /******************/ @@ -791,11 +790,11 @@ [in] [string,charset(UTF16)] uint16 value_name[], [in] spoolss_PrinterDataType type, [in] DATA_BLOB data, - [in] uint32 *_offered + [in] uint32 _offered ); [noopnum,nopull,noprint,public] void __spoolss_SetPrinterData( [in] spoolss_PrinterDataType type, - [out,switch_is(type)] spoolss_PrinterData *data + [out,switch_is(type)] spoolss_PrinterData data ); [nopush] WERROR spoolss_SetPrinterData( [in,ref] policy_handle *handle, @@ -812,7 +811,7 @@ /******************/ /* Function: 0x1d */ - WERROR spoolss_ClosePrinter( + [public] WERROR spoolss_ClosePrinter( [in,out,ref] policy_handle *handle ); @@ -878,10 +877,10 @@ [in,ref] policy_handle *handle, [in] [string,charset(UTF16)] uint16 form_name[], [in] uint32 level, - [in] DATA_BLOB *buffer, + [in,unique] DATA_BLOB *buffer, [in] uint32 offered, - [out,subcontext(4),subcontext_size(offered),switch_is(level)] spoolss_FormInfo *info, - [out] uint32 *needed + [out,unique,subcontext(4),subcontext_size(offered),switch_is(level)] spoolss_FormInfo *info, + [out] uint32 needed ); /******************/ @@ -898,11 +897,11 @@ [public,noopnum,noprint] WERROR _spoolss_EnumForms( [in,ref] policy_handle *handle, [in] uint32 level, - [in] DATA_BLOB *buffer, + [in,unique] DATA_BLOB *buffer, [in] uint32 offered, - [out] DATA_BLOB *info, - [out] uint32 *needed, - [out] uint32 *count + [out,unique] DATA_BLOB *info, + [out] uint32 needed, + [out] uint32 count ); [public,noopnum,noprint] void __spoolss_EnumForms( [in] uint32 level, @@ -912,11 +911,11 @@ [nopull,nopush] WERROR spoolss_EnumForms( [in,ref] policy_handle *handle, [in] uint32 level, - [in] DATA_BLOB *buffer, + [in,unique] DATA_BLOB *buffer, [in] uint32 offered, - [out,switch_is(level),size_is(count)] spoolss_FormInfo *info, - [out] uint32 *needed, - [out] uint32 *count + [out,unique,switch_is(level),size_is(count)] spoolss_FormInfo *info, + [out] uint32 needed, + [out] uint32 count ); typedef struct { @@ -948,13 +947,13 @@ /******************/ /* Function: 0x23 */ [public,noopnum,noprint] WERROR _spoolss_EnumPorts( - [in] [string,charset(UTF16)] uint16 *servername, + [in,unique] [string,charset(UTF16)] uint16 *servername, [in] uint32 level, - [in] DATA_BLOB *buffer, + [in,unique] DATA_BLOB *buffer, [in] uint32 offered, - [out] DATA_BLOB *info, - [out] uint32 *needed, - [out] uint32 *count + [out,unique] DATA_BLOB *info, + [out] uint32 needed, + [out] uint32 count ); [public,noopnum,noprint] void __spoolss_EnumPorts( [in] uint32 level, @@ -962,13 +961,13 @@ [out,switch_is(level)] spoolss_PortInfo info[count] ); [nopull,nopush] WERROR spoolss_EnumPorts( - [in] [string,charset(UTF16)] uint16 *servername, + [in,unique] [string,charset(UTF16)] uint16 *servername, [in] uint32 level, - [in] DATA_BLOB *buffer, + [in,unique] DATA_BLOB *buffer, [in] uint32 offered, - [out,switch_is(level),size_is(count)] spoolss_PortInfo *info, - [out] uint32 *needed, - [out] uint32 *count + [out,unique,switch_is(level),size_is(count)] spoolss_PortInfo *info, + [out] uint32 needed, + [out] uint32 count ); /******************/ @@ -990,13 +989,13 @@ } spoolss_MonitorInfo; [public,noopnum,noprint] WERROR _spoolss_EnumMonitors( - [in] [string,charset(UTF16)] uint16 *servername, + [in,unique] [string,charset(UTF16)] uint16 *servername, [in] uint32 level, - [in] DATA_BLOB *buffer, + [in,unique] DATA_BLOB *buffer, [in] uint32 offered, - [out] DATA_BLOB *info, - [out] uint32 *needed, - [out] uint32 *count + [out,unique] DATA_BLOB *info, + [out] uint32 needed, + [out] uint32 count ); [public,noopnum,noprint] void __spoolss_EnumMonitors( [in] uint32 level, @@ -1004,19 +1003,19 @@ [out,switch_is(level)] spoolss_MonitorInfo info[count] ); [nopull,nopush] WERROR spoolss_EnumMonitors( - [in] [string,charset(UTF16)] uint16 *servername, + [in,unique] [string,charset(UTF16)] uint16 *servername, [in] uint32 level, - [in] DATA_BLOB *buffer, + [in,unique] DATA_BLOB *buffer, [in] uint32 offered, - [out,switch_is(level),size_is(count)] spoolss_MonitorInfo *info, - [out] uint32 *needed, - [out] uint32 *count + [out,unique,switch_is(level),size_is(count)] spoolss_MonitorInfo *info, + [out] uint32 needed, + [out] uint32 count ); /******************/ /* Function: 0x25 */ WERROR spoolss_AddPort( - [in] [string,charset(UTF16)] uint16 *server_name, + [in,unique] [string,charset(UTF16)] uint16 *server_name, [in] uint32 unknown, [in] [string,charset(UTF16)] uint16 monitor_name[] ); @@ -1102,16 +1101,16 @@ /* Function: 0x35 */ WERROR spoolss_GetPrinterDriver2( [in,ref] policy_handle *handle, - [in] [string,charset(UTF16)] uint16 *architecture, + [in,unique] [string,charset(UTF16)] uint16 *architecture, [in] uint32 level, - [in] DATA_BLOB *buffer, + [in,unique] DATA_BLOB *buffer, [in] uint32 offered, [in] uint32 client_major_version, [in] uint32 client_minor_version, - [out] DATA_BLOB *info, - [out] uint32 *needed, - [out] uint32 *server_major_version, - [out] uint32 *server_minor_version + [out,unique] DATA_BLOB *info, + [out] uint32 needed, + [out] uint32 server_major_version, + [out] uint32 server_minor_version ); /******************/ @@ -1126,7 +1125,8 @@ /******************/ /* Function: 0x38 */ - WERROR spoolss_FindClosePrinterNotify( + [public] WERROR spoolss_FindClosePrinterNotify( + [in,ref] policy_handle *handle ); /******************/ @@ -1136,7 +1136,13 @@ /******************/ /* Function: 0x3a */ - WERROR spoolss_ReplyOpenPrinter( + [public] WERROR spoolss_ReplyOpenPrinter( + [in,string,charset(UTF16)] uint16 server_name[], + [in] uint32 printer_local, + [in] winreg_Type type, + [in] uint32 unknown1, + [in] uint32 unknown2, + [out,ref] policy_handle *handle ); /******************/ @@ -1146,7 +1152,8 @@ /******************/ /* Function: 0x3c */ - WERROR spoolss_ReplyClosePrinter( + [public] WERROR spoolss_ReplyClosePrinter( + [in,out,ref] policy_handle *handle ); /******************/ @@ -1169,31 +1176,65 @@ WERROR spoolss_ResetPrinterEx( ); + typedef [enum16bit] enum { + SPOOLSS_FIELD_SERVER_NAME = 0, + SPOOLSS_FIELD_PRINTER_NAME = 1, + SPOOLSS_FIELD_SHARE_NAME = 2, + SPOOLSS_FIELD_PORT_NAME = 3, + SPOOLSS_FIELD_DRIVER_NAME = 4, + SPOOLSS_FIELD_COMMENT = 5, + SPOOLSS_FIELD_LOCATION = 6, + SPOOLSS_FIELD_DEVMODE = 7, + SPOOLSS_FIELD_SEPFILE = 8, + SPOOLSS_FIELD_PRINT_PROCESSOR = 9, + SPOOLSS_FIELD_PARAMETERS = 10, + SPOOLSS_FIELD_DATATYPE = 11, + SPOOLSS_FIELD_SECURITY_DESCRIPTOR=12, + SPOOLSS_FIELD_ATTRIBUTES = 13, + SPOOLSS_FIELD_PRIORITY = 14, + SPOOLSS_FIELD_DEFAULT_PRIORITY = 15, + SPOOLSS_FIELD_START_TIME = 16, + SPOOLSS_FIELD_UNTIL_TIME = 17, + SPOOLSS_FIELD_STATUS = 18, + SPOOLSS_FIELD_STATUS_STRING = 19, + SPOOLSS_FIELD_CJOBS = 20, + SPOOLSS_FIELD_AVERAGE_PPM = 21, + SPOOLSS_FIELD_TOTAL_PAGES = 22, + SPOOLSS_FIELD_PAGES_PRINTED = 23, + SPOOLSS_FIELD_TOTAL_BYTES = 24, + SPOOLSS_FIELD_BYTES_PRINTED = 25 + } spoolss_Field; + + typedef [enum16bit] enum { + SPOOLSS_NOTIFY_PRINTER = 0, + SPOOLSS_NOTIFY_JOB = 1 + } spoolss_NotifyType; + /******************/ /* Function: 0x41 */ - typedef [flag(NDR_PAHEX)] struct { + typedef struct { + spoolss_NotifyType type; uint16 u1; - uint16 u2; + uint32 u2; uint32 u3; - uint32 u4; uint32 count; - [size_is(count)] uint16 *array; - } spoolss_RemoteFindFirstPrinterChangeNotifyEx_t2; + [size_is(count)] spoolss_Field *fields; + } spoolss_NotifyOptionsArray; typedef struct { - uint32 u1; - uint32 u2; + uint32 version; + uint32 flags; uint32 count; - [size_is(count)] spoolss_RemoteFindFirstPrinterChangeNotifyEx_t2 *t2; - } spoolss_RemoteFindFirstPrinterChangeNotifyEx_t1; + [size_is(count)] spoolss_NotifyOptionsArray *options; + } spoolss_NotifyOptionsContainer; - WERROR spoolss_RemoteFindFirstPrinterChangeNotifyEx( + [public] WERROR spoolss_RemoteFindFirstPrinterChangeNotifyEx( [in,ref] policy_handle *handle, - [in] uint32 u1, - [in] uint32 u2, - [in] [string,charset(UTF16)] uint16 *str, - [in] uint32 u3, - [in] spoolss_RemoteFindFirstPrinterChangeNotifyEx_t1 *t1 + [in] uint32 flags, + [in] uint32 options, + [in,unique] [string,charset(UTF16)] uint16 *str, + [in] uint32 printer_local, + [in,unique] spoolss_NotifyOptionsContainer *t1 ); /******************/ @@ -1201,9 +1242,55 @@ WERROR spoolss_RouterRefreshPrinterChangeNotification( ); + typedef struct { + uint32 size; + [size_is(size/2),unique,charset(UTF16)] uint16 *string; + } spoolss_NotifyUTF16String; + + typedef struct { + uint32 size; + [size_is(size),charset(DOS)] uint8 *string; + } spoolss_NotifyDOSString; + + typedef struct { + uint16 data[8]; + } spoolss_NotifyBlobData; + + typedef struct { + uint32 len; + [unique] spoolss_NotifyBlobData *data; + } spoolss_NotifyBlob; + + typedef [switch_type(uint32)] union { + [case(1)] dlong integer; + [case(2)] spoolss_NotifyUTF16String utf16_string; + [case(3)] spoolss_NotifyDOSString ascii_string; + [case(4)] spoolss_NotifyBlob blob; + [case(5)] spoolss_NotifyDOSString ascii_string; + } spoolss_NotifyData; + + typedef struct { + spoolss_NotifyType type; + spoolss_Field field; + uint32 variable_type; + uint32 job_id; + [switch_is(variable_type)] spoolss_NotifyData data; + } spoolss_Notify; + + typedef struct { + uint32 version; + uint32 flags; + uint32 count; + [size_is(count)] spoolss_Notify notifies[]; + } spoolss_NotifyInfo; + /******************/ /* Function: 0x43 */ - WERROR spoolss_RemoteFindNextPrinterChangeNotifyEx( + [public] WERROR spoolss_RemoteFindNextPrinterChangeNotifyEx( + [in,ref] policy_handle *handle, + [in] uint32 change_low, + [in,unique] spoolss_NotifyOptionsContainer *container, + [out, unique] spoolss_NotifyInfo *info ); /******************/ @@ -1225,11 +1312,72 @@ [case(1)] spoolss_UserLevel1 *level1; } spoolss_UserLevel; + typedef bitmap { + SERVER_ACCESS_ADMINISTER = 0x00000001, + SERVER_ACCESS_ENUMERATE = 0x00000002, + PRINTER_ACCESS_ADMINISTER = 0x00000004, + PRINTER_ACCESS_USE = 0x00000008, + JOB_ACCESS_ADMINISTER = 0x00000010 + } spoolss_AccessRights; + + /* Access rights for print servers */ + const int SERVER_ALL_ACCESS = SEC_STD_REQUIRED | + SERVER_ACCESS_ADMINISTER | + SERVER_ACCESS_ENUMERATE; + + const int SERVER_READ = SEC_STD_READ_CONTROL | + SERVER_ACCESS_ENUMERATE; + + const int SERVER_WRITE = STANDARD_RIGHTS_WRITE_ACCESS | + SERVER_ACCESS_ADMINISTER | + SERVER_ACCESS_ENUMERATE; + + const int SERVER_EXECUTE = SEC_STD_READ_CONTROL | + SERVER_ACCESS_ENUMERATE; + + /* Access rights for printers */ + const int PRINTER_ALL_ACCESS = SEC_STD_REQUIRED | + PRINTER_ACCESS_ADMINISTER | + PRINTER_ACCESS_USE; + + const int PRINTER_READ = SEC_STD_READ_CONTROL | + PRINTER_ACCESS_USE; + + const int PRINTER_WRITE = STANDARD_RIGHTS_WRITE_ACCESS | + PRINTER_ACCESS_USE; + + const int PRINTER_EXECUTE = SEC_STD_READ_CONTROL | + PRINTER_ACCESS_USE; + + /* Access rights for jobs */ + const int JOB_ALL_ACCESS = SEC_STD_REQUIRED | + JOB_ACCESS_ADMINISTER; + + const int JOB_READ = SEC_STD_READ_CONTROL | + JOB_ACCESS_ADMINISTER; + + const int JOB_WRITE = STANDARD_RIGHTS_WRITE_ACCESS | + JOB_ACCESS_ADMINISTER; + + const int JOB_EXECUTE = SEC_STD_READ_CONTROL | + JOB_ACCESS_ADMINISTER; + + /* ACE masks for various print permissions */ + const int PRINTER_ACE_FULL_CONTROL = SEC_GENERIC_ALL | + PRINTER_ALL_ACCESS; + + const int PRINTER_ACE_MANAGE_DOCUMENTS = SEC_GENERIC_ALL | + READ_CONTROL_ACCESS; + + const int PRINTER_ACE_PRINT = GENERIC_EXECUTE_ACCESS | + READ_CONTROL_ACCESS | + PRINTER_ACCESS_USE; + /******************/ /* Function: 0x45 */ - WERROR spoolss_OpenPrinterEx( - [in] [string,charset(UTF16)] uint16 *printername, - [in] [string,charset(UTF16)] uint16 *datatype, + [public] WERROR spoolss_OpenPrinterEx( + [in,unique] [string,charset(UTF16)] uint16 *printername, + [in,unique] [string,charset(UTF16)] uint16 *datatype, [in] spoolss_DevmodeContainer devmode_ctr, [in] uint32 access_mask, [in] uint32 level, @@ -1240,11 +1388,11 @@ /******************/ /* Function: 0x46 */ WERROR spoolss_AddPrinterEx( - [in] [string,charset(UTF16)] uint16 *server, + [in,unique] [string,charset(UTF16)] uint16 *server, [in] uint32 level, - [in,switch_is(level)] spoolss_PrinterInfo *info, + [in,unique,switch_is(level)] spoolss_PrinterInfo *info, [in] spoolss_DevmodeContainer devmode_ctr, - [in] security_descriptor *secdesc, + [in,unique] security_descriptor *secdesc, [in] uint32 ulevel, [in,switch_is(ulevel)] spoolss_UserLevel userlevel ); @@ -1259,12 +1407,13 @@ WERROR spoolss_EnumPrinterData( [in,ref] policy_handle *handle, [in] uint32 enum_index, + [out,ref,size_is(value_offered/2),charset(UTF16)] uint16 *value_name, [in] uint32 value_offered, - [out] lstring *value_name, - [out] uint32 *value_needed, - [out] uint32 *printerdata_type, - [out] DATA_BLOB *buffer, - [in,out,ref] uint32 *data_size + [out,ref] uint32 *value_needed, + [out,ref] uint32 *printerdata_type, + [out,ref] DATA_BLOB *buffer, + [in] uint32 data_offered, + [out,ref] uint32 *data_needed ); /******************/ @@ -1307,25 +1456,30 @@ [in] [string,charset(UTF16)] uint16 key_name[], [in] [string,charset(UTF16)] uint16 value_name[], [in] uint32 offered, - [out] uint32 *type, - [out] DATA_BLOB *buffer, - [out] uint32 *needed + [out] uint32 type, + [out] DATA_BLOB buffer, + [out] uint32 needed ); /******************/ /* Function: 0x4f */ - WERROR spoolss_EnumPrinterDataEx( + [public] WERROR spoolss_EnumPrinterDataEx( [in,ref] policy_handle *handle, [in] [string,charset(UTF16)] uint16 key_name[], [in] uint32 offered, - [out] DATA_BLOB *buffer, - [out] uint32 *needed, - [out] uint32 *count + [out] DATA_BLOB buffer, + [out] uint32 needed, + [out] uint32 count ); /******************/ /* Function: 0x50 */ - WERROR spoolss_EnumPrinterKey( + [public] WERROR spoolss_EnumPrinterKey( + [in, ref] policy_handle *handle, + [in] [string,charset(UTF16)] uint16 key_name[], + [out] uint32 key_buffer_size, + [out] uint16 key_buffer[key_buffer_size], + [in,out] uint32 needed ); /******************/ @@ -1375,14 +1529,14 @@ [in,value(r->in.in_data.length)] uint32 _in_data_length, [in] uint32 offered, [in] uint32 unknown1, - [out] DATA_BLOB *out_data, - [out] uint32 *needed, - [out] uint32 *unknown2 + [out] DATA_BLOB out_data, + [out] uint32 needed, + [out] uint32 unknown2 ); /******************/ /* Function: 0x59 */ - WERROR spoolss_AddPrinterDriverEx( + [public] WERROR spoolss_AddPrinterDriverEx( ); /******************/ diff --git a/source3/librpc/idl/srvsvc.idl b/source3/librpc/idl/srvsvc.idl index c66486b29c..2f23fd1e70 100644 --- a/source3/librpc/idl/srvsvc.idl +++ b/source3/librpc/idl/srvsvc.idl @@ -10,7 +10,6 @@ import "security.idl", "svcctl.idl"; version(3.0), endpoint("ncacn_np:[\\pipe\\srvsvc]", "ncacn_ip_tcp:", "ncalrpc:"), pointer_default(unique), - pointer_default_top(unique), helpstring("Server Service") ] interface srvsvc { @@ -56,7 +55,7 @@ import "security.idl", "svcctl.idl"; /******************/ /* Function: 0x00 */ WERROR srvsvc_NetCharDevEnum( - [in] [string,charset(UTF16)] uint16 *server_unc, + [in,unique] [string,charset(UTF16)] uint16 *server_unc, [in,out,ref] uint32 *level, [in,out,ref,switch_is(*level)] srvsvc_NetCharDevCtr *ctr, [in] uint32 max_buffer, @@ -67,7 +66,7 @@ import "security.idl", "svcctl.idl"; /******************/ /* Function: 0x01 */ WERROR srvsvc_NetCharDevGetInfo( - [in] [string,charset(UTF16)] uint16 *server_unc, + [in,unique] [string,charset(UTF16)] uint16 *server_unc, [in] [string,charset(UTF16)] uint16 device_name[], [in] uint32 level, [out,ref,switch_is(level)] srvsvc_NetCharDevInfo *info @@ -76,7 +75,7 @@ import "security.idl", "svcctl.idl"; /******************/ /* Function: 0x02 */ WERROR srvsvc_NetCharDevControl( - [in] [string,charset(UTF16)] uint16 *server_unc, + [in,unique] [string,charset(UTF16)] uint16 *server_unc, [in] [string,charset(UTF16)] uint16 device_name[], [in] uint32 opcode ); @@ -121,19 +120,19 @@ import "security.idl", "svcctl.idl"; /******************/ /* Function: 0x03 */ WERROR srvsvc_NetCharDevQEnum( - [in] [string,charset(UTF16)] uint16 *server_unc, - [in] [string,charset(UTF16)] uint16 *user, + [in,unique] [string,charset(UTF16)] uint16 *server_unc, + [in,unique] [string,charset(UTF16)] uint16 *user, [in,out,ref] uint32 *level, [in,out,switch_is(*level),ref] srvsvc_NetCharDevQCtr *ctr, [in] uint32 max_buffer, [out,ref] uint32 *totalentries, - [in,out] uint32 *resume_handle + [in,out,unique] uint32 *resume_handle ); /******************/ /* Function: 0x04 */ WERROR srvsvc_NetCharDevQGetInfo( - [in] [string,charset(UTF16)] uint16 *server_unc, + [in,unique] [string,charset(UTF16)] uint16 *server_unc, [in] [string,charset(UTF16)] uint16 queue_name[], [in] [string,charset(UTF16)] uint16 user[], [in] uint32 level, @@ -143,24 +142,24 @@ import "security.idl", "svcctl.idl"; /******************/ /* Function: 0x05 */ WERROR srvsvc_NetCharDevQSetInfo( - [in] [string,charset(UTF16)] uint16 *server_unc, + [in,unique] [string,charset(UTF16)] uint16 *server_unc, [in] [string,charset(UTF16)] uint16 queue_name[], [in] uint32 level, [in,switch_is(level)] srvsvc_NetCharDevQInfo info, - [in,out] uint32 *parm_error + [in,out,unique] uint32 *parm_error ); /******************/ /* Function: 0x06 */ WERROR srvsvc_NetCharDevQPurge( - [in] [string,charset(UTF16)] uint16 *server_unc, + [in,unique] [string,charset(UTF16)] uint16 *server_unc, [in] [string,charset(UTF16)] uint16 queue_name[] ); /******************/ /* Function: 0x07 */ WERROR srvsvc_NetCharDevQPurgeSelf( - [in] [string,charset(UTF16)] uint16 *server_unc, + [in,unique] [string,charset(UTF16)] uint16 *server_unc, [in] [string,charset(UTF16)] uint16 queue_name[], [in] [string,charset(UTF16)] uint16 computer_name[] ); @@ -201,8 +200,8 @@ import "security.idl", "svcctl.idl"; /******************/ /* Function: 0x08 */ WERROR srvsvc_NetConnEnum( - [in] [string,charset(UTF16)] uint16 *server_unc, - [in] [string,charset(UTF16)] uint16 *path, + [in,unique] [string,charset(UTF16)] uint16 *server_unc, + [in,unique] [string,charset(UTF16)] uint16 *path, [in,out,ref] uint32 *level, [in,out,switch_is(*level),ref] srvsvc_NetConnCtr *ctr, [in] uint32 max_buffer, @@ -250,9 +249,9 @@ import "security.idl", "svcctl.idl"; /******************/ /* Function: 0x09 */ WERROR srvsvc_NetFileEnum( - [in] [string,charset(UTF16)] uint16 *server_unc, - [in] [string,charset(UTF16)] uint16 *path, - [in] [string,charset(UTF16)] uint16 *user, + [in,unique] [string,charset(UTF16)] uint16 *server_unc, + [in,unique] [string,charset(UTF16)] uint16 *path, + [in,unique] [string,charset(UTF16)] uint16 *user, [in,out,ref] uint32 *level, [in,out,switch_is(*level),ref] srvsvc_NetFileCtr *ctr, [in] uint32 max_buffer, @@ -263,7 +262,7 @@ import "security.idl", "svcctl.idl"; /******************/ /* Function: 0x0a */ WERROR srvsvc_NetFileGetInfo( - [in] [string,charset(UTF16)] uint16 *server_unc, + [in,unique] [string,charset(UTF16)] uint16 *server_unc, [in] uint32 fid, [in] uint32 level, [out,switch_is(level),ref] srvsvc_NetFileInfo *info @@ -272,7 +271,7 @@ import "security.idl", "svcctl.idl"; /******************/ /* Function: 0x0b */ WERROR srvsvc_NetFileClose( - [in] [string,charset(UTF16)] uint16 *server_unc, + [in,unique] [string,charset(UTF16)] uint16 *server_unc, [in] uint32 fid ); @@ -357,9 +356,9 @@ import "security.idl", "svcctl.idl"; /******************/ /* Function: 0x0c */ WERROR srvsvc_NetSessEnum( - [in] [string,charset(UTF16)] uint16 *server_unc, - [in] [string,charset(UTF16)] uint16 *client, - [in] [string,charset(UTF16)] uint16 *user, + [in,unique] [string,charset(UTF16)] uint16 *server_unc, + [in,unique] [string,charset(UTF16)] uint16 *client, + [in,unique] [string,charset(UTF16)] uint16 *user, [in,out,ref] uint32 *level, [in,out,switch_is(*level),ref] srvsvc_NetSessCtr *ctr, [in] uint32 max_buffer, @@ -370,9 +369,9 @@ import "security.idl", "svcctl.idl"; /******************/ /* Function: 0x0d */ WERROR srvsvc_NetSessDel( - [in] [string,charset(UTF16)] uint16 *server_unc, - [in] [string,charset(UTF16)] uint16 *client, - [in] [string,charset(UTF16)] uint16 *user + [in,unique] [string,charset(UTF16)] uint16 *server_unc, + [in,unique] [string,charset(UTF16)] uint16 *client, + [in,unique] [string,charset(UTF16)] uint16 *user ); /**************************/ @@ -546,27 +545,27 @@ import "security.idl", "svcctl.idl"; /******************/ /* Function: 0x0e */ WERROR srvsvc_NetShareAdd( - [in] [string,charset(UTF16)] uint16 *server_unc, + [in,unique] [string,charset(UTF16)] uint16 *server_unc, [in] uint32 level, [in,switch_is(level)] srvsvc_NetShareInfo info, - [in,out] uint32 *parm_error + [in,out,unique] uint32 *parm_error ); /******************/ /* Function: 0x0f */ WERROR srvsvc_NetShareEnumAll ( - [in] [string,charset(UTF16)] uint16 *server_unc, + [in,unique] [string,charset(UTF16)] uint16 *server_unc, [in,out,ref] uint32 *level, [in,out,ref,switch_is(*level)] srvsvc_NetShareCtr *ctr, [in] uint32 max_buffer, [out,ref] uint32 *totalentries, - [in,out] uint32 *resume_handle + [in,out,unique] uint32 *resume_handle ); /******************/ /* Function: 0x10 */ WERROR srvsvc_NetShareGetInfo( - [in] [string,charset(UTF16)] uint16 *server_unc, + [in,unique] [string,charset(UTF16)] uint16 *server_unc, [in] [string,charset(UTF16)] uint16 share_name[], [in] uint32 level, [out,ref,switch_is(level)] srvsvc_NetShareInfo *info @@ -575,17 +574,17 @@ import "security.idl", "svcctl.idl"; /******************/ /* Function: 0x11 */ WERROR srvsvc_NetShareSetInfo( - [in] [string,charset(UTF16)] uint16 *server_unc, + [in,unique] [string,charset(UTF16)] uint16 *server_unc, [in] [string,charset(UTF16)] uint16 share_name[], [in] uint32 level, [in,switch_is(level)] srvsvc_NetShareInfo info, - [in,out] uint32 *parm_error + [in,out,unique] uint32 *parm_error ); /******************/ /* Function: 0x12 */ WERROR srvsvc_NetShareDel( - [in] [string,charset(UTF16)] uint16 *server_unc, + [in,unique] [string,charset(UTF16)] uint16 *server_unc, [in] [string,charset(UTF16)] uint16 share_name[], [in] uint32 reserved ); @@ -593,7 +592,7 @@ import "security.idl", "svcctl.idl"; /******************/ /* Function: 0x13 */ WERROR srvsvc_NetShareDelSticky( - [in] [string,charset(UTF16)] uint16 *server_unc, + [in,unique] [string,charset(UTF16)] uint16 *server_unc, [in] [string,charset(UTF16)] uint16 share_name[], [in] uint32 reserved ); @@ -601,7 +600,7 @@ import "security.idl", "svcctl.idl"; /******************/ /* Function: 0x14 */ WERROR srvsvc_NetShareCheck( - [in] [string,charset(UTF16)] uint16 *server_unc, + [in,unique] [string,charset(UTF16)] uint16 *server_unc, [in] [string,charset(UTF16)] uint16 device_name[], [out,ref] srvsvc_ShareType *type ); @@ -1111,7 +1110,7 @@ import "security.idl", "svcctl.idl"; /******************/ /* Function: 0x15 */ WERROR srvsvc_NetSrvGetInfo( - [in] [string,charset(UTF16)] uint16 *server_unc, + [in,unique] [string,charset(UTF16)] uint16 *server_unc, [in] uint32 level, [out,ref,switch_is(level)] srvsvc_NetSrvInfo *info ); @@ -1119,10 +1118,10 @@ import "security.idl", "svcctl.idl"; /******************/ /* Function: 0x16 */ WERROR srvsvc_NetSrvSetInfo( - [in] [string,charset(UTF16)] uint16 *server_unc, + [in,unique] [string,charset(UTF16)] uint16 *server_unc, [in] uint32 level, [in,switch_is(level)] srvsvc_NetSrvInfo info, - [in,out] uint32 *parm_error + [in,out,unique] uint32 *parm_error ); /**************************/ @@ -1140,12 +1139,12 @@ import "security.idl", "svcctl.idl"; /******************/ /* Function: 0x17 */ WERROR srvsvc_NetDiskEnum( - [in] [string,charset(UTF16)] uint16 *server_unc, + [in,unique] [string,charset(UTF16)] uint16 *server_unc, [in] uint32 level, [in,out,ref] srvsvc_NetDiskInfo *info, [in] uint32 maxlen, [out,ref] uint32 *totalentries, - [in,out] uint32 *resume_handle + [in,out,unique] uint32 *resume_handle ); /**************************/ @@ -1174,8 +1173,8 @@ import "security.idl", "svcctl.idl"; /******************/ /* Function: 0x18 */ WERROR srvsvc_NetServerStatisticsGet( - [in] [string,charset(UTF16)] uint16 *server_unc, - [in] [string,charset(UTF16)] uint16 *service, + [in,unique] [string,charset(UTF16)] uint16 *server_unc, + [in,unique] [string,charset(UTF16)] uint16 *service, [in] uint32 level, [in] uint32 options, [out,ref] srvsvc_Statistics *stats @@ -1195,7 +1194,7 @@ import "security.idl", "svcctl.idl"; /******************/ /* Function: 0x19 */ WERROR srvsvc_NetTransportAdd( - [in] [string,charset(UTF16)] uint16 *server_unc, + [in,unique] [string,charset(UTF16)] uint16 *server_unc, [in] uint32 level, [in,switch_is(level)] srvsvc_NetTransportInfo info ); @@ -1262,7 +1261,7 @@ import "security.idl", "svcctl.idl"; /******************/ /* Function: 0x1a */ WERROR srvsvc_NetTransportEnum( - [in] [string,charset(UTF16)] uint16 *server_unc, + [in,unique] [string,charset(UTF16)] uint16 *server_unc, [in,out,ref] uint32 *level, [in,out,ref,switch_is(*level)] srvsvc_NetTransportCtr *transports, [in] uint32 max_buffer, @@ -1273,7 +1272,7 @@ import "security.idl", "svcctl.idl"; /******************/ /* Function: 0x1b */ WERROR srvsvc_NetTransportDel( - [in] [string,charset(UTF16)] uint16 *server_unc, + [in,unique] [string,charset(UTF16)] uint16 *server_unc, [in] uint32 unknown, [in] srvsvc_NetTransportInfo0 transport ); @@ -1299,8 +1298,8 @@ import "security.idl", "svcctl.idl"; /******************/ /* Function: 0x1c */ WERROR srvsvc_NetRemoteTOD( - [in] [string,charset(UTF16)] uint16 *server_unc, - [out] srvsvc_NetRemoteTODInfo *info + [in,unique] [string,charset(UTF16)] uint16 *server_unc, + [out,unique] srvsvc_NetRemoteTODInfo *info ); /**************************/ @@ -1309,8 +1308,8 @@ import "security.idl", "svcctl.idl"; /******************/ /* Function: 0x1d */ WERROR srvsvc_NetSetServiceBits( - [in] [string,charset(UTF16)] uint16 *server_unc, - [in] [string,charset(UTF16)] uint16 *transport, + [in,unique] [string,charset(UTF16)] uint16 *server_unc, + [in,unique] [string,charset(UTF16)] uint16 *transport, [in] uint32 servicebits, [in] uint32 updateimmediately ); @@ -1321,7 +1320,7 @@ import "security.idl", "svcctl.idl"; /******************/ /* Function: 0x1e */ WERROR srvsvc_NetPathType( - [in] [string,charset(UTF16)] uint16 *server_unc, + [in,unique] [string,charset(UTF16)] uint16 *server_unc, [in] [string,charset(UTF16)] uint16 path[], [in] uint32 pathflags, [out,ref] uint32 *pathtype @@ -1330,7 +1329,7 @@ import "security.idl", "svcctl.idl"; /******************/ /* Function: 0x1f */ WERROR srvsvc_NetPathCanonicalize( - [in] [string,charset(UTF16)] uint16 *server_unc, + [in,unique] [string,charset(UTF16)] uint16 *server_unc, [in] [string,charset(UTF16)] uint16 path[], [out] [size_is(maxbuf)] uint8 can_path[], [in] uint32 maxbuf, @@ -1342,7 +1341,7 @@ import "security.idl", "svcctl.idl"; /******************/ /* Function: 0x20 */ WERROR srvsvc_NetPathCompare( - [in] [string,charset(UTF16)] uint16 *server_unc, + [in,unique] [string,charset(UTF16)] uint16 *server_unc, [in] [string,charset(UTF16)] uint16 path1[], [in] [string,charset(UTF16)] uint16 path2[], [in] uint32 pathtype, @@ -1355,7 +1354,7 @@ import "security.idl", "svcctl.idl"; /******************/ /* Function: 0x21 */ WERROR srvsvc_NetNameValidate( - [in] [string,charset(UTF16)] uint16 *server_unc, + [in,unique] [string,charset(UTF16)] uint16 *server_unc, [in] [string,charset(UTF16)] uint16 name[], [in] uint32 name_type, [in] uint32 flags @@ -1369,7 +1368,7 @@ import "security.idl", "svcctl.idl"; /******************/ /* Function: 0x23 */ WERROR srvsvc_NetPRNameCompare( - [in] [string,charset(UTF16)] uint16 *server_unc, + [in,unique] [string,charset(UTF16)] uint16 *server_unc, [in] [string,charset(UTF16)] uint16 name1[], [in] [string,charset(UTF16)] uint16 name2[], [in] uint32 name_type, @@ -1384,7 +1383,7 @@ import "security.idl", "svcctl.idl"; /* Note, there must be some way to return entries read vs total entries ... */ WERROR srvsvc_NetShareEnum( - [in] [string,charset(UTF16)] uint16 *server_unc, + [in,unique] [string,charset(UTF16)] uint16 *server_unc, [in,out,ref] uint32 *level, [in,out,ref,switch_is(*level)] srvsvc_NetShareCtr *ctr, [in] uint32 max_buffer, @@ -1395,33 +1394,33 @@ import "security.idl", "svcctl.idl"; /******************/ /* Function: 0x25 */ WERROR srvsvc_NetShareDelStart( - [in] [string,charset(UTF16)] uint16 *server_unc, + [in,unique] [string,charset(UTF16)] uint16 *server_unc, [in] [string,charset(UTF16)] uint16 share[], [in] uint32 reserved, - [out] policy_handle *hnd + [out,unique] policy_handle *hnd ); /******************/ /* Function: 0x26 */ WERROR srvsvc_NetShareDelCommit( - [in, out] policy_handle *hnd + [in, out,unique] policy_handle *hnd ); /******************/ /* Function: 0x27 */ WERROR srvsvc_NetGetFileSecurity( - [in] [string,charset(UTF16)] uint16 *server_unc, - [in] [string,charset(UTF16)] uint16 *share, + [in,unique] [string,charset(UTF16)] uint16 *server_unc, + [in,unique] [string,charset(UTF16)] uint16 *share, [in] [string,charset(UTF16)] uint16 file[], [in] security_secinfo securityinformation, - [out] sec_desc_buf *sd_buf + [out,unique] sec_desc_buf *sd_buf ); /******************/ /* Function: 0x28 */ WERROR srvsvc_NetSetFileSecurity( - [in] [string,charset(UTF16)] uint16 *server_unc, - [in] [string,charset(UTF16)] uint16 *share, + [in,unique] [string,charset(UTF16)] uint16 *server_unc, + [in,unique] [string,charset(UTF16)] uint16 *share, [in] [string,charset(UTF16)] uint16 file[], [in] security_secinfo securityinformation, [in] sec_desc_buf sd_buf @@ -1439,7 +1438,7 @@ import "security.idl", "svcctl.idl"; /******************/ /* Function: 0x29 */ WERROR srvsvc_NetServerTransportAddEx( - [in] [string,charset(UTF16)] uint16 *server_unc, + [in,unique] [string,charset(UTF16)] uint16 *server_unc, [in] uint32 level, [in,switch_is(level)] srvsvc_NetTransportInfo info ); @@ -1447,9 +1446,9 @@ import "security.idl", "svcctl.idl"; /******************/ /* Function: 0x2a */ WERROR srvsvc_NetServerSetServiceBitsEx( - [in] [string,charset(UTF16)] uint16 *server_unc, - [in] [string,charset(UTF16)] uint16 *emulated_server_unc, - [in] [string,charset(UTF16)] uint16 *transport, + [in,unique] [string,charset(UTF16)] uint16 *server_unc, + [in,unique] [string,charset(UTF16)] uint16 *emulated_server_unc, + [in,unique] [string,charset(UTF16)] uint16 *transport, [in] uint32 servicebitsofinterest, [in] uint32 servicebits, [in] uint32 updateimmediately diff --git a/source3/librpc/idl/svcctl.idl b/source3/librpc/idl/svcctl.idl index 2fbdb71e74..e36a0918bf 100644 --- a/source3/librpc/idl/svcctl.idl +++ b/source3/librpc/idl/svcctl.idl @@ -7,7 +7,6 @@ [ uuid("367abb81-9844-35f1-ad32-98f038001003"), version(2.0), pointer_default(unique), - pointer_default_top(unique), endpoint("ncacn_np:[\\pipe\\svcctl]", "ncalrpc:"), helpstring("Service Control") ] interface svcctl @@ -116,11 +115,20 @@ /*****************/ /* Function 0x04 */ WERROR svcctl_QueryServiceObjectSecurity( + [in] policy_handle *handle, + [in] uint32 security_flags, + [out,ref,size_is(buffer_size)] uint8 *buffer, + [in,range(0,0x40000)] uint32 buffer_size, + [out,ref,range(0,0x40000)] uint32 *needed ); /*****************/ /* Function 0x05 */ WERROR svcctl_SetServiceObjectSecurity( + [in] policy_handle *handle, + [in] uint32 security_flags, + [in,ref,size_is(buffer_size)] uint8 *buffer, + [in] uint32 buffer_size ); /*****************/ @@ -162,13 +170,13 @@ [in] uint32 type, [in] uint32 start, [in] uint32 error, - [in] [string,charset(UTF16)] uint16 *binary_path, - [in] [string,charset(UTF16)] uint16 *load_order_group, + [in,unique] [string,charset(UTF16)] uint16 *binary_path, + [in,unique] [string,charset(UTF16)] uint16 *load_order_group, [out,ref] uint32 *tag_id, - [in] [string,charset(UTF16)] uint16 *dependencies, - [in] [string,charset(UTF16)] uint16 *service_start_name, - [in] [string,charset(UTF16)] uint16 *password, - [in] [string,charset(UTF16)] uint16 *display_name + [in,unique] [string,charset(UTF16)] uint16 *dependencies, + [in,unique] [string,charset(UTF16)] uint16 *service_start_name, + [in,unique] [string,charset(UTF16)] uint16 *password, + [in,unique] [string,charset(UTF16)] uint16 *display_name ); /*****************/ @@ -176,18 +184,18 @@ WERROR svcctl_CreateServiceW( [in,ref] policy_handle *scmanager_handle, [in] [string,charset(UTF16)] uint16 ServiceName[], - [in] [string,charset(UTF16)] uint16 *DisplayName, + [in,unique] [string,charset(UTF16)] uint16 *DisplayName, [in] uint32 desired_access, [in] uint32 type, [in] uint32 start_type, [in] uint32 error_control, [in] [string,charset(UTF16)] uint16 binary_path[], - [in] [string,charset(UTF16)] uint16 *LoadOrderGroupKey, - [in,out] uint32 *TagId, - [in,size_is(dependencies_size)] uint8 *dependencies, + [in,unique] [string,charset(UTF16)] uint16 *LoadOrderGroupKey, + [in,out,unique] uint32 *TagId, + [in,unique,size_is(dependencies_size)] uint8 *dependencies, [in] uint32 dependencies_size, - [in] [string,charset(UTF16)] uint16 *service_start_name, - [in,size_is(password_size)] uint8 *password, + [in,unique] [string,charset(UTF16)] uint16 *service_start_name, + [in,unique,size_is(password_size)] uint8 *password, [in] uint32 password_size, [out,ref] policy_handle *handle ); @@ -197,7 +205,7 @@ WERROR svcctl_EnumDependentServicesW( [in,ref] policy_handle *service, [in] uint32 state, - [out] ENUM_SERVICE_STATUS *service_status, + [out,unique] ENUM_SERVICE_STATUS *service_status, [in] uint32 buf_size, [out,ref] uint32 *bytes_needed, [out,ref] uint32 *services_returned @@ -213,14 +221,14 @@ [out,size_is(buf_size)] uint8 service[*], [out,ref] uint32 *bytes_needed, [out,ref] uint32 *services_returned, - [in,out] uint32 *resume_handle + [in,out,unique] uint32 *resume_handle ); /*****************/ /* Function 0x0f */ WERROR svcctl_OpenSCManagerW( - [in] [string,charset(UTF16)] uint16 *MachineName, - [in] [string,charset(UTF16)] uint16 *DatabaseName, + [in,unique] [string,charset(UTF16)] uint16 *MachineName, + [in,unique] [string,charset(UTF16)] uint16 *DatabaseName, [in] uint32 access_mask, [out,ref] policy_handle *handle ); @@ -257,25 +265,25 @@ WERROR svcctl_StartServiceW( [in,ref] policy_handle *handle, [in] uint32 NumArgs, - [in/*FIXME:,length_is(NumArgs)*/] [string,charset(UTF16)] uint16 *Arguments + [in,unique/*FIXME:,length_is(NumArgs)*/] [string,charset(UTF16)] uint16 *Arguments ); /*****************/ /* Function 0x14 */ WERROR svcctl_GetServiceDisplayNameW( [in,ref] policy_handle *handle, - [in] [string,charset(UTF16)] uint16 *service_name, + [in,unique] [string,charset(UTF16)] uint16 *service_name, [out,ref] [string,charset(UTF16)] uint16 **display_name, - [in,out] uint32 *display_name_length + [in,out,unique] uint32 *display_name_length ); /*****************/ /* Function 0x15 */ WERROR svcctl_GetServiceKeyNameW( [in,ref] policy_handle *handle, - [in] [string,charset(UTF16)] uint16 *service_name, + [in,unique] [string,charset(UTF16)] uint16 *service_name, [out,ref] [string,charset(UTF16)] uint16 **key_name, - [in,out] uint32 *display_name_length + [in,out,unique] uint32 *display_name_length ); /*****************/ @@ -294,31 +302,31 @@ [in] uint32 type, [in] uint32 start, [in] uint32 error, - [in] [string,charset(UTF16)] uint16 *binary_path, - [in] [string,charset(UTF16)] uint16 *load_order_group, + [in,unique] [string,charset(UTF16)] uint16 *binary_path, + [in,unique] [string,charset(UTF16)] uint16 *load_order_group, [out,ref] uint32 *tag_id, - [in] [string,charset(UTF16)] uint16 *dependencies, - [in] [string,charset(UTF16)] uint16 *service_start_name, - [in] [string,charset(UTF16)] uint16 *password, - [in] [string,charset(UTF16)] uint16 *display_name + [in,unique] [string,charset(UTF16)] uint16 *dependencies, + [in,unique] [string,charset(UTF16)] uint16 *service_start_name, + [in,unique] [string,charset(UTF16)] uint16 *password, + [in,unique] [string,charset(UTF16)] uint16 *display_name ); /*****************/ /* Function 0x18 */ WERROR svcctl_CreateServiceA( [in,ref] policy_handle *handle, - [in] [string,charset(UTF16)] uint16 *ServiceName, - [in] [string,charset(UTF16)] uint16 *DisplayName, + [in,unique] [string,charset(UTF16)] uint16 *ServiceName, + [in,unique] [string,charset(UTF16)] uint16 *DisplayName, [in] uint32 desired_access, [in] uint32 type, [in] uint32 start_type, [in] uint32 error_control, - [in] [string,charset(UTF16)] uint16 *binary_path, - [in] [string,charset(UTF16)] uint16 *LoadOrderGroupKey, - [out] uint32 *TagId, - [in] [string,charset(UTF16)] uint16 *dependencies, - [in] [string,charset(UTF16)] uint16 *service_start_name, - [in] [string,charset(UTF16)] uint16 *password + [in,unique] [string,charset(UTF16)] uint16 *binary_path, + [in,unique] [string,charset(UTF16)] uint16 *LoadOrderGroupKey, + [out,unique] uint32 *TagId, + [in,unique] [string,charset(UTF16)] uint16 *dependencies, + [in,unique] [string,charset(UTF16)] uint16 *service_start_name, + [in,unique] [string,charset(UTF16)] uint16 *password ); /*****************/ @@ -326,7 +334,7 @@ WERROR svcctl_EnumDependentServicesA( [in,ref] policy_handle *service, [in] uint32 state, - [out] ENUM_SERVICE_STATUS *service_status, + [out,unique] ENUM_SERVICE_STATUS *service_status, [in] uint32 buf_size, [out,ref] uint32 *bytes_needed, [out,ref] uint32 *services_returned @@ -342,14 +350,14 @@ [out,size_is(buf_size)] uint8 service[*], [out,ref] uint32 *bytes_needed, [out,ref] uint32 *services_returned, - [in,out] uint32 *resume_handle + [in,out,unique] uint32 *resume_handle ); /*****************/ /* Function 0x1b */ WERROR svcctl_OpenSCManagerA( - [in] [string,charset(UTF16)] uint16 *MachineName, - [in] [string,charset(UTF16)] uint16 *DatabaseName, + [in,unique] [string,charset(UTF16)] uint16 *MachineName, + [in,unique] [string,charset(UTF16)] uint16 *DatabaseName, [in] uint32 access_mask, [out,ref] policy_handle *handle ); @@ -358,7 +366,7 @@ /* Function 0x1c */ WERROR svcctl_OpenServiceA( [in,ref] policy_handle *scmanager_handle, - [in] [string,charset(UTF16)] uint16 *ServiceName, + [in,unique] [string,charset(UTF16)] uint16 *ServiceName, [in] uint32 access_mask ); @@ -385,25 +393,25 @@ WERROR svcctl_StartServiceA( [in,ref] policy_handle *handle, [in] uint32 NumArgs, - [in/*FIXME:,length_is(NumArgs)*/] [string,charset(UTF16)] uint16 *Arguments + [in,unique/*FIXME:,length_is(NumArgs)*/] [string,charset(UTF16)] uint16 *Arguments ); /*****************/ /* Function 0x20 */ WERROR svcctl_GetServiceDisplayNameA( [in,ref] policy_handle *handle, - [in] [string,charset(UTF16)] uint16 *service_name, + [in,unique] [string,charset(UTF16)] uint16 *service_name, [out,ref] [string,charset(UTF16)] uint16 **display_name, - [in,out] uint32 *display_name_length + [in,out,unique] uint32 *display_name_length ); /*****************/ /* Function 0x21 */ WERROR svcctl_GetServiceKeyNameA( [in,ref] policy_handle *handle, - [in] [string,charset(UTF16)] uint16 *service_name, + [in,unique] [string,charset(UTF16)] uint16 *service_name, [out,ref] [string,charset(UTF16)] uint16 **key_name, - [in,out] uint32 *display_name_length + [in,out,unique] uint32 *display_name_length ); /*****************/ @@ -421,7 +429,7 @@ WERROR svcctl_ChangeServiceConfig2A( [in,ref] policy_handle *handle, [in] uint32 info_level, - [in] uint8 *info + [in,unique] uint8 *info ); /*****************/ @@ -429,7 +437,7 @@ WERROR svcctl_ChangeServiceConfig2W( [in,ref] policy_handle *handle, [in] uint32 info_level, - [in] uint8 *info + [in,unique] uint8 *info ); /*****************/ @@ -473,7 +481,7 @@ [in] uint32 buf_size, [out,ref] uint32 *bytes_needed, [out,ref] uint32 *service_returned, - [in,out] uint32 *resume_handle, + [in,out,unique] uint32 *resume_handle, [out,ref] [string,charset(UTF16)] uint16 **group_name ); @@ -488,7 +496,7 @@ [in] uint32 buf_size, [out,ref] uint32 *bytes_needed, [out,ref] uint32 *service_returned, - [in,out] uint32 *resume_handle, + [in,out,unique] uint32 *resume_handle, [out,ref] [string,charset(UTF16)] uint16 **group_name ); diff --git a/source3/librpc/idl/unixinfo.idl b/source3/librpc/idl/unixinfo.idl deleted file mode 100644 index 48bc565fff..0000000000 --- a/source3/librpc/idl/unixinfo.idl +++ /dev/null @@ -1,56 +0,0 @@ -#include "idl_types.h" -/* - Unixinfo interface definition -*/ - -import "security.idl"; - -[ uuid("9c54e310-a955-4885-bd31-78787147dfa6"), - version(0.0), - endpoint("ncacn_np:[\\pipe\\unixinfo]", "ncacn_ip_tcp:", "ncalrpc:"), - pointer_default(unique), - helpstring("Unixinfo specific stuff") -] interface unixinfo -{ - /******************/ - /* Function: 0x00 */ - NTSTATUS unixinfo_SidToUid ( - [in] dom_sid sid, - [out] hyper *uid - ); - - /******************/ - /* Function: 0x01 */ - NTSTATUS unixinfo_UidToSid ( - [in] hyper uid, - [out] dom_sid *sid - ); - - /******************/ - /* Function: 0x02 */ - NTSTATUS unixinfo_SidToGid ( - [in] dom_sid sid, - [out] hyper *gid - ); - - /******************/ - /* Function: 0x03 */ - NTSTATUS unixinfo_GidToSid ( - [in] hyper gid, - [out] dom_sid *sid - ); - - typedef struct { - NTSTATUS status; - utf8string homedir; - utf8string shell; - } unixinfo_GetPWUidInfo; - - /******************/ - /* Function: 0x04 */ - NTSTATUS unixinfo_GetPWUid ( - [in,out,ref,range(0,1023)] uint32 *count, - [in,size_is(*count)] hyper uids[], - [out,size_is(*count)] unixinfo_GetPWUidInfo infos[*] - ); -} diff --git a/source3/librpc/idl/winreg.idl b/source3/librpc/idl/winreg.idl index 9f316ab39b..f7a61ecbea 100644 --- a/source3/librpc/idl/winreg.idl +++ b/source3/librpc/idl/winreg.idl @@ -9,7 +9,6 @@ import "lsa.idl", "initshutdown.idl", "security.idl"; version(1.0), endpoint("ncacn_np:[\\pipe\\winreg]","ncacn_ip_tcp:","ncalrpc:"), pointer_default(unique), - pointer_default_top(unique), helpstring("Remote Registry Service") ] interface winreg { @@ -50,7 +49,7 @@ import "lsa.idl", "initshutdown.idl", "security.idl"; /******************/ /* Function: 0x00 */ WERROR winreg_OpenHKCR( - [in] uint16 *system_name, + [in,unique] uint16 *system_name, [in] winreg_AccessMask access_mask, [out,ref] policy_handle *handle ); @@ -58,7 +57,7 @@ import "lsa.idl", "initshutdown.idl", "security.idl"; /******************/ /* Function: 0x01 */ WERROR winreg_OpenHKCU( - [in] uint16 *system_name, + [in,unique] uint16 *system_name, [in] winreg_AccessMask access_mask, [out,ref] policy_handle *handle ); @@ -66,7 +65,7 @@ import "lsa.idl", "initshutdown.idl", "security.idl"; /******************/ /* Function: 0x02 */ WERROR winreg_OpenHKLM( - [in] uint16 *system_name, + [in,unique] uint16 *system_name, [in] winreg_AccessMask access_mask, [out,ref] policy_handle *handle ); @@ -74,7 +73,7 @@ import "lsa.idl", "initshutdown.idl", "security.idl"; /******************/ /* Function: 0x03 */ WERROR winreg_OpenHKPD( - [in] uint16 *system_name, + [in,unique] uint16 *system_name, [in] winreg_AccessMask access_mask, [out,ref] policy_handle *handle ); @@ -82,7 +81,7 @@ import "lsa.idl", "initshutdown.idl", "security.idl"; /******************/ /* Function: 0x04 */ WERROR winreg_OpenHKU( - [in] uint16 *system_name, + [in,unique] uint16 *system_name, [in] winreg_AccessMask access_mask, [out,ref] policy_handle *handle ); @@ -198,8 +197,8 @@ import "lsa.idl", "initshutdown.idl", "security.idl"; /* Function: 0x0d */ WERROR winreg_LoadKey( [in,ref] policy_handle *handle, - [in] winreg_String *keyname, - [in] winreg_String *filename + [in,unique] winreg_String *keyname, + [in,unique] winreg_String *filename ); /******************/ @@ -244,10 +243,10 @@ import "lsa.idl", "initshutdown.idl", "security.idl"; WERROR winreg_QueryValue( [in,ref] policy_handle *handle, [in] winreg_String value_name, - [in,out] winreg_Type *type, - [in,out,size_is(*data_size),length_is(*value_length)] uint8 *data, - [in,out] uint32 *data_size, - [in,out] uint32 *value_length + [in,out,unique] winreg_Type *type, + [in,out,unique,size_is(*data_size),length_is(*value_length)] uint8 *data, + [in,out,unique] uint32 *data_size, + [in,out,unique] uint32 *value_length ); /******************/ @@ -304,8 +303,8 @@ import "lsa.idl", "initshutdown.idl", "security.idl"; /******************/ /* Function: 0x18 */ WERROR winreg_InitiateSystemShutdown( - [in] uint16 *hostname, - [in] initshutdown_String *message, + [in,unique] uint16 *hostname, + [in,unique] initshutdown_String *message, [in] uint32 timeout, [in] uint8 force_apps, [in] uint8 reboot @@ -314,7 +313,7 @@ import "lsa.idl", "initshutdown.idl", "security.idl"; /******************/ /* Function: 0x19 */ WERROR winreg_AbortSystemShutdown( - [in] uint16 *server + [in,unique] uint16 *server ); /******************/ @@ -327,7 +326,7 @@ import "lsa.idl", "initshutdown.idl", "security.idl"; /******************/ /* Function: 0x1b */ WERROR winreg_OpenHKCC( - [in] uint16 *system_name, + [in,unique] uint16 *system_name, [in] winreg_AccessMask access_mask, [out,ref] policy_handle *handle ); @@ -335,7 +334,7 @@ import "lsa.idl", "initshutdown.idl", "security.idl"; /******************/ /* Function: 0x1c */ WERROR winreg_OpenHKDD( - [in] uint16 *system_name, + [in,unique] uint16 *system_name, [in] winreg_AccessMask access_mask, [out,ref] policy_handle *handle ); @@ -353,15 +352,15 @@ import "lsa.idl", "initshutdown.idl", "security.idl"; [in,ref] policy_handle *key_handle, [in,out,ref,size_is(num_values),length_is(num_values)] QueryMultipleValue *values, [in] uint32 num_values, - [in,out,size_is(*buffer_size),length_is(*buffer_size)] uint8 *buffer, + [in,out,unique,size_is(*buffer_size),length_is(*buffer_size)] uint8 *buffer, [in,out,ref] uint32 *buffer_size ); /******************/ /* Function: 0x1e */ WERROR winreg_InitiateSystemShutdownEx( - [in] uint16 *hostname, - [in] initshutdown_String *message, + [in,unique] uint16 *hostname, + [in,unique] initshutdown_String *message, [in] uint32 timeout, [in] uint8 force_apps, [in] uint8 reboot, @@ -376,7 +375,7 @@ import "lsa.idl", "initshutdown.idl", "security.idl"; /******************/ /* Function: 0x20 */ WERROR winreg_OpenHKPT( - [in] uint16 *system_name, + [in,unique] uint16 *system_name, [in] winreg_AccessMask access_mask, [out,ref] policy_handle *handle ); @@ -384,7 +383,7 @@ import "lsa.idl", "initshutdown.idl", "security.idl"; /******************/ /* Function: 0x21 */ WERROR winreg_OpenHKPN( - [in] uint16 *system_name, + [in,unique] uint16 *system_name, [in] winreg_AccessMask access_mask, [out,ref] policy_handle *handle ); diff --git a/source3/librpc/idl/wkssvc.idl b/source3/librpc/idl/wkssvc.idl index 9829379eef..023ce59ad9 100644 --- a/source3/librpc/idl/wkssvc.idl +++ b/source3/librpc/idl/wkssvc.idl @@ -9,7 +9,6 @@ import "srvsvc.idl", "lsa.idl"; [ uuid("6bffd098-a112-3610-9833-46c3f87e345a"), version(1.0), pointer_default(unique), - pointer_default_top(unique), helpstring("Workstation Service"), endpoint("ncacn_np:[\\pipe\\wkssvc]","ncacn_ip_tcp:","ncalrpc:") ] interface wkssvc @@ -259,7 +258,7 @@ import "srvsvc.idl", "lsa.idl"; } wkssvc_NetWkstaInfo; WERROR wkssvc_NetWkstaGetInfo( - [in] [string,charset(UTF16)] uint16 *server_name, + [in,unique] [string,charset(UTF16)] uint16 *server_name, [in] uint32 level, [out,switch_is(level),ref] wkssvc_NetWkstaInfo *info ); @@ -268,7 +267,7 @@ import "srvsvc.idl", "lsa.idl"; /******************/ /* Function: 0x01 */ WERROR wkssvc_NetWkstaSetInfo( - [in] [string,charset(UTF16)] uint16 *server_name, + [in,unique] [string,charset(UTF16)] uint16 *server_name, [in] uint32 level, [in,switch_is(level),ref] wkssvc_NetWkstaInfo *info, [in,out,ref] uint32 *parm_error @@ -309,11 +308,11 @@ import "srvsvc.idl", "lsa.idl"; } wkssvc_NetWkstaEnumUsersInfo; WERROR wkssvc_NetWkstaEnumUsers( - [in] [string,charset(UTF16)] uint16 *server_name, + [in,unique] [string,charset(UTF16)] uint16 *server_name, [in,out,ref] wkssvc_NetWkstaEnumUsersInfo *info, [in] uint32 prefmaxlen, [out,ref] uint32 *entries_read, - [in,out] uint32 *resume_handle + [in,out,unique] uint32 *resume_handle ); /*****************************/ @@ -329,7 +328,7 @@ import "srvsvc.idl", "lsa.idl"; } wkssvc_NetrWkstaUserInfo; WERROR wkssvc_NetrWkstaUserGetInfo( - [in] [string,charset(UTF16)] uint16 *unknown, + [in,unique] [string,charset(UTF16)] uint16 *unknown, [in] uint32 level, [out,ref] [switch_is(level)] wkssvc_NetrWkstaUserInfo *info ); @@ -337,10 +336,10 @@ import "srvsvc.idl", "lsa.idl"; /*****************************/ /* Function 0x04 */ WERROR wkssvc_NetrWkstaUserSetInfo( - [in] [string,charset(UTF16)] uint16 *unknown, + [in,unique] [string,charset(UTF16)] uint16 *unknown, [in] uint32 level, [in,ref] [switch_is(level)] wkssvc_NetrWkstaUserInfo *info, - [in,out] uint32 *parm_err + [in,out,unique] uint32 *parm_err ); /*****************************/ @@ -369,29 +368,29 @@ import "srvsvc.idl", "lsa.idl"; } wkssvc_NetWkstaTransportInfo; WERROR wkssvc_NetWkstaTransportEnum ( - [in] [string,charset(UTF16)] uint16 *server_name, + [in,unique] [string,charset(UTF16)] uint16 *server_name, [in,out,ref] wkssvc_NetWkstaTransportInfo *info, [in] uint32 max_buffer, [out,ref] uint32 *total_entries, - [in,out] uint32 *resume_handle + [in,out,unique] uint32 *resume_handle ); /*****************************/ /* Function 0x06 */ /* only supported on NT */ WERROR wkssvc_NetrWkstaTransportAdd( - [in] [string,charset(UTF16)] uint16 *server_name, + [in,unique] [string,charset(UTF16)] uint16 *server_name, [in] uint32 level, /* must be 0 */ [in,ref] wkssvc_NetWkstaTransportInfo0 *info0, - [in,out] uint32 *parm_err + [in,out,unique] uint32 *parm_err ); /*****************************/ /* Function 0x07 */ /* only supported on NT */ WERROR wkssvc_NetrWkstaTransportDel( - [in] [string,charset(UTF16)] uint16 *server_name, - [in] [string,charset(UTF16)] uint16 *transport_name, + [in,unique] [string,charset(UTF16)] uint16 *server_name, + [in,unique] [string,charset(UTF16)] uint16 *transport_name, [in] uint32 unknown3 ); @@ -437,16 +436,16 @@ import "srvsvc.idl", "lsa.idl"; } wkssvc_NetrUseGetInfoCtr; WERROR wkssvc_NetrUseAdd( - [in] [string,charset(UTF16)] uint16 *server_name, + [in,unique] [string,charset(UTF16)] uint16 *server_name, [in] uint32 level, [in,ref] [switch_is(level)] wkssvc_NetrUseGetInfoCtr *ctr, - [in,out] uint32 *parm_err + [in,out,unique] uint32 *parm_err ); /*****************************/ /* Function 0x09 */ WERROR wkssvc_NetrUseGetInfo( - [in] [string,charset(UTF16)] uint16 *server_name, + [in,unique] [string,charset(UTF16)] uint16 *server_name, [in,ref] [string,charset(UTF16)] uint16 *use_name, [in] uint32 level, [out,ref] [switch_is(level)] wkssvc_NetrUseGetInfoCtr *ctr @@ -455,7 +454,7 @@ import "srvsvc.idl", "lsa.idl"; /*****************************/ /* Function 0x0a */ WERROR wkssvc_NetrUseDel( - [in] [string,charset(UTF16)] uint16 *server_name, + [in,unique] [string,charset(UTF16)] uint16 *server_name, [in,ref] [string,charset(UTF16)] uint16 *use_name, [in] uint32 force_cond ); @@ -489,19 +488,19 @@ import "srvsvc.idl", "lsa.idl"; } wkssvc_NetrUseEnumInfo; WERROR wkssvc_NetrUseEnum( - [in] [string,charset(UTF16)] uint16 *server_name, + [in,unique] [string,charset(UTF16)] uint16 *server_name, [in,out,ref] wkssvc_NetrUseEnumInfo *info, [in] uint32 prefmaxlen, [out,ref] uint32 *entries_read, - [in,out] uint32 *resume_handle + [in,out,unique] uint32 *resume_handle ); /*****************************/ /* Function 0x0c */ WERROR wkssvc_NetrMessageBufferSend( - [in] [string,charset(UTF16)] uint16 *server_name, + [in,unique] [string,charset(UTF16)] uint16 *server_name, [in,ref] [string,charset(UTF16)] uint16 *message_name, - [in] [string,charset(UTF16)] uint16 *message_sender_name, + [in,unique] [string,charset(UTF16)] uint16 *message_sender_name, [in,ref] [size_is(message_size)] uint8 *message_buffer, [in] uint32 message_size ); @@ -552,8 +551,8 @@ import "srvsvc.idl", "lsa.idl"; } wkssvc_NetrWorkstationStatistics; WERROR wkssvc_NetrWorkstationStatisticsGet( - [in] [string,charset(UTF16)] uint16 *server_name, - [in] [string,charset(UTF16)] uint16 *unknown2, + [in,unique] [string,charset(UTF16)] uint16 *server_name, + [in,unique] [string,charset(UTF16)] uint16 *unknown2, [in] uint32 unknown3, [in] uint32 unknown4, [out,ref] wkssvc_NetrWorkstationStatistics **info @@ -574,20 +573,20 @@ import "srvsvc.idl", "lsa.idl"; /*****************************/ /* Function 0x10 */ WERROR wkssvc_NetrJoinDomain( - [in] [string,charset(UTF16)] uint16 *server_name, + [in,unique] [string,charset(UTF16)] uint16 *server_name, [in,ref] [string,charset(UTF16)] uint16 *domain_name, - [in] [string,charset(UTF16)] uint16 *account_ou, - [in] [string,charset(UTF16)] uint16 *Account, - [in] [string,charset(UTF16)] uint16 *password, + [in,unique] [string,charset(UTF16)] uint16 *account_ou, + [in,unique] [string,charset(UTF16)] uint16 *Account, + [in,unique] [string,charset(UTF16)] uint16 *password, [in] wkssvc_joinflags join_flags ); /*****************************/ /* Function 0x11 */ WERROR wkssvc_NetrUnjoinDomain( - [in] [string,charset(UTF16)] uint16 *server_name, - [in] [string,charset(UTF16)] uint16 *Account, - [in] [string,charset(UTF16)] uint16 *password, + [in,unique] [string,charset(UTF16)] uint16 *server_name, + [in,unique] [string,charset(UTF16)] uint16 *Account, + [in,unique] [string,charset(UTF16)] uint16 *password, [in] wkssvc_joinflags unjoin_flags ); @@ -599,10 +598,10 @@ import "srvsvc.idl", "lsa.idl"; } wkssvc_renameflags; WERROR wkssvc_NetrRenameMachineInDomain( - [in] [string,charset(UTF16)] uint16 *server_name, - [in] [string,charset(UTF16)] uint16 *NewMachineName, - [in] [string,charset(UTF16)] uint16 *Account, - [in] [string,charset(UTF16)] uint16 *password, + [in,unique] [string,charset(UTF16)] uint16 *server_name, + [in,unique] [string,charset(UTF16)] uint16 *NewMachineName, + [in,unique] [string,charset(UTF16)] uint16 *Account, + [in,unique] [string,charset(UTF16)] uint16 *password, [in] wkssvc_renameflags RenameOptions ); @@ -618,10 +617,10 @@ import "srvsvc.idl", "lsa.idl"; } wkssvc_NetValidateNameType; WERROR wkssvc_NetrValidateName( - [in] [string,charset(UTF16)] uint16 *server_name, + [in,unique] [string,charset(UTF16)] uint16 *server_name, [in,ref] [string,charset(UTF16)] uint16 *name, - [in] [string,charset(UTF16)] uint16 *Account, - [in] [string,charset(UTF16)] uint16 *Password, + [in,unique] [string,charset(UTF16)] uint16 *Account, + [in,unique] [string,charset(UTF16)] uint16 *Password, [in] wkssvc_NetValidateNameType name_type ); @@ -635,7 +634,7 @@ import "srvsvc.idl", "lsa.idl"; } wkssvc_NetJoinStatus; WERROR wkssvc_NetrGetJoinInformation( - [in] [string,charset(UTF16)] uint16 *server_name, + [in,unique] [string,charset(UTF16)] uint16 *server_name, [in,out,ref] [string,charset(UTF16)] uint16 **name_buffer, [out,ref] wkssvc_NetJoinStatus *name_type ); @@ -643,12 +642,16 @@ import "srvsvc.idl", "lsa.idl"; /*****************************/ /* Function 0x15 */ WERROR wkssvc_NetrGetJoinableOus( - [in] [string,charset(UTF16)] uint16 *server_name, + [in,unique] [string,charset(UTF16)] uint16 *server_name, [in,ref] [string,charset(UTF16)] uint16 *domain_name, - [in] [string,charset(UTF16)] uint16 *Account, - [in] [string,charset(UTF16)] uint16 *unknown, + [in,unique] [string,charset(UTF16)] uint16 *Account, + [in,unique] [string,charset(UTF16)] uint16 *unknown, [in,out,ref] uint32 *num_ous, - [out,ref] [size_is(*num_ous)] [string,charset(UTF16)] uint16 ***ous + /* + * this is a [ref] pointer to a [unique] pointer to an + * array of [unique] pointers to a string array + */ + [out,ref] [size_is(,*num_ous)] [string,charset(UTF16)] uint16 ***ous ); typedef [flag(NDR_PAHEX)] struct { @@ -687,81 +690,85 @@ import "srvsvc.idl", "lsa.idl"; /*****************************/ /* Function 0x16 */ WERROR wkssvc_NetrJoinDomain2 ( - [in] [string,charset(UTF16)] uint16 *server_name, + [in,unique] [string,charset(UTF16)] uint16 *server_name, [in,ref] [string,charset(UTF16)] uint16 *domain_name, - [in] [string,charset(UTF16)] uint16 *account_ou, - [in] [string,charset(UTF16)] uint16 *admin_account, - [in] wkssvc_PasswordBuffer *encrypted_password, + [in,unique] [string,charset(UTF16)] uint16 *account_ou, + [in,unique] [string,charset(UTF16)] uint16 *admin_account, + [in,unique] wkssvc_PasswordBuffer *encrypted_password, [in] wkssvc_joinflags join_flags ); /*****************************/ /* Function 0x17 */ WERROR wkssvc_NetrUnjoinDomain2 ( - [in] [string,charset(UTF16)] uint16 *server_name, - [in] [string,charset(UTF16)] uint16 *account, - [in] wkssvc_PasswordBuffer *encrypted_password, + [in,unique] [string,charset(UTF16)] uint16 *server_name, + [in,unique] [string,charset(UTF16)] uint16 *account, + [in,unique] wkssvc_PasswordBuffer *encrypted_password, [in] wkssvc_joinflags unjoin_flags ); /*****************************/ /* Function 0x18 */ WERROR wkssvc_NetrRenameMachineInDomain2( - [in] [string,charset(UTF16)] uint16 *server_name, - [in] [string,charset(UTF16)] uint16 *NewMachineName, - [in] [string,charset(UTF16)] uint16 *Account, - [in] wkssvc_PasswordBuffer *EncryptedPassword, + [in,unique] [string,charset(UTF16)] uint16 *server_name, + [in,unique] [string,charset(UTF16)] uint16 *NewMachineName, + [in,unique] [string,charset(UTF16)] uint16 *Account, + [in,unique] wkssvc_PasswordBuffer *EncryptedPassword, [in] wkssvc_renameflags RenameOptions ); /*****************************/ /* Function 0x19 */ WERROR wkssvc_NetrValidateName2( - [in] [string,charset(UTF16)] uint16 *server_name, + [in,unique] [string,charset(UTF16)] uint16 *server_name, [in,ref] [string,charset(UTF16)] uint16 *name, - [in] [string,charset(UTF16)] uint16 *Account, - [in] wkssvc_PasswordBuffer *EncryptedPassword, + [in,unique] [string,charset(UTF16)] uint16 *Account, + [in,unique] wkssvc_PasswordBuffer *EncryptedPassword, [in] wkssvc_NetValidateNameType name_type ); /*****************************/ /* Function 0x1a */ WERROR wkssvc_NetrGetJoinableOus2( - [in] [string,charset(UTF16)] uint16 *server_name, + [in,unique] [string,charset(UTF16)] uint16 *server_name, [in,ref] [string,charset(UTF16)] uint16 *domain_name, - [in] [string,charset(UTF16)] uint16 *Account, - [in] wkssvc_PasswordBuffer *EncryptedPassword, + [in,unique] [string,charset(UTF16)] uint16 *Account, + [in,unique] wkssvc_PasswordBuffer *EncryptedPassword, [in,out,ref] uint32 *num_ous, - [out,ref] [size_is(*num_ous)] [string,charset(UTF16)] uint16 ***ous + /* + * this is a [ref] pointer to a [unique] pointer to an + * array of [unique] pointers to a string array + */ + [out,ref] [size_is(,*num_ous)] [string,charset(UTF16)] uint16 ***ous ); /*****************************/ /* Function 0x1b */ WERROR wkssvc_NetrAddAlternateComputerName( - [in] [string,charset(UTF16)] uint16 *server_name, - [in] [string,charset(UTF16)] uint16 *NewAlternateMachineName, - [in] [string,charset(UTF16)] uint16 *Account, - [in] wkssvc_PasswordBuffer *EncryptedPassword, + [in,unique] [string,charset(UTF16)] uint16 *server_name, + [in,unique] [string,charset(UTF16)] uint16 *NewAlternateMachineName, + [in,unique] [string,charset(UTF16)] uint16 *Account, + [in,unique] wkssvc_PasswordBuffer *EncryptedPassword, [in] uint32 Reserved ); /*****************************/ /* Function 0x1c */ WERROR wkssvc_NetrRemoveAlternateComputerName( - [in] [string,charset(UTF16)] uint16 *server_name, - [in] [string,charset(UTF16)] uint16 *AlternateMachineNameToRemove, - [in] [string,charset(UTF16)] uint16 *Account, - [in] wkssvc_PasswordBuffer *EncryptedPassword, + [in,unique] [string,charset(UTF16)] uint16 *server_name, + [in,unique] [string,charset(UTF16)] uint16 *AlternateMachineNameToRemove, + [in,unique] [string,charset(UTF16)] uint16 *Account, + [in,unique] wkssvc_PasswordBuffer *EncryptedPassword, [in] uint32 Reserved ); /*****************************/ /* Function 0x1d */ WERROR wkssvc_NetrSetPrimaryComputername( - [in] [string,charset(UTF16)] uint16 *server_name, - [in] [string,charset(UTF16)] uint16 *primary_name, - [in] [string,charset(UTF16)] uint16 *Account, - [in] wkssvc_PasswordBuffer *EncryptedPassword, + [in,unique] [string,charset(UTF16)] uint16 *server_name, + [in,unique] [string,charset(UTF16)] uint16 *primary_name, + [in,unique] [string,charset(UTF16)] uint16 *Account, + [in,unique] wkssvc_PasswordBuffer *EncryptedPassword, [in] uint32 Reserved ); @@ -780,7 +787,7 @@ import "srvsvc.idl", "lsa.idl"; } wkssvc_ComputerNamesCtr; WERROR wkssvc_NetrEnumerateComputerNames( - [in] [string,charset(UTF16)] uint16 *server_name, + [in,unique] [string,charset(UTF16)] uint16 *server_name, [in] wkssvc_ComputerNameType name_type, [in] uint32 Reserved, [out,ref] wkssvc_ComputerNamesCtr **ctr diff --git a/source3/librpc/ndr/libndr.h b/source3/librpc/ndr/libndr.h index d0c2c74db9..a277a626c7 100644 --- a/source3/librpc/ndr/libndr.h +++ b/source3/librpc/ndr/libndr.h @@ -22,8 +22,8 @@ #define _PRINTF_ATTRIBUTE(a,b) -#include "librpc/ndr/misc.h" -#include "librpc/ndr/security.h" +#include "librpc/gen_ndr/misc.h" +#include "librpc/gen_ndr/security.h" /* this provides definitions for the libcli/rpc/ MSRPC library diff --git a/source3/librpc/ndr/misc.h b/source3/librpc/ndr/misc.h deleted file mode 100644 index 71975d7858..0000000000 --- a/source3/librpc/ndr/misc.h +++ /dev/null @@ -1,42 +0,0 @@ -/* header auto-generated by pidl */ - -#ifndef _HEADER_misc -#define _HEADER_misc - -struct GUID { - uint32_t time_low; - uint16_t time_mid; - uint16_t time_hi_and_version; - uint8_t clock_seq[2]; - uint8_t node[6]; -}/* [noprint,gensize,public,noejs] */; - -struct ndr_syntax_id { - struct GUID uuid; - uint32_t if_version; -}/* [public] */; - -struct policy_handle { - uint32_t handle_type; - struct GUID uuid; -}/* [public] */; - -enum netr_SchannelType { - SEC_CHAN_WKSTA=2, - SEC_CHAN_DOMAIN=4, - SEC_CHAN_BDC=6 -}; - -enum netr_SamDatabaseID { - SAM_DATABASE_DOMAIN=0, - SAM_DATABASE_BUILTIN=1, - SAM_DATABASE_PRIVS=2 -}; - -enum samr_RejectReason { - SAMR_REJECT_OTHER=0, - SAMR_REJECT_TOO_SHORT=1, - SAMR_REJECT_COMPLEXITY=2 -}; - -#endif /* _HEADER_misc */ diff --git a/source3/librpc/ndr/ndr.c b/source3/librpc/ndr/ndr.c index 62a88a8856..53eff00d59 100644 --- a/source3/librpc/ndr/ndr.c +++ b/source3/librpc/ndr/ndr.c @@ -176,12 +176,16 @@ _PUBLIC_ void ndr_print_debug_helper(struct ndr_print *ndr, const char *format, { va_list ap; char *s = NULL; - int i; + int i, ret; va_start(ap, format); - vasprintf(&s, format, ap); + ret = vasprintf(&s, format, ap); va_end(ap); + if (ret == -1) { + return; + } + for (i=0;i<ndr->depth;i++) { DEBUGADD(0,(" ")); } @@ -450,11 +454,16 @@ _PUBLIC_ enum ndr_err_code ndr_pull_error(struct ndr_pull *ndr, { char *s=NULL; va_list ap; + int ret; va_start(ap, format); - vasprintf(&s, format, ap); + ret = vasprintf(&s, format, ap); va_end(ap); + if (ret == -1) { + return NDR_ERR_ALLOC; + } + DEBUG(3,("ndr_pull_error(%u): %s\n", ndr_err, s)); free(s); @@ -471,11 +480,16 @@ _PUBLIC_ enum ndr_err_code ndr_push_error(struct ndr_push *ndr, { char *s=NULL; va_list ap; + int ret; va_start(ap, format); - vasprintf(&s, format, ap); + ret = vasprintf(&s, format, ap); va_end(ap); + if (ret == -1) { + return NDR_ERR_ALLOC; + } + DEBUG(3,("ndr_push_error(%u): %s\n", ndr_err, s)); free(s); diff --git a/source3/librpc/ndr/ndr_basic.c b/source3/librpc/ndr/ndr_basic.c index 54397c9469..f342c6e36f 100644 --- a/source3/librpc/ndr/ndr_basic.c +++ b/source3/librpc/ndr/ndr_basic.c @@ -773,8 +773,7 @@ _PUBLIC_ void ndr_print_array_uint8(struct ndr_print *ndr, const char *name, ndr->depth++; for (i=0;i<count;i++) { char *idx=NULL; - asprintf(&idx, "[%d]", i); - if (idx) { + if (asprintf(&idx, "[%d]", i) != -1) { ndr_print_uint8(ndr, idx, data[i]); free(idx); } diff --git a/source3/librpc/ndr/ndr_krb5pac.c b/source3/librpc/ndr/ndr_krb5pac.c new file mode 100644 index 0000000000..b0eab44012 --- /dev/null +++ b/source3/librpc/ndr/ndr_krb5pac.c @@ -0,0 +1,141 @@ +/* + Unix SMB/CIFS implementation. + + routines for marshalling/unmarshalling spoolss subcontext buffer structures + + Copyright (C) Stefan Metzmacher 2005 + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. +*/ + + +#include "includes.h" + +#include "librpc/gen_ndr/ndr_krb5pac.h" + +static size_t _ndr_size_PAC_INFO(const union PAC_INFO *r, uint32_t level, int flags) +{ + size_t s = ndr_size_PAC_INFO(r, level, flags); + switch (level) { + case PAC_TYPE_LOGON_INFO: + return NDR_ROUND(s,8); + default: + return s; + } +} + +static size_t _subcontext_size_PAC_INFO(const union PAC_INFO *r, uint32_t level, int flags) +{ + size_t s = ndr_size_PAC_INFO(r, level, flags); + return NDR_ROUND(s,8); +} + +enum ndr_err_code ndr_push_PAC_BUFFER(struct ndr_push *ndr, int ndr_flags, const struct PAC_BUFFER *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_PAC_TYPE(ndr, NDR_SCALARS, r->type)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, _ndr_size_PAC_INFO(r->info,r->type,0))); + { + uint32_t _flags_save_PAC_INFO = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_ALIGN8); + NDR_CHECK(ndr_push_relative_ptr1(ndr, r->info)); + ndr->flags = _flags_save_PAC_INFO; + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + } + if (ndr_flags & NDR_BUFFERS) { + { + uint32_t _flags_save_PAC_INFO = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_ALIGN8); + if (r->info) { + NDR_CHECK(ndr_push_relative_ptr2(ndr, r->info)); + { + struct ndr_push *_ndr_info; + NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_info, 0, _subcontext_size_PAC_INFO(r->info,r->type,0))); + NDR_CHECK(ndr_push_set_switch_value(_ndr_info, r->info, r->type)); + NDR_CHECK(ndr_push_PAC_INFO(_ndr_info, NDR_SCALARS|NDR_BUFFERS, r->info)); + NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_info, 0, _subcontext_size_PAC_INFO(r->info,r->type,0))); + } + } + ndr->flags = _flags_save_PAC_INFO; + } + } + return NDR_ERR_SUCCESS; +} + +enum ndr_err_code ndr_pull_PAC_BUFFER(struct ndr_pull *ndr, int ndr_flags, struct PAC_BUFFER *r) +{ + uint32_t _ptr_info; + TALLOC_CTX *_mem_save_info_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_PAC_TYPE(ndr, NDR_SCALARS, &r->type)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->_ndr_size)); + { + uint32_t _flags_save_PAC_INFO = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_ALIGN8); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info)); + if (_ptr_info) { + NDR_PULL_ALLOC(ndr, r->info); + NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->info, _ptr_info)); + } else { + r->info = NULL; + } + ndr->flags = _flags_save_PAC_INFO; + } + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->_pad)); + } + if (ndr_flags & NDR_BUFFERS) { + { + uint32_t _flags_save_PAC_INFO = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_ALIGN8); + if (r->info) { + uint32_t _relative_save_offset; + _relative_save_offset = ndr->offset; + NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->info)); + _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->info, 0); + { + struct ndr_pull *_ndr_info; + NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_info, 0, r->_ndr_size)); + NDR_CHECK(ndr_pull_set_switch_value(_ndr_info, r->info, r->type)); + NDR_CHECK(ndr_pull_PAC_INFO(_ndr_info, NDR_SCALARS|NDR_BUFFERS, r->info)); + NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_info, 0, r->_ndr_size)); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, 0); + ndr->offset = _relative_save_offset; + } + ndr->flags = _flags_save_PAC_INFO; + } + } + return NDR_ERR_SUCCESS; +} + +void ndr_print_PAC_BUFFER(struct ndr_print *ndr, const char *name, const struct PAC_BUFFER *r) +{ + ndr_print_struct(ndr, name, "PAC_BUFFER"); + ndr->depth++; + ndr_print_PAC_TYPE(ndr, "type", r->type); + ndr_print_uint32(ndr, "_ndr_size", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?_ndr_size_PAC_INFO(r->info,r->type,0):r->_ndr_size); + ndr_print_ptr(ndr, "info", r->info); + ndr->depth++; + if (r->info) { + ndr_print_set_switch_value(ndr, r->info, r->type); + ndr_print_PAC_INFO(ndr, "info", r->info); + } + ndr->depth--; + ndr_print_uint32(ndr, "_pad", r->_pad); + ndr->depth--; +} diff --git a/source3/librpc/ndr/ndr_misc.c b/source3/librpc/ndr/ndr_misc.c index 245ba45215..79761b9251 100644 --- a/source3/librpc/ndr/ndr_misc.c +++ b/source3/librpc/ndr/ndr_misc.c @@ -24,41 +24,6 @@ #include "includes.h" -enum ndr_err_code ndr_push_GUID(struct ndr_push *ndr, int ndr_flags, const struct GUID *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->time_low)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->time_mid)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->time_hi_and_version)); - NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->clock_seq, 2)); - NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->node, 6)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -enum ndr_err_code ndr_pull_GUID(struct ndr_pull *ndr, int ndr_flags, struct GUID *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->time_low)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->time_mid)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->time_hi_and_version)); - NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->clock_seq, 2)); - NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->node, 6)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -size_t ndr_size_GUID(const struct GUID *r, int flags) -{ - return ndr_size_struct(r, flags, (ndr_push_flags_fn_t)ndr_push_GUID); -} - /** * see if a range of memory is all zero. A NULL pointer is considered * to be all zero @@ -78,39 +43,6 @@ void ndr_print_GUID(struct ndr_print *ndr, const char *name, const struct GUID * ndr->print(ndr, "%-25s: %s", name, GUID_string(ndr, guid)); } -enum ndr_err_code ndr_push_policy_handle(struct ndr_push *ndr, int ndr_flags, const struct policy_handle *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->handle_type)); - NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->uuid)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -enum ndr_err_code ndr_pull_policy_handle(struct ndr_pull *ndr, int ndr_flags, struct policy_handle *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->handle_type)); - NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->uuid)); - } - if (ndr_flags & NDR_BUFFERS) { - } - return NDR_ERR_SUCCESS; -} - -void ndr_print_policy_handle(struct ndr_print *ndr, const char *name, const struct policy_handle *r) -{ - ndr_print_struct(ndr, name, "policy_handle"); - ndr->depth++; - ndr_print_uint32(ndr, "handle_type", r->handle_type); - ndr_print_GUID(ndr, "uuid", &r->uuid); - ndr->depth--; -} - enum ndr_err_code ndr_push_server_id(struct ndr_push *ndr, int ndr_flags, const struct server_id *r) { if (ndr_flags & NDR_SCALARS) { @@ -153,84 +85,3 @@ void ndr_print_server_id(struct ndr_print *ndr, const char *name, const struct s #endif ndr->depth--; } - -void ndr_print_ads_struct(struct ndr_print *ndr, const char *name, const struct ads_struct *r) -{ - if (!r) { return; } - - ndr_print_struct(ndr, name, "ads_struct"); - ndr->depth++; - ndr_print_bool(ndr, "is_mine", r->is_mine); - ndr_print_struct(ndr, name, "server"); - ndr->depth++; - ndr_print_string(ndr, "realm", r->server.realm); - ndr_print_string(ndr, "workgroup", r->server.workgroup); - ndr_print_string(ndr, "ldap_server", r->server.ldap_server); - ndr_print_bool(ndr, "foreign", r->server.foreign); - ndr->depth--; - ndr_print_struct(ndr, name, "auth"); - ndr->depth++; - ndr_print_string(ndr, "realm", r->auth.realm); -#ifdef DEBUG_PASSWORD - ndr_print_string(ndr, "password", r->auth.password); -#else - ndr_print_string(ndr, "password", "(PASSWORD ommited)"); -#endif - ndr_print_string(ndr, "user_name", r->auth.user_name); - ndr_print_string(ndr, "kdc_server", r->auth.kdc_server); - ndr_print_uint32(ndr, "flags", r->auth.flags); - ndr_print_uint32(ndr, "time_offset", r->auth.time_offset); - ndr_print_time_t(ndr, "tgt_expire", r->auth.tgt_expire); - ndr_print_time_t(ndr, "tgs_expire", r->auth.tgs_expire); - ndr_print_time_t(ndr, "renewable", r->auth.renewable); - ndr->depth--; - ndr_print_struct(ndr, name, "config"); - ndr->depth++; - ndr_print_uint32(ndr, "flags", r->config.flags); - ndr_print_string(ndr, "realm", r->config.realm); - ndr_print_string(ndr, "bind_path", r->config.bind_path); - ndr_print_string(ndr, "ldap_server_name", r->config.ldap_server_name); - ndr_print_string(ndr, "server_site_name", r->config.server_site_name); - ndr_print_string(ndr, "client_site_name", r->config.client_site_name); - ndr_print_time_t(ndr, "current_time", r->config.current_time); - ndr_print_bool(ndr, "tried_closest_dc", r->config.tried_closest_dc); - ndr_print_string(ndr, "schema_path", r->config.schema_path); - ndr_print_string(ndr, "config_path", r->config.config_path); - ndr->depth--; -#ifdef HAVE_LDAP - ndr_print_struct(ndr, name, "ldap"); - ndr->depth++; - ndr_print_ptr(ndr, "ld", r->ldap.ld); - ndr_print_sockaddr_storage(ndr, "ss", &r->ldap.ss); - ndr_print_time_t(ndr, "last_attempt", r->ldap.last_attempt); - ndr_print_uint32(ndr, "port", r->ldap.port); - ndr_print_uint16(ndr, "wrap_type", r->ldap.wrap_type); -#ifdef HAVE_LDAP_SASL_WRAPPING - ndr_print_ptr(ndr, "sbiod", r->ldap.sbiod); -#endif /* HAVE_LDAP_SASL_WRAPPING */ - ndr_print_ptr(ndr, "mem_ctx", r->ldap.mem_ctx); - ndr_print_ptr(ndr, "wrap_ops", r->ldap.wrap_ops); - ndr_print_ptr(ndr, "wrap_private_data", r->ldap.wrap_private_data); - ndr_print_struct(ndr, name, "in"); - ndr->depth++; - ndr_print_uint32(ndr, "ofs", r->ldap.in.ofs); - ndr_print_uint32(ndr, "needed", r->ldap.in.needed); - ndr_print_uint32(ndr, "left", r->ldap.in.left); - ndr_print_uint32(ndr, "max_wrapped", r->ldap.in.max_wrapped); - ndr_print_uint32(ndr, "min_wrapped", r->ldap.in.min_wrapped); - ndr_print_uint32(ndr, "size", r->ldap.in.size); - ndr_print_array_uint8(ndr, "buf", r->ldap.in.buf, r->ldap.in.size); - ndr->depth--; - ndr_print_struct(ndr, name, "out"); - ndr->depth++; - ndr_print_uint32(ndr, "ofs", r->ldap.out.ofs); - ndr_print_uint32(ndr, "left", r->ldap.out.left); - ndr_print_uint32(ndr, "max_unwrapped", r->ldap.out.max_unwrapped); - ndr_print_uint32(ndr, "sig_size", r->ldap.out.sig_size); - ndr_print_uint32(ndr, "size", r->ldap.out.size); - ndr_print_array_uint8(ndr, "buf", r->ldap.out.buf, r->ldap.out.size); - ndr->depth--; - ndr->depth--; -#endif /* HAVE_LDAP */ - ndr->depth--; -} diff --git a/source3/librpc/ndr/ndr_sec_helper.c b/source3/librpc/ndr/ndr_sec_helper.c index d1938b9588..f8bad6ca61 100644 --- a/source3/librpc/ndr/ndr_sec_helper.c +++ b/source3/librpc/ndr/ndr_sec_helper.c @@ -89,818 +89,3 @@ void ndr_print_dom_sid28(struct ndr_print *ndr, const char *name, const struct d { ndr_print_dom_sid(ndr, name, sid); } - -static enum ndr_err_code ndr_push_security_ace_flags(struct ndr_push *ndr, int ndr_flags, uint8_t r) -{ - NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r)); - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_security_ace_flags(struct ndr_pull *ndr, int ndr_flags, uint8_t *r) -{ - uint8_t v; - NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &v)); - *r = v; - return NDR_ERR_SUCCESS; -} - -void ndr_print_security_ace_flags(struct ndr_print *ndr, const char *name, uint8_t r) -{ - ndr_print_uint8(ndr, name, r); - ndr->depth++; - ndr_print_bitmap_flag(ndr, sizeof(uint8_t), "SEC_ACE_FLAG_OBJECT_INHERIT", SEC_ACE_FLAG_OBJECT_INHERIT, r); - ndr_print_bitmap_flag(ndr, sizeof(uint8_t), "SEC_ACE_FLAG_CONTAINER_INHERIT", SEC_ACE_FLAG_CONTAINER_INHERIT, r); - ndr_print_bitmap_flag(ndr, sizeof(uint8_t), "SEC_ACE_FLAG_NO_PROPAGATE_INHERIT", SEC_ACE_FLAG_NO_PROPAGATE_INHERIT, r); - ndr_print_bitmap_flag(ndr, sizeof(uint8_t), "SEC_ACE_FLAG_INHERIT_ONLY", SEC_ACE_FLAG_INHERIT_ONLY, r); - ndr_print_bitmap_flag(ndr, sizeof(uint8_t), "SEC_ACE_FLAG_INHERITED_ACE", SEC_ACE_FLAG_INHERITED_ACE, r); - ndr_print_bitmap_flag(ndr, sizeof(uint8_t), "SEC_ACE_FLAG_VALID_INHERIT", SEC_ACE_FLAG_VALID_INHERIT, r); - ndr_print_bitmap_flag(ndr, sizeof(uint8_t), "SEC_ACE_FLAG_SUCCESSFUL_ACCESS", SEC_ACE_FLAG_SUCCESSFUL_ACCESS, r); - ndr_print_bitmap_flag(ndr, sizeof(uint8_t), "SEC_ACE_FLAG_FAILED_ACCESS", SEC_ACE_FLAG_FAILED_ACCESS, r); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_security_ace_type(struct ndr_push *ndr, int ndr_flags, enum security_ace_type r) -{ - NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r)); - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_security_ace_type(struct ndr_pull *ndr, int ndr_flags, enum security_ace_type *r) -{ - uint8_t v; - NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &v)); - *r = (enum security_ace_type)v; - return NDR_ERR_SUCCESS; -} - -void ndr_print_security_ace_type(struct ndr_print *ndr, const char *name, enum security_ace_type r) -{ - const char *val = NULL; - - switch (r) { - case SEC_ACE_TYPE_ACCESS_ALLOWED: val = "SEC_ACE_TYPE_ACCESS_ALLOWED"; break; - case SEC_ACE_TYPE_ACCESS_DENIED: val = "SEC_ACE_TYPE_ACCESS_DENIED"; break; - case SEC_ACE_TYPE_SYSTEM_AUDIT: val = "SEC_ACE_TYPE_SYSTEM_AUDIT"; break; - case SEC_ACE_TYPE_SYSTEM_ALARM: val = "SEC_ACE_TYPE_SYSTEM_ALARM"; break; - case SEC_ACE_TYPE_ALLOWED_COMPOUND: val = "SEC_ACE_TYPE_ALLOWED_COMPOUND"; break; - case SEC_ACE_TYPE_ACCESS_ALLOWED_OBJECT: val = "SEC_ACE_TYPE_ACCESS_ALLOWED_OBJECT"; break; - case SEC_ACE_TYPE_ACCESS_DENIED_OBJECT: val = "SEC_ACE_TYPE_ACCESS_DENIED_OBJECT"; break; - case SEC_ACE_TYPE_SYSTEM_AUDIT_OBJECT: val = "SEC_ACE_TYPE_SYSTEM_AUDIT_OBJECT"; break; - case SEC_ACE_TYPE_SYSTEM_ALARM_OBJECT: val = "SEC_ACE_TYPE_SYSTEM_ALARM_OBJECT"; break; - } - ndr_print_enum(ndr, name, "ENUM", val, r); -} - -static enum ndr_err_code ndr_push_security_ace_object_flags(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_security_ace_object_flags(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; -} - -void ndr_print_security_ace_object_flags(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), "SEC_ACE_OBJECT_TYPE_PRESENT", SEC_ACE_OBJECT_TYPE_PRESENT, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SEC_ACE_INHERITED_OBJECT_TYPE_PRESENT", SEC_ACE_INHERITED_OBJECT_TYPE_PRESENT, r); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_security_ace_object_type(struct ndr_push *ndr, int ndr_flags, const union security_ace_object_type *r) -{ - int level; - level = ndr_push_get_switch_value(ndr, r); - if (ndr_flags & NDR_SCALARS) { - switch (level) { - case SEC_ACE_OBJECT_TYPE_PRESENT: - NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->type)); - break; - - default: - break; - - } - } - if (ndr_flags & NDR_BUFFERS) { - switch (level) { - case SEC_ACE_OBJECT_TYPE_PRESENT: - break; - - default: - break; - - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_security_ace_object_type(struct ndr_pull *ndr, int ndr_flags, union security_ace_object_type *r) -{ - int level; - level = ndr_pull_get_switch_value(ndr, r); - if (ndr_flags & NDR_SCALARS) { - switch (level) { - case SEC_ACE_OBJECT_TYPE_PRESENT: { - NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->type)); - break; } - - default: { - break; } - - } - } - if (ndr_flags & NDR_BUFFERS) { - switch (level) { - case SEC_ACE_OBJECT_TYPE_PRESENT: - break; - - default: - break; - - } - } - return NDR_ERR_SUCCESS; -} - -void ndr_print_security_ace_object_type(struct ndr_print *ndr, const char *name, const union security_ace_object_type *r) -{ - int level; - level = ndr_print_get_switch_value(ndr, r); - ndr_print_union(ndr, name, level, "security_ace_object_type"); - switch (level) { - case SEC_ACE_OBJECT_TYPE_PRESENT: - ndr_print_GUID(ndr, "type", &r->type); - break; - - default: - break; - - } -} - -static enum ndr_err_code ndr_push_security_ace_object_inherited_type(struct ndr_push *ndr, int ndr_flags, const union security_ace_object_inherited_type *r) -{ - int level; - level = ndr_push_get_switch_value(ndr, r); - if (ndr_flags & NDR_SCALARS) { - switch (level) { - case SEC_ACE_INHERITED_OBJECT_TYPE_PRESENT: - NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->inherited_type)); - break; - - default: - break; - - } - } - if (ndr_flags & NDR_BUFFERS) { - switch (level) { - case SEC_ACE_INHERITED_OBJECT_TYPE_PRESENT: - break; - - default: - break; - - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_security_ace_object_inherited_type(struct ndr_pull *ndr, int ndr_flags, union security_ace_object_inherited_type *r) -{ - int level; - level = ndr_pull_get_switch_value(ndr, r); - if (ndr_flags & NDR_SCALARS) { - switch (level) { - case SEC_ACE_INHERITED_OBJECT_TYPE_PRESENT: { - NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->inherited_type)); - break; } - - default: { - break; } - - } - } - if (ndr_flags & NDR_BUFFERS) { - switch (level) { - case SEC_ACE_INHERITED_OBJECT_TYPE_PRESENT: - break; - - default: - break; - - } - } - return NDR_ERR_SUCCESS; -} - -void ndr_print_security_ace_object_inherited_type(struct ndr_print *ndr, const char *name, const union security_ace_object_inherited_type *r) -{ - int level; - level = ndr_print_get_switch_value(ndr, r); - ndr_print_union(ndr, name, level, "security_ace_object_inherited_type"); - switch (level) { - case SEC_ACE_INHERITED_OBJECT_TYPE_PRESENT: - ndr_print_GUID(ndr, "inherited_type", &r->inherited_type); - break; - - default: - break; - - } -} - -static enum ndr_err_code ndr_push_security_ace_object(struct ndr_push *ndr, int ndr_flags, const struct security_ace_object *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_security_ace_object_flags(ndr, NDR_SCALARS, r->flags)); - NDR_CHECK(ndr_push_set_switch_value(ndr, &r->type, r->flags&SEC_ACE_OBJECT_TYPE_PRESENT)); - NDR_CHECK(ndr_push_security_ace_object_type(ndr, NDR_SCALARS, &r->type)); - NDR_CHECK(ndr_push_set_switch_value(ndr, &r->inherited_type, r->flags&SEC_ACE_INHERITED_OBJECT_TYPE_PRESENT)); - NDR_CHECK(ndr_push_security_ace_object_inherited_type(ndr, NDR_SCALARS, &r->inherited_type)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_push_security_ace_object_type(ndr, NDR_BUFFERS, &r->type)); - NDR_CHECK(ndr_push_security_ace_object_inherited_type(ndr, NDR_BUFFERS, &r->inherited_type)); - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_security_ace_object(struct ndr_pull *ndr, int ndr_flags, struct security_ace_object *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_security_ace_object_flags(ndr, NDR_SCALARS, &r->flags)); - NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->type, r->flags&SEC_ACE_OBJECT_TYPE_PRESENT)); - NDR_CHECK(ndr_pull_security_ace_object_type(ndr, NDR_SCALARS, &r->type)); - NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->inherited_type, r->flags&SEC_ACE_INHERITED_OBJECT_TYPE_PRESENT)); - NDR_CHECK(ndr_pull_security_ace_object_inherited_type(ndr, NDR_SCALARS, &r->inherited_type)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_pull_security_ace_object_type(ndr, NDR_BUFFERS, &r->type)); - NDR_CHECK(ndr_pull_security_ace_object_inherited_type(ndr, NDR_BUFFERS, &r->inherited_type)); - } - return NDR_ERR_SUCCESS; -} - -void ndr_print_security_ace_object(struct ndr_print *ndr, const char *name, const struct security_ace_object *r) -{ - ndr_print_struct(ndr, name, "security_ace_object"); - ndr->depth++; - ndr_print_security_ace_object_flags(ndr, "flags", r->flags); - ndr_print_set_switch_value(ndr, &r->type, r->flags&SEC_ACE_OBJECT_TYPE_PRESENT); - ndr_print_security_ace_object_type(ndr, "type", &r->type); - ndr_print_set_switch_value(ndr, &r->inherited_type, r->flags&SEC_ACE_INHERITED_OBJECT_TYPE_PRESENT); - ndr_print_security_ace_object_inherited_type(ndr, "inherited_type", &r->inherited_type); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_security_ace_object_ctr(struct ndr_push *ndr, int ndr_flags, const union security_ace_object_ctr *r) -{ - int level; - level = ndr_push_get_switch_value(ndr, r); - if (ndr_flags & NDR_SCALARS) { - switch (level) { - case SEC_ACE_TYPE_ACCESS_ALLOWED_OBJECT: - NDR_CHECK(ndr_push_security_ace_object(ndr, NDR_SCALARS, &r->object)); - break; - - case SEC_ACE_TYPE_ACCESS_DENIED_OBJECT: - NDR_CHECK(ndr_push_security_ace_object(ndr, NDR_SCALARS, &r->object)); - break; - - case SEC_ACE_TYPE_SYSTEM_AUDIT_OBJECT: - NDR_CHECK(ndr_push_security_ace_object(ndr, NDR_SCALARS, &r->object)); - break; - - case SEC_ACE_TYPE_SYSTEM_ALARM_OBJECT: - NDR_CHECK(ndr_push_security_ace_object(ndr, NDR_SCALARS, &r->object)); - break; - - default: - break; - - } - } - if (ndr_flags & NDR_BUFFERS) { - switch (level) { - case SEC_ACE_TYPE_ACCESS_ALLOWED_OBJECT: - NDR_CHECK(ndr_push_security_ace_object(ndr, NDR_BUFFERS, &r->object)); - break; - - case SEC_ACE_TYPE_ACCESS_DENIED_OBJECT: - NDR_CHECK(ndr_push_security_ace_object(ndr, NDR_BUFFERS, &r->object)); - break; - - case SEC_ACE_TYPE_SYSTEM_AUDIT_OBJECT: - NDR_CHECK(ndr_push_security_ace_object(ndr, NDR_BUFFERS, &r->object)); - break; - - case SEC_ACE_TYPE_SYSTEM_ALARM_OBJECT: - NDR_CHECK(ndr_push_security_ace_object(ndr, NDR_BUFFERS, &r->object)); - break; - - default: - break; - - } - } - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_security_ace_object_ctr(struct ndr_pull *ndr, int ndr_flags, union security_ace_object_ctr *r) -{ - int level; - level = ndr_pull_get_switch_value(ndr, r); - if (ndr_flags & NDR_SCALARS) { - switch (level) { - case SEC_ACE_TYPE_ACCESS_ALLOWED_OBJECT: { - NDR_CHECK(ndr_pull_security_ace_object(ndr, NDR_SCALARS, &r->object)); - break; } - - case SEC_ACE_TYPE_ACCESS_DENIED_OBJECT: { - NDR_CHECK(ndr_pull_security_ace_object(ndr, NDR_SCALARS, &r->object)); - break; } - - case SEC_ACE_TYPE_SYSTEM_AUDIT_OBJECT: { - NDR_CHECK(ndr_pull_security_ace_object(ndr, NDR_SCALARS, &r->object)); - break; } - - case SEC_ACE_TYPE_SYSTEM_ALARM_OBJECT: { - NDR_CHECK(ndr_pull_security_ace_object(ndr, NDR_SCALARS, &r->object)); - break; } - - default: { - break; } - - } - } - if (ndr_flags & NDR_BUFFERS) { - switch (level) { - case SEC_ACE_TYPE_ACCESS_ALLOWED_OBJECT: - NDR_CHECK(ndr_pull_security_ace_object(ndr, NDR_BUFFERS, &r->object)); - break; - - case SEC_ACE_TYPE_ACCESS_DENIED_OBJECT: - NDR_CHECK(ndr_pull_security_ace_object(ndr, NDR_BUFFERS, &r->object)); - break; - - case SEC_ACE_TYPE_SYSTEM_AUDIT_OBJECT: - NDR_CHECK(ndr_pull_security_ace_object(ndr, NDR_BUFFERS, &r->object)); - break; - - case SEC_ACE_TYPE_SYSTEM_ALARM_OBJECT: - NDR_CHECK(ndr_pull_security_ace_object(ndr, NDR_BUFFERS, &r->object)); - break; - - default: - break; - - } - } - return NDR_ERR_SUCCESS; -} - -void ndr_print_security_ace_object_ctr(struct ndr_print *ndr, const char *name, const union security_ace_object_ctr *r) -{ - int level; - level = ndr_print_get_switch_value(ndr, r); - ndr_print_union(ndr, name, level, "security_ace_object_ctr"); - switch (level) { - case SEC_ACE_TYPE_ACCESS_ALLOWED_OBJECT: - ndr_print_security_ace_object(ndr, "object", &r->object); - break; - - case SEC_ACE_TYPE_ACCESS_DENIED_OBJECT: - ndr_print_security_ace_object(ndr, "object", &r->object); - break; - - case SEC_ACE_TYPE_SYSTEM_AUDIT_OBJECT: - ndr_print_security_ace_object(ndr, "object", &r->object); - break; - - case SEC_ACE_TYPE_SYSTEM_ALARM_OBJECT: - ndr_print_security_ace_object(ndr, "object", &r->object); - break; - - default: - break; - - } -} - -enum ndr_err_code ndr_push_security_ace(struct ndr_push *ndr, int ndr_flags, const struct security_ace *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_security_ace_type(ndr, NDR_SCALARS, r->type)); - NDR_CHECK(ndr_push_security_ace_flags(ndr, NDR_SCALARS, r->flags)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, ndr_size_security_ace(r,ndr->flags))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->access_mask)); - NDR_CHECK(ndr_push_set_switch_value(ndr, &r->object, r->type)); - NDR_CHECK(ndr_push_security_ace_object_ctr(ndr, NDR_SCALARS, &r->object)); - NDR_CHECK(ndr_push_dom_sid(ndr, NDR_SCALARS, &r->trustee)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_push_security_ace_object_ctr(ndr, NDR_BUFFERS, &r->object)); - } - return NDR_ERR_SUCCESS; -} - -enum ndr_err_code ndr_pull_security_ace(struct ndr_pull *ndr, int ndr_flags, struct security_ace *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_security_ace_type(ndr, NDR_SCALARS, &r->type)); - NDR_CHECK(ndr_pull_security_ace_flags(ndr, NDR_SCALARS, &r->flags)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->size)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->access_mask)); - NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->object, r->type)); - NDR_CHECK(ndr_pull_security_ace_object_ctr(ndr, NDR_SCALARS, &r->object)); - NDR_CHECK(ndr_pull_dom_sid(ndr, NDR_SCALARS, &r->trustee)); - } - if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_pull_security_ace_object_ctr(ndr, NDR_BUFFERS, &r->object)); - } - return NDR_ERR_SUCCESS; -} - -void ndr_print_security_ace(struct ndr_print *ndr, const char *name, const struct security_ace *r) -{ - ndr_print_struct(ndr, name, "security_ace"); - ndr->depth++; - ndr_print_security_ace_type(ndr, "type", r->type); - ndr_print_security_ace_flags(ndr, "flags", r->flags); - ndr_print_uint16(ndr, "size", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?ndr_size_security_ace(r,ndr->flags):r->size); - ndr_print_uint32(ndr, "access_mask", r->access_mask); - ndr_print_set_switch_value(ndr, &r->object, r->type); - ndr_print_security_ace_object_ctr(ndr, "object", &r->object); - ndr_print_dom_sid(ndr, "trustee", &r->trustee); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_security_acl_revision(struct ndr_push *ndr, int ndr_flags, enum security_acl_revision r) -{ - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r)); - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_security_acl_revision(struct ndr_pull *ndr, int ndr_flags, enum security_acl_revision *r) -{ - uint16_t v; - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &v)); - *r = (enum security_acl_revision)v; - return NDR_ERR_SUCCESS; -} - -void ndr_print_security_acl_revision(struct ndr_print *ndr, const char *name, enum security_acl_revision r) -{ - const char *val = NULL; - - switch (r) { - case SECURITY_ACL_REVISION_NT4: val = "SECURITY_ACL_REVISION_NT4"; break; - case SECURITY_ACL_REVISION_ADS: val = "SECURITY_ACL_REVISION_ADS"; break; - } - ndr_print_enum(ndr, name, "ENUM", val, r); -} - -enum ndr_err_code ndr_push_security_acl(struct ndr_push *ndr, int ndr_flags, const struct security_acl *r) -{ - uint32_t cntr_aces_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_security_acl_revision(ndr, NDR_SCALARS, r->revision)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, ndr_size_security_acl(r,ndr->flags))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_aces)); - for (cntr_aces_0 = 0; cntr_aces_0 < r->num_aces; cntr_aces_0++) { - NDR_CHECK(ndr_push_security_ace(ndr, NDR_SCALARS, &r->aces[cntr_aces_0])); - } - } - if (ndr_flags & NDR_BUFFERS) { - for (cntr_aces_0 = 0; cntr_aces_0 < r->num_aces; cntr_aces_0++) { - NDR_CHECK(ndr_push_security_ace(ndr, NDR_BUFFERS, &r->aces[cntr_aces_0])); - } - } - return NDR_ERR_SUCCESS; -} - -enum ndr_err_code ndr_pull_security_acl(struct ndr_pull *ndr, int ndr_flags, struct security_acl *r) -{ - uint32_t cntr_aces_0; - TALLOC_CTX *_mem_save_aces_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_security_acl_revision(ndr, NDR_SCALARS, &r->revision)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->size)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->num_aces)); - if (r->num_aces > 1000) { /* num_aces is unsigned */ - return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range"); - } - NDR_PULL_ALLOC_N(ndr, r->aces, r->num_aces); - _mem_save_aces_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->aces, 0); - for (cntr_aces_0 = 0; cntr_aces_0 < r->num_aces; cntr_aces_0++) { - NDR_CHECK(ndr_pull_security_ace(ndr, NDR_SCALARS, &r->aces[cntr_aces_0])); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_aces_0, 0); - } - if (ndr_flags & NDR_BUFFERS) { - _mem_save_aces_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->aces, 0); - for (cntr_aces_0 = 0; cntr_aces_0 < r->num_aces; cntr_aces_0++) { - NDR_CHECK(ndr_pull_security_ace(ndr, NDR_BUFFERS, &r->aces[cntr_aces_0])); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_aces_0, 0); - } - return NDR_ERR_SUCCESS; -} - -void ndr_print_security_acl(struct ndr_print *ndr, const char *name, const struct security_acl *r) -{ - uint32_t cntr_aces_0; - ndr_print_struct(ndr, name, "security_acl"); - ndr->depth++; - ndr_print_security_acl_revision(ndr, "revision", r->revision); - ndr_print_uint16(ndr, "size", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?ndr_size_security_acl(r,ndr->flags):r->size); - ndr_print_uint32(ndr, "num_aces", r->num_aces); - ndr->print(ndr, "%s: ARRAY(%d)", "aces", r->num_aces); - ndr->depth++; - for (cntr_aces_0=0;cntr_aces_0<r->num_aces;cntr_aces_0++) { - char *idx_0=NULL; - asprintf(&idx_0, "[%d]", cntr_aces_0); - if (idx_0) { - ndr_print_security_ace(ndr, "aces", &r->aces[cntr_aces_0]); - free(idx_0); - } - } - ndr->depth--; - ndr->depth--; -} - -static enum ndr_err_code ndr_push_security_descriptor_revision(struct ndr_push *ndr, int ndr_flags, enum security_descriptor_revision r) -{ - NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r)); - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_security_descriptor_revision(struct ndr_pull *ndr, int ndr_flags, enum security_descriptor_revision *r) -{ - uint8_t v; - NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &v)); - *r = (enum security_descriptor_revision)v; - return NDR_ERR_SUCCESS; -} - -void ndr_print_security_descriptor_revision(struct ndr_print *ndr, const char *name, enum security_descriptor_revision r) -{ - const char *val = NULL; - - switch (r) { - case SECURITY_DESCRIPTOR_REVISION_1: val = "SECURITY_DESCRIPTOR_REVISION_1"; break; - } - ndr_print_enum(ndr, name, "ENUM", val, r); -} - -static enum ndr_err_code ndr_push_security_descriptor_type(struct ndr_push *ndr, int ndr_flags, uint16_t r) -{ - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r)); - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_security_descriptor_type(struct ndr_pull *ndr, int ndr_flags, uint16_t *r) -{ - uint16_t v; - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &v)); - *r = v; - return NDR_ERR_SUCCESS; -} - -void ndr_print_security_descriptor_type(struct ndr_print *ndr, const char *name, uint16_t r) -{ - ndr_print_uint16(ndr, name, r); - ndr->depth++; - ndr_print_bitmap_flag(ndr, sizeof(uint16_t), "SEC_DESC_OWNER_DEFAULTED", SEC_DESC_OWNER_DEFAULTED, r); - ndr_print_bitmap_flag(ndr, sizeof(uint16_t), "SEC_DESC_GROUP_DEFAULTED", SEC_DESC_GROUP_DEFAULTED, r); - ndr_print_bitmap_flag(ndr, sizeof(uint16_t), "SEC_DESC_DACL_PRESENT", SEC_DESC_DACL_PRESENT, r); - ndr_print_bitmap_flag(ndr, sizeof(uint16_t), "SEC_DESC_DACL_DEFAULTED", SEC_DESC_DACL_DEFAULTED, r); - ndr_print_bitmap_flag(ndr, sizeof(uint16_t), "SEC_DESC_SACL_PRESENT", SEC_DESC_SACL_PRESENT, r); - ndr_print_bitmap_flag(ndr, sizeof(uint16_t), "SEC_DESC_SACL_DEFAULTED", SEC_DESC_SACL_DEFAULTED, r); - ndr_print_bitmap_flag(ndr, sizeof(uint16_t), "SEC_DESC_DACL_TRUSTED", SEC_DESC_DACL_TRUSTED, r); - ndr_print_bitmap_flag(ndr, sizeof(uint16_t), "SEC_DESC_SERVER_SECURITY", SEC_DESC_SERVER_SECURITY, r); - ndr_print_bitmap_flag(ndr, sizeof(uint16_t), "SEC_DESC_DACL_AUTO_INHERIT_REQ", SEC_DESC_DACL_AUTO_INHERIT_REQ, r); - ndr_print_bitmap_flag(ndr, sizeof(uint16_t), "SEC_DESC_SACL_AUTO_INHERIT_REQ", SEC_DESC_SACL_AUTO_INHERIT_REQ, r); - ndr_print_bitmap_flag(ndr, sizeof(uint16_t), "SEC_DESC_DACL_AUTO_INHERITED", SEC_DESC_DACL_AUTO_INHERITED, r); - ndr_print_bitmap_flag(ndr, sizeof(uint16_t), "SEC_DESC_SACL_AUTO_INHERITED", SEC_DESC_SACL_AUTO_INHERITED, r); - ndr_print_bitmap_flag(ndr, sizeof(uint16_t), "SEC_DESC_DACL_PROTECTED", SEC_DESC_DACL_PROTECTED, r); - ndr_print_bitmap_flag(ndr, sizeof(uint16_t), "SEC_DESC_SACL_PROTECTED", SEC_DESC_SACL_PROTECTED, r); - ndr_print_bitmap_flag(ndr, sizeof(uint16_t), "SEC_DESC_RM_CONTROL_VALID", SEC_DESC_RM_CONTROL_VALID, r); - ndr_print_bitmap_flag(ndr, sizeof(uint16_t), "SEC_DESC_SELF_RELATIVE", SEC_DESC_SELF_RELATIVE, r); - ndr->depth--; -} - -enum ndr_err_code ndr_push_security_descriptor(struct ndr_push *ndr, int ndr_flags, const struct security_descriptor *r) -{ - { - uint32_t _flags_save_STRUCT = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_LITTLE_ENDIAN); - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_security_descriptor_revision(ndr, NDR_SCALARS, r->revision)); - NDR_CHECK(ndr_push_security_descriptor_type(ndr, NDR_SCALARS, r->type)); - NDR_CHECK(ndr_push_relative_ptr1(ndr, r->owner_sid)); - NDR_CHECK(ndr_push_relative_ptr1(ndr, r->group_sid)); - NDR_CHECK(ndr_push_relative_ptr1(ndr, r->sacl)); - NDR_CHECK(ndr_push_relative_ptr1(ndr, r->dacl)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->owner_sid) { - NDR_CHECK(ndr_push_relative_ptr2(ndr, r->owner_sid)); - NDR_CHECK(ndr_push_dom_sid(ndr, NDR_SCALARS, r->owner_sid)); - } - if (r->group_sid) { - NDR_CHECK(ndr_push_relative_ptr2(ndr, r->group_sid)); - NDR_CHECK(ndr_push_dom_sid(ndr, NDR_SCALARS, r->group_sid)); - } - if (r->sacl) { - NDR_CHECK(ndr_push_relative_ptr2(ndr, r->sacl)); - NDR_CHECK(ndr_push_security_acl(ndr, NDR_SCALARS|NDR_BUFFERS, r->sacl)); - } - if (r->dacl) { - NDR_CHECK(ndr_push_relative_ptr2(ndr, r->dacl)); - NDR_CHECK(ndr_push_security_acl(ndr, NDR_SCALARS|NDR_BUFFERS, r->dacl)); - } - } - ndr->flags = _flags_save_STRUCT; - } - return NDR_ERR_SUCCESS; -} - -enum ndr_err_code ndr_pull_security_descriptor(struct ndr_pull *ndr, int ndr_flags, struct security_descriptor *r) -{ - uint32_t _ptr_owner_sid; - TALLOC_CTX *_mem_save_owner_sid_0; - uint32_t _ptr_group_sid; - TALLOC_CTX *_mem_save_group_sid_0; - uint32_t _ptr_sacl; - TALLOC_CTX *_mem_save_sacl_0; - uint32_t _ptr_dacl; - TALLOC_CTX *_mem_save_dacl_0; - { - uint32_t _flags_save_STRUCT = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_LITTLE_ENDIAN); - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_security_descriptor_revision(ndr, NDR_SCALARS, &r->revision)); - NDR_CHECK(ndr_pull_security_descriptor_type(ndr, NDR_SCALARS, &r->type)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_owner_sid)); - if (_ptr_owner_sid) { - NDR_PULL_ALLOC(ndr, r->owner_sid); - NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->owner_sid, _ptr_owner_sid)); - } else { - r->owner_sid = NULL; - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_group_sid)); - if (_ptr_group_sid) { - NDR_PULL_ALLOC(ndr, r->group_sid); - NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->group_sid, _ptr_group_sid)); - } else { - r->group_sid = NULL; - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_sacl)); - if (_ptr_sacl) { - NDR_PULL_ALLOC(ndr, r->sacl); - NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->sacl, _ptr_sacl)); - } else { - r->sacl = NULL; - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_dacl)); - if (_ptr_dacl) { - NDR_PULL_ALLOC(ndr, r->dacl); - NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->dacl, _ptr_dacl)); - } else { - r->dacl = NULL; - } - } - if (ndr_flags & NDR_BUFFERS) { - if (r->owner_sid) { - struct ndr_pull_save _relative_save; - ndr_pull_save(ndr, &_relative_save); - NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->owner_sid)); - _mem_save_owner_sid_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->owner_sid, 0); - NDR_CHECK(ndr_pull_dom_sid(ndr, NDR_SCALARS, r->owner_sid)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_owner_sid_0, 0); - ndr_pull_restore(ndr, &_relative_save); - } - if (r->group_sid) { - struct ndr_pull_save _relative_save; - ndr_pull_save(ndr, &_relative_save); - NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->group_sid)); - _mem_save_group_sid_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->group_sid, 0); - NDR_CHECK(ndr_pull_dom_sid(ndr, NDR_SCALARS, r->group_sid)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_group_sid_0, 0); - ndr_pull_restore(ndr, &_relative_save); - } - if (r->sacl) { - struct ndr_pull_save _relative_save; - ndr_pull_save(ndr, &_relative_save); - NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->sacl)); - _mem_save_sacl_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->sacl, 0); - NDR_CHECK(ndr_pull_security_acl(ndr, NDR_SCALARS|NDR_BUFFERS, r->sacl)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sacl_0, 0); - ndr_pull_restore(ndr, &_relative_save); - } - if (r->dacl) { - struct ndr_pull_save _relative_save; - ndr_pull_save(ndr, &_relative_save); - NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->dacl)); - _mem_save_dacl_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->dacl, 0); - NDR_CHECK(ndr_pull_security_acl(ndr, NDR_SCALARS|NDR_BUFFERS, r->dacl)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_dacl_0, 0); - ndr_pull_restore(ndr, &_relative_save); - } - } - ndr->flags = _flags_save_STRUCT; - } - return NDR_ERR_SUCCESS; -} - -void ndr_print_security_descriptor(struct ndr_print *ndr, const char *name, const struct security_descriptor *r) -{ - ndr_print_struct(ndr, name, "security_descriptor"); - { - uint32_t _flags_save_STRUCT = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_LITTLE_ENDIAN); - ndr->depth++; - ndr_print_security_descriptor_revision(ndr, "revision", r->revision); - ndr_print_security_descriptor_type(ndr, "type", r->type); - ndr_print_ptr(ndr, "owner_sid", r->owner_sid); - ndr->depth++; - if (r->owner_sid) { - ndr_print_dom_sid(ndr, "owner_sid", r->owner_sid); - } - ndr->depth--; - ndr_print_ptr(ndr, "group_sid", r->group_sid); - ndr->depth++; - if (r->group_sid) { - ndr_print_dom_sid(ndr, "group_sid", r->group_sid); - } - ndr->depth--; - ndr_print_ptr(ndr, "sacl", r->sacl); - ndr->depth++; - if (r->sacl) { - ndr_print_security_acl(ndr, "sacl", r->sacl); - } - ndr->depth--; - ndr_print_ptr(ndr, "dacl", r->dacl); - ndr->depth++; - if (r->dacl) { - ndr_print_security_acl(ndr, "dacl", r->dacl); - } - ndr->depth--; - ndr->depth--; - ndr->flags = _flags_save_STRUCT; - } -} - -enum ndr_err_code ndr_push_security_secinfo(struct ndr_push *ndr, int ndr_flags, uint32_t r) -{ - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); - return NDR_ERR_SUCCESS; -} - -enum ndr_err_code ndr_pull_security_secinfo(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; -} - -void ndr_print_security_secinfo(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), "SECINFO_OWNER", SECINFO_OWNER, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SECINFO_GROUP", SECINFO_GROUP, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SECINFO_DACL", SECINFO_DACL, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SECINFO_SACL", SECINFO_SACL, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SECINFO_UNPROTECTED_SACL", SECINFO_UNPROTECTED_SACL, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SECINFO_UNPROTECTED_DACL", SECINFO_UNPROTECTED_DACL, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SECINFO_PROTECTED_SACL", SECINFO_PROTECTED_SACL, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SECINFO_PROTECTED_DACL", SECINFO_PROTECTED_DACL, r); - ndr->depth--; -} - diff --git a/source3/librpc/ndr/ndr_string.c b/source3/librpc/ndr/ndr_string.c index 711dbce538..e553443bd8 100644 --- a/source3/librpc/ndr/ndr_string.c +++ b/source3/librpc/ndr/ndr_string.c @@ -633,8 +633,7 @@ _PUBLIC_ void ndr_print_string_array(struct ndr_print *ndr, const char *name, co ndr->depth++; for (i=0;i<count;i++) { char *idx=NULL; - asprintf(&idx, "[%d]", i); - if (idx) { + if (asprintf(&idx, "[%d]", i) != -1) { ndr_print_string(ndr, idx, a[i]); free(idx); } diff --git a/source3/librpc/ndr/security.h b/source3/librpc/ndr/security.h deleted file mode 100644 index 99f7daf2bd..0000000000 --- a/source3/librpc/ndr/security.h +++ /dev/null @@ -1,257 +0,0 @@ -/* header auto-generated by pidl */ - -#ifndef _HEADER_security -#define _HEADER_security - -#define SEC_MASK_GENERIC ( 0xF0000000 ) -#define SEC_MASK_FLAGS ( 0x0F000000 ) -#define SEC_MASK_STANDARD ( 0x00FF0000 ) -#define SEC_MASK_SPECIFIC ( 0x0000FFFF ) -#define SEC_GENERIC_ALL ( 0x10000000 ) -#define SEC_GENERIC_EXECUTE ( 0x20000000 ) -#define SEC_GENERIC_WRITE ( 0x40000000 ) -#define SEC_GENERIC_READ ( 0x80000000 ) -#define SEC_FLAG_SYSTEM_SECURITY ( 0x01000000 ) -#define SEC_FLAG_MAXIMUM_ALLOWED ( 0x02000000 ) -#define SEC_STD_DELETE ( 0x00010000 ) -#define SEC_STD_READ_CONTROL ( 0x00020000 ) -#define SEC_STD_WRITE_DAC ( 0x00040000 ) -#define SEC_STD_WRITE_OWNER ( 0x00080000 ) -#define SEC_STD_SYNCHRONIZE ( 0x00100000 ) -#define SEC_STD_REQUIRED ( 0x000F0000 ) -#define SEC_STD_ALL ( 0x001F0000 ) -#define SEC_FILE_READ_DATA ( 0x00000001 ) -#define SEC_FILE_WRITE_DATA ( 0x00000002 ) -#define SEC_FILE_APPEND_DATA ( 0x00000004 ) -#define SEC_FILE_READ_EA ( 0x00000008 ) -#define SEC_FILE_WRITE_EA ( 0x00000010 ) -#define SEC_FILE_EXECUTE ( 0x00000020 ) -#define SEC_FILE_READ_ATTRIBUTE ( 0x00000080 ) -#define SEC_FILE_WRITE_ATTRIBUTE ( 0x00000100 ) -#define SEC_FILE_ALL ( 0x000001ff ) -#define SEC_DIR_LIST ( 0x00000001 ) -#define SEC_DIR_ADD_FILE ( 0x00000002 ) -#define SEC_DIR_ADD_SUBDIR ( 0x00000004 ) -#define SEC_DIR_READ_EA ( 0x00000008 ) -#define SEC_DIR_WRITE_EA ( 0x00000010 ) -#define SEC_DIR_TRAVERSE ( 0x00000020 ) -#define SEC_DIR_DELETE_CHILD ( 0x00000040 ) -#define SEC_DIR_READ_ATTRIBUTE ( 0x00000080 ) -#define SEC_DIR_WRITE_ATTRIBUTE ( 0x00000100 ) -#define SEC_REG_QUERY_VALUE ( 0x00000001 ) -#define SEC_REG_SET_VALUE ( 0x00000002 ) -#define SEC_REG_CREATE_SUBKEY ( 0x00000004 ) -#define SEC_REG_ENUM_SUBKEYS ( 0x00000008 ) -#define SEC_REG_NOTIFY ( 0x00000010 ) -#define SEC_REG_CREATE_LINK ( 0x00000020 ) -#define SEC_ADS_CREATE_CHILD ( 0x00000001 ) -#define SEC_ADS_DELETE_CHILD ( 0x00000002 ) -#define SEC_ADS_LIST ( 0x00000004 ) -#define SEC_ADS_SELF_WRITE ( 0x00000008 ) -#define SEC_ADS_READ_PROP ( 0x00000010 ) -#define SEC_ADS_WRITE_PROP ( 0x00000020 ) -#define SEC_ADS_DELETE_TREE ( 0x00000040 ) -#define SEC_ADS_LIST_OBJECT ( 0x00000080 ) -#define SEC_ADS_CONTROL_ACCESS ( 0x00000100 ) -#define SEC_RIGHTS_FILE_READ ( SEC_STD_READ_CONTROL|SEC_STD_SYNCHRONIZE|SEC_FILE_READ_DATA|SEC_FILE_READ_ATTRIBUTE|SEC_FILE_READ_EA ) -#define SEC_RIGHTS_FILE_WRITE ( SEC_STD_READ_CONTROL|SEC_STD_SYNCHRONIZE|SEC_FILE_WRITE_DATA|SEC_FILE_WRITE_ATTRIBUTE|SEC_FILE_WRITE_EA|SEC_FILE_APPEND_DATA ) -#define SEC_RIGHTS_FILE_EXECUTE ( SEC_STD_SYNCHRONIZE|SEC_STD_READ_CONTROL|SEC_FILE_READ_ATTRIBUTE|SEC_FILE_EXECUTE ) -#define SEC_RIGHTS_FILE_ALL ( SEC_STD_ALL|SEC_FILE_ALL ) -#define SEC_RIGHTS_DIR_READ ( SEC_RIGHTS_FILE_READ ) -#define SEC_RIGHTS_DIR_WRITE ( SEC_RIGHTS_FILE_WRITE ) -#define SEC_RIGHTS_DIR_EXECUTE ( SEC_RIGHTS_FILE_EXECUTE ) -#define SEC_RIGHTS_DIR_ALL ( SEC_RIGHTS_FILE_ALL ) -#define SID_NULL ( "S-1-0-0" ) -#define SID_WORLD_DOMAIN ( "S-1-1" ) -#define SID_WORLD ( "S-1-1-0" ) -#define SID_CREATOR_OWNER_DOMAIN ( "S-1-3" ) -#define SID_CREATOR_OWNER ( "S-1-3-0" ) -#define SID_CREATOR_GROUP ( "S-1-3-1" ) -#define SID_NT_AUTHORITY ( "S-1-5" ) -#define SID_NT_DIALUP ( "S-1-5-1" ) -#define SID_NT_NETWORK ( "S-1-5-2" ) -#define SID_NT_BATCH ( "S-1-5-3" ) -#define SID_NT_INTERACTIVE ( "S-1-5-4" ) -#define SID_NT_SERVICE ( "S-1-5-6" ) -#define SID_NT_ANONYMOUS ( "S-1-5-7" ) -#define SID_NT_PROXY ( "S-1-5-8" ) -#define SID_NT_ENTERPRISE_DCS ( "S-1-5-9" ) -#define SID_NT_SELF ( "S-1-5-10" ) -#define SID_NT_AUTHENTICATED_USERS ( "S-1-5-11" ) -#define SID_NT_RESTRICTED ( "S-1-5-12" ) -#define SID_NT_TERMINAL_SERVER_USERS ( "S-1-5-13" ) -#define SID_NT_REMOTE_INTERACTIVE ( "S-1-5-14" ) -#define SID_NT_THIS_ORGANISATION ( "S-1-5-15" ) -#define SID_NT_SYSTEM ( "S-1-5-18" ) -#define SID_NT_LOCAL_SERVICE ( "S-1-5-19" ) -#define SID_NT_NETWORK_SERVICE ( "S-1-5-20" ) -#define SID_BUILTIN ( "S-1-5-32" ) -#define SID_BUILTIN_ADMINISTRATORS ( "S-1-5-32-544" ) -#define SID_BUILTIN_USERS ( "S-1-5-32-545" ) -#define SID_BUILTIN_GUESTS ( "S-1-5-32-546" ) -#define SID_BUILTIN_POWER_USERS ( "S-1-5-32-547" ) -#define SID_BUILTIN_ACCOUNT_OPERATORS ( "S-1-5-32-548" ) -#define SID_BUILTIN_SERVER_OPERATORS ( "S-1-5-32-549" ) -#define SID_BUILTIN_PRINT_OPERATORS ( "S-1-5-32-550" ) -#define SID_BUILTIN_BACKUP_OPERATORS ( "S-1-5-32-551" ) -#define SID_BUILTIN_REPLICATOR ( "S-1-5-32-552" ) -#define SID_BUILTIN_RAS_SERVERS ( "S-1-5-32-553" ) -#define SID_BUILTIN_PREW2K ( "S-1-5-32-554" ) -#define DOMAIN_RID_LOGON ( 9 ) -#define DOMAIN_RID_ADMINISTRATOR ( 500 ) -#define DOMAIN_RID_GUEST ( 501 ) -#define DOMAIN_RID_ADMINS ( 512 ) -#define DOMAIN_RID_USERS ( 513 ) -#define DOMAIN_RID_DCS ( 516 ) -#define DOMAIN_RID_CERT_ADMINS ( 517 ) -#define DOMAIN_RID_SCHEMA_ADMINS ( 518 ) -#define DOMAIN_RID_ENTERPRISE_ADMINS ( 519 ) -#define NT4_ACL_REVISION ( SECURITY_ACL_REVISION_NT4 ) -#define SD_REVISION ( SECURITY_DESCRIPTOR_REVISION_1 ) -enum sec_privilege { - SEC_PRIV_SECURITY=1, - SEC_PRIV_BACKUP=2, - SEC_PRIV_RESTORE=3, - SEC_PRIV_SYSTEMTIME=4, - SEC_PRIV_SHUTDOWN=5, - SEC_PRIV_REMOTE_SHUTDOWN=6, - SEC_PRIV_TAKE_OWNERSHIP=7, - SEC_PRIV_DEBUG=8, - SEC_PRIV_SYSTEM_ENVIRONMENT=9, - SEC_PRIV_SYSTEM_PROFILE=10, - SEC_PRIV_PROFILE_SINGLE_PROCESS=11, - SEC_PRIV_INCREASE_BASE_PRIORITY=12, - SEC_PRIV_LOAD_DRIVER=13, - SEC_PRIV_CREATE_PAGEFILE=14, - SEC_PRIV_INCREASE_QUOTA=15, - SEC_PRIV_CHANGE_NOTIFY=16, - SEC_PRIV_UNDOCK=17, - SEC_PRIV_MANAGE_VOLUME=18, - SEC_PRIV_IMPERSONATE=19, - SEC_PRIV_CREATE_GLOBAL=20, - SEC_PRIV_ENABLE_DELEGATION=21, - SEC_PRIV_INTERACTIVE_LOGON=22, - SEC_PRIV_NETWORK_LOGON=23, - SEC_PRIV_REMOTE_INTERACTIVE_LOGON=24 -}; - -/* bitmap security_ace_flags */ -#define SEC_ACE_FLAG_OBJECT_INHERIT ( 0x01 ) -#define SEC_ACE_FLAG_CONTAINER_INHERIT ( 0x02 ) -#define SEC_ACE_FLAG_NO_PROPAGATE_INHERIT ( 0x04 ) -#define SEC_ACE_FLAG_INHERIT_ONLY ( 0x08 ) -#define SEC_ACE_FLAG_INHERITED_ACE ( 0x10 ) -#define SEC_ACE_FLAG_VALID_INHERIT ( 0x0f ) -#define SEC_ACE_FLAG_SUCCESSFUL_ACCESS ( 0x40 ) -#define SEC_ACE_FLAG_FAILED_ACCESS ( 0x80 ) - -enum security_ace_type { - SEC_ACE_TYPE_ACCESS_ALLOWED=0, - SEC_ACE_TYPE_ACCESS_DENIED=1, - SEC_ACE_TYPE_SYSTEM_AUDIT=2, - SEC_ACE_TYPE_SYSTEM_ALARM=3, - SEC_ACE_TYPE_ALLOWED_COMPOUND=4, - SEC_ACE_TYPE_ACCESS_ALLOWED_OBJECT=5, - SEC_ACE_TYPE_ACCESS_DENIED_OBJECT=6, - SEC_ACE_TYPE_SYSTEM_AUDIT_OBJECT=7, - SEC_ACE_TYPE_SYSTEM_ALARM_OBJECT=8 -}; - -/* bitmap security_ace_object_flags */ -#define SEC_ACE_OBJECT_TYPE_PRESENT ( 0x00000001 ) -#define SEC_ACE_INHERITED_OBJECT_TYPE_PRESENT ( 0x00000002 ) - -union security_ace_object_type { - struct GUID type;/* [case(SEC_ACE_OBJECT_TYPE_PRESENT)] */ -}/* [nodiscriminant] */; - -union security_ace_object_inherited_type { - struct GUID inherited_type;/* [case(SEC_ACE_INHERITED_OBJECT_TYPE_PRESENT)] */ -}/* [nodiscriminant] */; - -struct security_ace_object { - uint32_t flags; - union security_ace_object_type type;/* [switch_is(flags&SEC_ACE_OBJECT_TYPE_PRESENT)] */ - union security_ace_object_inherited_type inherited_type;/* [switch_is(flags&SEC_ACE_INHERITED_OBJECT_TYPE_PRESENT)] */ -}; - -union security_ace_object_ctr { - struct security_ace_object object;/* [case(SEC_ACE_TYPE_ACCESS_ALLOWED_OBJECT)] */ -}/* [nodiscriminant] */; - -struct security_ace { - enum security_ace_type type; - uint8_t flags; - uint16_t size;/* [value(ndr_size_security_ace(r,ndr->flags))] */ - uint32_t access_mask; - union security_ace_object_ctr object;/* [switch_is(type)] */ - struct dom_sid trustee; -}/* [gensize,public,nosize] */; - -enum security_acl_revision { - SECURITY_ACL_REVISION_NT4=2, - SECURITY_ACL_REVISION_ADS=4 -}; - -struct security_acl { - enum security_acl_revision revision; - uint16_t size;/* [value(ndr_size_security_acl(r,ndr->flags))] */ - uint32_t num_aces;/* [range(0 1000)] */ - struct security_ace *aces; -}/* [gensize,public,nosize] */; - -enum security_descriptor_revision { - SECURITY_DESCRIPTOR_REVISION_1=1 -}; - -/* bitmap security_descriptor_type */ -#define SEC_DESC_OWNER_DEFAULTED ( 0x0001 ) -#define SEC_DESC_GROUP_DEFAULTED ( 0x0002 ) -#define SEC_DESC_DACL_PRESENT ( 0x0004 ) -#define SEC_DESC_DACL_DEFAULTED ( 0x0008 ) -#define SEC_DESC_SACL_PRESENT ( 0x0010 ) -#define SEC_DESC_SACL_DEFAULTED ( 0x0020 ) -#define SEC_DESC_DACL_TRUSTED ( 0x0040 ) -#define SEC_DESC_SERVER_SECURITY ( 0x0080 ) -#define SEC_DESC_DACL_AUTO_INHERIT_REQ ( 0x0100 ) -#define SEC_DESC_SACL_AUTO_INHERIT_REQ ( 0x0200 ) -#define SEC_DESC_DACL_AUTO_INHERITED ( 0x0400 ) -#define SEC_DESC_SACL_AUTO_INHERITED ( 0x0800 ) -#define SEC_DESC_DACL_PROTECTED ( 0x1000 ) -#define SEC_DESC_SACL_PROTECTED ( 0x2000 ) -#define SEC_DESC_RM_CONTROL_VALID ( 0x4000 ) -#define SEC_DESC_SELF_RELATIVE ( 0x8000 ) - -struct security_descriptor { - enum security_descriptor_revision revision; - uint16_t type; - struct dom_sid *owner_sid;/* [relative] */ - struct dom_sid *group_sid;/* [relative] */ - struct security_acl *sacl;/* [relative] */ - struct security_acl *dacl;/* [relative] */ -}/* [gensize,public,flag(LIBNDR_FLAG_LITTLE_ENDIAN),nosize] */; - -struct sec_desc_buf { - uint32_t sd_size;/* [value(ndr_size_security_descriptor(sd,ndr->flags)),range(0 0x40000)] */ - struct security_descriptor *sd;/* [unique,subcontext(4)] */ -}/* [public] */; - -struct security_token { - struct dom_sid *user_sid;/* [unique] */ - struct dom_sid *group_sid;/* [unique] */ - uint32_t num_sids; - struct dom_sid **sids;/* [unique,size_is(num_sids)] */ - uint64_t privilege_mask; -}/* [public] */; - -/* bitmap security_secinfo */ -#define SECINFO_OWNER ( 0x00000001 ) -#define SECINFO_GROUP ( 0x00000002 ) -#define SECINFO_DACL ( 0x00000004 ) -#define SECINFO_SACL ( 0x00000008 ) -#define SECINFO_UNPROTECTED_SACL ( 0x10000000 ) -#define SECINFO_UNPROTECTED_DACL ( 0x20000000 ) -#define SECINFO_PROTECTED_SACL ( 0x40000000 ) -#define SECINFO_PROTECTED_DACL ( 0x80000000 ) - -#endif /* _HEADER_security */ diff --git a/source3/librpc/ndr/sid.c b/source3/librpc/ndr/sid.c index 89ab2b8ea5..b6ec045806 100644 --- a/source3/librpc/ndr/sid.c +++ b/source3/librpc/ndr/sid.c @@ -187,70 +187,3 @@ enum ndr_err_code ndr_push_dom_sid28(struct ndr_push *ndr, int ndr_flags, const return NDR_ERR_SUCCESS; } - -enum ndr_err_code ndr_push_sec_desc_buf(struct ndr_push *ndr, int ndr_flags, const struct sec_desc_buf *r) -{ - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_size_security_descriptor(r->sd,ndr->flags))); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->sd)); - } - if (ndr_flags & NDR_BUFFERS) { - if (r->sd) { - { - struct ndr_push *_ndr_sd; - NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_sd, 4, -1)); - NDR_CHECK(ndr_push_security_descriptor(_ndr_sd, NDR_SCALARS|NDR_BUFFERS, r->sd)); - NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_sd, 4, -1)); - } - } - } - return NDR_ERR_SUCCESS; -} - -enum ndr_err_code ndr_pull_sec_desc_buf(struct ndr_pull *ndr, int ndr_flags, struct sec_desc_buf *r) -{ - uint32_t _ptr_sd; - TALLOC_CTX *_mem_save_sd_0; - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sd_size)); - if (r->sd_size > 0x40000) { /* sd_size is unsigned */ - return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range"); - } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_sd)); - if (_ptr_sd) { - NDR_PULL_ALLOC(ndr, r->sd); - } else { - r->sd = NULL; - } - } - if (ndr_flags & NDR_BUFFERS) { - if (r->sd) { - _mem_save_sd_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->sd, 0); - { - struct ndr_pull *_ndr_sd; - NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_sd, 4, -1)); - NDR_CHECK(ndr_pull_security_descriptor(_ndr_sd, NDR_SCALARS|NDR_BUFFERS, r->sd)); - NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_sd, 4, -1)); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sd_0, 0); - } - } - return NDR_ERR_SUCCESS; -} - -void ndr_print_sec_desc_buf(struct ndr_print *ndr, const char *name, const struct sec_desc_buf *r) -{ - ndr_print_struct(ndr, name, "sec_desc_buf"); - ndr->depth++; - ndr_print_uint32(ndr, "sd_size", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?ndr_size_security_descriptor(r->sd,ndr->flags):r->sd_size); - ndr_print_ptr(ndr, "sd", r->sd); - ndr->depth++; - if (r->sd) { - ndr_print_security_descriptor(ndr, "sd", r->sd); - } - ndr->depth--; - ndr->depth--; -} |