summaryrefslogtreecommitdiff
path: root/librpc/gen_ndr/cli_initshutdown.c
blob: bc8ca5b5f128cf64782eabdfb5c5a6bbaf487fb6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
/*
 * Unix SMB/CIFS implementation.
 * client auto-generated by pidl. DO NOT MODIFY!
 */

#include "includes.h"
#include "librpc/gen_ndr/cli_initshutdown.h"

NTSTATUS rpccli_initshutdown_Init(struct rpc_pipe_client *cli,
				  TALLOC_CTX *mem_ctx,
				  uint16_t *hostname /* [in] [unique] */,
				  struct lsa_StringLarge *message /* [in] [unique] */,
				  uint32_t timeout /* [in]  */,
				  uint8_t force_apps /* [in]  */,
				  uint8_t do_reboot /* [in]  */,
				  WERROR *werror)
{
	struct initshutdown_Init r;
	NTSTATUS status;

	/* In parameters */
	r.in.hostname = hostname;
	r.in.message = message;
	r.in.timeout = timeout;
	r.in.force_apps = force_apps;
	r.in.do_reboot = do_reboot;

	if (DEBUGLEVEL >= 10) {
		NDR_PRINT_IN_DEBUG(initshutdown_Init, &r);
	}

	status = cli_do_rpc_ndr(cli,
				mem_ctx,
				&ndr_table_initshutdown,
				NDR_INITSHUTDOWN_INIT,
				&r);

	if (!NT_STATUS_IS_OK(status)) {
		return status;
	}

	if (DEBUGLEVEL >= 10) {
		NDR_PRINT_OUT_DEBUG(initshutdown_Init, &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_initshutdown_Abort(struct rpc_pipe_client *cli,
				   TALLOC_CTX *mem_ctx,
				   uint16_t *server /* [in] [unique] */,
				   WERROR *werror)
{
	struct initshutdown_Abort r;
	NTSTATUS status;

	/* In parameters */
	r.in.server = server;

	if (DEBUGLEVEL >= 10) {
		NDR_PRINT_IN_DEBUG(initshutdown_Abort, &r);
	}

	status = cli_do_rpc_ndr(cli,
				mem_ctx,
				&ndr_table_initshutdown,
				NDR_INITSHUTDOWN_ABORT,
				&r);

	if (!NT_STATUS_IS_OK(status)) {
		return status;
	}

	if (DEBUGLEVEL >= 10) {
		NDR_PRINT_OUT_DEBUG(initshutdown_Abort, &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_initshutdown_InitEx(struct rpc_pipe_client *cli,
				    TALLOC_CTX *mem_ctx,
				    uint16_t *hostname /* [in] [unique] */,
				    struct lsa_StringLarge *message /* [in] [unique] */,
				    uint32_t timeout /* [in]  */,
				    uint8_t force_apps /* [in]  */,
				    uint8_t do_reboot /* [in]  */,
				    uint32_t reason /* [in]  */,
				    WERROR *werror)
{
	struct initshutdown_InitEx r;
	NTSTATUS status;

	/* In parameters */
	r.in.hostname = hostname;
	r.in.message = message;
	r.in.timeout = timeout;
	r.in.force_apps = force_apps;
	r.in.do_reboot = do_reboot;
	r.in.reason = reason;

	if (DEBUGLEVEL >= 10) {
		NDR_PRINT_IN_DEBUG(initshutdown_InitEx, &r);
	}

	status = cli_do_rpc_ndr(cli,
				mem_ctx,
				&ndr_table_initshutdown,
				NDR_INITSHUTDOWN_INITEX,
				&r);

	if (!NT_STATUS_IS_OK(status)) {
		return status;
	}

	if (DEBUGLEVEL >= 10) {
		NDR_PRINT_OUT_DEBUG(initshutdown_InitEx, &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);
}