summaryrefslogtreecommitdiffhomepage
path: root/src/daemon
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2017-01-16 02:32:54 +0000
committermidipix <writeonce@midipix.org>2017-01-16 01:52:23 -0500
commitcd4191db5ebcb3ca96c5d5eb4336eddd895445bf (patch)
treec4dd168fbb5ef6536671a6ff9c65599b925449a0 /src/daemon
parentdf4a224d9c3615b3b160432855b5862d2dc69157 (diff)
downloadntapi-cd4191db5ebcb3ca96c5d5eb4336eddd895445bf.tar.bz2
ntapi-cd4191db5ebcb3ca96c5d5eb4336eddd895445bf.tar.xz
daemon initialization: establish SEH frames for the daemon and internal thread.
Diffstat (limited to 'src/daemon')
-rw-r--r--src/daemon/ntapi_dsr_init.c12
-rw-r--r--src/daemon/ntapi_dsr_internal_connection.c11
2 files changed, 20 insertions, 3 deletions
diff --git a/src/daemon/ntapi_dsr_init.c b/src/daemon/ntapi_dsr_init.c
index 317a421..b54131e 100644
--- a/src/daemon/ntapi_dsr_init.c
+++ b/src/daemon/ntapi_dsr_init.c
@@ -12,6 +12,8 @@
#include <ntapi/ntapi.h>
#include "ntapi_impl.h"
+int32_t __ntapi_tt_seh_frame(void *, void *, void *, int32_t (*)(nt_daemon_params *));
+
static int32_t __stdcall __ntapi_dsr_once(nt_daemon_params * params);
int32_t __stdcall __ntapi_dsr_init(nt_daemon_params * params)
@@ -139,7 +141,7 @@ int32_t __stdcall __ntapi_dsr_init(nt_daemon_params * params)
/* __ntapi_dsr_start executes in the daemon's dedicated thread */
-int32_t __stdcall __ntapi_dsr_start_impl(nt_daemon_params * params)
+static int32_t __ntapi_dsr_start_impl(nt_daemon_params * params)
{
int32_t status;
void * ctx;
@@ -161,7 +163,7 @@ int32_t __stdcall __ntapi_dsr_start_impl(nt_daemon_params * params)
return NT_STATUS_SUCCESS;
}
-int32_t __stdcall __ntapi_dsr_start(nt_daemon_params * params)
+static int32_t __ntapi_dsr_start_routine(nt_daemon_params * params)
{
at_store_32(
&params->exit_code_daemon_loop,
@@ -172,6 +174,12 @@ int32_t __stdcall __ntapi_dsr_start(nt_daemon_params * params)
__ntapi_dsr_start_impl(params));
}
+int32_t __stdcall __ntapi_dsr_start(nt_daemon_params * params)
+{
+ return __ntapi_tt_seh_frame(
+ params,0,0,
+ __ntapi_dsr_start_routine);
+}
/* __ntapi_dsr_once executes in the daemon's dedicated thread */
static int32_t __stdcall __ntapi_dsr_once(nt_daemon_params * params)
diff --git a/src/daemon/ntapi_dsr_internal_connection.c b/src/daemon/ntapi_dsr_internal_connection.c
index 2d6e39f..109ea43 100644
--- a/src/daemon/ntapi_dsr_internal_connection.c
+++ b/src/daemon/ntapi_dsr_internal_connection.c
@@ -12,6 +12,8 @@
#include <ntapi/ntapi.h>
#include "ntapi_impl.h"
+int32_t __ntapi_tt_seh_frame(void *, void *, void *, int32_t (*)(nt_daemon_params *));
+
static int32_t __stdcall __ntapi_dsr_internal_client_connect_fail(
nt_daemon_params * params,
int32_t status)
@@ -82,7 +84,7 @@ int32_t __stdcall __ntapi_dsr_connect_internal_client(nt_daemon_params * params)
/* __ntapi_dsr_internal_client_connect executes in its own temporary thread */
-int32_t __stdcall __ntapi_dsr_internal_client_connect(nt_daemon_params * params)
+static int32_t __ntapi_dsr_internal_client_connect_impl(nt_daemon_params * params)
{
int32_t status;
nt_unicode_string server_name;
@@ -143,3 +145,10 @@ int32_t __stdcall __ntapi_dsr_internal_client_connect(nt_daemon_params * params)
NT_CURRENT_THREAD_HANDLE,
status);
}
+
+int32_t __stdcall __ntapi_dsr_internal_client_connect(nt_daemon_params * params)
+{
+ return __ntapi_tt_seh_frame(
+ params,0,0,
+ __ntapi_dsr_internal_client_connect_impl);
+} \ No newline at end of file