2002-10-11 19:52:37 +02:00
|
|
|
|
/*
|
|
|
|
|
* RPC server API
|
|
|
|
|
*
|
|
|
|
|
* Copyright 2001 Ove K<EFBFBD>ven, TransGaming Technologies
|
|
|
|
|
*
|
|
|
|
|
* 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
|
2006-05-18 14:49:52 +02:00
|
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
2002-10-11 19:52:37 +02:00
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#ifndef __WINE_RPC_SERVER_H
|
|
|
|
|
#define __WINE_RPC_SERVER_H
|
|
|
|
|
|
|
|
|
|
#include "rpc_binding.h"
|
2006-10-16 17:49:29 +02:00
|
|
|
|
#include "wine/list.h"
|
2002-10-11 19:52:37 +02:00
|
|
|
|
|
2006-10-16 17:48:57 +02:00
|
|
|
|
struct protseq_ops;
|
|
|
|
|
|
2002-10-11 19:52:37 +02:00
|
|
|
|
typedef struct _RpcServerProtseq
|
|
|
|
|
{
|
2006-10-16 18:01:27 +02:00
|
|
|
|
const struct protseq_ops *ops; /* RO */
|
|
|
|
|
struct list entry; /* CS ::server_cs */
|
|
|
|
|
LPSTR Protseq; /* RO */
|
|
|
|
|
LPSTR Endpoint; /* RO */
|
2002-10-11 19:52:37 +02:00
|
|
|
|
UINT MaxCalls;
|
2006-10-16 18:01:27 +02:00
|
|
|
|
/* list of listening connections */
|
|
|
|
|
RpcConnection* conn; /* CS cs */
|
|
|
|
|
CRITICAL_SECTION cs;
|
2006-10-16 17:47:22 +02:00
|
|
|
|
|
|
|
|
|
/* is the server currently listening? */
|
2006-10-16 18:01:27 +02:00
|
|
|
|
BOOL is_listening; /* CS ::listen_cs */
|
2006-10-16 17:47:22 +02:00
|
|
|
|
/* mutex for ensuring only one thread can change state at a time */
|
|
|
|
|
HANDLE mgr_mutex;
|
|
|
|
|
/* set when server thread has finished opening connections */
|
|
|
|
|
HANDLE server_ready_event;
|
2002-10-11 19:52:37 +02:00
|
|
|
|
} RpcServerProtseq;
|
|
|
|
|
|
2006-10-16 17:48:57 +02:00
|
|
|
|
struct protseq_ops
|
|
|
|
|
{
|
|
|
|
|
const char *name;
|
|
|
|
|
RpcServerProtseq *(*alloc)(void);
|
|
|
|
|
void (*signal_state_changed)(RpcServerProtseq *protseq);
|
|
|
|
|
/* previous array is passed in to allow reuse of memory */
|
|
|
|
|
void *(*get_wait_array)(RpcServerProtseq *protseq, void *prev_array, unsigned int *count);
|
|
|
|
|
void (*free_wait_array)(RpcServerProtseq *protseq, void *array);
|
|
|
|
|
/* returns -1 for failure, 0 for server state changed and 1 to indicate a
|
|
|
|
|
* new connection was established */
|
|
|
|
|
int (*wait_for_new_connection)(RpcServerProtseq *protseq, unsigned int count, void *wait_array);
|
2006-11-08 21:45:19 +01:00
|
|
|
|
/* opens the endpoint and optionally begins listening */
|
|
|
|
|
RPC_STATUS (*open_endpoint)(RpcServerProtseq *protseq, LPSTR endpoint);
|
2006-10-16 17:48:57 +02:00
|
|
|
|
};
|
|
|
|
|
|
2002-10-11 19:52:37 +02:00
|
|
|
|
typedef struct _RpcServerInterface
|
|
|
|
|
{
|
|
|
|
|
struct _RpcServerInterface* Next;
|
|
|
|
|
RPC_SERVER_INTERFACE* If;
|
|
|
|
|
UUID MgrTypeUuid;
|
|
|
|
|
RPC_MGR_EPV* MgrEpv;
|
|
|
|
|
UINT Flags;
|
|
|
|
|
UINT MaxCalls;
|
|
|
|
|
UINT MaxRpcSize;
|
|
|
|
|
RPC_IF_CALLBACK_FN* IfCallbackFn;
|
|
|
|
|
} RpcServerInterface;
|
|
|
|
|
|
2006-10-25 14:28:56 +02:00
|
|
|
|
void RPCRT4_new_client(RpcConnection* conn);
|
|
|
|
|
const struct protseq_ops *rpcrt4_get_protseq_ops(const char *protseq);
|
|
|
|
|
|
2002-10-11 19:52:37 +02:00
|
|
|
|
#endif /* __WINE_RPC_SERVER_H */
|