#include "includes.h"
#include <tevent.h>
#include "lib/util/tevent_ntstatus.h"
-#include "librpc/gen_ndr/ndr_wbint.h"
-#include "librpc/gen_ndr/ndr_wbint_c.h"
+#include "autoconf/librpc/gen_ndr/ndr_wbint.h"
+#include "autoconf/librpc/gen_ndr/ndr_wbint_c.h"
/* wbint - client functions generated by pidl */
return NT_STATUS_OK;
}
-struct dcerpc_wbint_Sid2Uid_r_state {
- TALLOC_CTX *out_mem_ctx;
-};
-
-static void dcerpc_wbint_Sid2Uid_r_done(struct tevent_req *subreq);
-
-struct tevent_req *dcerpc_wbint_Sid2Uid_r_send(TALLOC_CTX *mem_ctx,
- struct tevent_context *ev,
- struct dcerpc_binding_handle *h,
- struct wbint_Sid2Uid *r)
-{
- struct tevent_req *req;
- struct dcerpc_wbint_Sid2Uid_r_state *state;
- struct tevent_req *subreq;
-
- req = tevent_req_create(mem_ctx, &state,
- struct dcerpc_wbint_Sid2Uid_r_state);
- if (req == NULL) {
- return NULL;
- }
-
- state->out_mem_ctx = talloc_new(state);
- if (tevent_req_nomem(state->out_mem_ctx, req)) {
- return tevent_req_post(req, ev);
- }
-
- subreq = dcerpc_binding_handle_call_send(state, ev, h,
- NULL, &ndr_table_wbint,
- NDR_WBINT_SID2UID, state->out_mem_ctx, r);
- if (tevent_req_nomem(subreq, req)) {
- return tevent_req_post(req, ev);
- }
- tevent_req_set_callback(subreq, dcerpc_wbint_Sid2Uid_r_done, req);
-
- return req;
-}
-
-static void dcerpc_wbint_Sid2Uid_r_done(struct tevent_req *subreq)
-{
- struct tevent_req *req =
- tevent_req_callback_data(subreq,
- struct tevent_req);
- NTSTATUS status;
-
- status = dcerpc_binding_handle_call_recv(subreq);
- if (!NT_STATUS_IS_OK(status)) {
- tevent_req_nterror(req, status);
- return;
- }
-
- tevent_req_done(req);
-}
-
-NTSTATUS dcerpc_wbint_Sid2Uid_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
-{
- struct dcerpc_wbint_Sid2Uid_r_state *state =
- tevent_req_data(req,
- struct dcerpc_wbint_Sid2Uid_r_state);
- NTSTATUS status;
-
- if (tevent_req_is_nterror(req, &status)) {
- tevent_req_received(req);
- return status;
- }
-
- talloc_steal(mem_ctx, state->out_mem_ctx);
-
- tevent_req_received(req);
- return NT_STATUS_OK;
-}
-
-NTSTATUS dcerpc_wbint_Sid2Uid_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct wbint_Sid2Uid *r)
-{
- NTSTATUS status;
-
- status = dcerpc_binding_handle_call(h,
- NULL, &ndr_table_wbint,
- NDR_WBINT_SID2UID, mem_ctx, r);
-
- return status;
-}
-
-struct dcerpc_wbint_Sid2Uid_state {
- struct wbint_Sid2Uid orig;
- struct wbint_Sid2Uid tmp;
- TALLOC_CTX *out_mem_ctx;
-};
-
-static void dcerpc_wbint_Sid2Uid_done(struct tevent_req *subreq);
-
-struct tevent_req *dcerpc_wbint_Sid2Uid_send(TALLOC_CTX *mem_ctx,
- struct tevent_context *ev,
- struct dcerpc_binding_handle *h,
- const char *_dom_name /* [in] [unique,charset(UTF8)] */,
- struct dom_sid *_sid /* [in] [ref] */,
- uint64_t *_uid /* [out] [ref] */)
-{
- struct tevent_req *req;
- struct dcerpc_wbint_Sid2Uid_state *state;
- struct tevent_req *subreq;
-
- req = tevent_req_create(mem_ctx, &state,
- struct dcerpc_wbint_Sid2Uid_state);
- if (req == NULL) {
- return NULL;
- }
- state->out_mem_ctx = NULL;
-
- /* In parameters */
- state->orig.in.dom_name = _dom_name;
- state->orig.in.sid = _sid;
-
- /* Out parameters */
- state->orig.out.uid = _uid;
-
- /* Result */
- ZERO_STRUCT(state->orig.out.result);
-
- state->out_mem_ctx = talloc_named_const(state, 0,
- "dcerpc_wbint_Sid2Uid_out_memory");
- if (tevent_req_nomem(state->out_mem_ctx, req)) {
- return tevent_req_post(req, ev);
- }
-
- /* make a temporary copy, that we pass to the dispatch function */
- state->tmp = state->orig;
-
- subreq = dcerpc_wbint_Sid2Uid_r_send(state, ev, h, &state->tmp);
- if (tevent_req_nomem(subreq, req)) {
- return tevent_req_post(req, ev);
- }
- tevent_req_set_callback(subreq, dcerpc_wbint_Sid2Uid_done, req);
- return req;
-}
-
-static void dcerpc_wbint_Sid2Uid_done(struct tevent_req *subreq)
-{
- struct tevent_req *req = tevent_req_callback_data(
- subreq, struct tevent_req);
- struct dcerpc_wbint_Sid2Uid_state *state = tevent_req_data(
- req, struct dcerpc_wbint_Sid2Uid_state);
- NTSTATUS status;
- TALLOC_CTX *mem_ctx;
-
- if (state->out_mem_ctx) {
- mem_ctx = state->out_mem_ctx;
- } else {
- mem_ctx = state;
- }
-
- status = dcerpc_wbint_Sid2Uid_r_recv(subreq, mem_ctx);
- TALLOC_FREE(subreq);
- if (!NT_STATUS_IS_OK(status)) {
- tevent_req_nterror(req, status);
- return;
- }
-
- /* Copy out parameters */
- *state->orig.out.uid = *state->tmp.out.uid;
-
- /* Copy result */
- state->orig.out.result = state->tmp.out.result;
-
- /* Reset temporary structure */
- ZERO_STRUCT(state->tmp);
-
- tevent_req_done(req);
-}
-
-NTSTATUS dcerpc_wbint_Sid2Uid_recv(struct tevent_req *req,
- TALLOC_CTX *mem_ctx,
- NTSTATUS *result)
-{
- struct dcerpc_wbint_Sid2Uid_state *state = tevent_req_data(
- req, struct dcerpc_wbint_Sid2Uid_state);
- NTSTATUS status;
-
- if (tevent_req_is_nterror(req, &status)) {
- tevent_req_received(req);
- return status;
- }
-
- /* Steal possible out parameters to the callers context */
- talloc_steal(mem_ctx, state->out_mem_ctx);
-
- /* Return result */
- *result = state->orig.out.result;
-
- tevent_req_received(req);
- return NT_STATUS_OK;
-}
-
-NTSTATUS dcerpc_wbint_Sid2Uid(struct dcerpc_binding_handle *h,
- TALLOC_CTX *mem_ctx,
- const char *_dom_name /* [in] [unique,charset(UTF8)] */,
- struct dom_sid *_sid /* [in] [ref] */,
- uint64_t *_uid /* [out] [ref] */,
- NTSTATUS *result)
-{
- struct wbint_Sid2Uid r;
- NTSTATUS status;
-
- /* In parameters */
- r.in.dom_name = _dom_name;
- r.in.sid = _sid;
-
- status = dcerpc_wbint_Sid2Uid_r(h, mem_ctx, &r);
- if (!NT_STATUS_IS_OK(status)) {
- return status;
- }
-
- /* Return variables */
- *_uid = *r.out.uid;
-
- /* Return result */
- *result = r.out.result;
-
- return NT_STATUS_OK;
-}
-
-struct dcerpc_wbint_Sid2Gid_r_state {
- TALLOC_CTX *out_mem_ctx;
-};
-
-static void dcerpc_wbint_Sid2Gid_r_done(struct tevent_req *subreq);
-
-struct tevent_req *dcerpc_wbint_Sid2Gid_r_send(TALLOC_CTX *mem_ctx,
- struct tevent_context *ev,
- struct dcerpc_binding_handle *h,
- struct wbint_Sid2Gid *r)
-{
- struct tevent_req *req;
- struct dcerpc_wbint_Sid2Gid_r_state *state;
- struct tevent_req *subreq;
-
- req = tevent_req_create(mem_ctx, &state,
- struct dcerpc_wbint_Sid2Gid_r_state);
- if (req == NULL) {
- return NULL;
- }
-
- state->out_mem_ctx = talloc_new(state);
- if (tevent_req_nomem(state->out_mem_ctx, req)) {
- return tevent_req_post(req, ev);
- }
-
- subreq = dcerpc_binding_handle_call_send(state, ev, h,
- NULL, &ndr_table_wbint,
- NDR_WBINT_SID2GID, state->out_mem_ctx, r);
- if (tevent_req_nomem(subreq, req)) {
- return tevent_req_post(req, ev);
- }
- tevent_req_set_callback(subreq, dcerpc_wbint_Sid2Gid_r_done, req);
-
- return req;
-}
-
-static void dcerpc_wbint_Sid2Gid_r_done(struct tevent_req *subreq)
-{
- struct tevent_req *req =
- tevent_req_callback_data(subreq,
- struct tevent_req);
- NTSTATUS status;
-
- status = dcerpc_binding_handle_call_recv(subreq);
- if (!NT_STATUS_IS_OK(status)) {
- tevent_req_nterror(req, status);
- return;
- }
-
- tevent_req_done(req);
-}
-
-NTSTATUS dcerpc_wbint_Sid2Gid_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
-{
- struct dcerpc_wbint_Sid2Gid_r_state *state =
- tevent_req_data(req,
- struct dcerpc_wbint_Sid2Gid_r_state);
- NTSTATUS status;
-
- if (tevent_req_is_nterror(req, &status)) {
- tevent_req_received(req);
- return status;
- }
-
- talloc_steal(mem_ctx, state->out_mem_ctx);
-
- tevent_req_received(req);
- return NT_STATUS_OK;
-}
-
-NTSTATUS dcerpc_wbint_Sid2Gid_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct wbint_Sid2Gid *r)
-{
- NTSTATUS status;
-
- status = dcerpc_binding_handle_call(h,
- NULL, &ndr_table_wbint,
- NDR_WBINT_SID2GID, mem_ctx, r);
-
- return status;
-}
-
-struct dcerpc_wbint_Sid2Gid_state {
- struct wbint_Sid2Gid orig;
- struct wbint_Sid2Gid tmp;
- TALLOC_CTX *out_mem_ctx;
-};
-
-static void dcerpc_wbint_Sid2Gid_done(struct tevent_req *subreq);
-
-struct tevent_req *dcerpc_wbint_Sid2Gid_send(TALLOC_CTX *mem_ctx,
- struct tevent_context *ev,
- struct dcerpc_binding_handle *h,
- const char *_dom_name /* [in] [unique,charset(UTF8)] */,
- struct dom_sid *_sid /* [in] [ref] */,
- uint64_t *_gid /* [out] [ref] */)
-{
- struct tevent_req *req;
- struct dcerpc_wbint_Sid2Gid_state *state;
- struct tevent_req *subreq;
-
- req = tevent_req_create(mem_ctx, &state,
- struct dcerpc_wbint_Sid2Gid_state);
- if (req == NULL) {
- return NULL;
- }
- state->out_mem_ctx = NULL;
-
- /* In parameters */
- state->orig.in.dom_name = _dom_name;
- state->orig.in.sid = _sid;
-
- /* Out parameters */
- state->orig.out.gid = _gid;
-
- /* Result */
- ZERO_STRUCT(state->orig.out.result);
-
- state->out_mem_ctx = talloc_named_const(state, 0,
- "dcerpc_wbint_Sid2Gid_out_memory");
- if (tevent_req_nomem(state->out_mem_ctx, req)) {
- return tevent_req_post(req, ev);
- }
-
- /* make a temporary copy, that we pass to the dispatch function */
- state->tmp = state->orig;
-
- subreq = dcerpc_wbint_Sid2Gid_r_send(state, ev, h, &state->tmp);
- if (tevent_req_nomem(subreq, req)) {
- return tevent_req_post(req, ev);
- }
- tevent_req_set_callback(subreq, dcerpc_wbint_Sid2Gid_done, req);
- return req;
-}
-
-static void dcerpc_wbint_Sid2Gid_done(struct tevent_req *subreq)
-{
- struct tevent_req *req = tevent_req_callback_data(
- subreq, struct tevent_req);
- struct dcerpc_wbint_Sid2Gid_state *state = tevent_req_data(
- req, struct dcerpc_wbint_Sid2Gid_state);
- NTSTATUS status;
- TALLOC_CTX *mem_ctx;
-
- if (state->out_mem_ctx) {
- mem_ctx = state->out_mem_ctx;
- } else {
- mem_ctx = state;
- }
-
- status = dcerpc_wbint_Sid2Gid_r_recv(subreq, mem_ctx);
- TALLOC_FREE(subreq);
- if (!NT_STATUS_IS_OK(status)) {
- tevent_req_nterror(req, status);
- return;
- }
-
- /* Copy out parameters */
- *state->orig.out.gid = *state->tmp.out.gid;
-
- /* Copy result */
- state->orig.out.result = state->tmp.out.result;
-
- /* Reset temporary structure */
- ZERO_STRUCT(state->tmp);
-
- tevent_req_done(req);
-}
-
-NTSTATUS dcerpc_wbint_Sid2Gid_recv(struct tevent_req *req,
- TALLOC_CTX *mem_ctx,
- NTSTATUS *result)
-{
- struct dcerpc_wbint_Sid2Gid_state *state = tevent_req_data(
- req, struct dcerpc_wbint_Sid2Gid_state);
- NTSTATUS status;
-
- if (tevent_req_is_nterror(req, &status)) {
- tevent_req_received(req);
- return status;
- }
-
- /* Steal possible out parameters to the callers context */
- talloc_steal(mem_ctx, state->out_mem_ctx);
-
- /* Return result */
- *result = state->orig.out.result;
-
- tevent_req_received(req);
- return NT_STATUS_OK;
-}
-
-NTSTATUS dcerpc_wbint_Sid2Gid(struct dcerpc_binding_handle *h,
- TALLOC_CTX *mem_ctx,
- const char *_dom_name /* [in] [unique,charset(UTF8)] */,
- struct dom_sid *_sid /* [in] [ref] */,
- uint64_t *_gid /* [out] [ref] */,
- NTSTATUS *result)
-{
- struct wbint_Sid2Gid r;
- NTSTATUS status;
-
- /* In parameters */
- r.in.dom_name = _dom_name;
- r.in.sid = _sid;
-
- status = dcerpc_wbint_Sid2Gid_r(h, mem_ctx, &r);
- if (!NT_STATUS_IS_OK(status)) {
- return status;
- }
-
- /* Return variables */
- *_gid = *r.out.gid;
-
- /* Return result */
- *result = r.out.result;
-
- return NT_STATUS_OK;
-}
-
struct dcerpc_wbint_Sids2UnixIDs_r_state {
TALLOC_CTX *out_mem_ctx;
};
return NULL;
}
- state->out_mem_ctx = NULL;
+ state->out_mem_ctx = talloc_new(state);
+ if (tevent_req_nomem(state->out_mem_ctx, req)) {
+ return tevent_req_post(req, ev);
+ }
subreq = dcerpc_binding_handle_call_send(state, ev, h,
NULL, &ndr_table_wbint,
- NDR_WBINT_PINGDC, state, r);
+ NDR_WBINT_PINGDC, state->out_mem_ctx, r);
if (tevent_req_nomem(subreq, req)) {
return tevent_req_post(req, ev);
}
struct tevent_req *dcerpc_wbint_PingDc_send(TALLOC_CTX *mem_ctx,
struct tevent_context *ev,
- struct dcerpc_binding_handle *h)
+ struct dcerpc_binding_handle *h,
+ const char **_dcname /* [out] [ref,charset(UTF8)] */)
{
struct tevent_req *req;
struct dcerpc_wbint_PingDc_state *state;
/* In parameters */
/* Out parameters */
+ state->orig.out.dcname = _dcname;
/* Result */
ZERO_STRUCT(state->orig.out.result);
+ state->out_mem_ctx = talloc_named_const(state, 0,
+ "dcerpc_wbint_PingDc_out_memory");
+ if (tevent_req_nomem(state->out_mem_ctx, req)) {
+ return tevent_req_post(req, ev);
+ }
+
/* make a temporary copy, that we pass to the dispatch function */
state->tmp = state->orig;
}
/* Copy out parameters */
+ *state->orig.out.dcname = *state->tmp.out.dcname;
/* Copy result */
state->orig.out.result = state->tmp.out.result;
NTSTATUS dcerpc_wbint_PingDc(struct dcerpc_binding_handle *h,
TALLOC_CTX *mem_ctx,
+ const char **_dcname /* [out] [ref,charset(UTF8)] */,
NTSTATUS *result)
{
struct wbint_PingDc r;
}
/* Return variables */
+ *_dcname = *r.out.dcname;
/* Return result */
*result = r.out.result;