/* GetDCName */
-NTSTATUS rpccli_netlogon_getdcname(struct rpc_pipe_client *cli,
- TALLOC_CTX *mem_ctx, const char *mydcname,
- const char *domainname, fstring newdcname)
+WERROR rpccli_netlogon_getdcname(struct rpc_pipe_client *cli,
+ TALLOC_CTX *mem_ctx, const char *mydcname,
+ const char *domainname, fstring newdcname)
{
prs_struct qbuf, rbuf;
NET_Q_GETDCNAME q;
NET_R_GETDCNAME r;
- NTSTATUS result;
+ WERROR result;
fstring mydcname_slash;
ZERO_STRUCT(q);
/* Marshall data and send request */
- CLI_DO_RPC(cli, mem_ctx, PI_NETLOGON, NET_GETDCNAME,
+ CLI_DO_RPC_WERR(cli, mem_ctx, PI_NETLOGON, NET_GETDCNAME,
q, r,
qbuf, rbuf,
net_io_q_getdcname,
net_io_r_getdcname,
- NT_STATUS_UNSUCCESSFUL);
+ WERR_GENERAL_FAILURE);
result = r.status;
- if (NT_STATUS_IS_OK(result)) {
+ if (W_ERROR_IS_OK(result)) {
rpcstr_pull_unistr2_fstring(newdcname, &r.uni_dcname);
}
return result;
}
-static NTSTATUS cmd_netlogon_getdcname(struct rpc_pipe_client *cli,
- TALLOC_CTX *mem_ctx, int argc,
- const char **argv)
+static WERROR cmd_netlogon_getdcname(struct rpc_pipe_client *cli,
+ TALLOC_CTX *mem_ctx, int argc,
+ const char **argv)
{
fstring dcname;
- NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
+ WERROR result = WERR_GENERAL_FAILURE;
int old_timeout;
if (argc != 2) {
fprintf(stderr, "Usage: %s domainname\n", argv[0]);
- return NT_STATUS_OK;
+ return WERR_OK;
}
/* Make sure to wait for our DC's reply */
cli_set_timeout(cli->cli, old_timeout);
- if (!NT_STATUS_IS_OK(result))
+ if (!W_ERROR_IS_OK(result))
goto done;
/* Display results */
{ "logonctrl2", RPC_RTYPE_NTSTATUS, cmd_netlogon_logon_ctrl2, NULL, PI_NETLOGON, NULL, "Logon Control 2", "" },
{ "getanydcname", RPC_RTYPE_WERROR, NULL, cmd_netlogon_getanydcname, PI_NETLOGON, NULL, "Get trusted DC name", "" },
- { "getdcname", RPC_RTYPE_NTSTATUS, cmd_netlogon_getdcname, NULL, PI_NETLOGON, NULL, "Get trusted PDC name", "" },
+ { "getdcname", RPC_RTYPE_WERROR, NULL, cmd_netlogon_getdcname, PI_NETLOGON, NULL, "Get trusted PDC name", "" },
{ "dsr_getdcname", RPC_RTYPE_WERROR, NULL, cmd_netlogon_dsr_getdcname, PI_NETLOGON, NULL, "Get trusted DC name", "" },
{ "dsr_getdcnameex", RPC_RTYPE_WERROR, NULL, cmd_netlogon_dsr_getdcnameex, PI_NETLOGON, NULL, "Get trusted DC name", "" },
{ "dsr_getdcnameex2", RPC_RTYPE_WERROR, NULL, cmd_netlogon_dsr_getdcnameex2, PI_NETLOGON, NULL, "Get trusted DC name", "" },