summaryrefslogtreecommitdiffhomepage
path: root/src/sem/ntapi_sem_set.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/sem/ntapi_sem_set.c')
-rw-r--r--src/sem/ntapi_sem_set.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/sem/ntapi_sem_set.c b/src/sem/ntapi_sem_set.c
index 813de30..02a23e6 100644
--- a/src/sem/ntapi_sem_set.c
+++ b/src/sem/ntapi_sem_set.c
@@ -16,10 +16,9 @@
static int32_t __sem_set_return(
intptr_t * hlock,
- int32_t status,
- int32_t cmd)
+ int32_t status)
{
- if (cmd == NT_SEM_CMD_SETALL)
+ if (hlock)
at_store(hlock,0);
return status;
@@ -53,6 +52,9 @@ int32_t __stdcall __ntapi_sem_set(
if (sem_info_length != sizeof(nt_sem_info))
return NT_STATUS_INFO_LENGTH_MISMATCH;
+ /* init */
+ hlock = 0;
+
/* section */
hsection = 0;
secaddr = 0;
@@ -84,8 +86,7 @@ int32_t __stdcall __ntapi_sem_set(
__ntapi->tt_generic_memcpy(
secaddr,sem_info,
sem_info_length);
- } else
- hlock = 0;
+ }
/* msg */
__ntapi->tt_aligned_block_memset(
@@ -105,13 +106,13 @@ int32_t __stdcall __ntapi_sem_set(
msg.data.seminfo.section_size = sem_info_length;
if ((status = __ntapi->zw_request_wait_reply_port(sem->hport,&msg,&msg)))
- return __sem_set_return(hlock,status,sem_ipc_cmd);
+ return __sem_set_return(hlock,status);
else if (msg.data.ttyinfo.status)
- return __sem_set_return(hlock,msg.data.ttyinfo.status,sem_ipc_cmd);
+ return __sem_set_return(hlock,msg.data.ttyinfo.status);
/* reply */
iosb->status = NT_STATUS_SUCCESS;
iosb->info = 0;
- return __sem_set_return(hlock,NT_STATUS_SUCCESS,sem_ipc_cmd);
+ return __sem_set_return(hlock,NT_STATUS_SUCCESS);
}