ReactOS 0.4.15-dev-7953-g1f49173
rpcss_shared.h
Go to the documentation of this file.
1/*
2 * RPCSS shared definitions
3 *
4 * Copyright (C) 2002 Greg Turner
5 *
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.
10 *
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.
15 *
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 Street, Fifth Floor, Boston, MA 02110-1301 USA
19 */
20
21#ifndef __WINE_RPCSS_SHARED_H
22#define __WINE_RPCSS_SHARED_H
23
24#include <stdarg.h>
25#include <windef.h>
26#include <winbase.h>
27#include <rpc.h>
28#include <rpcdcep.h>
29
30#define RPCSS_NP_PROTOCOL_VERSION 0x0000
31
32#define RPCSS_STRINGIFY_MACRO(x) RPCSS_STRINGIFY_MACRO2(x)
33#define RPCSS_STRINGIFY_MACRO2(x) #x
34
35#define STRINGIFIED_RPCSS_NP_PROTOCOL_VERSION \
36 RPCSS_STRINGIFY_MACRO(RPCSS_NP_PROTOCOL_VERSION)
37
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)
42
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)
47
48/* payloads above 1K are fragmented into multiple messages */
49#define VARDATA_PAYLOAD_BYTES 1024
50
51/* ick -- maybe we should pass a handle to a mailslot or something? */
52#define MAX_RPCSS_NP_REPLY_STRING_LEN 512
53
54/* number of microseconds/10 to wait for master mutex before giving up */
55#define MASTER_MUTEX_TIMEOUT 6000000
56
57/* number of miliseconds to wait on the master mutex after it returns BUSY */
58#define MASTER_MUTEX_WAITNAMEDPIPE_TIMEOUT 5000
59
60/* a data payload; not a normal message */
61#define RPCSS_NP_MESSAGE_TYPEID_VARDATAPAYLOADMSG 1
65
66/* RANMSG:
67 * Simply tells the server that another rpcss instance ran.
68 * The server should respond by resetting its timeout to the
69 * full lazy timeout.
70 */
71#define RPCSS_NP_MESSAGE_TYPEID_RANMSG 2
73 long timeout;
75
76/* REGISTEREPMSG:
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,
80 * respectively.
81 */
82#define RPCSS_NP_MESSAGE_TYPEID_REGISTEREPMSG 3
89
90/* UNREGISTEREPMSG:
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,
94 * respectively.
95 */
96#define RPCSS_NP_MESSAGE_TYPEID_UNREGISTEREPMSG 4
102
103/* RESOLVEEPMSG:
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
110 * registered.
111 */
112#define RPCSS_NP_MESSAGE_TYPEID_RESOLVEEPMSG 5
117
118typedef union {
125
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)
130 */
131typedef struct _RPCSS_NP_MESSAGE {
136
137typedef union {
138 /* some of these aren't used, but I guess we don't care */
141 void *as_pvoid;
143 char as_string[MAX_RPCSS_NP_REPLY_STRING_LEN]; /* FIXME: yucky */
145
146#endif /* __WINE_RPCSS_SHARED_H */
unsigned int UINT32
unsigned int UINT
Definition: ndis.h:50
struct _RPCSS_NP_MESSAGE_UNION_REGISTEREPMSG RPCSS_NP_MESSAGE_UNION_REGISTEREPMSG
struct _RPCSS_NP_MESSAGE RPCSS_NP_MESSAGE
union RPCSS_NP_REPLY * PRPCSS_NP_REPLY
#define VARDATA_PAYLOAD_BYTES
Definition: rpcss_shared.h:49
struct _RPCSS_NP_MESSAGE_UNION_UNREGISTEREPMSG RPCSS_NP_MESSAGE_UNION_UNREGISTEREPMSG
struct _RPCSS_NP_MESSAGE * PRPCSS_NP_MESSAGE
#define MAX_RPCSS_NP_REPLY_STRING_LEN
Definition: rpcss_shared.h:52
struct _RPCSS_NP_MESSAGE_UNION_VARDATAPAYLOADMSG RPCSS_NP_MESSAGE_UNION_VARDATAPAYLOADMSG
struct _RPCSS_NP_MESSAGE_UNION_RESOLVEEPMSG RPCSS_NP_MESSAGE_UNION_RESOLVEEPMSG
struct _RPCSS_NP_MESSAGE_UNION_RANMSG RPCSS_NP_MESSAGE_UNION_RANMSG
char payload[VARDATA_PAYLOAD_BYTES]
Definition: rpcss_shared.h:63
RPCSS_NP_MESSAGE_UNION message
Definition: rpcss_shared.h:133
UINT32 vardata_payload_size
Definition: rpcss_shared.h:134
int32_t INT
Definition: typedefs.h:58
RPCSS_NP_MESSAGE_UNION_VARDATAPAYLOADMSG vardatapayloadmsg
Definition: rpcss_shared.h:120
RPCSS_NP_MESSAGE_UNION_RANMSG ranmsg
Definition: rpcss_shared.h:119
RPCSS_NP_MESSAGE_UNION_UNREGISTEREPMSG unregisterepmsg
Definition: rpcss_shared.h:122
RPCSS_NP_MESSAGE_UNION_RESOLVEEPMSG resolveepmsg
Definition: rpcss_shared.h:123
RPCSS_NP_MESSAGE_UNION_REGISTEREPMSG registerepmsg
Definition: rpcss_shared.h:121