2 * Unix SMB/CIFS implementation.
3 * server auto-generated by pidl. DO NOT MODIFY!
7 #include "librpc/gen_ndr/srv_unixinfo.h"
9 static BOOL
api_unixinfo_SidToUid(pipes_struct
*p
)
11 struct ndr_pull
*pull
;
12 struct ndr_push
*push
;
15 struct unixinfo_SidToUid r
;
16 TALLOC_CTX
*mem_ctx
= talloc_init("api_unixinfo_SidToUid");
18 if (!prs_data_blob(&p
->in_data
.data
, &blob
, mem_ctx
)) {
23 pull
= ndr_pull_init_blob(&blob
, mem_ctx
);
27 pull
->flags
|= LIBNDR_FLAG_REF_ALLOC
;
28 status
= ndr_pull_unixinfo_SidToUid(pull
, NDR_IN
, &r
);
29 if (NT_STATUS_IS_ERR(status
)) {
35 NDR_PRINT_IN_DEBUG(unixinfo_SidToUid
, &r
);
38 r
.out
.uid
= talloc_size(mem_ctx
, sizeof(*r
.out
.uid
));
39 if (r
.out
.uid
== NULL
) {
44 r
.out
.result
= _unixinfo_SidToUid(p
, r
.in
.sid
, r
.out
.uid
);
47 NDR_PRINT_OUT_DEBUG(unixinfo_SidToUid
, &r
);
49 push
= ndr_push_init_ctx(mem_ctx
);
55 status
= ndr_push_unixinfo_SidToUid(push
, NDR_OUT
, &r
);
56 if (NT_STATUS_IS_ERR(status
)) {
61 blob
= ndr_push_blob(push
);
62 if (!prs_init_data_blob(&p
->out_data
.rdata
, &blob
, p
->mem_ctx
)) {
72 static BOOL
api_unixinfo_UidToSid(pipes_struct
*p
)
74 struct ndr_pull
*pull
;
75 struct ndr_push
*push
;
78 struct unixinfo_UidToSid r
;
79 TALLOC_CTX
*mem_ctx
= talloc_init("api_unixinfo_UidToSid");
81 if (!prs_data_blob(&p
->in_data
.data
, &blob
, mem_ctx
)) {
86 pull
= ndr_pull_init_blob(&blob
, mem_ctx
);
90 pull
->flags
|= LIBNDR_FLAG_REF_ALLOC
;
91 status
= ndr_pull_unixinfo_UidToSid(pull
, NDR_IN
, &r
);
92 if (NT_STATUS_IS_ERR(status
)) {
98 NDR_PRINT_IN_DEBUG(unixinfo_UidToSid
, &r
);
101 r
.out
.sid
= talloc_size(mem_ctx
, sizeof(*r
.out
.sid
));
102 if (r
.out
.sid
== NULL
) {
103 talloc_free(mem_ctx
);
107 r
.out
.result
= _unixinfo_UidToSid(p
, r
.in
.uid
, r
.out
.sid
);
109 if (DEBUGLEVEL
>= 10)
110 NDR_PRINT_OUT_DEBUG(unixinfo_UidToSid
, &r
);
112 push
= ndr_push_init_ctx(mem_ctx
);
114 talloc_free(mem_ctx
);
118 status
= ndr_push_unixinfo_UidToSid(push
, NDR_OUT
, &r
);
119 if (NT_STATUS_IS_ERR(status
)) {
120 talloc_free(mem_ctx
);
124 blob
= ndr_push_blob(push
);
125 if (!prs_init_data_blob(&p
->out_data
.rdata
, &blob
, p
->mem_ctx
)) {
126 talloc_free(mem_ctx
);
130 talloc_free(mem_ctx
);
135 static BOOL
api_unixinfo_SidToGid(pipes_struct
*p
)
137 struct ndr_pull
*pull
;
138 struct ndr_push
*push
;
141 struct unixinfo_SidToGid r
;
142 TALLOC_CTX
*mem_ctx
= talloc_init("api_unixinfo_SidToGid");
144 if (!prs_data_blob(&p
->in_data
.data
, &blob
, mem_ctx
)) {
145 talloc_free(mem_ctx
);
149 pull
= ndr_pull_init_blob(&blob
, mem_ctx
);
153 pull
->flags
|= LIBNDR_FLAG_REF_ALLOC
;
154 status
= ndr_pull_unixinfo_SidToGid(pull
, NDR_IN
, &r
);
155 if (NT_STATUS_IS_ERR(status
)) {
156 talloc_free(mem_ctx
);
160 if (DEBUGLEVEL
>= 10)
161 NDR_PRINT_IN_DEBUG(unixinfo_SidToGid
, &r
);
164 r
.out
.gid
= talloc_size(mem_ctx
, sizeof(*r
.out
.gid
));
165 if (r
.out
.gid
== NULL
) {
166 talloc_free(mem_ctx
);
170 r
.out
.result
= _unixinfo_SidToGid(p
, r
.in
.sid
, r
.out
.gid
);
172 if (DEBUGLEVEL
>= 10)
173 NDR_PRINT_OUT_DEBUG(unixinfo_SidToGid
, &r
);
175 push
= ndr_push_init_ctx(mem_ctx
);
177 talloc_free(mem_ctx
);
181 status
= ndr_push_unixinfo_SidToGid(push
, NDR_OUT
, &r
);
182 if (NT_STATUS_IS_ERR(status
)) {
183 talloc_free(mem_ctx
);
187 blob
= ndr_push_blob(push
);
188 if (!prs_init_data_blob(&p
->out_data
.rdata
, &blob
, p
->mem_ctx
)) {
189 talloc_free(mem_ctx
);
193 talloc_free(mem_ctx
);
198 static BOOL
api_unixinfo_GidToSid(pipes_struct
*p
)
200 struct ndr_pull
*pull
;
201 struct ndr_push
*push
;
204 struct unixinfo_GidToSid r
;
205 TALLOC_CTX
*mem_ctx
= talloc_init("api_unixinfo_GidToSid");
207 if (!prs_data_blob(&p
->in_data
.data
, &blob
, mem_ctx
)) {
208 talloc_free(mem_ctx
);
212 pull
= ndr_pull_init_blob(&blob
, mem_ctx
);
216 pull
->flags
|= LIBNDR_FLAG_REF_ALLOC
;
217 status
= ndr_pull_unixinfo_GidToSid(pull
, NDR_IN
, &r
);
218 if (NT_STATUS_IS_ERR(status
)) {
219 talloc_free(mem_ctx
);
223 if (DEBUGLEVEL
>= 10)
224 NDR_PRINT_IN_DEBUG(unixinfo_GidToSid
, &r
);
227 r
.out
.sid
= talloc_size(mem_ctx
, sizeof(*r
.out
.sid
));
228 if (r
.out
.sid
== NULL
) {
229 talloc_free(mem_ctx
);
233 r
.out
.result
= _unixinfo_GidToSid(p
, r
.in
.gid
, r
.out
.sid
);
235 if (DEBUGLEVEL
>= 10)
236 NDR_PRINT_OUT_DEBUG(unixinfo_GidToSid
, &r
);
238 push
= ndr_push_init_ctx(mem_ctx
);
240 talloc_free(mem_ctx
);
244 status
= ndr_push_unixinfo_GidToSid(push
, NDR_OUT
, &r
);
245 if (NT_STATUS_IS_ERR(status
)) {
246 talloc_free(mem_ctx
);
250 blob
= ndr_push_blob(push
);
251 if (!prs_init_data_blob(&p
->out_data
.rdata
, &blob
, p
->mem_ctx
)) {
252 talloc_free(mem_ctx
);
256 talloc_free(mem_ctx
);
261 static BOOL
api_unixinfo_GetPWUid(pipes_struct
*p
)
263 struct ndr_pull
*pull
;
264 struct ndr_push
*push
;
267 struct unixinfo_GetPWUid r
;
268 TALLOC_CTX
*mem_ctx
= talloc_init("api_unixinfo_GetPWUid");
270 if (!prs_data_blob(&p
->in_data
.data
, &blob
, mem_ctx
)) {
271 talloc_free(mem_ctx
);
275 pull
= ndr_pull_init_blob(&blob
, mem_ctx
);
279 pull
->flags
|= LIBNDR_FLAG_REF_ALLOC
;
280 status
= ndr_pull_unixinfo_GetPWUid(pull
, NDR_IN
, &r
);
281 if (NT_STATUS_IS_ERR(status
)) {
282 talloc_free(mem_ctx
);
286 if (DEBUGLEVEL
>= 10)
287 NDR_PRINT_IN_DEBUG(unixinfo_GetPWUid
, &r
);
290 r
.out
.count
= r
.in
.count
;
291 r
.out
.infos
= talloc_array_size(mem_ctx
, sizeof(*r
.out
.infos
), *r
.in
.count
);
292 if (r
.out
.infos
== NULL
) {
293 talloc_free(mem_ctx
);
297 r
.out
.result
= _unixinfo_GetPWUid(p
, r
.in
.count
, r
.in
.uids
, r
.out
.infos
);
299 if (DEBUGLEVEL
>= 10)
300 NDR_PRINT_OUT_DEBUG(unixinfo_GetPWUid
, &r
);
302 push
= ndr_push_init_ctx(mem_ctx
);
304 talloc_free(mem_ctx
);
308 status
= ndr_push_unixinfo_GetPWUid(push
, NDR_OUT
, &r
);
309 if (NT_STATUS_IS_ERR(status
)) {
310 talloc_free(mem_ctx
);
314 blob
= ndr_push_blob(push
);
315 if (!prs_init_data_blob(&p
->out_data
.rdata
, &blob
, p
->mem_ctx
)) {
316 talloc_free(mem_ctx
);
320 talloc_free(mem_ctx
);
327 static struct api_struct api_unixinfo_cmds
[] =
329 {"UNIXINFO_SIDTOUID", DCERPC_UNIXINFO_SIDTOUID
, api_unixinfo_SidToUid
},
330 {"UNIXINFO_UIDTOSID", DCERPC_UNIXINFO_UIDTOSID
, api_unixinfo_UidToSid
},
331 {"UNIXINFO_SIDTOGID", DCERPC_UNIXINFO_SIDTOGID
, api_unixinfo_SidToGid
},
332 {"UNIXINFO_GIDTOSID", DCERPC_UNIXINFO_GIDTOSID
, api_unixinfo_GidToSid
},
333 {"UNIXINFO_GETPWUID", DCERPC_UNIXINFO_GETPWUID
, api_unixinfo_GetPWUid
},
336 void unixinfo_get_pipe_fns(struct api_struct
**fns
, int *n_fns
)
338 *fns
= api_unixinfo_cmds
;
339 *n_fns
= sizeof(api_unixinfo_cmds
) / sizeof(struct api_struct
);
342 NTSTATUS
rpc_unixinfo_init(void)
344 return rpc_pipe_register_commands(SMB_RPC_INTERFACE_VERSION
, "unixinfo", "unixinfo", api_unixinfo_cmds
, sizeof(api_unixinfo_cmds
) / sizeof(struct api_struct
));