2002-10-11 19:52:37 +02:00
|
|
|
/*
|
|
|
|
* RPC server API
|
|
|
|
*
|
2008-10-18 19:20:44 +02:00
|
|
|
* Copyright 2001 Ove Kåven, TransGaming Technologies
|
2002-10-11 19:52:37 +02:00
|
|
|
*
|
|
|
|
* 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 */
|
2006-11-10 13:07:28 +01:00
|
|
|
UINT MaxCalls; /* RO */
|
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 */
|
2009-03-29 19:42:35 +02:00
|
|
|
RPC_STATUS (*open_endpoint)(RpcServerProtseq *protseq, const char *endpoint);
|
2006-10-16 17:48:57 +02:00
|
|
|
};
|
|
|
|
|
2002-10-11 19:52:37 +02:00
|
|
|
typedef struct _RpcServerInterface
|
|
|
|
{
|
2006-11-13 12:45:57 +01:00
|
|
|
struct list entry;
|
2002-10-11 19:52:37 +02:00
|
|
|
RPC_SERVER_INTERFACE* If;
|
|
|
|
UUID MgrTypeUuid;
|
|
|
|
RPC_MGR_EPV* MgrEpv;
|
|
|
|
UINT Flags;
|
|
|
|
UINT MaxCalls;
|
|
|
|
UINT MaxRpcSize;
|
|
|
|
RPC_IF_CALLBACK_FN* IfCallbackFn;
|
2006-11-13 12:46:04 +01:00
|
|
|
LONG CurrentCalls; /* number of calls currently executing */
|
|
|
|
/* set when unregistering interface to let the caller of
|
|
|
|
* RpcServerUnregisterIf* know that all calls have finished */
|
|
|
|
HANDLE CallsCompletedEvent;
|
2008-09-12 13:58:19 +02:00
|
|
|
BOOL Delete; /* delete when the last call finishes */
|
2002-10-11 19:52:37 +02:00
|
|
|
} 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);
|
|
|
|
|
2009-03-20 17:10:42 +01:00
|
|
|
void RPCRT4_destroy_all_protseqs(void);
|
2009-12-13 22:35:29 +01:00
|
|
|
void RPCRT4_ServerFreeAllRegisteredAuthInfo(void);
|
2009-03-20 17:10:42 +01:00
|
|
|
|
2002-10-11 19:52:37 +02:00
|
|
|
#endif /* __WINE_RPC_SERVER_H */
|