summaryrefslogtreecommitdiffhomepage
path: root/src/sem
diff options
context:
space:
mode:
Diffstat (limited to 'src/sem')
-rw-r--r--src/sem/ntapi_sem_connect.c30
-rw-r--r--src/sem/ntapi_sem_fcntl.c3
2 files changed, 26 insertions, 7 deletions
diff --git a/src/sem/ntapi_sem_connect.c b/src/sem/ntapi_sem_connect.c
index 32c3610..2dc9a94 100644
--- a/src/sem/ntapi_sem_connect.c
+++ b/src/sem/ntapi_sem_connect.c
@@ -259,12 +259,17 @@ int32_t __stdcall __ntapi_sem_open(
__in uint32_t share,
__in uint32_t nslots)
{
- int32_t status;
- uint32_t key;
- uint32_t id;
- void * hsymlink;
- nt_oa ipcoa;
- void * hipc;
+ int32_t status;
+ uint32_t key;
+ uint32_t id;
+ void * hsymlink;
+ nt_oa ipcoa;
+ void * hipc;
+ nt_rtdata * rtdata;
+ nt_tty_service_info semctl;
+
+ /* init */
+ rtdata = (__ntapi_internals())->rtdata;
/* validate */
if (!oa->root_dir)
@@ -310,6 +315,19 @@ int32_t __stdcall __ntapi_sem_open(
return status;
}
+ /* semctl service attributes */
+ if (!rtdata->hsempid)
+ if ((status = __semctl_get_service_attr(rtdata,&semctl)))
+ return status;
+
+ /* semctl server */
+ if ((status = __semctl_server_connect(rtdata,&semctl)))
+ return status;
+
+ /* sempid symlink */
+ if ((status = __sempid_symlink_set(rtdata,&semctl)))
+ return status;
+
/* ipc connect */
status = __ntapi->ipc_connect_by_symlink(
&hipc,hsymlink);
diff --git a/src/sem/ntapi_sem_fcntl.c b/src/sem/ntapi_sem_fcntl.c
index d48557f..d160e66 100644
--- a/src/sem/ntapi_sem_fcntl.c
+++ b/src/sem/ntapi_sem_fcntl.c
@@ -37,5 +37,6 @@ int32_t __stdcall __ntapi_sem_fcntl(
(void)output_buffer;
(void)output_buffer_length;
- return 0;
+ /* internal only */
+ return NT_STATUS_NOT_IMPLEMENTED;
}