Home | Info | Community | Development | myReactOS | Contact Us
ReactOS Development > Doxygenrpcss_shared.h
Go to the documentation of this file.
00001 /* 00002 * RPCSS shared definitions 00003 * 00004 * Copyright (C) 2002 Greg Turner 00005 * 00006 * This library is free software; you can redistribute it and/or 00007 * modify it under the terms of the GNU Lesser General Public 00008 * License as published by the Free Software Foundation; either 00009 * version 2.1 of the License, or (at your option) any later version. 00010 * 00011 * This library is distributed in the hope that it will be useful, 00012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00014 * Lesser General Public License for more details. 00015 * 00016 * You should have received a copy of the GNU Lesser General Public 00017 * License along with this library; if not, write to the Free Software 00018 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 00019 */ 00020 00021 #ifndef __WINE_RPCSS_SHARED_H 00022 #define __WINE_RPCSS_SHARED_H 00023 00024 #include <stdarg.h> 00025 #include <windef.h> 00026 #include <winbase.h> 00027 #include <rpc.h> 00028 #include <rpcdcep.h> 00029 00030 #define RPCSS_NP_PROTOCOL_VERSION 0x0000 00031 00032 #define RPCSS_STRINGIFY_MACRO(x) RPCSS_STRINGIFY_MACRO2(x) 00033 #define RPCSS_STRINGIFY_MACRO2(x) #x 00034 00035 #define STRINGIFIED_RPCSS_NP_PROTOCOL_VERSION \ 00036 RPCSS_STRINGIFY_MACRO(RPCSS_NP_PROTOCOL_VERSION) 00037 00038 /* only local communications are supported so far on this pipe. 00039 until this changes, we can just use a constant pipe-name */ 00040 #define NAME_RPCSS_NAMED_PIPE \ 00041 ("\\\\.\\pipe\\RpcssNP" STRINGIFIED_RPCSS_NP_PROTOCOL_VERSION) 00042 00043 /* mutex is local only... perhaps this ought to be part of the pipe 00044 protocol for remote wine<->wine connections? */ 00045 #define RPCSS_MASTER_MUTEX_NAME \ 00046 ("RPCSSMasterMutex" STRINGIFIED_RPCSS_NP_PROTOCOL_VERSION) 00047 00048 /* payloads above 1K are fragmented into multiple messages */ 00049 #define VARDATA_PAYLOAD_BYTES 1024 00050 00051 /* ick -- maybe we should pass a handle to a mailslot or something? */ 00052 #define MAX_RPCSS_NP_REPLY_STRING_LEN 512 00053 00054 /* number of microseconds/10 to wait for master mutex before giving up */ 00055 #define MASTER_MUTEX_TIMEOUT 6000000 00056 00057 /* number of miliseconds to wait on the master mutex after it returns BUSY */ 00058 #define MASTER_MUTEX_WAITNAMEDPIPE_TIMEOUT 5000 00059 00060 /* a data payload; not a normal message */ 00061 #define RPCSS_NP_MESSAGE_TYPEID_VARDATAPAYLOADMSG 1 00062 typedef struct _RPCSS_NP_MESSAGE_UNION_VARDATAPAYLOADMSG { 00063 char payload[VARDATA_PAYLOAD_BYTES]; 00064 } RPCSS_NP_MESSAGE_UNION_VARDATAPAYLOADMSG; 00065 00066 /* RANMSG: 00067 * Simply tells the server that another rpcss instance ran. 00068 * The server should respond by resetting its timeout to the 00069 * full lazy timeout. 00070 */ 00071 #define RPCSS_NP_MESSAGE_TYPEID_RANMSG 2 00072 typedef struct _RPCSS_NP_MESSAGE_UNION_RANMSG { 00073 long timeout; 00074 } RPCSS_NP_MESSAGE_UNION_RANMSG; 00075 00076 /* REGISTEREPMSG: 00077 * Registers endpoints with the endpoint server. 00078 * object_count and binding_count contain the number 00079 * of object uuids and endpoints in the vardata payload, 00080 * respectively. 00081 */ 00082 #define RPCSS_NP_MESSAGE_TYPEID_REGISTEREPMSG 3 00083 typedef struct _RPCSS_NP_MESSAGE_UNION_REGISTEREPMSG { 00084 RPC_SYNTAX_IDENTIFIER iface; 00085 int object_count; 00086 int binding_count; 00087 int no_replace; 00088 } RPCSS_NP_MESSAGE_UNION_REGISTEREPMSG; 00089 00090 /* UNREGISTEREPMSG: 00091 * Unregisters endpoints with the endpoint server. 00092 * object_count and binding_count contain the number 00093 * of object uuids and endpoints in the vardata payload, 00094 * respectively. 00095 */ 00096 #define RPCSS_NP_MESSAGE_TYPEID_UNREGISTEREPMSG 4 00097 typedef struct _RPCSS_NP_MESSAGE_UNION_UNREGISTEREPMSG { 00098 RPC_SYNTAX_IDENTIFIER iface; 00099 int object_count; 00100 int binding_count; 00101 } RPCSS_NP_MESSAGE_UNION_UNREGISTEREPMSG; 00102 00103 /* RESOLVEEPMSG: 00104 * Locates an endpoint registered with the endpoint server. 00105 * Vardata contains a single protseq string. This is a bit 00106 * silly: the protseq string is probably shorter than the 00107 * reply (an endpoint string), which is truncated at 00108 * MAX_RPCSS_NP_REPLY_STRING_LEN, at least for the moment. 00109 * returns the empty string if the requested endpoint isn't 00110 * registered. 00111 */ 00112 #define RPCSS_NP_MESSAGE_TYPEID_RESOLVEEPMSG 5 00113 typedef struct _RPCSS_NP_MESSAGE_UNION_RESOLVEEPMSG { 00114 RPC_SYNTAX_IDENTIFIER iface; 00115 UUID object; 00116 } RPCSS_NP_MESSAGE_UNION_RESOLVEEPMSG; 00117 00118 typedef union { 00119 RPCSS_NP_MESSAGE_UNION_RANMSG ranmsg; 00120 RPCSS_NP_MESSAGE_UNION_VARDATAPAYLOADMSG vardatapayloadmsg; 00121 RPCSS_NP_MESSAGE_UNION_REGISTEREPMSG registerepmsg; 00122 RPCSS_NP_MESSAGE_UNION_UNREGISTEREPMSG unregisterepmsg; 00123 RPCSS_NP_MESSAGE_UNION_RESOLVEEPMSG resolveepmsg; 00124 } RPCSS_NP_MESSAGE_UNION; 00125 00126 /* vardata_payload_size specifies the number of bytes 00127 * to be transferred over the pipe in VARDATAPAYLOAD 00128 * messages (divide by VARDATA_PAYLOAD_BYTES to 00129 * get the # of payloads) 00130 */ 00131 typedef struct _RPCSS_NP_MESSAGE { 00132 UINT32 message_type; 00133 RPCSS_NP_MESSAGE_UNION message; 00134 UINT32 vardata_payload_size; 00135 } RPCSS_NP_MESSAGE, *PRPCSS_NP_MESSAGE; 00136 00137 typedef union { 00138 /* some of these aren't used, but I guess we don't care */ 00139 UINT as_uint; 00140 INT as_int; 00141 void *as_pvoid; 00142 HANDLE as_handle; 00143 char as_string[MAX_RPCSS_NP_REPLY_STRING_LEN]; /* FIXME: yucky */ 00144 } RPCSS_NP_REPLY, *PRPCSS_NP_REPLY; 00145 00146 #endif /* __WINE_RPCSS_SHARED_H */ Generated on Sat May 26 2012 04:32:08 for ReactOS by
1.7.6.1
|