/* s3 compat server functions auto-generated by pidl */ #include "bin/default/librpc/gen_ndr/ndr_eventlog6.h" #include "bin/default/librpc/gen_ndr/ndr_eventlog6_scompat.h" #include #include #include #include enum s3compat_rpc_dispatch { S3COMPAT_RPC_DISPATCH_EXTERNAL = 0x00000001, S3COMPAT_RPC_DISPATCH_INTERNAL = 0x00000002, }; /* eventlog6 - dcerpc server boilerplate generated by pidl */ static NTSTATUS eventlog6__op_bind(struct dcesrv_connection_context *context, const struct dcesrv_interface *iface) { struct pipes_struct *p = NULL; /* Retrieve pipes struct */ p = dcesrv_get_pipes_struct(context->conn); p->pipe_bound = true; #ifdef DCESRV_INTERFACE_EVENTLOG6_BIND return DCESRV_INTERFACE_EVENTLOG6_BIND(context,iface); #else return NT_STATUS_OK; #endif } static void eventlog6__op_unbind(struct dcesrv_connection_context *context, const struct dcesrv_interface *iface) { #ifdef DCESRV_INTERFACE_EVENTLOG6_UNBIND DCESRV_INTERFACE_EVENTLOG6_UNBIND(context, iface); #else return; #endif } NTSTATUS eventlog6__op_ndr_pull(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, struct ndr_pull *pull, void **r) { enum ndr_err_code ndr_err; uint16_t opnum = dce_call->pkt.u.request.opnum; dce_call->fault_code = 0; if (opnum >= ndr_table_eventlog6.num_calls) { dce_call->fault_code = DCERPC_FAULT_OP_RNG_ERROR; return NT_STATUS_NET_WRITE_FAULT; } *r = talloc_named(mem_ctx, ndr_table_eventlog6.calls[opnum].struct_size, "struct %s", ndr_table_eventlog6.calls[opnum].name); NT_STATUS_HAVE_NO_MEMORY(*r); /* unravel the NDR for the packet */ ndr_err = ndr_table_eventlog6.calls[opnum].ndr_pull(pull, NDR_IN, *r); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { dce_call->fault_code = DCERPC_FAULT_NDR; return NT_STATUS_NET_WRITE_FAULT; } return NT_STATUS_OK; } static NTSTATUS eventlog6__op_dispatch_internal(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, void *r, enum s3compat_rpc_dispatch dispatch) { uint16_t opnum = dce_call->pkt.u.request.opnum; struct pipes_struct *p = NULL; struct auth_session_info *pipe_session_info = NULL; NTSTATUS status = NT_STATUS_OK; bool impersonated = false; /* Retrieve pipes struct */ p = dcesrv_get_pipes_struct(dce_call->conn); /* Update pipes struct opnum */ p->opnum = opnum; p->dce_call = dce_call; p->mem_ctx = mem_ctx; /* Update pipes struct session info */ pipe_session_info = p->session_info; p->session_info = dce_call->auth_state->session_info; p->auth.auth_type = dce_call->auth_state->auth_type; p->auth.auth_level = dce_call->auth_state->auth_level; p->auth.auth_context_id = dce_call->auth_state->auth_context_id; /* Reset pipes struct fault state */ p->fault_state = 0; /* Impersonate */ if (dispatch == S3COMPAT_RPC_DISPATCH_EXTERNAL) { impersonated = become_authenticated_pipe_user(p->session_info); if (!impersonated) { dce_call->fault_code = DCERPC_FAULT_ACCESS_DENIED; status = NT_STATUS_NET_WRITE_FAULT; goto fail; } } switch (opnum) { case 0: { /* eventlog6_EvtRpcRegisterRemoteSubscription */ struct eventlog6_EvtRpcRegisterRemoteSubscription *r2 = (struct eventlog6_EvtRpcRegisterRemoteSubscription *)r; if (DEBUGLEVEL >= 10) { NDR_PRINT_FUNCTION_DEBUG(eventlog6_EvtRpcRegisterRemoteSubscription, NDR_IN, r2); } NDR_ZERO_STRUCT(r2->out); r2->out.handle = talloc_zero(r2, struct policy_handle); if (r2->out.handle == NULL) { status = NT_STATUS_NO_MEMORY; p->fault_state = DCERPC_FAULT_CANT_PERFORM; goto fail; } r2->out.control = talloc_zero(r2, struct policy_handle); if (r2->out.control == NULL) { status = NT_STATUS_NO_MEMORY; p->fault_state = DCERPC_FAULT_CANT_PERFORM; goto fail; } r2->out.queryChannelInfoSize = talloc_zero(r2, uint32_t); if (r2->out.queryChannelInfoSize == NULL) { status = NT_STATUS_NO_MEMORY; p->fault_state = DCERPC_FAULT_CANT_PERFORM; goto fail; } r2->out.queryChannelInfo = talloc_zero(r2, struct eventlog6_EvtRpcQueryChannelInfo *); if (r2->out.queryChannelInfo == NULL) { status = NT_STATUS_NO_MEMORY; p->fault_state = DCERPC_FAULT_CANT_PERFORM; goto fail; } r2->out.error = talloc_zero(r2, struct eventlog6_RpcInfo); if (r2->out.error == NULL) { status = NT_STATUS_NO_MEMORY; p->fault_state = DCERPC_FAULT_CANT_PERFORM; goto fail; } r2->out.result = _eventlog6_EvtRpcRegisterRemoteSubscription(p, r2); break; } case 1: { /* eventlog6_EvtRpcRemoteSubscriptionNextAsync */ struct eventlog6_EvtRpcRemoteSubscriptionNextAsync *r2 = (struct eventlog6_EvtRpcRemoteSubscriptionNextAsync *)r; if (DEBUGLEVEL >= 10) { NDR_PRINT_FUNCTION_DEBUG(eventlog6_EvtRpcRemoteSubscriptionNextAsync, NDR_IN, r2); } NDR_ZERO_STRUCT(r2->out); r2->out.numActualRecords = talloc_zero(r2, uint32_t); if (r2->out.numActualRecords == NULL) { status = NT_STATUS_NO_MEMORY; p->fault_state = DCERPC_FAULT_CANT_PERFORM; goto fail; } r2->out.eventDataIndices = talloc_zero(r2, uint32_t *); if (r2->out.eventDataIndices == NULL) { status = NT_STATUS_NO_MEMORY; p->fault_state = DCERPC_FAULT_CANT_PERFORM; goto fail; } r2->out.eventDataSizes = talloc_zero(r2, uint32_t *); if (r2->out.eventDataSizes == NULL) { status = NT_STATUS_NO_MEMORY; p->fault_state = DCERPC_FAULT_CANT_PERFORM; goto fail; } r2->out.resultBufferSize = talloc_zero(r2, uint32_t); if (r2->out.resultBufferSize == NULL) { status = NT_STATUS_NO_MEMORY; p->fault_state = DCERPC_FAULT_CANT_PERFORM; goto fail; } r2->out.resultBuffer = talloc_zero(r2, uint8_t *); if (r2->out.resultBuffer == NULL) { status = NT_STATUS_NO_MEMORY; p->fault_state = DCERPC_FAULT_CANT_PERFORM; goto fail; } r2->out.result = _eventlog6_EvtRpcRemoteSubscriptionNextAsync(p, r2); break; } case 2: { /* eventlog6_EvtRpcRemoteSubscriptionNext */ struct eventlog6_EvtRpcRemoteSubscriptionNext *r2 = (struct eventlog6_EvtRpcRemoteSubscriptionNext *)r; if (DEBUGLEVEL >= 10) { NDR_PRINT_FUNCTION_DEBUG(eventlog6_EvtRpcRemoteSubscriptionNext, NDR_IN, r2); } NDR_ZERO_STRUCT(r2->out); r2->out.numActualRecords = talloc_zero(r2, uint32_t); if (r2->out.numActualRecords == NULL) { status = NT_STATUS_NO_MEMORY; p->fault_state = DCERPC_FAULT_CANT_PERFORM; goto fail; } r2->out.eventDataIndices = talloc_zero(r2, uint32_t *); if (r2->out.eventDataIndices == NULL) { status = NT_STATUS_NO_MEMORY; p->fault_state = DCERPC_FAULT_CANT_PERFORM; goto fail; } r2->out.eventDataSizes = talloc_zero(r2, uint32_t *); if (r2->out.eventDataSizes == NULL) { status = NT_STATUS_NO_MEMORY; p->fault_state = DCERPC_FAULT_CANT_PERFORM; goto fail; } r2->out.resultBufferSize = talloc_zero(r2, uint32_t); if (r2->out.resultBufferSize == NULL) { status = NT_STATUS_NO_MEMORY; p->fault_state = DCERPC_FAULT_CANT_PERFORM; goto fail; } r2->out.resultBuffer = talloc_zero(r2, uint8_t *); if (r2->out.resultBuffer == NULL) { status = NT_STATUS_NO_MEMORY; p->fault_state = DCERPC_FAULT_CANT_PERFORM; goto fail; } r2->out.result = _eventlog6_EvtRpcRemoteSubscriptionNext(p, r2); break; } case 3: { /* eventlog6_EvtRpcRemoteSubscriptionWaitAsync */ struct eventlog6_EvtRpcRemoteSubscriptionWaitAsync *r2 = (struct eventlog6_EvtRpcRemoteSubscriptionWaitAsync *)r; if (DEBUGLEVEL >= 10) { NDR_PRINT_FUNCTION_DEBUG(eventlog6_EvtRpcRemoteSubscriptionWaitAsync, NDR_IN, r2); } r2->out.result = _eventlog6_EvtRpcRemoteSubscriptionWaitAsync(p, r2); break; } case 4: { /* eventlog6_EvtRpcRegisterControllableOperation */ struct eventlog6_EvtRpcRegisterControllableOperation *r2 = (struct eventlog6_EvtRpcRegisterControllableOperation *)r; if (DEBUGLEVEL >= 10) { NDR_PRINT_FUNCTION_DEBUG(eventlog6_EvtRpcRegisterControllableOperation, NDR_IN, r2); } NDR_ZERO_STRUCT(r2->out); r2->out.handle = talloc_zero(r2, struct policy_handle); if (r2->out.handle == NULL) { status = NT_STATUS_NO_MEMORY; p->fault_state = DCERPC_FAULT_CANT_PERFORM; goto fail; } r2->out.result = _eventlog6_EvtRpcRegisterControllableOperation(p, r2); break; } case 5: { /* eventlog6_EvtRpcRegisterLogQuery */ struct eventlog6_EvtRpcRegisterLogQuery *r2 = (struct eventlog6_EvtRpcRegisterLogQuery *)r; if (DEBUGLEVEL >= 10) { NDR_PRINT_FUNCTION_DEBUG(eventlog6_EvtRpcRegisterLogQuery, NDR_IN, r2); } NDR_ZERO_STRUCT(r2->out); r2->out.handle = talloc_zero(r2, struct policy_handle); if (r2->out.handle == NULL) { status = NT_STATUS_NO_MEMORY; p->fault_state = DCERPC_FAULT_CANT_PERFORM; goto fail; } r2->out.opControl = talloc_zero(r2, struct policy_handle); if (r2->out.opControl == NULL) { status = NT_STATUS_NO_MEMORY; p->fault_state = DCERPC_FAULT_CANT_PERFORM; goto fail; } r2->out.queryChannelInfoSize = talloc_zero(r2, uint32_t); if (r2->out.queryChannelInfoSize == NULL) { status = NT_STATUS_NO_MEMORY; p->fault_state = DCERPC_FAULT_CANT_PERFORM; goto fail; } r2->out.queryChannelInfo = talloc_zero(r2, struct eventlog6_EvtRpcQueryChannelInfo *); if (r2->out.queryChannelInfo == NULL) { status = NT_STATUS_NO_MEMORY; p->fault_state = DCERPC_FAULT_CANT_PERFORM; goto fail; } r2->out.error = talloc_zero(r2, struct eventlog6_RpcInfo); if (r2->out.error == NULL) { status = NT_STATUS_NO_MEMORY; p->fault_state = DCERPC_FAULT_CANT_PERFORM; goto fail; } r2->out.result = _eventlog6_EvtRpcRegisterLogQuery(p, r2); break; } case 6: { /* eventlog6_EvtRpcClearLog */ struct eventlog6_EvtRpcClearLog *r2 = (struct eventlog6_EvtRpcClearLog *)r; if (DEBUGLEVEL >= 10) { NDR_PRINT_FUNCTION_DEBUG(eventlog6_EvtRpcClearLog, NDR_IN, r2); } NDR_ZERO_STRUCT(r2->out); r2->out.error = talloc_zero(r2, struct eventlog6_RpcInfo); if (r2->out.error == NULL) { status = NT_STATUS_NO_MEMORY; p->fault_state = DCERPC_FAULT_CANT_PERFORM; goto fail; } r2->out.result = _eventlog6_EvtRpcClearLog(p, r2); break; } case 7: { /* eventlog6_EvtRpcExportLog */ struct eventlog6_EvtRpcExportLog *r2 = (struct eventlog6_EvtRpcExportLog *)r; if (DEBUGLEVEL >= 10) { NDR_PRINT_FUNCTION_DEBUG(eventlog6_EvtRpcExportLog, NDR_IN, r2); } NDR_ZERO_STRUCT(r2->out); r2->out.error = talloc_zero(r2, struct eventlog6_RpcInfo); if (r2->out.error == NULL) { status = NT_STATUS_NO_MEMORY; p->fault_state = DCERPC_FAULT_CANT_PERFORM; goto fail; } r2->out.result = _eventlog6_EvtRpcExportLog(p, r2); break; } case 8: { /* eventlog6_EvtRpcLocalizeExportLog */ struct eventlog6_EvtRpcLocalizeExportLog *r2 = (struct eventlog6_EvtRpcLocalizeExportLog *)r; if (DEBUGLEVEL >= 10) { NDR_PRINT_FUNCTION_DEBUG(eventlog6_EvtRpcLocalizeExportLog, NDR_IN, r2); } NDR_ZERO_STRUCT(r2->out); r2->out.error = talloc_zero(r2, struct eventlog6_RpcInfo); if (r2->out.error == NULL) { status = NT_STATUS_NO_MEMORY; p->fault_state = DCERPC_FAULT_CANT_PERFORM; goto fail; } r2->out.result = _eventlog6_EvtRpcLocalizeExportLog(p, r2); break; } case 9: { /* eventlog6_EvtRpcMessageRender */ struct eventlog6_EvtRpcMessageRender *r2 = (struct eventlog6_EvtRpcMessageRender *)r; if (DEBUGLEVEL >= 10) { NDR_PRINT_FUNCTION_DEBUG(eventlog6_EvtRpcMessageRender, NDR_IN, r2); } NDR_ZERO_STRUCT(r2->out); r2->out.actualSizeString = talloc_zero(r2, uint32_t); if (r2->out.actualSizeString == NULL) { status = NT_STATUS_NO_MEMORY; p->fault_state = DCERPC_FAULT_CANT_PERFORM; goto fail; } r2->out.neededSizeString = talloc_zero(r2, uint32_t); if (r2->out.neededSizeString == NULL) { status = NT_STATUS_NO_MEMORY; p->fault_state = DCERPC_FAULT_CANT_PERFORM; goto fail; } r2->out.string = talloc_zero(r2, uint8_t *); if (r2->out.string == NULL) { status = NT_STATUS_NO_MEMORY; p->fault_state = DCERPC_FAULT_CANT_PERFORM; goto fail; } r2->out.error = talloc_zero(r2, struct eventlog6_RpcInfo); if (r2->out.error == NULL) { status = NT_STATUS_NO_MEMORY; p->fault_state = DCERPC_FAULT_CANT_PERFORM; goto fail; } r2->out.result = _eventlog6_EvtRpcMessageRender(p, r2); break; } case 10: { /* eventlog6_EvtRpcMessageRenderDefault */ struct eventlog6_EvtRpcMessageRenderDefault *r2 = (struct eventlog6_EvtRpcMessageRenderDefault *)r; if (DEBUGLEVEL >= 10) { NDR_PRINT_FUNCTION_DEBUG(eventlog6_EvtRpcMessageRenderDefault, NDR_IN, r2); } NDR_ZERO_STRUCT(r2->out); r2->out.actualSizeString = talloc_zero(r2, uint32_t); if (r2->out.actualSizeString == NULL) { status = NT_STATUS_NO_MEMORY; p->fault_state = DCERPC_FAULT_CANT_PERFORM; goto fail; } r2->out.neededSizeString = talloc_zero(r2, uint32_t); if (r2->out.neededSizeString == NULL) { status = NT_STATUS_NO_MEMORY; p->fault_state = DCERPC_FAULT_CANT_PERFORM; goto fail; } r2->out.string = talloc_zero(r2, uint8_t *); if (r2->out.string == NULL) { status = NT_STATUS_NO_MEMORY; p->fault_state = DCERPC_FAULT_CANT_PERFORM; goto fail; } r2->out.error = talloc_zero(r2, struct eventlog6_RpcInfo); if (r2->out.error == NULL) { status = NT_STATUS_NO_MEMORY; p->fault_state = DCERPC_FAULT_CANT_PERFORM; goto fail; } r2->out.result = _eventlog6_EvtRpcMessageRenderDefault(p, r2); break; } case 11: { /* eventlog6_EvtRpcQueryNext */ struct eventlog6_EvtRpcQueryNext *r2 = (struct eventlog6_EvtRpcQueryNext *)r; if (DEBUGLEVEL >= 10) { NDR_PRINT_FUNCTION_DEBUG(eventlog6_EvtRpcQueryNext, NDR_IN, r2); } NDR_ZERO_STRUCT(r2->out); r2->out.numActualRecords = talloc_zero(r2, uint32_t); if (r2->out.numActualRecords == NULL) { status = NT_STATUS_NO_MEMORY; p->fault_state = DCERPC_FAULT_CANT_PERFORM; goto fail; } r2->out.eventDataIndices = talloc_zero(r2, uint32_t *); if (r2->out.eventDataIndices == NULL) { status = NT_STATUS_NO_MEMORY; p->fault_state = DCERPC_FAULT_CANT_PERFORM; goto fail; } r2->out.eventDataSizes = talloc_zero(r2, uint32_t *); if (r2->out.eventDataSizes == NULL) { status = NT_STATUS_NO_MEMORY; p->fault_state = DCERPC_FAULT_CANT_PERFORM; goto fail; } r2->out.resultBufferSize = talloc_zero(r2, uint32_t); if (r2->out.resultBufferSize == NULL) { status = NT_STATUS_NO_MEMORY; p->fault_state = DCERPC_FAULT_CANT_PERFORM; goto fail; } r2->out.resultBuffer = talloc_zero(r2, uint8_t *); if (r2->out.resultBuffer == NULL) { status = NT_STATUS_NO_MEMORY; p->fault_state = DCERPC_FAULT_CANT_PERFORM; goto fail; } r2->out.result = _eventlog6_EvtRpcQueryNext(p, r2); break; } case 12: { /* eventlog6_EvtRpcQuerySeek */ struct eventlog6_EvtRpcQuerySeek *r2 = (struct eventlog6_EvtRpcQuerySeek *)r; if (DEBUGLEVEL >= 10) { NDR_PRINT_FUNCTION_DEBUG(eventlog6_EvtRpcQuerySeek, NDR_IN, r2); } NDR_ZERO_STRUCT(r2->out); r2->out.error = talloc_zero(r2, struct eventlog6_RpcInfo); if (r2->out.error == NULL) { status = NT_STATUS_NO_MEMORY; p->fault_state = DCERPC_FAULT_CANT_PERFORM; goto fail; } r2->out.result = _eventlog6_EvtRpcQuerySeek(p, r2); break; } case 13: { /* eventlog6_EvtRpcClose */ struct eventlog6_EvtRpcClose *r2 = (struct eventlog6_EvtRpcClose *)r; if (DEBUGLEVEL >= 10) { NDR_PRINT_FUNCTION_DEBUG(eventlog6_EvtRpcClose, NDR_IN, r2); } NDR_ZERO_STRUCT(r2->out); r2->out.handle = r2->in.handle; r2->out.result = _eventlog6_EvtRpcClose(p, r2); break; } case 14: { /* eventlog6_EvtRpcCancel */ struct eventlog6_EvtRpcCancel *r2 = (struct eventlog6_EvtRpcCancel *)r; if (DEBUGLEVEL >= 10) { NDR_PRINT_FUNCTION_DEBUG(eventlog6_EvtRpcCancel, NDR_IN, r2); } r2->out.result = _eventlog6_EvtRpcCancel(p, r2); break; } case 15: { /* eventlog6_EvtRpcAssertConfig */ struct eventlog6_EvtRpcAssertConfig *r2 = (struct eventlog6_EvtRpcAssertConfig *)r; if (DEBUGLEVEL >= 10) { NDR_PRINT_FUNCTION_DEBUG(eventlog6_EvtRpcAssertConfig, NDR_IN, r2); } r2->out.result = _eventlog6_EvtRpcAssertConfig(p, r2); break; } case 16: { /* eventlog6_EvtRpcRetractConfig */ struct eventlog6_EvtRpcRetractConfig *r2 = (struct eventlog6_EvtRpcRetractConfig *)r; if (DEBUGLEVEL >= 10) { NDR_PRINT_FUNCTION_DEBUG(eventlog6_EvtRpcRetractConfig, NDR_IN, r2); } r2->out.result = _eventlog6_EvtRpcRetractConfig(p, r2); break; } case 17: { /* eventlog6_EvtRpcOpenLogHandle */ struct eventlog6_EvtRpcOpenLogHandle *r2 = (struct eventlog6_EvtRpcOpenLogHandle *)r; if (DEBUGLEVEL >= 10) { NDR_PRINT_FUNCTION_DEBUG(eventlog6_EvtRpcOpenLogHandle, NDR_IN, r2); } NDR_ZERO_STRUCT(r2->out); r2->out.handle = talloc_zero(r2, struct policy_handle); if (r2->out.handle == NULL) { status = NT_STATUS_NO_MEMORY; p->fault_state = DCERPC_FAULT_CANT_PERFORM; goto fail; } r2->out.error = talloc_zero(r2, struct eventlog6_RpcInfo); if (r2->out.error == NULL) { status = NT_STATUS_NO_MEMORY; p->fault_state = DCERPC_FAULT_CANT_PERFORM; goto fail; } r2->out.result = _eventlog6_EvtRpcOpenLogHandle(p, r2); break; } case 18: { /* eventlog6_EvtRpcGetLogFileInfo */ struct eventlog6_EvtRpcGetLogFileInfo *r2 = (struct eventlog6_EvtRpcGetLogFileInfo *)r; if (DEBUGLEVEL >= 10) { NDR_PRINT_FUNCTION_DEBUG(eventlog6_EvtRpcGetLogFileInfo, NDR_IN, r2); } NDR_ZERO_STRUCT(r2->out); r2->out.propertyValueBuffer = talloc_zero_array(r2, uint8_t, r2->in.propertyValueBufferSize); if (r2->out.propertyValueBuffer == NULL) { status = NT_STATUS_NO_MEMORY; p->fault_state = DCERPC_FAULT_CANT_PERFORM; goto fail; } r2->out.propertyValueBufferLength = talloc_zero(r2, uint32_t); if (r2->out.propertyValueBufferLength == NULL) { status = NT_STATUS_NO_MEMORY; p->fault_state = DCERPC_FAULT_CANT_PERFORM; goto fail; } r2->out.result = _eventlog6_EvtRpcGetLogFileInfo(p, r2); break; } case 19: { /* eventlog6_EvtRpcGetChannelList */ struct eventlog6_EvtRpcGetChannelList *r2 = (struct eventlog6_EvtRpcGetChannelList *)r; if (DEBUGLEVEL >= 10) { NDR_PRINT_FUNCTION_DEBUG(eventlog6_EvtRpcGetChannelList, NDR_IN, r2); } NDR_ZERO_STRUCT(r2->out); r2->out.numChannelPaths = talloc_zero(r2, uint32_t); if (r2->out.numChannelPaths == NULL) { status = NT_STATUS_NO_MEMORY; p->fault_state = DCERPC_FAULT_CANT_PERFORM; goto fail; } r2->out.channelPaths = talloc_zero(r2, const char **); if (r2->out.channelPaths == NULL) { status = NT_STATUS_NO_MEMORY; p->fault_state = DCERPC_FAULT_CANT_PERFORM; goto fail; } r2->out.result = _eventlog6_EvtRpcGetChannelList(p, r2); break; } case 20: { /* eventlog6_EvtRpcGetChannelConfig */ struct eventlog6_EvtRpcGetChannelConfig *r2 = (struct eventlog6_EvtRpcGetChannelConfig *)r; if (DEBUGLEVEL >= 10) { NDR_PRINT_FUNCTION_DEBUG(eventlog6_EvtRpcGetChannelConfig, NDR_IN, r2); } NDR_ZERO_STRUCT(r2->out); r2->out.props = talloc_zero(r2, struct eventlog6_EvtRpcVariantList); if (r2->out.props == NULL) { status = NT_STATUS_NO_MEMORY; p->fault_state = DCERPC_FAULT_CANT_PERFORM; goto fail; } r2->out.result = _eventlog6_EvtRpcGetChannelConfig(p, r2); break; } case 21: { /* eventlog6_EvtRpcPutChannelConfig */ struct eventlog6_EvtRpcPutChannelConfig *r2 = (struct eventlog6_EvtRpcPutChannelConfig *)r; if (DEBUGLEVEL >= 10) { NDR_PRINT_FUNCTION_DEBUG(eventlog6_EvtRpcPutChannelConfig, NDR_IN, r2); } NDR_ZERO_STRUCT(r2->out); r2->out.error = talloc_zero(r2, struct eventlog6_RpcInfo); if (r2->out.error == NULL) { status = NT_STATUS_NO_MEMORY; p->fault_state = DCERPC_FAULT_CANT_PERFORM; goto fail; } r2->out.result = _eventlog6_EvtRpcPutChannelConfig(p, r2); break; } case 22: { /* eventlog6_EvtRpcGetPublisherList */ struct eventlog6_EvtRpcGetPublisherList *r2 = (struct eventlog6_EvtRpcGetPublisherList *)r; if (DEBUGLEVEL >= 10) { NDR_PRINT_FUNCTION_DEBUG(eventlog6_EvtRpcGetPublisherList, NDR_IN, r2); } NDR_ZERO_STRUCT(r2->out); r2->out.numPublisherIds = talloc_zero(r2, uint32_t); if (r2->out.numPublisherIds == NULL) { status = NT_STATUS_NO_MEMORY; p->fault_state = DCERPC_FAULT_CANT_PERFORM; goto fail; } r2->out.publisherIds = talloc_zero(r2, const char **); if (r2->out.publisherIds == NULL) { status = NT_STATUS_NO_MEMORY; p->fault_state = DCERPC_FAULT_CANT_PERFORM; goto fail; } r2->out.result = _eventlog6_EvtRpcGetPublisherList(p, r2); break; } case 23: { /* eventlog6_EvtRpcGetPublisherListForChannel */ struct eventlog6_EvtRpcGetPublisherListForChannel *r2 = (struct eventlog6_EvtRpcGetPublisherListForChannel *)r; if (DEBUGLEVEL >= 10) { NDR_PRINT_FUNCTION_DEBUG(eventlog6_EvtRpcGetPublisherListForChannel, NDR_IN, r2); } NDR_ZERO_STRUCT(r2->out); r2->out.numPublisherIds = talloc_zero(r2, uint32_t); if (r2->out.numPublisherIds == NULL) { status = NT_STATUS_NO_MEMORY; p->fault_state = DCERPC_FAULT_CANT_PERFORM; goto fail; } r2->out.publisherIds = talloc_zero(r2, const char **); if (r2->out.publisherIds == NULL) { status = NT_STATUS_NO_MEMORY; p->fault_state = DCERPC_FAULT_CANT_PERFORM; goto fail; } r2->out.result = _eventlog6_EvtRpcGetPublisherListForChannel(p, r2); break; } case 24: { /* eventlog6_EvtRpcGetPublisherMetadata */ struct eventlog6_EvtRpcGetPublisherMetadata *r2 = (struct eventlog6_EvtRpcGetPublisherMetadata *)r; if (DEBUGLEVEL >= 10) { NDR_PRINT_FUNCTION_DEBUG(eventlog6_EvtRpcGetPublisherMetadata, NDR_IN, r2); } NDR_ZERO_STRUCT(r2->out); r2->out.pubMetadataProps = talloc_zero(r2, struct eventlog6_EvtRpcVariantList); if (r2->out.pubMetadataProps == NULL) { status = NT_STATUS_NO_MEMORY; p->fault_state = DCERPC_FAULT_CANT_PERFORM; goto fail; } r2->out.pubMetadata = talloc_zero(r2, struct policy_handle); if (r2->out.pubMetadata == NULL) { status = NT_STATUS_NO_MEMORY; p->fault_state = DCERPC_FAULT_CANT_PERFORM; goto fail; } r2->out.result = _eventlog6_EvtRpcGetPublisherMetadata(p, r2); break; } case 25: { /* eventlog6_EvtRpcGetPublisherResourceMetadata */ struct eventlog6_EvtRpcGetPublisherResourceMetadata *r2 = (struct eventlog6_EvtRpcGetPublisherResourceMetadata *)r; if (DEBUGLEVEL >= 10) { NDR_PRINT_FUNCTION_DEBUG(eventlog6_EvtRpcGetPublisherResourceMetadata, NDR_IN, r2); } NDR_ZERO_STRUCT(r2->out); r2->out.pubMetadataProps = talloc_zero(r2, struct eventlog6_EvtRpcVariantList); if (r2->out.pubMetadataProps == NULL) { status = NT_STATUS_NO_MEMORY; p->fault_state = DCERPC_FAULT_CANT_PERFORM; goto fail; } r2->out.result = _eventlog6_EvtRpcGetPublisherResourceMetadata(p, r2); break; } case 26: { /* eventlog6_EvtRpcGetEventMetadataEnum */ struct eventlog6_EvtRpcGetEventMetadataEnum *r2 = (struct eventlog6_EvtRpcGetEventMetadataEnum *)r; if (DEBUGLEVEL >= 10) { NDR_PRINT_FUNCTION_DEBUG(eventlog6_EvtRpcGetEventMetadataEnum, NDR_IN, r2); } NDR_ZERO_STRUCT(r2->out); r2->out.eventMetaDataEnum = talloc_zero(r2, struct policy_handle); if (r2->out.eventMetaDataEnum == NULL) { status = NT_STATUS_NO_MEMORY; p->fault_state = DCERPC_FAULT_CANT_PERFORM; goto fail; } r2->out.result = _eventlog6_EvtRpcGetEventMetadataEnum(p, r2); break; } case 27: { /* eventlog6_EvtRpcGetNextEventMetadata */ struct eventlog6_EvtRpcGetNextEventMetadata *r2 = (struct eventlog6_EvtRpcGetNextEventMetadata *)r; if (DEBUGLEVEL >= 10) { NDR_PRINT_FUNCTION_DEBUG(eventlog6_EvtRpcGetNextEventMetadata, NDR_IN, r2); } NDR_ZERO_STRUCT(r2->out); r2->out.numReturned = talloc_zero(r2, uint32_t); if (r2->out.numReturned == NULL) { status = NT_STATUS_NO_MEMORY; p->fault_state = DCERPC_FAULT_CANT_PERFORM; goto fail; } r2->out.eventMetadataInstances = talloc_zero(r2, struct eventlog6_EvtRpcVariantList *); if (r2->out.eventMetadataInstances == NULL) { status = NT_STATUS_NO_MEMORY; p->fault_state = DCERPC_FAULT_CANT_PERFORM; goto fail; } r2->out.result = _eventlog6_EvtRpcGetNextEventMetadata(p, r2); break; } case 28: { /* eventlog6_EvtRpcGetClassicLogDisplayName */ struct eventlog6_EvtRpcGetClassicLogDisplayName *r2 = (struct eventlog6_EvtRpcGetClassicLogDisplayName *)r; if (DEBUGLEVEL >= 10) { NDR_PRINT_FUNCTION_DEBUG(eventlog6_EvtRpcGetClassicLogDisplayName, NDR_IN, r2); } NDR_ZERO_STRUCT(r2->out); r2->out.displayName = talloc_zero(r2, uint16_t *); if (r2->out.displayName == NULL) { status = NT_STATUS_NO_MEMORY; p->fault_state = DCERPC_FAULT_CANT_PERFORM; goto fail; } r2->out.result = _eventlog6_EvtRpcGetClassicLogDisplayName(p, r2); break; } default: dce_call->fault_code = DCERPC_FAULT_OP_RNG_ERROR; break; } fail: /* Unimpersonate */ if (impersonated) { unbecome_authenticated_pipe_user(); } p->dce_call = NULL; p->mem_ctx = NULL; /* Restore session info */ p->session_info = pipe_session_info; p->auth.auth_type = 0; p->auth.auth_level = 0; p->auth.auth_context_id = 0; /* Check pipes struct fault state */ if (p->fault_state != 0) { dce_call->fault_code = p->fault_state; } if (dce_call->fault_code != 0) { status = NT_STATUS_NET_WRITE_FAULT; } return status; } NTSTATUS eventlog6__op_dispatch(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, void *r) { return eventlog6__op_dispatch_internal(dce_call, mem_ctx, r, S3COMPAT_RPC_DISPATCH_EXTERNAL); } NTSTATUS eventlog6__op_reply(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, void *r) { uint16_t opnum = dce_call->pkt.u.request.opnum; switch (opnum) { case 0: { /* eventlog6_EvtRpcRegisterRemoteSubscription */ struct eventlog6_EvtRpcRegisterRemoteSubscription *r2 = (struct eventlog6_EvtRpcRegisterRemoteSubscription *)r; if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) { DEBUG(5,("function eventlog6_EvtRpcRegisterRemoteSubscription replied async\n")); } if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) { NDR_PRINT_FUNCTION_DEBUG(eventlog6_EvtRpcRegisterRemoteSubscription, NDR_OUT | NDR_SET_VALUES, r2); } if (dce_call->fault_code != 0) { DBG_WARNING("dcerpc_fault %s in eventlog6_EvtRpcRegisterRemoteSubscription\n", dcerpc_errstr(mem_ctx, dce_call->fault_code)); } break; } case 1: { /* eventlog6_EvtRpcRemoteSubscriptionNextAsync */ struct eventlog6_EvtRpcRemoteSubscriptionNextAsync *r2 = (struct eventlog6_EvtRpcRemoteSubscriptionNextAsync *)r; if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) { DEBUG(5,("function eventlog6_EvtRpcRemoteSubscriptionNextAsync replied async\n")); } if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) { NDR_PRINT_FUNCTION_DEBUG(eventlog6_EvtRpcRemoteSubscriptionNextAsync, NDR_OUT | NDR_SET_VALUES, r2); } if (dce_call->fault_code != 0) { DBG_WARNING("dcerpc_fault %s in eventlog6_EvtRpcRemoteSubscriptionNextAsync\n", dcerpc_errstr(mem_ctx, dce_call->fault_code)); } break; } case 2: { /* eventlog6_EvtRpcRemoteSubscriptionNext */ struct eventlog6_EvtRpcRemoteSubscriptionNext *r2 = (struct eventlog6_EvtRpcRemoteSubscriptionNext *)r; if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) { DEBUG(5,("function eventlog6_EvtRpcRemoteSubscriptionNext replied async\n")); } if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) { NDR_PRINT_FUNCTION_DEBUG(eventlog6_EvtRpcRemoteSubscriptionNext, NDR_OUT | NDR_SET_VALUES, r2); } if (dce_call->fault_code != 0) { DBG_WARNING("dcerpc_fault %s in eventlog6_EvtRpcRemoteSubscriptionNext\n", dcerpc_errstr(mem_ctx, dce_call->fault_code)); } break; } case 3: { /* eventlog6_EvtRpcRemoteSubscriptionWaitAsync */ struct eventlog6_EvtRpcRemoteSubscriptionWaitAsync *r2 = (struct eventlog6_EvtRpcRemoteSubscriptionWaitAsync *)r; if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) { DEBUG(5,("function eventlog6_EvtRpcRemoteSubscriptionWaitAsync replied async\n")); } if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) { NDR_PRINT_FUNCTION_DEBUG(eventlog6_EvtRpcRemoteSubscriptionWaitAsync, NDR_OUT | NDR_SET_VALUES, r2); } if (dce_call->fault_code != 0) { DBG_WARNING("dcerpc_fault %s in eventlog6_EvtRpcRemoteSubscriptionWaitAsync\n", dcerpc_errstr(mem_ctx, dce_call->fault_code)); } break; } case 4: { /* eventlog6_EvtRpcRegisterControllableOperation */ struct eventlog6_EvtRpcRegisterControllableOperation *r2 = (struct eventlog6_EvtRpcRegisterControllableOperation *)r; if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) { DEBUG(5,("function eventlog6_EvtRpcRegisterControllableOperation replied async\n")); } if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) { NDR_PRINT_FUNCTION_DEBUG(eventlog6_EvtRpcRegisterControllableOperation, NDR_OUT | NDR_SET_VALUES, r2); } if (dce_call->fault_code != 0) { DBG_WARNING("dcerpc_fault %s in eventlog6_EvtRpcRegisterControllableOperation\n", dcerpc_errstr(mem_ctx, dce_call->fault_code)); } break; } case 5: { /* eventlog6_EvtRpcRegisterLogQuery */ struct eventlog6_EvtRpcRegisterLogQuery *r2 = (struct eventlog6_EvtRpcRegisterLogQuery *)r; if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) { DEBUG(5,("function eventlog6_EvtRpcRegisterLogQuery replied async\n")); } if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) { NDR_PRINT_FUNCTION_DEBUG(eventlog6_EvtRpcRegisterLogQuery, NDR_OUT | NDR_SET_VALUES, r2); } if (dce_call->fault_code != 0) { DBG_WARNING("dcerpc_fault %s in eventlog6_EvtRpcRegisterLogQuery\n", dcerpc_errstr(mem_ctx, dce_call->fault_code)); } break; } case 6: { /* eventlog6_EvtRpcClearLog */ struct eventlog6_EvtRpcClearLog *r2 = (struct eventlog6_EvtRpcClearLog *)r; if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) { DEBUG(5,("function eventlog6_EvtRpcClearLog replied async\n")); } if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) { NDR_PRINT_FUNCTION_DEBUG(eventlog6_EvtRpcClearLog, NDR_OUT | NDR_SET_VALUES, r2); } if (dce_call->fault_code != 0) { DBG_WARNING("dcerpc_fault %s in eventlog6_EvtRpcClearLog\n", dcerpc_errstr(mem_ctx, dce_call->fault_code)); } break; } case 7: { /* eventlog6_EvtRpcExportLog */ struct eventlog6_EvtRpcExportLog *r2 = (struct eventlog6_EvtRpcExportLog *)r; if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) { DEBUG(5,("function eventlog6_EvtRpcExportLog replied async\n")); } if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) { NDR_PRINT_FUNCTION_DEBUG(eventlog6_EvtRpcExportLog, NDR_OUT | NDR_SET_VALUES, r2); } if (dce_call->fault_code != 0) { DBG_WARNING("dcerpc_fault %s in eventlog6_EvtRpcExportLog\n", dcerpc_errstr(mem_ctx, dce_call->fault_code)); } break; } case 8: { /* eventlog6_EvtRpcLocalizeExportLog */ struct eventlog6_EvtRpcLocalizeExportLog *r2 = (struct eventlog6_EvtRpcLocalizeExportLog *)r; if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) { DEBUG(5,("function eventlog6_EvtRpcLocalizeExportLog replied async\n")); } if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) { NDR_PRINT_FUNCTION_DEBUG(eventlog6_EvtRpcLocalizeExportLog, NDR_OUT | NDR_SET_VALUES, r2); } if (dce_call->fault_code != 0) { DBG_WARNING("dcerpc_fault %s in eventlog6_EvtRpcLocalizeExportLog\n", dcerpc_errstr(mem_ctx, dce_call->fault_code)); } break; } case 9: { /* eventlog6_EvtRpcMessageRender */ struct eventlog6_EvtRpcMessageRender *r2 = (struct eventlog6_EvtRpcMessageRender *)r; if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) { DEBUG(5,("function eventlog6_EvtRpcMessageRender replied async\n")); } if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) { NDR_PRINT_FUNCTION_DEBUG(eventlog6_EvtRpcMessageRender, NDR_OUT | NDR_SET_VALUES, r2); } if (dce_call->fault_code != 0) { DBG_WARNING("dcerpc_fault %s in eventlog6_EvtRpcMessageRender\n", dcerpc_errstr(mem_ctx, dce_call->fault_code)); } break; } case 10: { /* eventlog6_EvtRpcMessageRenderDefault */ struct eventlog6_EvtRpcMessageRenderDefault *r2 = (struct eventlog6_EvtRpcMessageRenderDefault *)r; if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) { DEBUG(5,("function eventlog6_EvtRpcMessageRenderDefault replied async\n")); } if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) { NDR_PRINT_FUNCTION_DEBUG(eventlog6_EvtRpcMessageRenderDefault, NDR_OUT | NDR_SET_VALUES, r2); } if (dce_call->fault_code != 0) { DBG_WARNING("dcerpc_fault %s in eventlog6_EvtRpcMessageRenderDefault\n", dcerpc_errstr(mem_ctx, dce_call->fault_code)); } break; } case 11: { /* eventlog6_EvtRpcQueryNext */ struct eventlog6_EvtRpcQueryNext *r2 = (struct eventlog6_EvtRpcQueryNext *)r; if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) { DEBUG(5,("function eventlog6_EvtRpcQueryNext replied async\n")); } if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) { NDR_PRINT_FUNCTION_DEBUG(eventlog6_EvtRpcQueryNext, NDR_OUT | NDR_SET_VALUES, r2); } if (dce_call->fault_code != 0) { DBG_WARNING("dcerpc_fault %s in eventlog6_EvtRpcQueryNext\n", dcerpc_errstr(mem_ctx, dce_call->fault_code)); } break; } case 12: { /* eventlog6_EvtRpcQuerySeek */ struct eventlog6_EvtRpcQuerySeek *r2 = (struct eventlog6_EvtRpcQuerySeek *)r; if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) { DEBUG(5,("function eventlog6_EvtRpcQuerySeek replied async\n")); } if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) { NDR_PRINT_FUNCTION_DEBUG(eventlog6_EvtRpcQuerySeek, NDR_OUT | NDR_SET_VALUES, r2); } if (dce_call->fault_code != 0) { DBG_WARNING("dcerpc_fault %s in eventlog6_EvtRpcQuerySeek\n", dcerpc_errstr(mem_ctx, dce_call->fault_code)); } break; } case 13: { /* eventlog6_EvtRpcClose */ struct eventlog6_EvtRpcClose *r2 = (struct eventlog6_EvtRpcClose *)r; if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) { DEBUG(5,("function eventlog6_EvtRpcClose replied async\n")); } if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) { NDR_PRINT_FUNCTION_DEBUG(eventlog6_EvtRpcClose, NDR_OUT | NDR_SET_VALUES, r2); } if (dce_call->fault_code != 0) { DBG_WARNING("dcerpc_fault %s in eventlog6_EvtRpcClose\n", dcerpc_errstr(mem_ctx, dce_call->fault_code)); } break; } case 14: { /* eventlog6_EvtRpcCancel */ struct eventlog6_EvtRpcCancel *r2 = (struct eventlog6_EvtRpcCancel *)r; if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) { DEBUG(5,("function eventlog6_EvtRpcCancel replied async\n")); } if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) { NDR_PRINT_FUNCTION_DEBUG(eventlog6_EvtRpcCancel, NDR_OUT | NDR_SET_VALUES, r2); } if (dce_call->fault_code != 0) { DBG_WARNING("dcerpc_fault %s in eventlog6_EvtRpcCancel\n", dcerpc_errstr(mem_ctx, dce_call->fault_code)); } break; } case 15: { /* eventlog6_EvtRpcAssertConfig */ struct eventlog6_EvtRpcAssertConfig *r2 = (struct eventlog6_EvtRpcAssertConfig *)r; if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) { DEBUG(5,("function eventlog6_EvtRpcAssertConfig replied async\n")); } if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) { NDR_PRINT_FUNCTION_DEBUG(eventlog6_EvtRpcAssertConfig, NDR_OUT | NDR_SET_VALUES, r2); } if (dce_call->fault_code != 0) { DBG_WARNING("dcerpc_fault %s in eventlog6_EvtRpcAssertConfig\n", dcerpc_errstr(mem_ctx, dce_call->fault_code)); } break; } case 16: { /* eventlog6_EvtRpcRetractConfig */ struct eventlog6_EvtRpcRetractConfig *r2 = (struct eventlog6_EvtRpcRetractConfig *)r; if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) { DEBUG(5,("function eventlog6_EvtRpcRetractConfig replied async\n")); } if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) { NDR_PRINT_FUNCTION_DEBUG(eventlog6_EvtRpcRetractConfig, NDR_OUT | NDR_SET_VALUES, r2); } if (dce_call->fault_code != 0) { DBG_WARNING("dcerpc_fault %s in eventlog6_EvtRpcRetractConfig\n", dcerpc_errstr(mem_ctx, dce_call->fault_code)); } break; } case 17: { /* eventlog6_EvtRpcOpenLogHandle */ struct eventlog6_EvtRpcOpenLogHandle *r2 = (struct eventlog6_EvtRpcOpenLogHandle *)r; if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) { DEBUG(5,("function eventlog6_EvtRpcOpenLogHandle replied async\n")); } if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) { NDR_PRINT_FUNCTION_DEBUG(eventlog6_EvtRpcOpenLogHandle, NDR_OUT | NDR_SET_VALUES, r2); } if (dce_call->fault_code != 0) { DBG_WARNING("dcerpc_fault %s in eventlog6_EvtRpcOpenLogHandle\n", dcerpc_errstr(mem_ctx, dce_call->fault_code)); } break; } case 18: { /* eventlog6_EvtRpcGetLogFileInfo */ struct eventlog6_EvtRpcGetLogFileInfo *r2 = (struct eventlog6_EvtRpcGetLogFileInfo *)r; if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) { DEBUG(5,("function eventlog6_EvtRpcGetLogFileInfo replied async\n")); } if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) { NDR_PRINT_FUNCTION_DEBUG(eventlog6_EvtRpcGetLogFileInfo, NDR_OUT | NDR_SET_VALUES, r2); } if (dce_call->fault_code != 0) { DBG_WARNING("dcerpc_fault %s in eventlog6_EvtRpcGetLogFileInfo\n", dcerpc_errstr(mem_ctx, dce_call->fault_code)); } break; } case 19: { /* eventlog6_EvtRpcGetChannelList */ struct eventlog6_EvtRpcGetChannelList *r2 = (struct eventlog6_EvtRpcGetChannelList *)r; if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) { DEBUG(5,("function eventlog6_EvtRpcGetChannelList replied async\n")); } if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) { NDR_PRINT_FUNCTION_DEBUG(eventlog6_EvtRpcGetChannelList, NDR_OUT | NDR_SET_VALUES, r2); } if (dce_call->fault_code != 0) { DBG_WARNING("dcerpc_fault %s in eventlog6_EvtRpcGetChannelList\n", dcerpc_errstr(mem_ctx, dce_call->fault_code)); } break; } case 20: { /* eventlog6_EvtRpcGetChannelConfig */ struct eventlog6_EvtRpcGetChannelConfig *r2 = (struct eventlog6_EvtRpcGetChannelConfig *)r; if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) { DEBUG(5,("function eventlog6_EvtRpcGetChannelConfig replied async\n")); } if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) { NDR_PRINT_FUNCTION_DEBUG(eventlog6_EvtRpcGetChannelConfig, NDR_OUT | NDR_SET_VALUES, r2); } if (dce_call->fault_code != 0) { DBG_WARNING("dcerpc_fault %s in eventlog6_EvtRpcGetChannelConfig\n", dcerpc_errstr(mem_ctx, dce_call->fault_code)); } break; } case 21: { /* eventlog6_EvtRpcPutChannelConfig */ struct eventlog6_EvtRpcPutChannelConfig *r2 = (struct eventlog6_EvtRpcPutChannelConfig *)r; if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) { DEBUG(5,("function eventlog6_EvtRpcPutChannelConfig replied async\n")); } if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) { NDR_PRINT_FUNCTION_DEBUG(eventlog6_EvtRpcPutChannelConfig, NDR_OUT | NDR_SET_VALUES, r2); } if (dce_call->fault_code != 0) { DBG_WARNING("dcerpc_fault %s in eventlog6_EvtRpcPutChannelConfig\n", dcerpc_errstr(mem_ctx, dce_call->fault_code)); } break; } case 22: { /* eventlog6_EvtRpcGetPublisherList */ struct eventlog6_EvtRpcGetPublisherList *r2 = (struct eventlog6_EvtRpcGetPublisherList *)r; if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) { DEBUG(5,("function eventlog6_EvtRpcGetPublisherList replied async\n")); } if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) { NDR_PRINT_FUNCTION_DEBUG(eventlog6_EvtRpcGetPublisherList, NDR_OUT | NDR_SET_VALUES, r2); } if (dce_call->fault_code != 0) { DBG_WARNING("dcerpc_fault %s in eventlog6_EvtRpcGetPublisherList\n", dcerpc_errstr(mem_ctx, dce_call->fault_code)); } break; } case 23: { /* eventlog6_EvtRpcGetPublisherListForChannel */ struct eventlog6_EvtRpcGetPublisherListForChannel *r2 = (struct eventlog6_EvtRpcGetPublisherListForChannel *)r; if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) { DEBUG(5,("function eventlog6_EvtRpcGetPublisherListForChannel replied async\n")); } if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) { NDR_PRINT_FUNCTION_DEBUG(eventlog6_EvtRpcGetPublisherListForChannel, NDR_OUT | NDR_SET_VALUES, r2); } if (dce_call->fault_code != 0) { DBG_WARNING("dcerpc_fault %s in eventlog6_EvtRpcGetPublisherListForChannel\n", dcerpc_errstr(mem_ctx, dce_call->fault_code)); } break; } case 24: { /* eventlog6_EvtRpcGetPublisherMetadata */ struct eventlog6_EvtRpcGetPublisherMetadata *r2 = (struct eventlog6_EvtRpcGetPublisherMetadata *)r; if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) { DEBUG(5,("function eventlog6_EvtRpcGetPublisherMetadata replied async\n")); } if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) { NDR_PRINT_FUNCTION_DEBUG(eventlog6_EvtRpcGetPublisherMetadata, NDR_OUT | NDR_SET_VALUES, r2); } if (dce_call->fault_code != 0) { DBG_WARNING("dcerpc_fault %s in eventlog6_EvtRpcGetPublisherMetadata\n", dcerpc_errstr(mem_ctx, dce_call->fault_code)); } break; } case 25: { /* eventlog6_EvtRpcGetPublisherResourceMetadata */ struct eventlog6_EvtRpcGetPublisherResourceMetadata *r2 = (struct eventlog6_EvtRpcGetPublisherResourceMetadata *)r; if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) { DEBUG(5,("function eventlog6_EvtRpcGetPublisherResourceMetadata replied async\n")); } if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) { NDR_PRINT_FUNCTION_DEBUG(eventlog6_EvtRpcGetPublisherResourceMetadata, NDR_OUT | NDR_SET_VALUES, r2); } if (dce_call->fault_code != 0) { DBG_WARNING("dcerpc_fault %s in eventlog6_EvtRpcGetPublisherResourceMetadata\n", dcerpc_errstr(mem_ctx, dce_call->fault_code)); } break; } case 26: { /* eventlog6_EvtRpcGetEventMetadataEnum */ struct eventlog6_EvtRpcGetEventMetadataEnum *r2 = (struct eventlog6_EvtRpcGetEventMetadataEnum *)r; if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) { DEBUG(5,("function eventlog6_EvtRpcGetEventMetadataEnum replied async\n")); } if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) { NDR_PRINT_FUNCTION_DEBUG(eventlog6_EvtRpcGetEventMetadataEnum, NDR_OUT | NDR_SET_VALUES, r2); } if (dce_call->fault_code != 0) { DBG_WARNING("dcerpc_fault %s in eventlog6_EvtRpcGetEventMetadataEnum\n", dcerpc_errstr(mem_ctx, dce_call->fault_code)); } break; } case 27: { /* eventlog6_EvtRpcGetNextEventMetadata */ struct eventlog6_EvtRpcGetNextEventMetadata *r2 = (struct eventlog6_EvtRpcGetNextEventMetadata *)r; if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) { DEBUG(5,("function eventlog6_EvtRpcGetNextEventMetadata replied async\n")); } if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) { NDR_PRINT_FUNCTION_DEBUG(eventlog6_EvtRpcGetNextEventMetadata, NDR_OUT | NDR_SET_VALUES, r2); } if (dce_call->fault_code != 0) { DBG_WARNING("dcerpc_fault %s in eventlog6_EvtRpcGetNextEventMetadata\n", dcerpc_errstr(mem_ctx, dce_call->fault_code)); } break; } case 28: { /* eventlog6_EvtRpcGetClassicLogDisplayName */ struct eventlog6_EvtRpcGetClassicLogDisplayName *r2 = (struct eventlog6_EvtRpcGetClassicLogDisplayName *)r; if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) { DEBUG(5,("function eventlog6_EvtRpcGetClassicLogDisplayName replied async\n")); } if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) { NDR_PRINT_FUNCTION_DEBUG(eventlog6_EvtRpcGetClassicLogDisplayName, NDR_OUT | NDR_SET_VALUES, r2); } if (dce_call->fault_code != 0) { DBG_WARNING("dcerpc_fault %s in eventlog6_EvtRpcGetClassicLogDisplayName\n", dcerpc_errstr(mem_ctx, dce_call->fault_code)); } break; } default: dce_call->fault_code = DCERPC_FAULT_OP_RNG_ERROR; break; } if (dce_call->fault_code != 0) { return NT_STATUS_NET_WRITE_FAULT; } return NT_STATUS_OK; } NTSTATUS eventlog6__op_ndr_push(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, struct ndr_push *push, const void *r) { enum ndr_err_code ndr_err; uint16_t opnum = dce_call->pkt.u.request.opnum; ndr_err = ndr_table_eventlog6.calls[opnum].ndr_push(push, NDR_OUT, r); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { dce_call->fault_code = DCERPC_FAULT_NDR; return NT_STATUS_NET_WRITE_FAULT; } return NT_STATUS_OK; } NTSTATUS eventlog6__op_local(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, void *r) { return eventlog6__op_dispatch_internal(dce_call, mem_ctx, r, S3COMPAT_RPC_DISPATCH_INTERNAL); } static const struct dcesrv_interface dcesrv_eventlog6_interface = { .name = "eventlog6", .syntax_id = {{0xf6beaff7,0x1e19,0x4fbb,{0x9f,0x8f},{0xb8,0x9e,0x20,0x18,0x33,0x7c}},1.0}, .bind = eventlog6__op_bind, .unbind = eventlog6__op_unbind, .ndr_pull = eventlog6__op_ndr_pull, .dispatch = eventlog6__op_dispatch, .reply = eventlog6__op_reply, .ndr_push = eventlog6__op_ndr_push, .local = eventlog6__op_local, #ifdef DCESRV_INTERFACE_EVENTLOG6_FLAGS .flags = DCESRV_INTERFACE_EVENTLOG6_FLAGS #else .flags = 0 #endif }; static NTSTATUS eventlog6__check_register_in_endpoint(const char *name, struct dcerpc_binding *binding) { enum dcerpc_transport_t transport = dcerpc_binding_get_transport(binding); /* If service is embedded, register only for ncacn_np * see 8466b3c85e4b835e57e41776853093f4a0edc8b8 */ if (rpc_service_mode(name) == RPC_SERVICE_MODE_EMBEDDED && (transport != NCACN_NP && transport != NCALRPC)) { DBG_INFO("Interface 'eventlog6' not registered in endpoint '%s' as service is embedded\n", name); return NT_STATUS_NOT_SUPPORTED; } return NT_STATUS_OK; } static NTSTATUS eventlog6__op_init_server(struct dcesrv_context *dce_ctx, const struct dcesrv_endpoint_server *ep_server) { uint32_t i; NTSTATUS ret; struct dcerpc_binding *binding; #ifdef DCESRV_INTERFACE_EVENTLOG6_NCACN_NP_SECONDARY_ENDPOINT const char *ncacn_np_secondary_endpoint = DCESRV_INTERFACE_EVENTLOG6_NCACN_NP_SECONDARY_ENDPOINT; #else const char *ncacn_np_secondary_endpoint = NULL; #endif for (i=0;icount;i++) { const char *name = ndr_table_eventlog6.endpoints->names[i]; ret = dcerpc_parse_binding(dce_ctx, name, &binding); if (NT_STATUS_IS_ERR(ret)) { DBG_ERR("Failed to parse binding string '%s'\n", name); return ret; } ret = eventlog6__check_register_in_endpoint("eventlog6", binding); if (NT_STATUS_IS_ERR(ret)) { talloc_free(binding); continue; } talloc_free(binding); ret = dcesrv_interface_register(dce_ctx, name, ncacn_np_secondary_endpoint, &dcesrv_eventlog6_interface, NULL); if (!NT_STATUS_IS_OK(ret)) { DBG_ERR("Failed to register endpoint '%s'\n",name); return ret; } } return NT_STATUS_OK; } static NTSTATUS eventlog6__op_shutdown_server(struct dcesrv_context *dce_ctx, const struct dcesrv_endpoint_server *ep_server) { return NT_STATUS_OK; } static bool eventlog6__op_interface_by_uuid(struct dcesrv_interface *iface, const struct GUID *uuid, uint32_t if_version) { if (dcesrv_eventlog6_interface.syntax_id.if_version == if_version && GUID_equal(&dcesrv_eventlog6_interface.syntax_id.uuid, uuid)) { memcpy(iface,&dcesrv_eventlog6_interface, sizeof(*iface)); return true; } return false; } static bool eventlog6__op_interface_by_name(struct dcesrv_interface *iface, const char *name) { if (strcmp(dcesrv_eventlog6_interface.name, name)==0) { memcpy(iface, &dcesrv_eventlog6_interface, sizeof(*iface)); return true; } return false; } static const struct dcesrv_endpoint_server eventlog6_ep_server = { /* fill in our name */ .name = "eventlog6", /* Initialization flag */ .initialized = false, /* fill in all the operations */ #ifdef DCESRV_INTERFACE_EVENTLOG6_INIT_SERVER .init_server = DCESRV_INTERFACE_EVENTLOG6_INIT_SERVER, #else .init_server = eventlog6__op_init_server, #endif #ifdef DCESRV_INTERFACE_EVENTLOG6_SHUTDOWN_SERVER .shutdown_server = DCESRV_INTERFACE_EVENTLOG6_SHUTDOWN_SERVER, #else .shutdown_server = eventlog6__op_shutdown_server, #endif .interface_by_uuid = eventlog6__op_interface_by_uuid, .interface_by_name = eventlog6__op_interface_by_name }; const struct dcesrv_endpoint_server *eventlog6_get_ep_server(void) { return &eventlog6_ep_server; }