diff --git a/src/client/toks_client_acquire.c b/src/client/toks_client_acquire.c index 51e38b9..32c0835 100644 --- a/src/client/toks_client_acquire.c +++ b/src/client/toks_client_acquire.c @@ -14,7 +14,7 @@ static int32_t toks_client_cancel(void * hport) { int32_t status; - struct _nt_tty_ipc_msg msg; + struct _nt_tty_sync_msg msg; ntapi->tt_aligned_block_memset( &msg,0,sizeof(msg)); @@ -34,7 +34,7 @@ int32_t toks_client_acquire(struct toks_driver_ctx * dctx) { int32_t status; void * hport; - struct _nt_tty_ipc_msg msg; + struct _nt_tty_sync_msg msg; struct _nt_port_keys * keys; int64_t millisecs; nt_timeout timeout; @@ -53,26 +53,26 @@ int32_t toks_client_acquire(struct toks_driver_ctx * dctx) msg.header.data_size = sizeof(msg.data); msg.header.msg_size = sizeof(msg); msg.data.ttyinfo.opcode = TOKS_DAEMON_ACQUIRE; - msg.data.ipcinfo.hevent = toks_get_driver_hevent(dctx); + msg.data.syncinfo.hevent = toks_get_driver_hevent(dctx); if (toks_get_driver_tokpid(dctx)) { - msg.data.ipcinfo.ctrlsvc.keys.reserved = toks_get_driver_tokpid(dctx); - msg.data.ipcinfo.ctrlsvc.options = TOKS_OPT_FRAMEWORK_PID; + msg.data.syncinfo.ipcsvc.keys.reserved = toks_get_driver_tokpid(dctx); + msg.data.syncinfo.ipcsvc.options = TOKS_OPT_FRAMEWORK_PID; } else { - msg.data.ipcinfo.ctrlsvc.keys.reserved = toks_get_driver_tsyspid(dctx); + msg.data.syncinfo.ipcsvc.keys.reserved = toks_get_driver_tsyspid(dctx); } if (refstr && (reflen = toks_strlen(refstr))) { - if (reflen > sizeof(msg.data.ipcinfo.ctrlsvc.keys.key)) - reflen = sizeof(msg.data.ipcinfo.ctrlsvc.keys.key); + if (reflen > sizeof(msg.data.syncinfo.ipcsvc.keys.key)) + reflen = sizeof(msg.data.syncinfo.ipcsvc.keys.key); ntapi->tt_generic_memcpy( - msg.data.ipcinfo.ctrlsvc.keys.key, + msg.data.syncinfo.ipcsvc.keys.key, refstr,reflen); } if (!(millisecs = toks_get_driver_timeout(dctx))) { - msg.data.ipcinfo.hevent = 0; + msg.data.syncinfo.hevent = 0; } else if (millisecs == (-1)) { timeout.ulow = ~(0u); @@ -91,7 +91,7 @@ int32_t toks_client_acquire(struct toks_driver_ctx * dctx) case NT_STATUS_PENDING: status = ntapi->zw_wait_for_single_object( - msg.data.ipcinfo.hevent, + msg.data.syncinfo.hevent, NT_SYNC_NON_ALERTABLE, &timeout); @@ -111,12 +111,12 @@ int32_t toks_client_acquire(struct toks_driver_ctx * dctx) return msg.data.ttyinfo.status; } - keys->key[0] = msg.data.ipcinfo.ipckeys[0]; - keys->key[1] = msg.data.ipcinfo.ipckeys[1]; - keys->key[2] = msg.data.ipcinfo.ipckeys[2]; - keys->key[3] = msg.data.ipcinfo.ipckeys[3]; - keys->key[4] = msg.data.ipcinfo.ipckeys[4]; - keys->key[5] = msg.data.ipcinfo.ipckeys[5]; + keys->key[0] = msg.data.syncinfo.ipckeys[0]; + keys->key[1] = msg.data.syncinfo.ipckeys[1]; + keys->key[2] = msg.data.syncinfo.ipckeys[2]; + keys->key[3] = msg.data.syncinfo.ipckeys[3]; + keys->key[4] = msg.data.syncinfo.ipckeys[4]; + keys->key[5] = msg.data.syncinfo.ipckeys[5]; return NT_STATUS_SUCCESS; } diff --git a/src/client/toks_client_release.c b/src/client/toks_client_release.c index 87a5b4d..085b1d3 100644 --- a/src/client/toks_client_release.c +++ b/src/client/toks_client_release.c @@ -15,7 +15,7 @@ int32_t toks_client_release(struct toks_driver_ctx * dctx) { int32_t status; void * hport; - struct _nt_tty_ipc_msg msg; + struct _nt_tty_sync_msg msg; struct _nt_port_keys * keys; hport = toks_get_driver_hservice(dctx); @@ -29,12 +29,12 @@ int32_t toks_client_release(struct toks_driver_ctx * dctx) msg.header.msg_size = sizeof(msg); msg.data.ttyinfo.opcode = TOKS_DAEMON_RELEASE; - msg.data.ipcinfo.ipckeys[0] = keys->key[0]; - msg.data.ipcinfo.ipckeys[1] = keys->key[1]; - msg.data.ipcinfo.ipckeys[2] = keys->key[2]; - msg.data.ipcinfo.ipckeys[3] = keys->key[3]; - msg.data.ipcinfo.ipckeys[4] = keys->key[4]; - msg.data.ipcinfo.ipckeys[5] = keys->key[5]; + msg.data.syncinfo.ipckeys[0] = keys->key[0]; + msg.data.syncinfo.ipckeys[1] = keys->key[1]; + msg.data.syncinfo.ipckeys[2] = keys->key[2]; + msg.data.syncinfo.ipckeys[3] = keys->key[3]; + msg.data.syncinfo.ipckeys[4] = keys->key[4]; + msg.data.syncinfo.ipckeys[5] = keys->key[5]; if ((status = ntapi->zw_request_wait_reply_port(hport,&msg,&msg))) return status; diff --git a/src/daemon/toks_daemon_acquire.c b/src/daemon/toks_daemon_acquire.c index 2367f8a..60c3c10 100644 --- a/src/daemon/toks_daemon_acquire.c +++ b/src/daemon/toks_daemon_acquire.c @@ -14,7 +14,7 @@ static void toks_daemon_token_release(struct toks_token * token) { void * hport; - struct _nt_tty_ipc_msg msg; + struct _nt_tty_sync_msg msg; uint32_t * keys; hport = token->client.hdaemon; @@ -28,12 +28,12 @@ static void toks_daemon_token_release(struct toks_token * token) msg.header.msg_size = sizeof(msg); msg.data.ttyinfo.opcode = TOKS_DAEMON_RELEASE; - msg.data.ipcinfo.ipckeys[0] = keys[0]; - msg.data.ipcinfo.ipckeys[1] = keys[1]; - msg.data.ipcinfo.ipckeys[2] = keys[2]; - msg.data.ipcinfo.ipckeys[3] = keys[3]; - msg.data.ipcinfo.ipckeys[4] = keys[4]; - msg.data.ipcinfo.ipckeys[5] = keys[5]; + msg.data.syncinfo.ipckeys[0] = keys[0]; + msg.data.syncinfo.ipckeys[1] = keys[1]; + msg.data.syncinfo.ipckeys[2] = keys[2]; + msg.data.syncinfo.ipckeys[3] = keys[3]; + msg.data.syncinfo.ipckeys[4] = keys[4]; + msg.data.syncinfo.ipckeys[5] = keys[5]; ntapi->zw_request_wait_reply_port( hport,&msg,&msg); @@ -165,7 +165,7 @@ static int32_t toks_daemon_queue(struct toks_daemon_ctx * dctx, void * hcaller, status = ntapi->zw_duplicate_object( hcaller, - msg->ipcinfo.hevent, + msg->syncinfo.hevent, NT_CURRENT_PROCESS_HANDLE, &hevent, NT_EVENT_QUERY_STATE|NT_EVENT_MODIFY_STATE, @@ -235,8 +235,8 @@ int32_t __stdcall toks_daemon_acquire(struct toks_daemon_ctx * dctx) oa.sec_qos = 0; if (dctx->opcode == TOKS_DAEMON_ACQUIRE) { - if ((dctx->reqtokpid = msg->ipcinfo.ctrlsvc.keys.reserved)) { - if (msg->ipcinfo.ctrlsvc.options & TOKS_OPT_FRAMEWORK_PID) { + if ((dctx->reqtokpid = msg->syncinfo.ipcsvc.keys.reserved)) { + if (msg->syncinfo.ipcsvc.options & TOKS_OPT_FRAMEWORK_PID) { if ((status = toks_daemon_pidopen(dctx))) return status; } else { @@ -261,7 +261,7 @@ int32_t __stdcall toks_daemon_acquire(struct toks_daemon_ctx * dctx) for (; token->self && (tokenipcinfo.hevent) { + if ((token == tocap) && !msg->syncinfo.hevent) { ntapi->zw_close(client.hprocess); return NT_STATUS_TIMEOUT; } @@ -281,29 +281,29 @@ int32_t __stdcall toks_daemon_acquire(struct toks_daemon_ctx * dctx) return status; } - msg->ipcinfo.ipckeys[0] = ntapi->tt_buffer_crc32( + msg->syncinfo.ipckeys[0] = ntapi->tt_buffer_crc32( msg->header.msg_id, &pcnt,sizeof(pcnt)); - msg->ipcinfo.ipckeys[1] = ntapi->tt_buffer_crc32( + msg->syncinfo.ipckeys[1] = ntapi->tt_buffer_crc32( msg->header.msg_id, &msg->header,sizeof(msg->header)); - msg->ipcinfo.ipckeys[2] = ntapi->tt_buffer_crc32( + msg->syncinfo.ipckeys[2] = ntapi->tt_buffer_crc32( msg->header.msg_id, - &msg->ipcinfo,sizeof(msg->ipcinfo)); + &msg->syncinfo,sizeof(msg->syncinfo)); - msg->ipcinfo.ipckeys[3] = ntapi->tt_buffer_crc32( + msg->syncinfo.ipckeys[3] = ntapi->tt_buffer_crc32( msg->header.msg_id, &client,sizeof(client)); - msg->ipcinfo.ipckeys[4] = ntapi->tt_buffer_crc32( + msg->syncinfo.ipckeys[4] = ntapi->tt_buffer_crc32( msg->header.msg_id, toks_get_driver_tokens(dctx->driver_ctx), toks_get_driver_ntokens(dctx->driver_ctx) * sizeof(struct toks_token)); - msg->ipcinfo.ipckeys[5] = ntapi->tt_buffer_crc32( + msg->syncinfo.ipckeys[5] = ntapi->tt_buffer_crc32( msg->header.msg_id, &token->keys,sizeof(token->keys)); @@ -315,12 +315,12 @@ int32_t __stdcall toks_daemon_acquire(struct toks_daemon_ctx * dctx) if (dctx->opcode == TOKS_DAEMON_RELEASE) { client.hprocess = msg->ttyinfo.exarg; - token->keys.key[0] = msg->ipcinfo.ipckeys[0]; - token->keys.key[1] = msg->ipcinfo.ipckeys[1]; - token->keys.key[2] = msg->ipcinfo.ipckeys[2]; - token->keys.key[3] = msg->ipcinfo.ipckeys[3]; - token->keys.key[4] = msg->ipcinfo.ipckeys[4]; - token->keys.key[5] = msg->ipcinfo.ipckeys[5]; + token->keys.key[0] = msg->syncinfo.ipckeys[0]; + token->keys.key[1] = msg->syncinfo.ipckeys[1]; + token->keys.key[2] = msg->syncinfo.ipckeys[2]; + token->keys.key[3] = msg->syncinfo.ipckeys[3]; + token->keys.key[4] = msg->syncinfo.ipckeys[4]; + token->keys.key[5] = msg->syncinfo.ipckeys[5]; } else { token->keys.key[0] = ntapi->tt_buffer_crc32( msg->header.msg_id, @@ -332,7 +332,7 @@ int32_t __stdcall toks_daemon_acquire(struct toks_daemon_ctx * dctx) token->keys.key[2] = ntapi->tt_buffer_crc32( msg->header.msg_id, - &msg->ipcinfo,sizeof(msg->ipcinfo)); + &msg->syncinfo,sizeof(msg->syncinfo)); token->keys.key[3] = ntapi->tt_buffer_crc32( msg->header.msg_id, @@ -348,12 +348,12 @@ int32_t __stdcall toks_daemon_acquire(struct toks_daemon_ctx * dctx) msg->header.msg_id, &token->keys,sizeof(token->keys)); - msg->ipcinfo.ipckeys[0] = token->keys.key[0]; - msg->ipcinfo.ipckeys[1] = token->keys.key[1]; - msg->ipcinfo.ipckeys[2] = token->keys.key[2]; - msg->ipcinfo.ipckeys[3] = token->keys.key[3]; - msg->ipcinfo.ipckeys[4] = token->keys.key[4]; - msg->ipcinfo.ipckeys[5] = token->keys.key[5]; + msg->syncinfo.ipckeys[0] = token->keys.key[0]; + msg->syncinfo.ipckeys[1] = token->keys.key[1]; + msg->syncinfo.ipckeys[2] = token->keys.key[2]; + msg->syncinfo.ipckeys[3] = token->keys.key[3]; + msg->syncinfo.ipckeys[4] = token->keys.key[4]; + msg->syncinfo.ipckeys[5] = token->keys.key[5]; } if ((status = toks_daemon_token_instance(token,&client))) { diff --git a/src/daemon/toks_daemon_loop.c b/src/daemon/toks_daemon_loop.c index 378ecbf..4d250dc 100644 --- a/src/daemon/toks_daemon_loop.c +++ b/src/daemon/toks_daemon_loop.c @@ -86,7 +86,7 @@ int32_t __stdcall toks_daemon_loop(void * ctx) /* dispatch */ dctx->opcode = opcode; - request->ipcinfo.ctrlsvc.keys.padding = 0; + request->syncinfo.ipcsvc.keys.padding = 0; if (svcvtbl == toks_daemon_vtbl) toks_log_lpc_request( diff --git a/src/daemon/toks_daemon_release.c b/src/daemon/toks_daemon_release.c index d17cabd..0c4220d 100644 --- a/src/daemon/toks_daemon_release.c +++ b/src/daemon/toks_daemon_release.c @@ -85,7 +85,7 @@ int32_t __stdcall toks_daemon_release(struct toks_daemon_ctx * dctx) uint32_t * keys; msg = &dctx->reply; - keys = msg->ipcinfo.ipckeys; + keys = msg->syncinfo.ipckeys; toptr = toks_get_driver_tokens(dctx->driver_ctx); tocap = &toptr[toks_get_driver_ntokens(dctx->driver_ctx)]; diff --git a/src/log/toks_log_lpc_message.c b/src/log/toks_log_lpc_message.c index 43772bb..9d38ace 100644 --- a/src/log/toks_log_lpc_message.c +++ b/src/log/toks_log_lpc_message.c @@ -99,16 +99,16 @@ static void toks_log_lpc_request_desc( toks_lpc_opcode_desc(dctx)); if (dctx->opcode == TOKS_DAEMON_ACQUIRE) - if (msg->ipcinfo.ctrlsvc.keys.reserved) + if (msg->syncinfo.ipcsvc.keys.reserved) ch += ntapi->sprintf( ch, " (tokpid=%d)", - msg->ipcinfo.ctrlsvc.keys.reserved); + msg->syncinfo.ipcsvc.keys.reserved); - if (msg->ipcinfo.ctrlsvc.keys.key[0]) + if (msg->syncinfo.ipcsvc.keys.key[0]) ch += ntapi->sprintf( ch,", refstr=``%s''", - (const char *)msg->ipcinfo.ctrlsvc.keys.key); + (const char *)msg->syncinfo.ipcsvc.keys.key); } static void toks_log_lpc_reply_desc( @@ -131,11 +131,11 @@ static void toks_log_lpc_reply_desc( switch (dctx->opcode) { case TOKS_DAEMON_ACQUIRE: keys = (msg->ttyinfo.status == NT_STATUS_SUCCESS) - ? msg->ipcinfo.ipckeys : 0; + ? msg->syncinfo.ipckeys : 0; break; case TOKS_DAEMON_RELEASE: - keys = msg->ipcinfo.ipckeys; + keys = msg->syncinfo.ipckeys; break; default: @@ -174,7 +174,7 @@ static void toks_log_lpc_reply_desc( ch += ntapi->sprintf(ch," (pending, queued)"); } else if (msg->ttyinfo.status == NT_STATUS_TIMEOUT) { - if (!dctx->request.ipcinfo.hevent) + if (!dctx->request.syncinfo.hevent) ch += ntapi->sprintf(ch," (timeout=0, not queued)"); else ch += ntapi->sprintf(ch," (timeout, internal error)"); diff --git a/src/service/toks_service_abort.c b/src/service/toks_service_abort.c index dc06583..d899106 100644 --- a/src/service/toks_service_abort.c +++ b/src/service/toks_service_abort.c @@ -15,7 +15,7 @@ int32_t toks_service_abort(struct toks_driver_ctx * dctx) { int32_t status; void * hport; - struct _nt_tty_ipc_msg msg; + struct _nt_tty_sync_msg msg; hport = toks_get_driver_hservice(dctx);