struct tevent_context *ev_ctx,
struct messaging_context *msg_ctx,
const char *pipe_name,
- named_pipe_termination_fn *term_fn,
+ named_pipe_termination_fn term_fn,
uint16_t file_type,
uint16_t device_state,
uint64_t allocation_size,
void named_pipe_accept_function(struct tevent_context *ev_ctx,
struct messaging_context *msg_ctx,
const char *pipe_name, int fd,
- named_pipe_termination_fn *term_fn,
+ named_pipe_termination_fn term_fn,
void *private_data)
{
struct named_pipe_client *npc;
size_t count;
};
+static int dcerpc_ncacn_conn_destructor(struct dcerpc_ncacn_conn *ncacn_conn)
+{
+ if (ncacn_conn->disconnect_fn != NULL) {
+ bool ok = ncacn_conn->disconnect_fn(ncacn_conn->p);
+ if (!ok) {
+ DBG_WARNING("Failed to call disconnect function\n");
+ }
+ }
+ return 0;
+}
+
static void dcerpc_ncacn_packet_process(struct tevent_req *subreq);
static void dcerpc_ncacn_packet_done(struct tevent_req *subreq);
close(s);
return;
}
+ talloc_set_destructor(ncacn_conn, dcerpc_ncacn_conn_destructor);
ncacn_conn->transport = transport;
ncacn_conn->ev_ctx = ev_ctx;
status = dcerpc_read_ncacn_packet_recv(subreq, ncacn_conn, &pkt, &recv_buffer);
TALLOC_FREE(subreq);
if (!NT_STATUS_IS_OK(status)) {
- if (ncacn_conn->disconnect_fn != NULL) {
- ok = ncacn_conn->disconnect_fn(ncacn_conn->p);
- if (!ok) {
- DEBUG(3, ("Failed to call disconnect function\n"));
- }
- }
goto fail;
}
struct pipes_struct;
typedef bool (*dcerpc_ncacn_disconnect_fn)(struct pipes_struct *p);
-typedef void (named_pipe_termination_fn)(void *private_data);
+typedef void (*named_pipe_termination_fn)(void *private_data);
struct named_pipe_client {
const char *pipe_name;
struct iovec *iov;
size_t count;
- named_pipe_termination_fn *term_fn;
+ named_pipe_termination_fn term_fn;
void *private_data;
};
struct tevent_context *ev_ctx,
struct messaging_context *msg_ctx,
const char *pipe_name,
- named_pipe_termination_fn *term_fn,
+ named_pipe_termination_fn term_fn,
uint16_t file_type,
uint16_t device_state,
uint64_t allocation_size,
void named_pipe_accept_function(struct tevent_context *ev_ctx,
struct messaging_context *msg_ctx,
const char *pipe_name, int fd,
- named_pipe_termination_fn *term_fn,
+ named_pipe_termination_fn term_fn,
void *private_data);
void named_pipe_packet_process(struct tevent_req *subreq);