From 324cad50fcdaca36546ba331c6d9ec17167d3ed7 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Tue, 17 Feb 2009 09:04:58 +0100 Subject: librpc: rerun 'PIDL=pidl/pidl make idl' metze (cherry picked from commit eb1a2e4aea76462086a4303ba325c4da49e891cd) --- source/librpc/gen_ndr/cli_netlogon.c | 32 +++-- source/librpc/gen_ndr/cli_netlogon.h | 11 +- source/librpc/gen_ndr/ndr_netlogon.c | 221 ++++++++++++++++++++++++++++++++--- source/librpc/gen_ndr/ndr_netlogon.h | 5 +- source/librpc/gen_ndr/netlogon.h | 18 ++- source/librpc/gen_ndr/srv_netlogon.c | 24 ++-- source/librpc/gen_ndr/srv_netlogon.h | 2 +- 7 files changed, 271 insertions(+), 42 deletions(-) diff --git a/source/librpc/gen_ndr/cli_netlogon.c b/source/librpc/gen_ndr/cli_netlogon.c index 1db8486e396..52c7054f3d4 100644 --- a/source/librpc/gen_ndr/cli_netlogon.c +++ b/source/librpc/gen_ndr/cli_netlogon.c @@ -1086,23 +1086,33 @@ NTSTATUS rpccli_netr_DsRGetDCName(struct rpc_pipe_client *cli, return werror_to_ntstatus(r.out.result); } -NTSTATUS rpccli_netr_NETRLOGONDUMMYROUTINE1(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror) +NTSTATUS rpccli_netr_LogonGetCapabilities(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_name /* [in] [charset(UTF16)] */, + const char *computer_name /* [in] [unique,charset(UTF16)] */, + struct netr_Authenticator *credential /* [in] [ref] */, + struct netr_Authenticator *return_authenticator /* [in,out] [ref] */, + uint32_t query_level /* [in] */, + union netr_Capabilities *capabilities /* [out] [ref,switch_is(query_level)] */) { - struct netr_NETRLOGONDUMMYROUTINE1 r; + struct netr_LogonGetCapabilities r; NTSTATUS status; /* In parameters */ + r.in.server_name = server_name; + r.in.computer_name = computer_name; + r.in.credential = credential; + r.in.return_authenticator = return_authenticator; + r.in.query_level = query_level; if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(netr_NETRLOGONDUMMYROUTINE1, &r); + NDR_PRINT_IN_DEBUG(netr_LogonGetCapabilities, &r); } status = cli_do_rpc_ndr(cli, mem_ctx, &ndr_table_netlogon, - NDR_NETR_NETRLOGONDUMMYROUTINE1, + NDR_NETR_LOGONGETCAPABILITIES, &r); if (!NT_STATUS_IS_OK(status)) { @@ -1110,7 +1120,7 @@ NTSTATUS rpccli_netr_NETRLOGONDUMMYROUTINE1(struct rpc_pipe_client *cli, } if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(netr_NETRLOGONDUMMYROUTINE1, &r); + NDR_PRINT_OUT_DEBUG(netr_LogonGetCapabilities, &r); } if (NT_STATUS_IS_ERR(status)) { @@ -1118,13 +1128,11 @@ NTSTATUS rpccli_netr_NETRLOGONDUMMYROUTINE1(struct rpc_pipe_client *cli, } /* Return variables */ + *return_authenticator = *r.out.return_authenticator; + *capabilities = *r.out.capabilities; /* Return result */ - if (werror) { - *werror = r.out.result; - } - - return werror_to_ntstatus(r.out.result); + return r.out.result; } NTSTATUS rpccli_netr_NETRLOGONSETSERVICEBITS(struct rpc_pipe_client *cli, diff --git a/source/librpc/gen_ndr/cli_netlogon.h b/source/librpc/gen_ndr/cli_netlogon.h index 8a6013e9f5b..1d0df0b74d4 100644 --- a/source/librpc/gen_ndr/cli_netlogon.h +++ b/source/librpc/gen_ndr/cli_netlogon.h @@ -183,9 +183,14 @@ NTSTATUS rpccli_netr_DsRGetDCName(struct rpc_pipe_client *cli, uint32_t flags /* [in] */, struct netr_DsRGetDCNameInfo **info /* [out] [ref] */, WERROR *werror); -NTSTATUS rpccli_netr_NETRLOGONDUMMYROUTINE1(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - WERROR *werror); +NTSTATUS rpccli_netr_LogonGetCapabilities(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *server_name /* [in] [charset(UTF16)] */, + const char *computer_name /* [in] [unique,charset(UTF16)] */, + struct netr_Authenticator *credential /* [in] [ref] */, + struct netr_Authenticator *return_authenticator /* [in,out] [ref] */, + uint32_t query_level /* [in] */, + union netr_Capabilities *capabilities /* [out] [ref,switch_is(query_level)] */); NTSTATUS rpccli_netr_NETRLOGONSETSERVICEBITS(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, WERROR *werror); diff --git a/source/librpc/gen_ndr/ndr_netlogon.c b/source/librpc/gen_ndr/ndr_netlogon.c index b7f12ee9348..f0e739cdf01 100644 --- a/source/librpc/gen_ndr/ndr_netlogon.c +++ b/source/librpc/gen_ndr/ndr_netlogon.c @@ -6551,6 +6551,79 @@ _PUBLIC_ void ndr_print_netr_DsRGetDCNameInfo(struct ndr_print *ndr, const char ndr->depth--; } +static enum ndr_err_code ndr_push_netr_Capabilities(struct ndr_push *ndr, int ndr_flags, const union netr_Capabilities *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_netr_NegotiateFlags(ndr, NDR_SCALARS, r->server_capabilities)); + 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_netr_Capabilities(struct ndr_pull *ndr, int ndr_flags, union netr_Capabilities *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_netr_NegotiateFlags(ndr, NDR_SCALARS, &r->server_capabilities)); + 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_netr_Capabilities(struct ndr_print *ndr, const char *name, const union netr_Capabilities *r) +{ + int level; + level = ndr_print_get_switch_value(ndr, r); + ndr_print_union(ndr, name, level, "netr_Capabilities"); + switch (level) { + case 1: + ndr_print_netr_NegotiateFlags(ndr, "server_capabilities", r->server_capabilities); + break; + + default: + ndr_print_bad_level(ndr, name, level); + } +} + 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; @@ -11493,42 +11566,162 @@ _PUBLIC_ void ndr_print_netr_DsRGetDCName(struct ndr_print *ndr, const char *nam ndr->depth--; } -static enum ndr_err_code ndr_push_netr_NETRLOGONDUMMYROUTINE1(struct ndr_push *ndr, int flags, const struct netr_NETRLOGONDUMMYROUTINE1 *r) +static enum ndr_err_code ndr_push_netr_LogonGetCapabilities(struct ndr_push *ndr, int flags, const struct netr_LogonGetCapabilities *r) { if (flags & NDR_IN) { + 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.computer_name)); + if (r->in.computer_name) { + 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 (r->in.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->in.return_authenticator)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.query_level)); } 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.capabilities == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_set_switch_value(ndr, r->out.capabilities, r->in.query_level)); + NDR_CHECK(ndr_push_netr_Capabilities(ndr, NDR_SCALARS, r->out.capabilities)); + NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result)); } return NDR_ERR_SUCCESS; } -static enum ndr_err_code ndr_pull_netr_NETRLOGONDUMMYROUTINE1(struct ndr_pull *ndr, int flags, struct netr_NETRLOGONDUMMYROUTINE1 *r) +static enum ndr_err_code ndr_pull_netr_LogonGetCapabilities(struct ndr_pull *ndr, int flags, struct netr_LogonGetCapabilities *r) { + uint32_t _ptr_computer_name; + TALLOC_CTX *_mem_save_computer_name_0; + TALLOC_CTX *_mem_save_credential_0; + TALLOC_CTX *_mem_save_return_authenticator_0; + TALLOC_CTX *_mem_save_capabilities_0; if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + 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_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_computer_name)); + if (_ptr_computer_name) { + NDR_PULL_ALLOC(ndr, r->in.computer_name); + } else { + r->in.computer_name = NULL; + } + if (r->in.computer_name) { + _mem_save_computer_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.computer_name, 0); + 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)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_computer_name_0, 0); + } + 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); + } + _mem_save_return_authenticator_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.return_authenticator, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_netr_Authenticator(ndr, NDR_SCALARS, r->in.return_authenticator)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_return_authenticator_0, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.query_level)); + NDR_PULL_ALLOC(ndr, r->out.return_authenticator); + *r->out.return_authenticator = *r->in.return_authenticator; + NDR_PULL_ALLOC(ndr, r->out.capabilities); + ZERO_STRUCTP(r->out.capabilities); } 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.capabilities); + } + _mem_save_capabilities_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.capabilities, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_set_switch_value(ndr, r->out.capabilities, r->in.query_level)); + NDR_CHECK(ndr_pull_netr_Capabilities(ndr, NDR_SCALARS, r->out.capabilities)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_capabilities_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_NETRLOGONDUMMYROUTINE1(struct ndr_print *ndr, const char *name, int flags, const struct netr_NETRLOGONDUMMYROUTINE1 *r) +_PUBLIC_ void ndr_print_netr_LogonGetCapabilities(struct ndr_print *ndr, const char *name, int flags, const struct netr_LogonGetCapabilities *r) { - ndr_print_struct(ndr, name, "netr_NETRLOGONDUMMYROUTINE1"); + ndr_print_struct(ndr, name, "netr_LogonGetCapabilities"); ndr->depth++; if (flags & NDR_SET_VALUES) { ndr->flags |= LIBNDR_PRINT_SET_VALUES; } if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "netr_NETRLOGONDUMMYROUTINE1"); + ndr_print_struct(ndr, "in", "netr_LogonGetCapabilities"); ndr->depth++; + ndr_print_string(ndr, "server_name", r->in.server_name); + ndr_print_ptr(ndr, "computer_name", r->in.computer_name); + ndr->depth++; + if (r->in.computer_name) { + ndr_print_string(ndr, "computer_name", r->in.computer_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_ptr(ndr, "return_authenticator", r->in.return_authenticator); + ndr->depth++; + ndr_print_netr_Authenticator(ndr, "return_authenticator", r->in.return_authenticator); + ndr->depth--; + ndr_print_uint32(ndr, "query_level", r->in.query_level); ndr->depth--; } if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "netr_NETRLOGONDUMMYROUTINE1"); + ndr_print_struct(ndr, "out", "netr_LogonGetCapabilities"); 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, "capabilities", r->out.capabilities); + ndr->depth++; + ndr_print_set_switch_value(ndr, r->out.capabilities, r->in.query_level); + ndr_print_netr_Capabilities(ndr, "capabilities", r->out.capabilities); + ndr->depth--; + ndr_print_NTSTATUS(ndr, "result", r->out.result); ndr->depth--; } ndr->depth--; @@ -15064,11 +15257,11 @@ static const struct ndr_interface_call netlogon_calls[] = { false, }, { - "netr_NETRLOGONDUMMYROUTINE1", - sizeof(struct netr_NETRLOGONDUMMYROUTINE1), - (ndr_push_flags_fn_t) ndr_push_netr_NETRLOGONDUMMYROUTINE1, - (ndr_pull_flags_fn_t) ndr_pull_netr_NETRLOGONDUMMYROUTINE1, - (ndr_print_function_t) ndr_print_netr_NETRLOGONDUMMYROUTINE1, + "netr_LogonGetCapabilities", + sizeof(struct netr_LogonGetCapabilities), + (ndr_push_flags_fn_t) ndr_push_netr_LogonGetCapabilities, + (ndr_pull_flags_fn_t) ndr_pull_netr_LogonGetCapabilities, + (ndr_print_function_t) ndr_print_netr_LogonGetCapabilities, false, }, { diff --git a/source/librpc/gen_ndr/ndr_netlogon.h b/source/librpc/gen_ndr/ndr_netlogon.h index 4a9c48c805d..8f6467dc92b 100644 --- a/source/librpc/gen_ndr/ndr_netlogon.h +++ b/source/librpc/gen_ndr/ndr_netlogon.h @@ -54,7 +54,7 @@ extern const struct ndr_interface_table ndr_table_netlogon; #define NDR_NETR_DSRGETDCNAME (0x14) -#define NDR_NETR_NETRLOGONDUMMYROUTINE1 (0x15) +#define NDR_NETR_LOGONGETCAPABILITIES (0x15) #define NDR_NETR_NETRLOGONSETSERVICEBITS (0x16) @@ -202,6 +202,7 @@ void ndr_print_netr_DsR_DcFlags(struct ndr_print *ndr, const char *name, uint32_ enum ndr_err_code ndr_push_netr_DsRGetDCNameInfo(struct ndr_push *ndr, int ndr_flags, const struct netr_DsRGetDCNameInfo *r); enum ndr_err_code ndr_pull_netr_DsRGetDCNameInfo(struct ndr_pull *ndr, int ndr_flags, struct netr_DsRGetDCNameInfo *r); void ndr_print_netr_DsRGetDCNameInfo(struct ndr_print *ndr, const char *name, const struct netr_DsRGetDCNameInfo *r); +void ndr_print_netr_Capabilities(struct ndr_print *ndr, const char *name, const union netr_Capabilities *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); @@ -239,7 +240,7 @@ void ndr_print_netr_DatabaseRedo(struct ndr_print *ndr, const char *name, int fl 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_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_LogonGetCapabilities(struct ndr_print *ndr, const char *name, int flags, const struct netr_LogonGetCapabilities *r); void ndr_print_netr_NETRLOGONSETSERVICEBITS(struct ndr_print *ndr, const char *name, int flags, const struct netr_NETRLOGONSETSERVICEBITS *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); diff --git a/source/librpc/gen_ndr/netlogon.h b/source/librpc/gen_ndr/netlogon.h index b86533d132c..3db207f8bbb 100644 --- a/source/librpc/gen_ndr/netlogon.h +++ b/source/librpc/gen_ndr/netlogon.h @@ -761,6 +761,10 @@ struct netr_DsRGetDCNameInfo { const char *client_site_name;/* [unique,charset(UTF16)] */ }/* [public] */; +union netr_Capabilities { + uint32_t server_capabilities;/* [case] */ +}/* [switch_type(uint32)] */; + struct netr_BinaryString { uint16_t length; uint16_t size; @@ -1259,9 +1263,19 @@ struct netr_DsRGetDCName { }; -struct netr_NETRLOGONDUMMYROUTINE1 { +struct netr_LogonGetCapabilities { struct { - WERROR result; + const char *server_name;/* [charset(UTF16)] */ + const char *computer_name;/* [unique,charset(UTF16)] */ + struct netr_Authenticator *credential;/* [ref] */ + uint32_t query_level; + struct netr_Authenticator *return_authenticator;/* [ref] */ + } in; + + struct { + union netr_Capabilities *capabilities;/* [ref,switch_is(query_level)] */ + struct netr_Authenticator *return_authenticator;/* [ref] */ + NTSTATUS result; } out; }; diff --git a/source/librpc/gen_ndr/srv_netlogon.c b/source/librpc/gen_ndr/srv_netlogon.c index ae3ea0795b8..a70de99625f 100644 --- a/source/librpc/gen_ndr/srv_netlogon.c +++ b/source/librpc/gen_ndr/srv_netlogon.c @@ -1735,18 +1735,18 @@ static bool api_netr_DsRGetDCName(pipes_struct *p) return true; } -static bool api_netr_NETRLOGONDUMMYROUTINE1(pipes_struct *p) +static bool api_netr_LogonGetCapabilities(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_NETRLOGONDUMMYROUTINE1 *r; + struct netr_LogonGetCapabilities *r; - call = &ndr_table_netlogon.calls[NDR_NETR_NETRLOGONDUMMYROUTINE1]; + call = &ndr_table_netlogon.calls[NDR_NETR_LOGONGETCAPABILITIES]; - r = talloc(talloc_tos(), struct netr_NETRLOGONDUMMYROUTINE1); + r = talloc(talloc_tos(), struct netr_LogonGetCapabilities); if (r == NULL) { return false; } @@ -1770,10 +1770,18 @@ static bool api_netr_NETRLOGONDUMMYROUTINE1(pipes_struct *p) } if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(netr_NETRLOGONDUMMYROUTINE1, r); + NDR_PRINT_IN_DEBUG(netr_LogonGetCapabilities, r); } - r->out.result = _netr_NETRLOGONDUMMYROUTINE1(p, r); + ZERO_STRUCT(r->out); + r->out.return_authenticator = r->in.return_authenticator; + r->out.capabilities = talloc_zero(r, union netr_Capabilities); + if (r->out.capabilities == NULL) { + talloc_free(r); + return false; + } + + r->out.result = _netr_LogonGetCapabilities(p, r); if (p->rng_fault_state) { talloc_free(r); @@ -1782,7 +1790,7 @@ static bool api_netr_NETRLOGONDUMMYROUTINE1(pipes_struct *p) } if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(netr_NETRLOGONDUMMYROUTINE1, r); + NDR_PRINT_OUT_DEBUG(netr_LogonGetCapabilities, r); } push = ndr_push_init_ctx(r); @@ -3826,7 +3834,7 @@ static struct api_struct api_netlogon_cmds[] = {"NETR_LOGONCONTROL2EX", NDR_NETR_LOGONCONTROL2EX, api_netr_LogonControl2Ex}, {"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_LOGONGETCAPABILITIES", NDR_NETR_LOGONGETCAPABILITIES, api_netr_LogonGetCapabilities}, {"NETR_NETRLOGONSETSERVICEBITS", NDR_NETR_NETRLOGONSETSERVICEBITS, api_netr_NETRLOGONSETSERVICEBITS}, {"NETR_LOGONGETTRUSTRID", NDR_NETR_LOGONGETTRUSTRID, api_netr_LogonGetTrustRid}, {"NETR_NETRLOGONCOMPUTESERVERDIGEST", NDR_NETR_NETRLOGONCOMPUTESERVERDIGEST, api_netr_NETRLOGONCOMPUTESERVERDIGEST}, diff --git a/source/librpc/gen_ndr/srv_netlogon.h b/source/librpc/gen_ndr/srv_netlogon.h index 1fe16c603be..d1cf1867ec2 100644 --- a/source/librpc/gen_ndr/srv_netlogon.h +++ b/source/librpc/gen_ndr/srv_netlogon.h @@ -22,7 +22,7 @@ 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_DsRGetDCName(pipes_struct *p, struct netr_DsRGetDCName *r); -WERROR _netr_NETRLOGONDUMMYROUTINE1(pipes_struct *p, struct netr_NETRLOGONDUMMYROUTINE1 *r); +NTSTATUS _netr_LogonGetCapabilities(pipes_struct *p, struct netr_LogonGetCapabilities *r); WERROR _netr_NETRLOGONSETSERVICEBITS(pipes_struct *p, struct netr_NETRLOGONSETSERVICEBITS *r); WERROR _netr_LogonGetTrustRid(pipes_struct *p, struct netr_LogonGetTrustRid *r); WERROR _netr_NETRLOGONCOMPUTESERVERDIGEST(pipes_struct *p, struct netr_NETRLOGONCOMPUTESERVERDIGEST *r); -- cgit v1.2.1