Add my copyright.
[Samba.git] / source / librpc / gen_ndr / cli_unixinfo.c
blobc8a6c926ef2480cfb732ed7b1f81705e452fbef2
1 /*
2 * Unix SMB/CIFS implementation.
3 * client auto-generated by pidl. DO NOT MODIFY!
4 */
6 #include "includes.h"
7 #include "librpc/gen_ndr/cli_unixinfo.h"
9 NTSTATUS rpccli_unixinfo_SidToUid(struct rpc_pipe_client *cli,
10 TALLOC_CTX *mem_ctx,
11 struct dom_sid sid,
12 uint64_t *uid)
14 struct unixinfo_SidToUid r;
15 NTSTATUS status;
17 /* In parameters */
18 r.in.sid = sid;
20 if (DEBUGLEVEL >= 10) {
21 NDR_PRINT_IN_DEBUG(unixinfo_SidToUid, &r);
24 status = cli_do_rpc_ndr(cli,
25 mem_ctx,
26 PI_UNIXINFO,
27 &ndr_table_unixinfo,
28 NDR_UNIXINFO_SIDTOUID,
29 &r);
31 if (!NT_STATUS_IS_OK(status)) {
32 return status;
35 if (DEBUGLEVEL >= 10) {
36 NDR_PRINT_OUT_DEBUG(unixinfo_SidToUid, &r);
39 if (NT_STATUS_IS_ERR(status)) {
40 return status;
43 /* Return variables */
44 *uid = *r.out.uid;
46 /* Return result */
47 return r.out.result;
50 NTSTATUS rpccli_unixinfo_UidToSid(struct rpc_pipe_client *cli,
51 TALLOC_CTX *mem_ctx,
52 uint64_t uid,
53 struct dom_sid *sid)
55 struct unixinfo_UidToSid r;
56 NTSTATUS status;
58 /* In parameters */
59 r.in.uid = uid;
61 if (DEBUGLEVEL >= 10) {
62 NDR_PRINT_IN_DEBUG(unixinfo_UidToSid, &r);
65 status = cli_do_rpc_ndr(cli,
66 mem_ctx,
67 PI_UNIXINFO,
68 &ndr_table_unixinfo,
69 NDR_UNIXINFO_UIDTOSID,
70 &r);
72 if (!NT_STATUS_IS_OK(status)) {
73 return status;
76 if (DEBUGLEVEL >= 10) {
77 NDR_PRINT_OUT_DEBUG(unixinfo_UidToSid, &r);
80 if (NT_STATUS_IS_ERR(status)) {
81 return status;
84 /* Return variables */
85 *sid = *r.out.sid;
87 /* Return result */
88 return r.out.result;
91 NTSTATUS rpccli_unixinfo_SidToGid(struct rpc_pipe_client *cli,
92 TALLOC_CTX *mem_ctx,
93 struct dom_sid sid,
94 uint64_t *gid)
96 struct unixinfo_SidToGid r;
97 NTSTATUS status;
99 /* In parameters */
100 r.in.sid = sid;
102 if (DEBUGLEVEL >= 10) {
103 NDR_PRINT_IN_DEBUG(unixinfo_SidToGid, &r);
106 status = cli_do_rpc_ndr(cli,
107 mem_ctx,
108 PI_UNIXINFO,
109 &ndr_table_unixinfo,
110 NDR_UNIXINFO_SIDTOGID,
111 &r);
113 if (!NT_STATUS_IS_OK(status)) {
114 return status;
117 if (DEBUGLEVEL >= 10) {
118 NDR_PRINT_OUT_DEBUG(unixinfo_SidToGid, &r);
121 if (NT_STATUS_IS_ERR(status)) {
122 return status;
125 /* Return variables */
126 *gid = *r.out.gid;
128 /* Return result */
129 return r.out.result;
132 NTSTATUS rpccli_unixinfo_GidToSid(struct rpc_pipe_client *cli,
133 TALLOC_CTX *mem_ctx,
134 uint64_t gid,
135 struct dom_sid *sid)
137 struct unixinfo_GidToSid r;
138 NTSTATUS status;
140 /* In parameters */
141 r.in.gid = gid;
143 if (DEBUGLEVEL >= 10) {
144 NDR_PRINT_IN_DEBUG(unixinfo_GidToSid, &r);
147 status = cli_do_rpc_ndr(cli,
148 mem_ctx,
149 PI_UNIXINFO,
150 &ndr_table_unixinfo,
151 NDR_UNIXINFO_GIDTOSID,
152 &r);
154 if (!NT_STATUS_IS_OK(status)) {
155 return status;
158 if (DEBUGLEVEL >= 10) {
159 NDR_PRINT_OUT_DEBUG(unixinfo_GidToSid, &r);
162 if (NT_STATUS_IS_ERR(status)) {
163 return status;
166 /* Return variables */
167 *sid = *r.out.sid;
169 /* Return result */
170 return r.out.result;
173 NTSTATUS rpccli_unixinfo_GetPWUid(struct rpc_pipe_client *cli,
174 TALLOC_CTX *mem_ctx,
175 uint32_t *count,
176 uint64_t *uids,
177 struct unixinfo_GetPWUidInfo *infos)
179 struct unixinfo_GetPWUid r;
180 NTSTATUS status;
182 /* In parameters */
183 r.in.count = count;
184 r.in.uids = uids;
186 if (DEBUGLEVEL >= 10) {
187 NDR_PRINT_IN_DEBUG(unixinfo_GetPWUid, &r);
190 status = cli_do_rpc_ndr(cli,
191 mem_ctx,
192 PI_UNIXINFO,
193 &ndr_table_unixinfo,
194 NDR_UNIXINFO_GETPWUID,
195 &r);
197 if (!NT_STATUS_IS_OK(status)) {
198 return status;
201 if (DEBUGLEVEL >= 10) {
202 NDR_PRINT_OUT_DEBUG(unixinfo_GetPWUid, &r);
205 if (NT_STATUS_IS_ERR(status)) {
206 return status;
209 /* Return variables */
210 *count = *r.out.count;
211 memcpy(infos, r.out.infos, *r.in.count);
213 /* Return result */
214 return r.out.result;