wtsapi32: Add stub for WTSUnRegisterSessionNotification.
[wine.git] / include / wine / rpcss_shared.h
blobe2ffeeb785dd98b69e067ec55502f0ecee6fbec4
1 /*
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
24 #include <stdarg.h>
25 #include <windef.h>
26 #include <winbase.h>
27 #include <rpc.h>
28 #include <rpcdcep.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;
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.
71 #define RPCSS_NP_MESSAGE_TYPEID_RANMSG 2
72 typedef struct _RPCSS_NP_MESSAGE_UNION_RANMSG {
73 long timeout;
74 } RPCSS_NP_MESSAGE_UNION_RANMSG;
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.
82 #define RPCSS_NP_MESSAGE_TYPEID_REGISTEREPMSG 3
83 typedef struct _RPCSS_NP_MESSAGE_UNION_REGISTEREPMSG {
84 RPC_SYNTAX_IDENTIFIER iface;
85 int object_count;
86 int binding_count;
87 int no_replace;
88 } RPCSS_NP_MESSAGE_UNION_REGISTEREPMSG;
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.
96 #define RPCSS_NP_MESSAGE_TYPEID_UNREGISTEREPMSG 4
97 typedef struct _RPCSS_NP_MESSAGE_UNION_UNREGISTEREPMSG {
98 RPC_SYNTAX_IDENTIFIER iface;
99 int object_count;
100 int binding_count;
101 } RPCSS_NP_MESSAGE_UNION_UNREGISTEREPMSG;
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.
112 #define RPCSS_NP_MESSAGE_TYPEID_RESOLVEEPMSG 5
113 typedef struct _RPCSS_NP_MESSAGE_UNION_RESOLVEEPMSG {
114 RPC_SYNTAX_IDENTIFIER iface;
115 UUID object;
116 } RPCSS_NP_MESSAGE_UNION_RESOLVEEPMSG;
118 typedef union {
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 {
132 UINT32 message_type;
133 RPCSS_NP_MESSAGE_UNION message;
134 UINT32 vardata_payload_size;
135 } RPCSS_NP_MESSAGE, *PRPCSS_NP_MESSAGE;
137 typedef union {
138 /* some of these aren't used, but I guess we don't care */
139 UINT as_uint;
140 INT as_int;
141 void *as_pvoid;
142 HANDLE as_handle;
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 */