#include "includes.h"
#include "ntdomain.h"
+#include "lib/util/tevent_ntstatus.h"
+#include "librpc/rpc/dcerpc_connection.h"
#include "bin/default/librpc/gen_ndr/s3compat_efs.h"
struct _s3_compat_EfsRpcOpenFileRaw_state {
};
static struct tevent_req *_s3_compat_EfsRpcOpenFileRaw_send(TALLOC_CTX *mem_ctx,
- struct tevent_context *ev,
- struct dcerpc_call_handle *call,
- struct EfsRpcOpenFileRaw *r)
+ struct tevent_context *ev,
+ struct dcerpc_call_handle *call,
+ struct EfsRpcOpenFileRaw *r)
{
- struct tevent_req *req
+ struct tevent_req *req;
struct _s3_compat_EfsRpcOpenFileRaw_state *state;
struct pipes_struct *p;
state->r = r;
p = dcerpc_call_handle_get_pipes_struct(call);
+ if (p == NULL) {
+ tevent_req_nterror(req, NT_STATUS_NO_MEMORY);
+ return tevent_req_post(req, ev);
+ }
ZERO_STRUCT(r->out);
r->out.pvContext = talloc_zero(r, struct policy_handle);
if (p->fault_state) {
NTSTATUS status = dcerpc_fault_to_nt_status(p->fault_state);
- tevent_req_nterror(status);
+ tevent_req_nterror(req, status);
return tevent_req_post(req, ev);
}
};
static struct tevent_req *_s3_compat_EfsRpcReadFileRaw_send(TALLOC_CTX *mem_ctx,
- struct tevent_context *ev,
- struct dcerpc_call_handle *call,
- struct EfsRpcReadFileRaw *r)
+ struct tevent_context *ev,
+ struct dcerpc_call_handle *call,
+ struct EfsRpcReadFileRaw *r)
{
- struct tevent_req *req
+ struct tevent_req *req;
struct _s3_compat_EfsRpcReadFileRaw_state *state;
struct pipes_struct *p;
state->r = r;
p = dcerpc_call_handle_get_pipes_struct(call);
+ if (p == NULL) {
+ tevent_req_nterror(req, NT_STATUS_NO_MEMORY);
+ return tevent_req_post(req, ev);
+ }
r->out.result = _EfsRpcReadFileRaw(p, r);
if (p->fault_state) {
NTSTATUS status = dcerpc_fault_to_nt_status(p->fault_state);
- tevent_req_nterror(status);
+ tevent_req_nterror(req, status);
return tevent_req_post(req, ev);
}
};
static struct tevent_req *_s3_compat_EfsRpcWriteFileRaw_send(TALLOC_CTX *mem_ctx,
- struct tevent_context *ev,
- struct dcerpc_call_handle *call,
- struct EfsRpcWriteFileRaw *r)
+ struct tevent_context *ev,
+ struct dcerpc_call_handle *call,
+ struct EfsRpcWriteFileRaw *r)
{
- struct tevent_req *req
+ struct tevent_req *req;
struct _s3_compat_EfsRpcWriteFileRaw_state *state;
struct pipes_struct *p;
state->r = r;
p = dcerpc_call_handle_get_pipes_struct(call);
+ if (p == NULL) {
+ tevent_req_nterror(req, NT_STATUS_NO_MEMORY);
+ return tevent_req_post(req, ev);
+ }
r->out.result = _EfsRpcWriteFileRaw(p, r);
if (p->fault_state) {
NTSTATUS status = dcerpc_fault_to_nt_status(p->fault_state);
- tevent_req_nterror(status);
+ tevent_req_nterror(req, status);
return tevent_req_post(req, ev);
}
};
static struct tevent_req *_s3_compat_EfsRpcCloseRaw_send(TALLOC_CTX *mem_ctx,
- struct tevent_context *ev,
- struct dcerpc_call_handle *call,
- struct EfsRpcCloseRaw *r)
+ struct tevent_context *ev,
+ struct dcerpc_call_handle *call,
+ struct EfsRpcCloseRaw *r)
{
- struct tevent_req *req
+ struct tevent_req *req;
struct _s3_compat_EfsRpcCloseRaw_state *state;
struct pipes_struct *p;
state->r = r;
p = dcerpc_call_handle_get_pipes_struct(call);
+ if (p == NULL) {
+ tevent_req_nterror(req, NT_STATUS_NO_MEMORY);
+ return tevent_req_post(req, ev);
+ }
ZERO_STRUCT(r->out);
r->out.pvContext = r->in.pvContext;
if (p->fault_state) {
NTSTATUS status = dcerpc_fault_to_nt_status(p->fault_state);
- tevent_req_nterror(status);
+ tevent_req_nterror(req, status);
return tevent_req_post(req, ev);
}
};
static struct tevent_req *_s3_compat_EfsRpcEncryptFileSrv_send(TALLOC_CTX *mem_ctx,
- struct tevent_context *ev,
- struct dcerpc_call_handle *call,
- struct EfsRpcEncryptFileSrv *r)
+ struct tevent_context *ev,
+ struct dcerpc_call_handle *call,
+ struct EfsRpcEncryptFileSrv *r)
{
- struct tevent_req *req
+ struct tevent_req *req;
struct _s3_compat_EfsRpcEncryptFileSrv_state *state;
struct pipes_struct *p;
state->r = r;
p = dcerpc_call_handle_get_pipes_struct(call);
+ if (p == NULL) {
+ tevent_req_nterror(req, NT_STATUS_NO_MEMORY);
+ return tevent_req_post(req, ev);
+ }
r->out.result = _EfsRpcEncryptFileSrv(p, r);
if (p->fault_state) {
NTSTATUS status = dcerpc_fault_to_nt_status(p->fault_state);
- tevent_req_nterror(status);
+ tevent_req_nterror(req, status);
return tevent_req_post(req, ev);
}
};
static struct tevent_req *_s3_compat_EfsRpcDecryptFileSrv_send(TALLOC_CTX *mem_ctx,
- struct tevent_context *ev,
- struct dcerpc_call_handle *call,
- struct EfsRpcDecryptFileSrv *r)
+ struct tevent_context *ev,
+ struct dcerpc_call_handle *call,
+ struct EfsRpcDecryptFileSrv *r)
{
- struct tevent_req *req
+ struct tevent_req *req;
struct _s3_compat_EfsRpcDecryptFileSrv_state *state;
struct pipes_struct *p;
state->r = r;
p = dcerpc_call_handle_get_pipes_struct(call);
+ if (p == NULL) {
+ tevent_req_nterror(req, NT_STATUS_NO_MEMORY);
+ return tevent_req_post(req, ev);
+ }
r->out.result = _EfsRpcDecryptFileSrv(p, r);
if (p->fault_state) {
NTSTATUS status = dcerpc_fault_to_nt_status(p->fault_state);
- tevent_req_nterror(status);
+ tevent_req_nterror(req, status);
return tevent_req_post(req, ev);
}
};
static struct tevent_req *_s3_compat_EfsRpcQueryUsersOnFile_send(TALLOC_CTX *mem_ctx,
- struct tevent_context *ev,
- struct dcerpc_call_handle *call,
- struct EfsRpcQueryUsersOnFile *r)
+ struct tevent_context *ev,
+ struct dcerpc_call_handle *call,
+ struct EfsRpcQueryUsersOnFile *r)
{
- struct tevent_req *req
+ struct tevent_req *req;
struct _s3_compat_EfsRpcQueryUsersOnFile_state *state;
struct pipes_struct *p;
state->r = r;
p = dcerpc_call_handle_get_pipes_struct(call);
+ if (p == NULL) {
+ tevent_req_nterror(req, NT_STATUS_NO_MEMORY);
+ return tevent_req_post(req, ev);
+ }
ZERO_STRUCT(r->out);
r->out.pUsers = talloc_zero(r, struct ENCRYPTION_CERTIFICATE_HASH_LIST *);
if (p->fault_state) {
NTSTATUS status = dcerpc_fault_to_nt_status(p->fault_state);
- tevent_req_nterror(status);
+ tevent_req_nterror(req, status);
return tevent_req_post(req, ev);
}
};
static struct tevent_req *_s3_compat_EfsRpcQueryRecoveryAgents_send(TALLOC_CTX *mem_ctx,
- struct tevent_context *ev,
- struct dcerpc_call_handle *call,
- struct EfsRpcQueryRecoveryAgents *r)
+ struct tevent_context *ev,
+ struct dcerpc_call_handle *call,
+ struct EfsRpcQueryRecoveryAgents *r)
{
- struct tevent_req *req
+ struct tevent_req *req;
struct _s3_compat_EfsRpcQueryRecoveryAgents_state *state;
struct pipes_struct *p;
state->r = r;
p = dcerpc_call_handle_get_pipes_struct(call);
+ if (p == NULL) {
+ tevent_req_nterror(req, NT_STATUS_NO_MEMORY);
+ return tevent_req_post(req, ev);
+ }
ZERO_STRUCT(r->out);
r->out.pRecoveryAgents = talloc_zero(r, struct ENCRYPTION_CERTIFICATE_HASH_LIST *);
if (p->fault_state) {
NTSTATUS status = dcerpc_fault_to_nt_status(p->fault_state);
- tevent_req_nterror(status);
+ tevent_req_nterror(req, status);
return tevent_req_post(req, ev);
}
};
static struct tevent_req *_s3_compat_EfsRpcRemoveUsersFromFile_send(TALLOC_CTX *mem_ctx,
- struct tevent_context *ev,
- struct dcerpc_call_handle *call,
- struct EfsRpcRemoveUsersFromFile *r)
+ struct tevent_context *ev,
+ struct dcerpc_call_handle *call,
+ struct EfsRpcRemoveUsersFromFile *r)
{
- struct tevent_req *req
+ struct tevent_req *req;
struct _s3_compat_EfsRpcRemoveUsersFromFile_state *state;
struct pipes_struct *p;
state->r = r;
p = dcerpc_call_handle_get_pipes_struct(call);
+ if (p == NULL) {
+ tevent_req_nterror(req, NT_STATUS_NO_MEMORY);
+ return tevent_req_post(req, ev);
+ }
r->out.result = _EfsRpcRemoveUsersFromFile(p, r);
if (p->fault_state) {
NTSTATUS status = dcerpc_fault_to_nt_status(p->fault_state);
- tevent_req_nterror(status);
+ tevent_req_nterror(req, status);
return tevent_req_post(req, ev);
}
};
static struct tevent_req *_s3_compat_EfsRpcAddUsersToFile_send(TALLOC_CTX *mem_ctx,
- struct tevent_context *ev,
- struct dcerpc_call_handle *call,
- struct EfsRpcAddUsersToFile *r)
+ struct tevent_context *ev,
+ struct dcerpc_call_handle *call,
+ struct EfsRpcAddUsersToFile *r)
{
- struct tevent_req *req
+ struct tevent_req *req;
struct _s3_compat_EfsRpcAddUsersToFile_state *state;
struct pipes_struct *p;
state->r = r;
p = dcerpc_call_handle_get_pipes_struct(call);
+ if (p == NULL) {
+ tevent_req_nterror(req, NT_STATUS_NO_MEMORY);
+ return tevent_req_post(req, ev);
+ }
r->out.result = _EfsRpcAddUsersToFile(p, r);
if (p->fault_state) {
NTSTATUS status = dcerpc_fault_to_nt_status(p->fault_state);
- tevent_req_nterror(status);
+ tevent_req_nterror(req, status);
return tevent_req_post(req, ev);
}
};
static struct tevent_req *_s3_compat_EfsRpcSetFileEncryptionKey_send(TALLOC_CTX *mem_ctx,
- struct tevent_context *ev,
- struct dcerpc_call_handle *call,
- struct EfsRpcSetFileEncryptionKey *r)
+ struct tevent_context *ev,
+ struct dcerpc_call_handle *call,
+ struct EfsRpcSetFileEncryptionKey *r)
{
- struct tevent_req *req
+ struct tevent_req *req;
struct _s3_compat_EfsRpcSetFileEncryptionKey_state *state;
struct pipes_struct *p;
state->r = r;
p = dcerpc_call_handle_get_pipes_struct(call);
+ if (p == NULL) {
+ tevent_req_nterror(req, NT_STATUS_NO_MEMORY);
+ return tevent_req_post(req, ev);
+ }
r->out.result = _EfsRpcSetFileEncryptionKey(p, r);
if (p->fault_state) {
NTSTATUS status = dcerpc_fault_to_nt_status(p->fault_state);
- tevent_req_nterror(status);
+ tevent_req_nterror(req, status);
return tevent_req_post(req, ev);
}
};
static struct tevent_req *_s3_compat_EfsRpcNotSupported_send(TALLOC_CTX *mem_ctx,
- struct tevent_context *ev,
- struct dcerpc_call_handle *call,
- struct EfsRpcNotSupported *r)
+ struct tevent_context *ev,
+ struct dcerpc_call_handle *call,
+ struct EfsRpcNotSupported *r)
{
- struct tevent_req *req
+ struct tevent_req *req;
struct _s3_compat_EfsRpcNotSupported_state *state;
struct pipes_struct *p;
state->r = r;
p = dcerpc_call_handle_get_pipes_struct(call);
+ if (p == NULL) {
+ tevent_req_nterror(req, NT_STATUS_NO_MEMORY);
+ return tevent_req_post(req, ev);
+ }
r->out.result = _EfsRpcNotSupported(p, r);
if (p->fault_state) {
NTSTATUS status = dcerpc_fault_to_nt_status(p->fault_state);
- tevent_req_nterror(status);
+ tevent_req_nterror(req, status);
return tevent_req_post(req, ev);
}
};
static struct tevent_req *_s3_compat_EfsRpcFileKeyInfo_send(TALLOC_CTX *mem_ctx,
- struct tevent_context *ev,
- struct dcerpc_call_handle *call,
- struct EfsRpcFileKeyInfo *r)
+ struct tevent_context *ev,
+ struct dcerpc_call_handle *call,
+ struct EfsRpcFileKeyInfo *r)
{
- struct tevent_req *req
+ struct tevent_req *req;
struct _s3_compat_EfsRpcFileKeyInfo_state *state;
struct pipes_struct *p;
state->r = r;
p = dcerpc_call_handle_get_pipes_struct(call);
+ if (p == NULL) {
+ tevent_req_nterror(req, NT_STATUS_NO_MEMORY);
+ return tevent_req_post(req, ev);
+ }
r->out.result = _EfsRpcFileKeyInfo(p, r);
if (p->fault_state) {
NTSTATUS status = dcerpc_fault_to_nt_status(p->fault_state);
- tevent_req_nterror(status);
+ tevent_req_nterror(req, status);
return tevent_req_post(req, ev);
}
};
static struct tevent_req *_s3_compat_EfsRpcDuplicateEncryptionInfoFile_send(TALLOC_CTX *mem_ctx,
- struct tevent_context *ev,
- struct dcerpc_call_handle *call,
- struct EfsRpcDuplicateEncryptionInfoFile *r)
+ struct tevent_context *ev,
+ struct dcerpc_call_handle *call,
+ struct EfsRpcDuplicateEncryptionInfoFile *r)
{
- struct tevent_req *req
+ struct tevent_req *req;
struct _s3_compat_EfsRpcDuplicateEncryptionInfoFile_state *state;
struct pipes_struct *p;
state->r = r;
p = dcerpc_call_handle_get_pipes_struct(call);
+ if (p == NULL) {
+ tevent_req_nterror(req, NT_STATUS_NO_MEMORY);
+ return tevent_req_post(req, ev);
+ }
r->out.result = _EfsRpcDuplicateEncryptionInfoFile(p, r);
if (p->fault_state) {
NTSTATUS status = dcerpc_fault_to_nt_status(p->fault_state);
- tevent_req_nterror(status);
+ tevent_req_nterror(req, status);
return tevent_req_post(req, ev);
}
}
-static const struct dcerpc_call_entry_point_fns struct _s3_compat_efs_fns[] = {
+static const struct dcerpc_call_entry_point_fns _s3_compat_efs_fns[] = {
{
.send_fn = (dcerpc_call_entry_point_send_fn_t)
_s3_compat_EfsRpcOpenFileRaw_send,
};
static const struct dcerpc_call_entry_point_vector _s3_compat_efs_epv[] = {
+ {
.name = "_s3_compat_efs",
.table = &ndr_table_efs,
.num_fns = 14,
.fns = _s3_compat_efs_fns,
+ },
};
NTSTATUS dcerpc_server_setup_s3compat_efs(struct dcerpc_server *server)