2 * RPCSS shared definitions
4 * Copyright (C) 2002 Greg Turner
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
21 #ifndef __WINE_RPCSS_SHARED_H
22 #define __WINE_RPCSS_SHARED_H
30 #define RPCSS_NP_PROTOCOL_VERSION 0x0000
32 #define RPCSS_STRINGIFY_MACRO(x) RPCSS_STRINGIFY_MACRO2(x)
33 #define RPCSS_STRINGIFY_MACRO2(x) #x
35 #define STRINGIFIED_RPCSS_NP_PROTOCOL_VERSION \
36 RPCSS_STRINGIFY_MACRO(RPCSS_NP_PROTOCOL_VERSION)
38 /* only local communications are supported so far on this pipe.
39 until this changes, we can just use a constant pipe-name */
40 #define NAME_RPCSS_NAMED_PIPE \
41 ("\\\\.\\pipe\\RpcssNP" STRINGIFIED_RPCSS_NP_PROTOCOL_VERSION)
43 /* mutex is local only... perhaps this ought to be part of the pipe
44 protocol for remote wine<->wine connections? */
45 #define RPCSS_MASTER_MUTEX_NAME \
46 ("RPCSSMasterMutex" STRINGIFIED_RPCSS_NP_PROTOCOL_VERSION)
48 /* payloads above 1K are fragmented into multiple messages */
49 #define VARDATA_PAYLOAD_BYTES 1024
51 /* ick -- maybe we should pass a handle to a mailslot or something? */
52 #define MAX_RPCSS_NP_REPLY_STRING_LEN 512
54 /* number of microseconds/10 to wait for master mutex before giving up */
55 #define MASTER_MUTEX_TIMEOUT 6000000
57 /* number of miliseconds to wait on the master mutex after it returns BUSY */
58 #define MASTER_MUTEX_WAITNAMEDPIPE_TIMEOUT 5000
60 /* a data payload; not a normal message */
61 #define RPCSS_NP_MESSAGE_TYPEID_VARDATAPAYLOADMSG 1
62 typedef struct _RPCSS_NP_MESSAGE_UNION_VARDATAPAYLOADMSG
{
63 char payload
[VARDATA_PAYLOAD_BYTES
];
64 } RPCSS_NP_MESSAGE_UNION_VARDATAPAYLOADMSG
;
67 * Simply tells the server that another rpcss instance ran.
68 * The server should respond by resetting its timeout to the
71 #define RPCSS_NP_MESSAGE_TYPEID_RANMSG 2
72 typedef struct _RPCSS_NP_MESSAGE_UNION_RANMSG
{
74 } RPCSS_NP_MESSAGE_UNION_RANMSG
;
77 * Registers endpoints with the endpoint server.
78 * object_count and binding_count contain the number
79 * of object uuids and endpoints in the vardata payload,
82 #define RPCSS_NP_MESSAGE_TYPEID_REGISTEREPMSG 3
83 typedef struct _RPCSS_NP_MESSAGE_UNION_REGISTEREPMSG
{
84 RPC_SYNTAX_IDENTIFIER iface
;
88 } RPCSS_NP_MESSAGE_UNION_REGISTEREPMSG
;
91 * Unregisters endpoints with the endpoint server.
92 * object_count and binding_count contain the number
93 * of object uuids and endpoints in the vardata payload,
96 #define RPCSS_NP_MESSAGE_TYPEID_UNREGISTEREPMSG 4
97 typedef struct _RPCSS_NP_MESSAGE_UNION_UNREGISTEREPMSG
{
98 RPC_SYNTAX_IDENTIFIER iface
;
101 } RPCSS_NP_MESSAGE_UNION_UNREGISTEREPMSG
;
104 * Locates an endpoint registered with the endpoint server.
105 * Vardata contains a single protseq string. This is a bit
106 * silly: the protseq string is probably shorter than the
107 * reply (an endpoint string), which is truncated at
108 * MAX_RPCSS_NP_REPLY_STRING_LEN, at least for the moment.
109 * returns the empty string if the requested endpoint isn't
112 #define RPCSS_NP_MESSAGE_TYPEID_RESOLVEEPMSG 5
113 typedef struct _RPCSS_NP_MESSAGE_UNION_RESOLVEEPMSG
{
114 RPC_SYNTAX_IDENTIFIER iface
;
116 } RPCSS_NP_MESSAGE_UNION_RESOLVEEPMSG
;
119 RPCSS_NP_MESSAGE_UNION_RANMSG ranmsg
;
120 RPCSS_NP_MESSAGE_UNION_VARDATAPAYLOADMSG vardatapayloadmsg
;
121 RPCSS_NP_MESSAGE_UNION_REGISTEREPMSG registerepmsg
;
122 RPCSS_NP_MESSAGE_UNION_UNREGISTEREPMSG unregisterepmsg
;
123 RPCSS_NP_MESSAGE_UNION_RESOLVEEPMSG resolveepmsg
;
124 } RPCSS_NP_MESSAGE_UNION
;
126 /* vardata_payload_size specifies the number of bytes
127 * to be transferred over the pipe in VARDATAPAYLOAD
128 * messages (divide by VARDATA_PAYLOAD_BYTES to
129 * get the # of payloads)
131 typedef struct _RPCSS_NP_MESSAGE
{
133 RPCSS_NP_MESSAGE_UNION message
;
134 UINT32 vardata_payload_size
;
135 } RPCSS_NP_MESSAGE
, *PRPCSS_NP_MESSAGE
;
138 /* some of these aren't used, but I guess we don't care */
143 char as_string
[MAX_RPCSS_NP_REPLY_STRING_LEN
]; /* FIXME: yucky */
144 } RPCSS_NP_REPLY
, *PRPCSS_NP_REPLY
;
146 #endif /* __WINE_RPCSS_SHARED_H */