diff options
-rw-r--r-- | src/daemon/ntapi_dsr_init.c | 14 | ||||
-rw-r--r-- | src/daemon/ntapi_dsr_internal_connection.c | 10 |
2 files changed, 14 insertions, 10 deletions
diff --git a/src/daemon/ntapi_dsr_init.c b/src/daemon/ntapi_dsr_init.c index 91224c7..be72502 100644 --- a/src/daemon/ntapi_dsr_init.c +++ b/src/daemon/ntapi_dsr_init.c @@ -72,6 +72,20 @@ int32_t __stdcall __ntapi_dsr_init(nt_daemon_params * params) params->hthread_daemon_loop = tparams.hthread; if (status) return status; + + /* wait for the server to be ready */ + timeout.quad = NT_DSR_INIT_MAX_WAIT; + + if ((status = __ntapi->zw_wait_for_single_object( + params->hevent_daemon_ready, + 0,&timeout))) { + __ntapi->zw_terminate_thread( + tparams.hthread, + status); + return status; + } + + /* daemon dedicated thread: actual stack size */ params->stack_size_commit = tparams.stack_size_commit; params->stack_size_reserve = tparams.stack_size_reserve; diff --git a/src/daemon/ntapi_dsr_internal_connection.c b/src/daemon/ntapi_dsr_internal_connection.c index 5d8ee09..80c85f4 100644 --- a/src/daemon/ntapi_dsr_internal_connection.c +++ b/src/daemon/ntapi_dsr_internal_connection.c @@ -101,16 +101,6 @@ int32_t __stdcall __ntapi_dsr_internal_client_connect(nt_daemon_params * params) oa.sec_desc = (nt_security_descriptor *)0; oa.sec_qos = &sqos; - /* wait for the server to be ready */ - timeout.quad = NT_DSR_INIT_MAX_WAIT; - - if ((*pstatus = __ntapi->zw_wait_for_single_object( - params->hevent_daemon_ready, - 0,&timeout))) - __ntapi->zw_terminate_thread( - NT_CURRENT_THREAD_HANDLE, - *pstatus); - /* establish internal connection */ *pstatus = __ntapi->zw_connect_port( ¶ms->hport_internal_client, |