[PATCH 2/3] rpcss: Implement interface to return sequential identifiers.

Nikolay Sivov nsivov at codeweavers.com
Thu Nov 7 14:00:00 CST 2019


Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
---
 include/wine/irpcss.idl     | 33 +++++++++++++++++++++++++++++++++
 programs/rpcss/Makefile.in  |  3 ++-
 programs/rpcss/irpcss.idl   | 21 +++++++++++++++++++++
 programs/rpcss/rpcss_main.c | 12 ++++++++++++
 4 files changed, 68 insertions(+), 1 deletion(-)
 create mode 100644 include/wine/irpcss.idl
 create mode 100644 programs/rpcss/irpcss.idl

diff --git a/include/wine/irpcss.idl b/include/wine/irpcss.idl
new file mode 100644
index 0000000000..1874e10025
--- /dev/null
+++ b/include/wine/irpcss.idl
@@ -0,0 +1,33 @@
+/*
+ * Copyright 2019 Nikolay Sivov for CodeWeavers
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+import "wtypes.idl";
+
+cpp_quote("#define IRPCSS_PROTSEQ {'n','c','a','l','r','p','c',0}")
+cpp_quote("#define IRPCSS_ENDPOINT {'i','r','p','c','s','s',0}")
+
+[
+    uuid(85da4974-edc7-40ff-bad4-9c4525a8d044),
+    version(0.0),
+]
+interface Irpcss
+{
+    HRESULT irpcss_get_thread_seq_id(
+        [in] handle_t handle,
+        [out] DWORD *sequence_id);
+}
diff --git a/programs/rpcss/Makefile.in b/programs/rpcss/Makefile.in
index 6ccb5e965a..dcc405a944 100644
--- a/programs/rpcss/Makefile.in
+++ b/programs/rpcss/Makefile.in
@@ -10,4 +10,5 @@ C_SRCS = \
 
 IDL_SRCS = \
 	epm.idl \
-	irot.idl
+	irot.idl \
+	irpcss.idl
diff --git a/programs/rpcss/irpcss.idl b/programs/rpcss/irpcss.idl
new file mode 100644
index 0000000000..1f346ada82
--- /dev/null
+++ b/programs/rpcss/irpcss.idl
@@ -0,0 +1,21 @@
+/*
+ * Copyright 2019 Nikolay Sivov for CodeWeavers
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#pragma makedep server
+
+#include "wine/irpcss.idl"
diff --git a/programs/rpcss/rpcss_main.c b/programs/rpcss/rpcss_main.c
index 42749028c3..6e85ef2c33 100644
--- a/programs/rpcss/rpcss_main.c
+++ b/programs/rpcss/rpcss_main.c
@@ -28,6 +28,7 @@
 #include "winsvc.h"
 #include "irot.h"
 #include "epm.h"
+#include "irpcss.h"
 
 #include "wine/debug.h"
 
@@ -37,6 +38,13 @@ static WCHAR rpcssW[] = {'R','p','c','S','s',0};
 static HANDLE exit_event;
 static SERVICE_STATUS_HANDLE service_handle;
 
+HRESULT __cdecl irpcss_get_thread_seq_id(handle_t h, DWORD *id)
+{
+    static LONG thread_seq_id;
+    *id = InterlockedIncrement(&thread_seq_id);
+    return S_OK;
+}
+
 static RPC_STATUS RPCSS_Initialize(void)
 {
     static unsigned short irot_protseq[] = IROT_PROTSEQ;
@@ -45,6 +53,8 @@ static RPC_STATUS RPCSS_Initialize(void)
     static unsigned short epm_endpoint[] = {'\\','p','i','p','e','\\','e','p','m','a','p','p','e','r',0};
     static unsigned short epm_protseq_lrpc[] = {'n','c','a','l','r','p','c',0};
     static unsigned short epm_endpoint_lrpc[] = {'e','p','m','a','p','p','e','r',0};
+    static unsigned short irpcss_protseq[] = IRPCSS_PROTSEQ;
+    static unsigned short irpcss_endpoint[] = IRPCSS_ENDPOINT;
     static const struct protseq_map
     {
         unsigned short *protseq;
@@ -54,11 +64,13 @@ static RPC_STATUS RPCSS_Initialize(void)
         { epm_protseq, epm_endpoint },
         { epm_protseq_lrpc, epm_endpoint_lrpc },
         { irot_protseq, irot_endpoint },
+        { irpcss_protseq, irpcss_endpoint },
     };
     RPC_IF_HANDLE ifspecs[] =
     {
         epm_v3_0_s_ifspec,
         Irot_v0_2_s_ifspec,
+        Irpcss_v0_0_s_ifspec,
     };
     RPC_STATUS status;
     int i, j;
-- 
2.24.0.rc1




More information about the wine-devel mailing list