summaryrefslogtreecommitdiff
path: root/librpc/gen_ndr/srv_eventlog.c
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2009-01-24 03:30:48 +0100
committerGünther Deschner <gd@samba.org>2009-01-24 03:33:22 +0100
commit4cac1da142aec103f1022aedeb068d9cc94c7f4e (patch)
tree3d347f7fedfaab2eef4a69bcc031c714befcd0ca /librpc/gen_ndr/srv_eventlog.c
parentb57c37d6aec28ef93c5d47aa3b20382bd8679361 (diff)
downloadsamba-4cac1da142aec103f1022aedeb068d9cc94c7f4e.tar.gz
samba-4cac1da142aec103f1022aedeb068d9cc94c7f4e.tar.bz2
samba-4cac1da142aec103f1022aedeb068d9cc94c7f4e.zip
s3: re-run make samba3-idl.
Guenther
Diffstat (limited to 'librpc/gen_ndr/srv_eventlog.c')
-rw-r--r--librpc/gen_ndr/srv_eventlog.c146
1 files changed, 146 insertions, 0 deletions
diff --git a/librpc/gen_ndr/srv_eventlog.c b/librpc/gen_ndr/srv_eventlog.c
index 73c536d50f..795afc9a5a 100644
--- a/librpc/gen_ndr/srv_eventlog.c
+++ b/librpc/gen_ndr/srv_eventlog.c
@@ -265,6 +265,8 @@ static bool api_eventlog_DeregisterEventSource(pipes_struct *p)
NDR_PRINT_IN_DEBUG(eventlog_DeregisterEventSource, r);
}
+ ZERO_STRUCT(r->out);
+ r->out.handle = r->in.handle;
r->out.result = _eventlog_DeregisterEventSource(p, r);
if (p->rng_fault_state) {
@@ -651,6 +653,13 @@ static bool api_eventlog_RegisterEventSourceW(pipes_struct *p)
NDR_PRINT_IN_DEBUG(eventlog_RegisterEventSourceW, r);
}
+ ZERO_STRUCT(r->out);
+ r->out.log_handle = talloc_zero(r, struct policy_handle);
+ if (r->out.log_handle == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
r->out.result = _eventlog_RegisterEventSourceW(p, r);
if (p->rng_fault_state) {
@@ -724,6 +733,13 @@ static bool api_eventlog_OpenBackupEventLogW(pipes_struct *p)
NDR_PRINT_IN_DEBUG(eventlog_OpenBackupEventLogW, r);
}
+ ZERO_STRUCT(r->out);
+ r->out.handle = talloc_zero(r, struct policy_handle);
+ if (r->out.handle == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
r->out.result = _eventlog_OpenBackupEventLogW(p, r);
if (p->rng_fault_state) {
@@ -889,6 +905,9 @@ static bool api_eventlog_ReportEventW(pipes_struct *p)
NDR_PRINT_IN_DEBUG(eventlog_ReportEventW, r);
}
+ ZERO_STRUCT(r->out);
+ r->out.record_number = r->in.record_number;
+ r->out.time_written = r->in.time_written;
r->out.result = _eventlog_ReportEventW(p, r);
if (p->rng_fault_state) {
@@ -1692,6 +1711,19 @@ static bool api_eventlog_GetLogIntormation(pipes_struct *p)
NDR_PRINT_IN_DEBUG(eventlog_GetLogIntormation, r);
}
+ ZERO_STRUCT(r->out);
+ r->out.buffer = talloc_zero_array(r, uint8_t, r->in.buf_size);
+ if (r->out.buffer == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ r->out.bytes_needed = talloc_zero(r, uint32_t);
+ if (r->out.bytes_needed == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
r->out.result = _eventlog_GetLogIntormation(p, r);
if (p->rng_fault_state) {
@@ -1800,6 +1832,82 @@ static bool api_eventlog_FlushEventLog(pipes_struct *p)
return true;
}
+static bool api_eventlog_ReportEventAndSourceW(pipes_struct *p)
+{
+ const struct ndr_interface_call *call;
+ struct ndr_pull *pull;
+ struct ndr_push *push;
+ enum ndr_err_code ndr_err;
+ DATA_BLOB blob;
+ struct eventlog_ReportEventAndSourceW *r;
+
+ call = &ndr_table_eventlog.calls[NDR_EVENTLOG_REPORTEVENTANDSOURCEW];
+
+ r = talloc(talloc_tos(), struct eventlog_ReportEventAndSourceW);
+ if (r == NULL) {
+ return false;
+ }
+
+ if (!prs_data_blob(&p->in_data.data, &blob, r)) {
+ talloc_free(r);
+ return false;
+ }
+
+ pull = ndr_pull_init_blob(&blob, r, NULL);
+ if (pull == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ pull->flags |= LIBNDR_FLAG_REF_ALLOC;
+ ndr_err = call->ndr_pull(pull, NDR_IN, r);
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+ talloc_free(r);
+ return false;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_IN_DEBUG(eventlog_ReportEventAndSourceW, r);
+ }
+
+ ZERO_STRUCT(r->out);
+ r->out.record_number = r->in.record_number;
+ r->out.time_written = r->in.time_written;
+ r->out.result = _eventlog_ReportEventAndSourceW(p, r);
+
+ if (p->rng_fault_state) {
+ talloc_free(r);
+ /* Return true here, srv_pipe_hnd.c will take care */
+ return true;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_OUT_DEBUG(eventlog_ReportEventAndSourceW, r);
+ }
+
+ push = ndr_push_init_ctx(r, NULL);
+ if (push == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ ndr_err = call->ndr_push(push, NDR_OUT, r);
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+ talloc_free(r);
+ return false;
+ }
+
+ blob = ndr_push_blob(push);
+ if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
+ talloc_free(r);
+ return false;
+ }
+
+ talloc_free(r);
+
+ return true;
+}
+
/* Tables */
static struct api_struct api_eventlog_cmds[] =
@@ -1828,6 +1936,7 @@ static struct api_struct api_eventlog_cmds[] =
{"EVENTLOG_WRITECLUSTEREVENTS", NDR_EVENTLOG_WRITECLUSTEREVENTS, api_eventlog_WriteClusterEvents},
{"EVENTLOG_GETLOGINTORMATION", NDR_EVENTLOG_GETLOGINTORMATION, api_eventlog_GetLogIntormation},
{"EVENTLOG_FLUSHEVENTLOG", NDR_EVENTLOG_FLUSHEVENTLOG, api_eventlog_FlushEventLog},
+ {"EVENTLOG_REPORTEVENTANDSOURCEW", NDR_EVENTLOG_REPORTEVENTANDSOURCEW, api_eventlog_ReportEventAndSourceW},
};
void eventlog_get_pipe_fns(struct api_struct **fns, int *n_fns)
@@ -1866,6 +1975,8 @@ NTSTATUS rpc_eventlog_dispatch(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
case NDR_EVENTLOG_DEREGISTEREVENTSOURCE: {
struct eventlog_DeregisterEventSource *r = (struct eventlog_DeregisterEventSource *)_r;
+ ZERO_STRUCT(r->out);
+ r->out.handle = r->in.handle;
r->out.result = _eventlog_DeregisterEventSource(cli->pipes_struct, r);
return NT_STATUS_OK;
}
@@ -1914,12 +2025,24 @@ NTSTATUS rpc_eventlog_dispatch(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
case NDR_EVENTLOG_REGISTEREVENTSOURCEW: {
struct eventlog_RegisterEventSourceW *r = (struct eventlog_RegisterEventSourceW *)_r;
+ ZERO_STRUCT(r->out);
+ r->out.log_handle = talloc_zero(mem_ctx, struct policy_handle);
+ if (r->out.log_handle == NULL) {
+ return NT_STATUS_NO_MEMORY;
+ }
+
r->out.result = _eventlog_RegisterEventSourceW(cli->pipes_struct, r);
return NT_STATUS_OK;
}
case NDR_EVENTLOG_OPENBACKUPEVENTLOGW: {
struct eventlog_OpenBackupEventLogW *r = (struct eventlog_OpenBackupEventLogW *)_r;
+ ZERO_STRUCT(r->out);
+ r->out.handle = talloc_zero(mem_ctx, struct policy_handle);
+ if (r->out.handle == NULL) {
+ return NT_STATUS_NO_MEMORY;
+ }
+
r->out.result = _eventlog_OpenBackupEventLogW(cli->pipes_struct, r);
return NT_STATUS_OK;
}
@@ -1948,6 +2071,9 @@ NTSTATUS rpc_eventlog_dispatch(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
case NDR_EVENTLOG_REPORTEVENTW: {
struct eventlog_ReportEventW *r = (struct eventlog_ReportEventW *)_r;
+ ZERO_STRUCT(r->out);
+ r->out.record_number = r->in.record_number;
+ r->out.time_written = r->in.time_written;
r->out.result = _eventlog_ReportEventW(cli->pipes_struct, r);
return NT_STATUS_OK;
}
@@ -2014,6 +2140,17 @@ NTSTATUS rpc_eventlog_dispatch(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
case NDR_EVENTLOG_GETLOGINTORMATION: {
struct eventlog_GetLogIntormation *r = (struct eventlog_GetLogIntormation *)_r;
+ ZERO_STRUCT(r->out);
+ r->out.buffer = talloc_zero_array(mem_ctx, uint8_t, r->in.buf_size);
+ if (r->out.buffer == NULL) {
+ return NT_STATUS_NO_MEMORY;
+ }
+
+ r->out.bytes_needed = talloc_zero(mem_ctx, uint32_t);
+ if (r->out.bytes_needed == NULL) {
+ return NT_STATUS_NO_MEMORY;
+ }
+
r->out.result = _eventlog_GetLogIntormation(cli->pipes_struct, r);
return NT_STATUS_OK;
}
@@ -2024,6 +2161,15 @@ NTSTATUS rpc_eventlog_dispatch(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
return NT_STATUS_OK;
}
+ case NDR_EVENTLOG_REPORTEVENTANDSOURCEW: {
+ struct eventlog_ReportEventAndSourceW *r = (struct eventlog_ReportEventAndSourceW *)_r;
+ ZERO_STRUCT(r->out);
+ r->out.record_number = r->in.record_number;
+ r->out.time_written = r->in.time_written;
+ r->out.result = _eventlog_ReportEventAndSourceW(cli->pipes_struct, r);
+ return NT_STATUS_OK;
+ }
+
default:
return NT_STATUS_NOT_IMPLEMENTED;
}