summaryrefslogtreecommitdiffhomepage
path: root/src/ipc
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2017-09-08 22:22:22 +0000
committermidipix <writeonce@midipix.org>2017-09-08 22:49:30 -0400
commit47f21a54cf74e2ec0fc7aa7e3ee06ab5087600a6 (patch)
tree99d6b4aa390f16e0891877479e5adb4de005d59d /src/ipc
parenta6563a605d7906252921503e89eae8da00eb599c (diff)
downloadntapi-47f21a54cf74e2ec0fc7aa7e3ee06ab5087600a6.tar.bz2
ntapi-47f21a54cf74e2ec0fc7aa7e3ee06ab5087600a6.tar.xz
integrated msgqueue client side interfaces.
Diffstat (limited to 'src/ipc')
-rw-r--r--src/ipc/ntapi_ipc_connect.c69
1 files changed, 69 insertions, 0 deletions
diff --git a/src/ipc/ntapi_ipc_connect.c b/src/ipc/ntapi_ipc_connect.c
index 6584f49..fc05efb 100644
--- a/src/ipc/ntapi_ipc_connect.c
+++ b/src/ipc/ntapi_ipc_connect.c
@@ -68,6 +68,54 @@ static void __ipc_init_ctrl_msg_semsvc(
}
+static void __ipc_init_ctrl_msg_msqctl(
+ const nt_port_attr * attr,
+ nt_tty_ipc_msg * msg)
+{
+ __ntapi->tt_aligned_block_memset(
+ (uintptr_t *)msg,
+ 0,sizeof(*msg));
+
+ msg->data.ipcinfo.ctrlsvc.type = attr->type;
+ msg->data.ipcinfo.ctrlsvc.subtype = attr->subtype;
+
+ msg->data.ipcinfo.ctrlsvc.keys.key[0] = attr->keys.key[0];
+ msg->data.ipcinfo.ctrlsvc.keys.key[1] = attr->keys.key[1];
+ msg->data.ipcinfo.ctrlsvc.keys.key[2] = attr->keys.key[2];
+ msg->data.ipcinfo.ctrlsvc.keys.key[3] = attr->keys.key[3];
+ msg->data.ipcinfo.ctrlsvc.keys.key[4] = attr->keys.key[4];
+ msg->data.ipcinfo.ctrlsvc.keys.key[5] = attr->keys.key[5];
+
+ __ntapi->tt_guid_copy(
+ &msg->data.ipcinfo.ctrlsvc.guid,
+ &attr->guid);
+}
+
+
+static void __ipc_init_ctrl_msg_msqsvc(
+ nt_rtdata * rtdata,
+ nt_tty_ipc_msg * msg)
+{
+ __ntapi->tt_aligned_block_memset(
+ (uintptr_t *)msg,
+ 0,sizeof(*msg));
+
+ msg->data.ipcinfo.ctrlsvc.type = rtdata->msqctl_type;
+ msg->data.ipcinfo.ctrlsvc.subtype = rtdata->msqctl_subtype;
+
+ msg->data.ipcinfo.ctrlsvc.keys.key[0] = rtdata->msqctl_keys[0];
+ msg->data.ipcinfo.ctrlsvc.keys.key[1] = rtdata->msqctl_keys[1];
+ msg->data.ipcinfo.ctrlsvc.keys.key[2] = rtdata->msqctl_keys[2];
+ msg->data.ipcinfo.ctrlsvc.keys.key[3] = rtdata->msqctl_keys[3];
+ msg->data.ipcinfo.ctrlsvc.keys.key[4] = rtdata->msqctl_keys[4];
+ msg->data.ipcinfo.ctrlsvc.keys.key[5] = rtdata->msqctl_keys[5];
+
+ __ntapi->tt_guid_copy(
+ &msg->data.ipcinfo.ctrlsvc.guid,
+ &rtdata->msqctl_guid);
+}
+
+
static void __ipc_init_ctrl_msg_ipcpeer(
nt_rtdata * rtdata,
nt_tty_ipc_msg * msg)
@@ -123,6 +171,27 @@ static int32_t __ipc_set_client_keys(
opcode = NT_TTY_SEM_FCNTL;
break;
+ case NT_PORT_TYPE_MSQCTL:
+ if (rtdata->srv_type == NT_PORT_TYPE_MSQSVC)
+ __ipc_init_ctrl_msg_ipcpeer(
+ rtdata,&msg);
+ else
+ __ipc_init_ctrl_msg_msqctl(
+ attr,&msg);
+
+ opcode = NT_TTY_MSQ_FCNTL;
+ break;
+
+ case NT_PORT_TYPE_MSQSVC:
+ if (rtdata->srv_type == NT_PORT_TYPE_MSQCTL)
+ return NT_STATUS_SUCCESS;
+
+ __ipc_init_ctrl_msg_msqsvc(
+ rtdata,&msg);
+
+ opcode = NT_TTY_MSQ_FCNTL;
+ break;
+
default:
return NT_STATUS_SUCCESS;
}