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
);
29 pull
->flags
|= LIBNDR_FLAG_REF_ALLOC
;
30 status
= ndr_pull_unixinfo_SidToUid(pull
, NDR_IN
, &r
);
31 if (NT_STATUS_IS_ERR(status
)) {
37 NDR_PRINT_IN_DEBUG(unixinfo_SidToUid
, &r
);
40 r
.out
.uid
= talloc_zero(mem_ctx
, uint64_t);
41 if (r
.out
.uid
== NULL
) {
46 r
.out
.result
= _unixinfo_SidToUid(p
, &r
);
48 if (p
->rng_fault_state
) {
50 /* Return True here, srv_pipe_hnd.c will take care */
55 NDR_PRINT_OUT_DEBUG(unixinfo_SidToUid
, &r
);
57 push
= ndr_push_init_ctx(mem_ctx
);
63 status
= ndr_push_unixinfo_SidToUid(push
, NDR_OUT
, &r
);
64 if (NT_STATUS_IS_ERR(status
)) {
69 blob
= ndr_push_blob(push
);
70 if (!prs_copy_data_in(&p
->out_data
.rdata
, (const char *)blob
.data
, (uint32
)blob
.length
)) {
80 static BOOL
api_unixinfo_UidToSid(pipes_struct
*p
)
82 struct ndr_pull
*pull
;
83 struct ndr_push
*push
;
86 struct unixinfo_UidToSid r
;
87 TALLOC_CTX
*mem_ctx
= talloc_init("api_unixinfo_UidToSid");
89 if (!prs_data_blob(&p
->in_data
.data
, &blob
, mem_ctx
)) {
94 pull
= ndr_pull_init_blob(&blob
, mem_ctx
);
100 pull
->flags
|= LIBNDR_FLAG_REF_ALLOC
;
101 status
= ndr_pull_unixinfo_UidToSid(pull
, NDR_IN
, &r
);
102 if (NT_STATUS_IS_ERR(status
)) {
103 talloc_free(mem_ctx
);
107 if (DEBUGLEVEL
>= 10)
108 NDR_PRINT_IN_DEBUG(unixinfo_UidToSid
, &r
);
111 r
.out
.sid
= talloc_zero(mem_ctx
, struct dom_sid
);
112 if (r
.out
.sid
== NULL
) {
113 talloc_free(mem_ctx
);
117 r
.out
.result
= _unixinfo_UidToSid(p
, &r
);
119 if (p
->rng_fault_state
) {
120 talloc_free(mem_ctx
);
121 /* Return True here, srv_pipe_hnd.c will take care */
125 if (DEBUGLEVEL
>= 10)
126 NDR_PRINT_OUT_DEBUG(unixinfo_UidToSid
, &r
);
128 push
= ndr_push_init_ctx(mem_ctx
);
130 talloc_free(mem_ctx
);
134 status
= ndr_push_unixinfo_UidToSid(push
, NDR_OUT
, &r
);
135 if (NT_STATUS_IS_ERR(status
)) {
136 talloc_free(mem_ctx
);
140 blob
= ndr_push_blob(push
);
141 if (!prs_copy_data_in(&p
->out_data
.rdata
, (const char *)blob
.data
, (uint32
)blob
.length
)) {
142 talloc_free(mem_ctx
);
146 talloc_free(mem_ctx
);
151 static BOOL
api_unixinfo_SidToGid(pipes_struct
*p
)
153 struct ndr_pull
*pull
;
154 struct ndr_push
*push
;
157 struct unixinfo_SidToGid r
;
158 TALLOC_CTX
*mem_ctx
= talloc_init("api_unixinfo_SidToGid");
160 if (!prs_data_blob(&p
->in_data
.data
, &blob
, mem_ctx
)) {
161 talloc_free(mem_ctx
);
165 pull
= ndr_pull_init_blob(&blob
, mem_ctx
);
167 talloc_free(mem_ctx
);
171 pull
->flags
|= LIBNDR_FLAG_REF_ALLOC
;
172 status
= ndr_pull_unixinfo_SidToGid(pull
, NDR_IN
, &r
);
173 if (NT_STATUS_IS_ERR(status
)) {
174 talloc_free(mem_ctx
);
178 if (DEBUGLEVEL
>= 10)
179 NDR_PRINT_IN_DEBUG(unixinfo_SidToGid
, &r
);
182 r
.out
.gid
= talloc_zero(mem_ctx
, uint64_t);
183 if (r
.out
.gid
== NULL
) {
184 talloc_free(mem_ctx
);
188 r
.out
.result
= _unixinfo_SidToGid(p
, &r
);
190 if (p
->rng_fault_state
) {
191 talloc_free(mem_ctx
);
192 /* Return True here, srv_pipe_hnd.c will take care */
196 if (DEBUGLEVEL
>= 10)
197 NDR_PRINT_OUT_DEBUG(unixinfo_SidToGid
, &r
);
199 push
= ndr_push_init_ctx(mem_ctx
);
201 talloc_free(mem_ctx
);
205 status
= ndr_push_unixinfo_SidToGid(push
, NDR_OUT
, &r
);
206 if (NT_STATUS_IS_ERR(status
)) {
207 talloc_free(mem_ctx
);
211 blob
= ndr_push_blob(push
);
212 if (!prs_copy_data_in(&p
->out_data
.rdata
, (const char *)blob
.data
, (uint32
)blob
.length
)) {
213 talloc_free(mem_ctx
);
217 talloc_free(mem_ctx
);
222 static BOOL
api_unixinfo_GidToSid(pipes_struct
*p
)
224 struct ndr_pull
*pull
;
225 struct ndr_push
*push
;
228 struct unixinfo_GidToSid r
;
229 TALLOC_CTX
*mem_ctx
= talloc_init("api_unixinfo_GidToSid");
231 if (!prs_data_blob(&p
->in_data
.data
, &blob
, mem_ctx
)) {
232 talloc_free(mem_ctx
);
236 pull
= ndr_pull_init_blob(&blob
, mem_ctx
);
238 talloc_free(mem_ctx
);
242 pull
->flags
|= LIBNDR_FLAG_REF_ALLOC
;
243 status
= ndr_pull_unixinfo_GidToSid(pull
, NDR_IN
, &r
);
244 if (NT_STATUS_IS_ERR(status
)) {
245 talloc_free(mem_ctx
);
249 if (DEBUGLEVEL
>= 10)
250 NDR_PRINT_IN_DEBUG(unixinfo_GidToSid
, &r
);
253 r
.out
.sid
= talloc_zero(mem_ctx
, struct dom_sid
);
254 if (r
.out
.sid
== NULL
) {
255 talloc_free(mem_ctx
);
259 r
.out
.result
= _unixinfo_GidToSid(p
, &r
);
261 if (p
->rng_fault_state
) {
262 talloc_free(mem_ctx
);
263 /* Return True here, srv_pipe_hnd.c will take care */
267 if (DEBUGLEVEL
>= 10)
268 NDR_PRINT_OUT_DEBUG(unixinfo_GidToSid
, &r
);
270 push
= ndr_push_init_ctx(mem_ctx
);
272 talloc_free(mem_ctx
);
276 status
= ndr_push_unixinfo_GidToSid(push
, NDR_OUT
, &r
);
277 if (NT_STATUS_IS_ERR(status
)) {
278 talloc_free(mem_ctx
);
282 blob
= ndr_push_blob(push
);
283 if (!prs_copy_data_in(&p
->out_data
.rdata
, (const char *)blob
.data
, (uint32
)blob
.length
)) {
284 talloc_free(mem_ctx
);
288 talloc_free(mem_ctx
);
293 static BOOL
api_unixinfo_GetPWUid(pipes_struct
*p
)
295 struct ndr_pull
*pull
;
296 struct ndr_push
*push
;
299 struct unixinfo_GetPWUid r
;
300 TALLOC_CTX
*mem_ctx
= talloc_init("api_unixinfo_GetPWUid");
302 if (!prs_data_blob(&p
->in_data
.data
, &blob
, mem_ctx
)) {
303 talloc_free(mem_ctx
);
307 pull
= ndr_pull_init_blob(&blob
, mem_ctx
);
309 talloc_free(mem_ctx
);
313 pull
->flags
|= LIBNDR_FLAG_REF_ALLOC
;
314 status
= ndr_pull_unixinfo_GetPWUid(pull
, NDR_IN
, &r
);
315 if (NT_STATUS_IS_ERR(status
)) {
316 talloc_free(mem_ctx
);
320 if (DEBUGLEVEL
>= 10)
321 NDR_PRINT_IN_DEBUG(unixinfo_GetPWUid
, &r
);
324 r
.out
.count
= r
.in
.count
;
325 r
.out
.infos
= talloc_zero_array(mem_ctx
, struct unixinfo_GetPWUidInfo
, *r
.in
.count
);
326 if (r
.out
.infos
== NULL
) {
327 talloc_free(mem_ctx
);
331 r
.out
.result
= _unixinfo_GetPWUid(p
, &r
);
333 if (p
->rng_fault_state
) {
334 talloc_free(mem_ctx
);
335 /* Return True here, srv_pipe_hnd.c will take care */
339 if (DEBUGLEVEL
>= 10)
340 NDR_PRINT_OUT_DEBUG(unixinfo_GetPWUid
, &r
);
342 push
= ndr_push_init_ctx(mem_ctx
);
344 talloc_free(mem_ctx
);
348 status
= ndr_push_unixinfo_GetPWUid(push
, NDR_OUT
, &r
);
349 if (NT_STATUS_IS_ERR(status
)) {
350 talloc_free(mem_ctx
);
354 blob
= ndr_push_blob(push
);
355 if (!prs_copy_data_in(&p
->out_data
.rdata
, (const char *)blob
.data
, (uint32
)blob
.length
)) {
356 talloc_free(mem_ctx
);
360 talloc_free(mem_ctx
);
367 static struct api_struct api_unixinfo_cmds
[] =
369 {"UNIXINFO_SIDTOUID", DCERPC_UNIXINFO_SIDTOUID
, api_unixinfo_SidToUid
},
370 {"UNIXINFO_UIDTOSID", DCERPC_UNIXINFO_UIDTOSID
, api_unixinfo_UidToSid
},
371 {"UNIXINFO_SIDTOGID", DCERPC_UNIXINFO_SIDTOGID
, api_unixinfo_SidToGid
},
372 {"UNIXINFO_GIDTOSID", DCERPC_UNIXINFO_GIDTOSID
, api_unixinfo_GidToSid
},
373 {"UNIXINFO_GETPWUID", DCERPC_UNIXINFO_GETPWUID
, api_unixinfo_GetPWUid
},
376 void unixinfo_get_pipe_fns(struct api_struct
**fns
, int *n_fns
)
378 *fns
= api_unixinfo_cmds
;
379 *n_fns
= sizeof(api_unixinfo_cmds
) / sizeof(struct api_struct
);
382 NTSTATUS
rpc_unixinfo_init(void)
384 return rpc_pipe_register_commands(SMB_RPC_INTERFACE_VERSION
, "unixinfo", "unixinfo", api_unixinfo_cmds
, sizeof(api_unixinfo_cmds
) / sizeof(struct api_struct
));