Nikolay Sivov : rpcss: Implement interface to return sequential identifiers.

Alexandre Julliard julliard at winehq.org
Fri Nov 8 17:25:25 CST 2019


Module: wine
Branch: master
Commit: 9bec4bb582ba59baa2c2b7c9fae411722ee9cb64
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=9bec4bb582ba59baa2c2b7c9fae411722ee9cb64

Author: Nikolay Sivov <nsivov at codeweavers.com>
Date:   Thu Nov  7 23:00:00 2019 +0300

rpcss: Implement interface to return sequential identifiers.

Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
Signed-off-by: Huw Davies <huw at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 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(-)

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;




More information about the wine-cvs mailing list