ReactOS  0.4.14-dev-49-gfb4591c
rpc_server.c File Reference
#include "config.h"
#include "wine/port.h"
#include <stdarg.h>
#include <stdio.h>
#include <string.h>
#include <assert.h>
#include "windef.h"
#include "winbase.h"
#include "winerror.h"
#include "rpc.h"
#include "rpcndr.h"
#include "excpt.h"
#include "wine/debug.h"
#include "wine/exception.h"
#include "rpc_server.h"
#include "rpc_assoc.h"
#include "rpc_message.h"
#include "rpc_defs.h"
#include "ncastatus.h"
#include "secext.h"
Include dependency graph for rpc_server.c:

Go to the source code of this file.

Classes

struct  _RpcPacket
 
struct  _RpcObjTypeMap
 
struct  rpc_server_registered_auth_info
 

Typedefs

typedef struct _RpcPacket RpcPacket
 
typedef struct _RpcObjTypeMap RpcObjTypeMap
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (rpc)
 
static RpcObjTypeMapLookupObjTypeMap (UUID *ObjUuid)
 
static UUIDLookupObjType (UUID *ObjUuid)
 
static RpcServerInterfaceRPCRT4_find_interface (UUID *object, const RPC_SYNTAX_IDENTIFIER *if_id, const RPC_SYNTAX_IDENTIFIER *transfer_syntax, BOOL check_object)
 
static void RPCRT4_release_server_interface (RpcServerInterface *sif)
 
static RpcPktHdrhandle_bind_error (RpcConnection *conn, RPC_STATUS error)
 
static RPC_STATUS process_bind_packet_no_send (RpcConnection *conn, RpcPktBindHdr *hdr, RPC_MESSAGE *msg, unsigned char *auth_data, ULONG auth_length, RpcPktHdr **ack_response, unsigned char **auth_data_out, ULONG *auth_length_out)
 
static RPC_STATUS process_bind_packet (RpcConnection *conn, RpcPktBindHdr *hdr, RPC_MESSAGE *msg, unsigned char *auth_data, ULONG auth_length)
 
static RPC_STATUS process_request_packet (RpcConnection *conn, RpcPktRequestHdr *hdr, RPC_MESSAGE *msg)
 
static RPC_STATUS process_auth3_packet (RpcConnection *conn, RpcPktCommonHdr *hdr, RPC_MESSAGE *msg, unsigned char *auth_data, ULONG auth_length)
 
static void RPCRT4_process_packet (RpcConnection *conn, RpcPktHdr *hdr, RPC_MESSAGE *msg, unsigned char *auth_data, ULONG auth_length)
 
static DWORD CALLBACK RPCRT4_worker_thread (LPVOID the_arg)
 
static DWORD CALLBACK RPCRT4_io_thread (LPVOID the_arg)
 
void RPCRT4_new_client (RpcConnection *conn)
 
static DWORD CALLBACK RPCRT4_server_thread (LPVOID the_arg)
 
static void RPCRT4_sync_with_server_thread (RpcServerProtseq *ps)
 
static RPC_STATUS RPCRT4_start_listen_protseq (RpcServerProtseq *ps, BOOL auto_listen)
 
static RPC_STATUS RPCRT4_start_listen (BOOL auto_listen)
 
static RPC_STATUS RPCRT4_stop_listen (BOOL auto_listen)
 
static BOOL RPCRT4_protseq_is_endpoint_registered (RpcServerProtseq *protseq, const char *endpoint)
 
static RPC_STATUS RPCRT4_use_protseq (RpcServerProtseq *ps, const char *endpoint)
 
RPC_STATUS WINAPI RpcServerInqBindings (RPC_BINDING_VECTOR **BindingVector)
 
RPC_STATUS WINAPI RpcServerUseProtseqEpA (RPC_CSTR Protseq, UINT MaxCalls, RPC_CSTR Endpoint, LPVOID SecurityDescriptor)
 
RPC_STATUS WINAPI RpcServerUseProtseqEpW (RPC_WSTR Protseq, UINT MaxCalls, RPC_WSTR Endpoint, LPVOID SecurityDescriptor)
 
static RPC_STATUS alloc_serverprotoseq (UINT MaxCalls, const char *Protseq, RpcServerProtseq **ps)
 
static void destroy_serverprotoseq (RpcServerProtseq *ps)
 
static RPC_STATUS RPCRT4_get_or_create_serverprotseq (UINT MaxCalls, const char *Protseq, RpcServerProtseq **ps)
 
RPC_STATUS WINAPI RpcServerUseProtseqEpExA (RPC_CSTR Protseq, UINT MaxCalls, RPC_CSTR Endpoint, LPVOID SecurityDescriptor, PRPC_POLICY lpPolicy)
 
RPC_STATUS WINAPI RpcServerUseProtseqEpExW (RPC_WSTR Protseq, UINT MaxCalls, RPC_WSTR Endpoint, LPVOID SecurityDescriptor, PRPC_POLICY lpPolicy)
 
RPC_STATUS WINAPI RpcServerUseProtseqA (RPC_CSTR Protseq, unsigned int MaxCalls, void *SecurityDescriptor)
 
RPC_STATUS WINAPI RpcServerUseProtseqW (RPC_WSTR Protseq, unsigned int MaxCalls, void *SecurityDescriptor)
 
void RPCRT4_destroy_all_protseqs (void)
 
RPC_STATUS WINAPI RpcServerRegisterIf (RPC_IF_HANDLE IfSpec, UUID *MgrTypeUuid, RPC_MGR_EPV *MgrEpv)
 
RPC_STATUS WINAPI RpcServerRegisterIfEx (RPC_IF_HANDLE IfSpec, UUID *MgrTypeUuid, RPC_MGR_EPV *MgrEpv, UINT Flags, UINT MaxCalls, RPC_IF_CALLBACK_FN *IfCallbackFn)
 
RPC_STATUS WINAPI RpcServerRegisterIf2 (RPC_IF_HANDLE IfSpec, UUID *MgrTypeUuid, RPC_MGR_EPV *MgrEpv, UINT Flags, UINT MaxCalls, UINT MaxRpcSize, RPC_IF_CALLBACK_FN *IfCallbackFn)
 
RPC_STATUS WINAPI RpcServerRegisterIf3 (RPC_IF_HANDLE IfSpec, UUID *MgrTypeUuid, RPC_MGR_EPV *MgrEpv, UINT Flags, UINT MaxCalls, UINT MaxRpcSize, RPC_IF_CALLBACK_FN *IfCallbackFn, void *SecurityDescriptor)
 
RPC_STATUS WINAPI RpcServerUnregisterIf (RPC_IF_HANDLE IfSpec, UUID *MgrTypeUuid, UINT WaitForCallsToComplete)
 
RPC_STATUS WINAPI RpcServerUnregisterIfEx (RPC_IF_HANDLE IfSpec, UUID *MgrTypeUuid, int RundownContextHandles)
 
RPC_STATUS WINAPI RpcObjectSetType (UUID *ObjUuid, UUID *TypeUuid)
 
static RPC_STATUS find_security_package (ULONG auth_type, SecPkgInfoW **packages_buf, SecPkgInfoW **ret)
 
RPC_STATUS RPCRT4_ServerGetRegisteredAuthInfo (USHORT auth_type, CredHandle *cred, TimeStamp *exp, ULONG *max_token)
 
void RPCRT4_ServerFreeAllRegisteredAuthInfo (void)
 
RPC_STATUS WINAPI RpcServerRegisterAuthInfoA (RPC_CSTR ServerPrincName, ULONG AuthnSvc, RPC_AUTH_KEY_RETRIEVAL_FN GetKeyFn, LPVOID Arg)
 
RPC_STATUS WINAPI RpcServerRegisterAuthInfoW (RPC_WSTR ServerPrincName, ULONG AuthnSvc, RPC_AUTH_KEY_RETRIEVAL_FN GetKeyFn, LPVOID Arg)
 
RPC_STATUS RPC_ENTRY RpcServerInqDefaultPrincNameA (ULONG AuthnSvc, RPC_CSTR *PrincName)
 
RPC_STATUS RPC_ENTRY RpcServerInqDefaultPrincNameW (ULONG AuthnSvc, RPC_WSTR *PrincName)
 
RPC_STATUS WINAPI RpcServerListen (UINT MinimumCallThreads, UINT MaxCalls, UINT DontWait)
 
RPC_STATUS WINAPI RpcMgmtWaitServerListen (void)
 
RPC_STATUS WINAPI RpcMgmtStopServerListening (RPC_BINDING_HANDLE Binding)
 
RPC_STATUS WINAPI RpcMgmtEnableIdleCleanup (void)
 
RPC_STATUS WINAPI I_RpcServerStartListening (HWND hWnd)
 
RPC_STATUS WINAPI I_RpcServerStopListening (void)
 
UINT WINAPI I_RpcWindowProc (void *hWnd, UINT Message, UINT wParam, ULONG lParam)
 
RPC_STATUS WINAPI RpcMgmtInqIfIds (RPC_BINDING_HANDLE Binding, RPC_IF_ID_VECTOR **IfIdVector)
 
RPC_STATUS WINAPI RpcMgmtInqStats (RPC_BINDING_HANDLE Binding, RPC_STATS_VECTOR **Statistics)
 
RPC_STATUS WINAPI RpcMgmtStatsVectorFree (RPC_STATS_VECTOR **StatsVector)
 
RPC_STATUS WINAPI RpcMgmtEpEltInqBegin (RPC_BINDING_HANDLE Binding, ULONG InquiryType, RPC_IF_ID *IfId, ULONG VersOption, UUID *ObjectUuid, RPC_EP_INQ_HANDLE *InquiryContext)
 
RPC_STATUS WINAPI RpcMgmtIsServerListening (RPC_BINDING_HANDLE Binding)
 
RPC_STATUS WINAPI RpcMgmtSetAuthorizationFn (RPC_MGMT_AUTHORIZATION_FN fn)
 
RPC_STATUS WINAPI RpcMgmtSetServerStackSize (ULONG ThreadStackSize)
 
RPC_BINDING_HANDLE WINAPI I_RpcGetCurrentCallHandle (void)
 

Variables

static RpcObjTypeMapRpcObjTypeMaps
 
static struct list protseqs = LIST_INIT(protseqs)
 
static struct list server_interfaces = LIST_INIT(server_interfaces)
 
static struct list server_registered_auth_info = LIST_INIT(server_registered_auth_info)
 
static CRITICAL_SECTION server_cs = { &server_cs_debug, -1, 0, 0, 0, 0 }
 
static CRITICAL_SECTION_DEBUG server_cs_debug
 
static CRITICAL_SECTION listen_cs = { &listen_cs_debug, -1, 0, 0, 0, 0 }
 
static CRITICAL_SECTION_DEBUG listen_cs_debug
 
static CRITICAL_SECTION server_auth_info_cs = { &server_auth_info_cs_debug, -1, 0, 0, 0, 0 }
 
static CRITICAL_SECTION_DEBUG server_auth_info_cs_debug
 
static BOOL std_listen
 
static LONG listen_count
 
static HANDLE listen_done_event
 
static UUID uuid_nil
 

Typedef Documentation

◆ RpcObjTypeMap

◆ RpcPacket

Function Documentation

◆ alloc_serverprotoseq()

static RPC_STATUS alloc_serverprotoseq ( UINT  MaxCalls,
const char Protseq,
RpcServerProtseq **  ps 
)
static

Definition at line 953 of file rpc_server.c.

954 {
955  const struct protseq_ops *ops = rpcrt4_get_protseq_ops(Protseq);
956 
957  if (!ops)
958  {
959  FIXME("protseq %s not supported\n", debugstr_a(Protseq));
961  }
962 
963  *ps = ops->alloc();
964  if (!*ps)
965  return RPC_S_OUT_OF_RESOURCES;
966  (*ps)->MaxCalls = MaxCalls;
967  (*ps)->Protseq = RPCRT4_strdupA(Protseq);
968  (*ps)->ops = ops;
969  list_init(&(*ps)->listeners);
970  list_init(&(*ps)->connections);
971  InitializeCriticalSection(&(*ps)->cs);
972  (*ps)->cs.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": RpcServerProtseq.cs");
973 
974  list_add_head(&protseqs, &(*ps)->entry);
975 
976  TRACE("new protseq %p created for %s\n", *ps, Protseq);
977 
978  return RPC_S_OK;
979 }
static struct list protseqs
Definition: rpc_server.c:71
RpcServerProtseq *(* alloc)(void)
Definition: rpc_server.h:51
#define DWORD_PTR
Definition: treelist.c:76
__WINE_SERVER_LIST_INLINE void list_add_head(struct list *list, struct list *elem)
Definition: list.h:96
const struct protseq_ops * rpcrt4_get_protseq_ops(const char *protseq) DECLSPEC_HIDDEN
#define FIXME(fmt,...)
Definition: debug.h:110
VOID WINAPI InitializeCriticalSection(OUT LPCRITICAL_SECTION lpCriticalSection)
Definition: synch.c:751
#define RPC_S_PROTSEQ_NOT_SUPPORTED
Definition: winerror.h:1014
#define TRACE(s)
Definition: solgame.cpp:4
#define debugstr_a
Definition: kernel32.h:31
#define RPCRT4_strdupA(x)
Definition: rpc_binding.h:151
#define RPC_S_OUT_OF_RESOURCES
Definition: winerror.h:1032
__WINE_SERVER_LIST_INLINE void list_init(struct list *list)
Definition: list.h:149
#define RPC_S_OK
Definition: rpcnterr.h:22

Referenced by RPCRT4_get_or_create_serverprotseq().

◆ destroy_serverprotoseq()

static void destroy_serverprotoseq ( RpcServerProtseq ps)
static

Definition at line 982 of file rpc_server.c.

983 {
984  RPCRT4_strfree(ps->Protseq);
985  ps->cs.DebugInfo->Spare[0] = 0;
987  CloseHandle(ps->mgr_mutex);
989  list_remove(&ps->entry);
990  HeapFree(GetProcessHeap(), 0, ps);
991 }
HANDLE server_ready_event
Definition: rpc_server.h:45
#define CloseHandle
Definition: compat.h:398
struct list entry
Definition: rpc_server.h:32
void RPCRT4_strfree(LPSTR src)
Definition: rpc_binding.c:105
__WINE_SERVER_LIST_INLINE void list_remove(struct list *elem)
Definition: list.h:108
CRITICAL_SECTION cs
Definition: rpc_server.h:38
#define GetProcessHeap()
Definition: compat.h:395
void WINAPI DeleteCriticalSection(PCRITICAL_SECTION)
PCRITICAL_SECTION_DEBUG DebugInfo
Definition: winbase.h:859
#define HeapFree(x, y, z)
Definition: compat.h:394
DWORD_PTR Spare[8/sizeof(DWORD_PTR)]
Definition: winbase.h:852

Referenced by RPCRT4_destroy_all_protseqs().

◆ find_security_package()

static RPC_STATUS find_security_package ( ULONG  auth_type,
SecPkgInfoW **  packages_buf,
SecPkgInfoW **  ret 
)
static

Definition at line 1341 of file rpc_server.c.

1342 {
1343  SECURITY_STATUS sec_status;
1344  SecPkgInfoW *packages;
1345  ULONG package_count;
1346  ULONG i;
1347 
1348  sec_status = EnumerateSecurityPackagesW(&package_count, &packages);
1349  if (sec_status != SEC_E_OK)
1350  {
1351  ERR("EnumerateSecurityPackagesW failed with error 0x%08x\n", sec_status);
1352  return RPC_S_SEC_PKG_ERROR;
1353  }
1354 
1355  for (i = 0; i < package_count; i++)
1356  if (packages[i].wRPCID == auth_type)
1357  break;
1358 
1359  if (i == package_count)
1360  {
1361  WARN("unsupported AuthnSvc %u\n", auth_type);
1362  FreeContextBuffer(packages);
1364  }
1365 
1366  TRACE("found package %s for service %u\n", debugstr_w(packages[i].Name), auth_type);
1367  *packages_buf = packages;
1368  *ret = packages + i;
1369  return RPC_S_OK;
1370 }
SECURITY_STATUS WINAPI FreeContextBuffer(PVOID pv)
Definition: sspi.c:699
#define WARN(fmt,...)
Definition: debug.h:111
SECURITY_STATUS WINAPI EnumerateSecurityPackagesW(PULONG pcPackages, PSecPkgInfoW *ppPackageInfo)
Definition: sspi.c:709
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define debugstr_w
Definition: kernel32.h:32
#define RPC_S_SEC_PKG_ERROR
Definition: winerror.h:1132
LONG SECURITY_STATUS
Definition: sspi.h:34
#define TRACE(s)
Definition: solgame.cpp:4
int ret
#define RPC_S_UNKNOWN_AUTHN_SERVICE
Definition: winerror.h:1055
#define SEC_E_OK
Definition: winerror.h:2356
#define ERR(fmt,...)
Definition: debug.h:109
unsigned int ULONG
Definition: retypes.h:1
#define RPC_S_OK
Definition: rpcnterr.h:22

Referenced by RpcServerRegisterAuthInfoW().

◆ handle_bind_error()

static RpcPktHdr* handle_bind_error ( RpcConnection conn,
RPC_STATUS  error 
)
static

Definition at line 174 of file rpc_server.c.

175 {
176  unsigned int reject_reason;
177  switch (error)
178  {
180  reject_reason = REJECT_TEMPORARY_CONGESTION;
181  break;
182  case ERROR_OUTOFMEMORY:
184  reject_reason = REJECT_LOCAL_LIMIT_EXCEEDED;
185  break;
188  break;
190  reject_reason = REJECT_UNKNOWN_AUTHN_SERVICE;
191  break;
192  case ERROR_ACCESS_DENIED:
193  reject_reason = REJECT_INVALID_CHECKSUM;
194  break;
195  default:
196  FIXME("unexpected status value %d\n", error);
197  /* fall through */
198  case RPC_S_INVALID_BOUND:
199  reject_reason = REJECT_REASON_NOT_SPECIFIED;
200  break;
201  }
204  reject_reason);
205 }
RpcPktHdr * RPCRT4_BuildBindNackHeader(ULONG DataRepresentation, unsigned char RpcVersion, unsigned char RpcVersionMinor, unsigned short RejectReason)
Definition: rpc_message.c:231
#define RPC_S_INVALID_BOUND
Definition: winerror.h:1043
#define error(str)
Definition: mkdosfs.c:1605
#define REJECT_LOCAL_LIMIT_EXCEEDED
Definition: rpc_defs.h:222
#define REJECT_UNKNOWN_AUTHN_SERVICE
Definition: rpc_defs.h:228
#define REJECT_TEMPORARY_CONGESTION
Definition: rpc_defs.h:221
#define ERROR_ACCESS_DENIED
Definition: compat.h:87
#define REJECT_REASON_NOT_SPECIFIED
Definition: rpc_defs.h:220
#define FIXME(fmt,...)
Definition: debug.h:110
#define RPC_VER_MAJOR
Definition: rpc_defs.h:176
#define RPC_S_PROTOCOL_ERROR
Definition: winerror.h:1039
#define REJECT_INVALID_CHECKSUM
Definition: rpc_defs.h:229
#define RPC_S_UNKNOWN_AUTHN_SERVICE
Definition: winerror.h:1055
#define RPC_S_SERVER_TOO_BUSY
Definition: winerror.h:1034
#define NDR_LOCAL_DATA_REPRESENTATION
Definition: rpcndr.h:107
#define RPC_S_OUT_OF_RESOURCES
Definition: winerror.h:1032
#define REJECT_PROTOCOL_VERSION_NOT_SUPPORTED
Definition: rpc_defs.h:224
#define RPC_VER_MINOR
Definition: rpc_defs.h:177
#define ERROR_OUTOFMEMORY
Definition: deptool.c:13

Referenced by process_bind_packet().

◆ I_RpcGetCurrentCallHandle()

RPC_BINDING_HANDLE WINAPI I_RpcGetCurrentCallHandle ( void  )

Definition at line 1746 of file rpc_server.c.

1747 {
1748  TRACE("\n");
1750 }
#define TRACE(s)
Definition: solgame.cpp:4
RpcBinding * RPCRT4_GetThreadCurrentCallHandle(void) DECLSPEC_HIDDEN
Definition: rpcrt4_main.c:973

Referenced by client_get_handle(), NDRSContextMarshall(), NDRSContextUnmarshall(), RpcBindingInqAuthClientExW(), RpcBindingServerFromClient(), RpcImpersonateClient(), RpcRevertToSelfEx(), s_authinfo_test(), and s_context_handle_test().

◆ I_RpcServerStartListening()

RPC_STATUS WINAPI I_RpcServerStartListening ( HWND  hWnd)

Definition at line 1623 of file rpc_server.c.

1624 {
1625  FIXME( "(%p): stub\n", hWnd );
1626 
1627  return RPC_S_OK;
1628 }
HWND hWnd
Definition: settings.c:17
#define FIXME(fmt,...)
Definition: debug.h:110
#define RPC_S_OK
Definition: rpcnterr.h:22

◆ I_RpcServerStopListening()

RPC_STATUS WINAPI I_RpcServerStopListening ( void  )

Definition at line 1633 of file rpc_server.c.

1634 {
1635  FIXME( "(): stub\n" );
1636 
1637  return RPC_S_OK;
1638 }
#define FIXME(fmt,...)
Definition: debug.h:110
#define RPC_S_OK
Definition: rpcnterr.h:22

◆ I_RpcWindowProc()

UINT WINAPI I_RpcWindowProc ( void hWnd,
UINT  Message,
UINT  wParam,
ULONG  lParam 
)

Definition at line 1643 of file rpc_server.c.

1644 {
1645  FIXME( "(%p,%08x,%08x,%08x): stub\n", hWnd, Message, wParam, lParam );
1646 
1647  return 0;
1648 }
HWND hWnd
Definition: settings.c:17
WPARAM wParam
Definition: combotst.c:138
#define FIXME(fmt,...)
Definition: debug.h:110
CHAR Message[80]
Definition: alive.c:5
LPARAM lParam
Definition: combotst.c:139

◆ LookupObjType()

static UUID* LookupObjType ( UUID ObjUuid)
inlinestatic

Definition at line 124 of file rpc_server.c.

125 {
126  RpcObjTypeMap *map = LookupObjTypeMap(ObjUuid);
127  if (map)
128  return &map->Type;
129  else
130  return &uuid_nil;
131 }
Definition: _map.h:44
static RpcObjTypeMap * LookupObjTypeMap(UUID *ObjUuid)
Definition: rpc_server.c:111
static UUID uuid_nil
Definition: rpc_server.c:109

Referenced by RPCRT4_find_interface().

◆ LookupObjTypeMap()

static RpcObjTypeMap* LookupObjTypeMap ( UUID ObjUuid)
inlinestatic

Definition at line 111 of file rpc_server.c.

112 {
115 
116  while (rslt) {
117  if (! UuidCompare(ObjUuid, &rslt->Object, &dummy)) break;
118  rslt = rslt->next;
119  }
120 
121  return rslt;
122 }
int WINAPI UuidCompare(UUID *Uuid1, UUID *Uuid2, RPC_STATUS *Status)
Definition: rpcrt4_main.c:210
long RPC_STATUS
Definition: rpc.h:52
struct _RpcObjTypeMap * next
Definition: rpc_server.c:63
unsigned char dummy
Definition: maze.c:118
static RpcObjTypeMap * RpcObjTypeMaps
Definition: rpc_server.c:68

Referenced by LookupObjType().

◆ process_auth3_packet()

static RPC_STATUS process_auth3_packet ( RpcConnection conn,
RpcPktCommonHdr hdr,
RPC_MESSAGE msg,
unsigned char auth_data,
ULONG  auth_length 
)
static

Definition at line 478 of file rpc_server.c.

483 {
485 
486  if (UuidIsNil(&conn->ActiveInterface.SyntaxGUID, &status) ||
487  !auth_length || msg->BufferLength != 0)
489  else
490  {
492  (RpcAuthVerifier *)auth_data,
493  auth_length, NULL, NULL);
494  }
495 
496  /* FIXME: client doesn't expect a response to this message so must store
497  * status in connection so that fault packet can be returned when next
498  * packet is received */
499 
500  return RPC_S_OK;
501 }
int WINAPI UuidIsNil(UUID *Uuid, RPC_STATUS *Status)
Definition: rpcrt4_main.c:269
long RPC_STATUS
Definition: rpc.h:52
smooth NULL
Definition: ftsmooth.c:416
#define RPC_S_PROTOCOL_ERROR
Definition: winerror.h:1039
RPC_STATUS RPCRT4_ServerConnectionAuth(RpcConnection *conn, BOOL start, RpcAuthVerifier *auth_data_in, ULONG auth_length_in, unsigned char **auth_data_out, ULONG *auth_length_out)
Definition: rpc_message.c:1025
#define msg(x)
Definition: auth_time.c:54
static SERVICE_STATUS status
Definition: service.c:31
#define RPC_S_OK
Definition: rpcnterr.h:22
RPC_SYNTAX_IDENTIFIER ActiveInterface
Definition: rpc_binding.h:92
Definition: ps.c:97

Referenced by RPCRT4_io_thread(), and RPCRT4_process_packet().

◆ process_bind_packet()

static RPC_STATUS process_bind_packet ( RpcConnection conn,
RpcPktBindHdr hdr,
RPC_MESSAGE msg,
unsigned char auth_data,
ULONG  auth_length 
)
static

Definition at line 340 of file rpc_server.c.

344 {
346  RpcPktHdr *response = NULL;
347  unsigned char *auth_data_out = NULL;
348  ULONG auth_length_out = 0;
349 
350  status = process_bind_packet_no_send(conn, hdr, msg, auth_data, auth_length,
351  &response, &auth_data_out,
352  &auth_length_out);
353  if (status != RPC_S_OK)
354  response = handle_bind_error(conn, status);
355  if (response)
356  status = RPCRT4_SendWithAuth(conn, response, NULL, 0, auth_data_out, auth_length_out);
357  else
359  RPCRT4_FreeHeader(response);
360 
361  return status;
362 }
char hdr[14]
Definition: iptest.cpp:33
VOID RPCRT4_FreeHeader(RpcPktHdr *Header)
Definition: rpc_message.c:403
long RPC_STATUS
Definition: rpc.h:52
smooth NULL
Definition: ftsmooth.c:416
static RpcPktHdr * handle_bind_error(RpcConnection *conn, RPC_STATUS error)
Definition: rpc_server.c:174
RPC_STATUS RPCRT4_SendWithAuth(RpcConnection *Connection, RpcPktHdr *Header, void *Buffer, unsigned int BufferLength, const void *Auth, unsigned int AuthLength)
Definition: rpc_message.c:761
#define msg(x)
Definition: auth_time.c:54
unsigned int ULONG
Definition: retypes.h:1
static RPC_STATUS process_bind_packet_no_send(RpcConnection *conn, RpcPktBindHdr *hdr, RPC_MESSAGE *msg, unsigned char *auth_data, ULONG auth_length, RpcPktHdr **ack_response, unsigned char **auth_data_out, ULONG *auth_length_out)
Definition: rpc_server.c:207
static SERVICE_STATUS status
Definition: service.c:31
#define RPC_S_OK
Definition: rpcnterr.h:22
#define ERROR_OUTOFMEMORY
Definition: deptool.c:13
Definition: ps.c:97

Referenced by RPCRT4_io_thread(), and RPCRT4_process_packet().

◆ process_bind_packet_no_send()

static RPC_STATUS process_bind_packet_no_send ( RpcConnection conn,
RpcPktBindHdr hdr,
RPC_MESSAGE msg,
unsigned char auth_data,
ULONG  auth_length,
RpcPktHdr **  ack_response,
unsigned char **  auth_data_out,
ULONG auth_length_out 
)
static

Definition at line 207 of file rpc_server.c.

211 {
213  RpcContextElement *ctxt_elem;
214  unsigned int i;
216 
217  /* validate data */
218  for (i = 0, ctxt_elem = msg->Buffer;
219  i < hdr->num_elements;
220  i++, ctxt_elem = (RpcContextElement *)&ctxt_elem->transfer_syntaxes[ctxt_elem->num_syntaxes])
221  {
222  if (((char *)ctxt_elem - (char *)msg->Buffer) > msg->BufferLength ||
223  ((char *)&ctxt_elem->transfer_syntaxes[ctxt_elem->num_syntaxes] - (char *)msg->Buffer) > msg->BufferLength)
224  {
225  ERR("inconsistent data in packet - packet length %d, num elements %d\n",
226  msg->BufferLength, hdr->num_elements);
227  return RPC_S_INVALID_BOUND;
228  }
229  }
230 
231  if (hdr->max_tsize < RPC_MIN_PACKET_SIZE ||
233  conn->server_binding)
234  {
235  TRACE("packet size less than min size, or active interface syntax guid non-null\n");
236 
237  return RPC_S_INVALID_BOUND;
238  }
239 
241  hdr->num_elements * sizeof(*results));
242  if (!results)
243  return RPC_S_OUT_OF_RESOURCES;
244 
245  for (i = 0, ctxt_elem = (RpcContextElement *)msg->Buffer;
246  i < hdr->num_elements;
247  i++, ctxt_elem = (RpcContextElement *)&ctxt_elem->transfer_syntaxes[ctxt_elem->num_syntaxes])
248  {
249  RpcServerInterface* sif = NULL;
250  unsigned int j;
251 
252  for (j = 0; !sif && j < ctxt_elem->num_syntaxes; j++)
253  {
254  sif = RPCRT4_find_interface(NULL, &ctxt_elem->abstract_syntax,
255  &ctxt_elem->transfer_syntaxes[j], FALSE);
256  if (sif)
257  break;
258  }
259  if (sif)
260  {
262  TRACE("accepting bind request on connection %p for %s\n", conn,
264  results[i].result = RESULT_ACCEPT;
265  results[i].reason = REASON_NONE;
266  results[i].transfer_syntax = ctxt_elem->transfer_syntaxes[j];
267 
268  /* save the interface for later use */
269  /* FIXME: save linked list */
270  conn->ActiveInterface = ctxt_elem->abstract_syntax;
271  }
272  else if ((sif = RPCRT4_find_interface(NULL, &ctxt_elem->abstract_syntax,
273  NULL, FALSE)) != NULL)
274  {
276  TRACE("not accepting bind request on connection %p for %s - no transfer syntaxes supported\n",
277  conn, debugstr_guid(&ctxt_elem->abstract_syntax.SyntaxGUID));
280  memset(&results[i].transfer_syntax, 0, sizeof(results[i].transfer_syntax));
281  }
282  else
283  {
284  TRACE("not accepting bind request on connection %p for %s - abstract syntax not supported\n",
285  conn, debugstr_guid(&ctxt_elem->abstract_syntax.SyntaxGUID));
288  memset(&results[i].transfer_syntax, 0, sizeof(results[i].transfer_syntax));
289  }
290  }
291 
292  /* create temporary binding */
293  status = RPCRT4_MakeBinding(&conn->server_binding, conn);
294  if (status != RPC_S_OK)
295  {
297  return status;
298  }
299 
301  conn->NetworkAddr, conn->Endpoint,
302  conn->NetworkOptions,
303  hdr->assoc_gid,
304  &conn->server_binding->Assoc);
305  if (status != RPC_S_OK)
306  {
308  return status;
309  }
310 
311  if (auth_length)
312  {
314  (RpcAuthVerifier *)auth_data,
315  auth_length, auth_data_out,
316  auth_length_out);
317  if (status != RPC_S_OK)
318  {
320  return status;
321  }
322  }
323 
327  conn->server_binding->Assoc->assoc_group_id,
328  conn->Endpoint, hdr->num_elements,
329  results);
331 
332  if (*ack_response)
333  conn->MaxTransmissionSize = hdr->max_tsize;
334  else
336 
337  return status;
338 }
USHORT MaxTransmissionSize
Definition: rpc_binding.h:71
#define RESULT_PROVIDER_REJECTION
Definition: rpc_defs.h:213
#define REASON_NONE
Definition: rpc_defs.h:215
#define TRUE
Definition: types.h:120
static RpcServerInterface * RPCRT4_find_interface(UUID *object, const RPC_SYNTAX_IDENTIFIER *if_id, const RPC_SYNTAX_IDENTIFIER *transfer_syntax, BOOL check_object)
Definition: rpc_server.c:133
char hdr[14]
Definition: iptest.cpp:33
static const char * rpcrt4_conn_get_name(const RpcConnection *Connection)
Definition: rpc_binding.h:183
#define RPC_S_INVALID_BOUND
Definition: winerror.h:1043
#define RESULT_ACCEPT
Definition: rpc_defs.h:211
int WINAPI UuidIsNil(UUID *Uuid, RPC_STATUS *Status)
Definition: rpcrt4_main.c:269
long RPC_STATUS
Definition: rpc.h:52
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
unsigned char num_syntaxes
Definition: rpc_defs.h:69
smooth NULL
Definition: ftsmooth.c:416
#define debugstr_guid
Definition: kernel32.h:35
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
Definition: glfuncs.h:250
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
RpcPktHdr * RPCRT4_BuildBindAckHeader(ULONG DataRepresentation, unsigned short MaxTransmissionSize, unsigned short MaxReceiveSize, ULONG AssocGroupId, LPCSTR ServerAddress, unsigned char ResultCount, const RpcResult *Results)
Definition: rpc_message.c:253
LPWSTR NetworkOptions
Definition: rpc_binding.h:69
#define RPC_MIN_PACKET_SIZE
Definition: rpc_defs.h:183
LPSTR NetworkAddr
Definition: rpc_binding.h:67
struct _test_info results[8]
Definition: SetCursorPos.c:29
RPC_STATUS RPCRT4_ServerConnectionAuth(RpcConnection *conn, BOOL start, RpcAuthVerifier *auth_data_in, ULONG auth_length_in, unsigned char **auth_data_out, ULONG *auth_length_out)
Definition: rpc_message.c:1025
RPC_STATUS RPCRT4_MakeBinding(RpcBinding **Binding, RpcConnection *Connection)
Definition: rpc_binding.c:233
static void RPCRT4_release_server_interface(RpcServerInterface *sif)
Definition: rpc_server.c:162
struct _RpcBinding * server_binding
Definition: rpc_binding.h:96
#define ERR(fmt,...)
Definition: debug.h:109
#define NDR_LOCAL_DATA_REPRESENTATION
Definition: rpcndr.h:107
RPC_SYNTAX_IDENTIFIER transfer_syntaxes[ANYSIZE_ARRAY]
Definition: rpc_defs.h:72
#define RPC_S_OUT_OF_RESOURCES
Definition: winerror.h:1032
#define msg(x)
Definition: auth_time.c:54
RPC_STATUS RpcServerAssoc_GetAssociation(LPCSTR Protseq, LPCSTR NetworkAddr, LPCSTR Endpoint, LPCWSTR NetworkOptions, ULONG assoc_gid, RpcAssoc **assoc_out)
Definition: rpc_assoc.c:138
#define REASON_ABSTRACT_SYNTAX_NOT_SUPPORTED
Definition: rpc_defs.h:216
#define REASON_TRANSFER_SYNTAXES_NOT_SUPPORTED
Definition: rpc_defs.h:217
#define RPC_MAX_PACKET_SIZE
Definition: rpc_defs.h:184
RPC_SYNTAX_IDENTIFIER abstract_syntax
Definition: rpc_defs.h:71
#define memset(x, y, z)
Definition: compat.h:39
static SERVICE_STATUS status
Definition: service.c:31
#define HeapFree(x, y, z)
Definition: compat.h:394
#define RPC_S_OK
Definition: rpcnterr.h:22
RPC_SYNTAX_IDENTIFIER ActiveInterface
Definition: rpc_binding.h:92
Definition: ps.c:97

Referenced by process_bind_packet().

◆ process_request_packet()

static RPC_STATUS process_request_packet ( RpcConnection conn,
RpcPktRequestHdr hdr,
RPC_MESSAGE msg 
)
static

Definition at line 365 of file rpc_server.c.

366 {
368  RpcPktHdr *response = NULL;
369  RpcServerInterface* sif;
371  BOOL exception;
372  UUID *object_uuid;
373  NDR_SCONTEXT context_handle;
374  void *buf = msg->Buffer;
375 
376  /* fail if the connection isn't bound with an interface */
377  if (UuidIsNil(&conn->ActiveInterface.SyntaxGUID, &status)) {
378  /* FIXME: should send BindNack instead */
380  status);
381 
382  RPCRT4_Send(conn, response, NULL, 0);
383  RPCRT4_FreeHeader(response);
384  return RPC_S_OK;
385  }
386 
387  if (hdr->common.flags & RPC_FLG_OBJECT_UUID) {
388  object_uuid = (UUID*)(hdr + 1);
389  } else {
390  object_uuid = NULL;
391  }
392 
393  sif = RPCRT4_find_interface(object_uuid, &conn->ActiveInterface, NULL, TRUE);
394  if (!sif) {
395  WARN("interface %s no longer registered, returning fault packet\n", debugstr_guid(&conn->ActiveInterface.SyntaxGUID));
397  NCA_S_UNK_IF);
398 
399  RPCRT4_Send(conn, response, NULL, 0);
400  RPCRT4_FreeHeader(response);
401  return RPC_S_OK;
402  }
403  msg->RpcInterfaceInformation = sif->If;
404  /* copy the endpoint vector from sif to msg so that midl-generated code will use it */
405  msg->ManagerEpv = sif->MgrEpv;
406  if (object_uuid != NULL) {
407  RPCRT4_SetBindingObject(msg->Handle, object_uuid);
408  }
409 
410  /* find dispatch function */
411  msg->ProcNum = hdr->opnum;
412  if (sif->Flags & RPC_IF_OLE) {
413  /* native ole32 always gives us a dispatch table with a single entry
414  * (I assume that's a wrapper for IRpcStubBuffer::Invoke) */
416  } else {
417  if (msg->ProcNum >= sif->If->DispatchTable->DispatchTableCount) {
418  WARN("invalid procnum (%d/%d)\n", msg->ProcNum, sif->If->DispatchTable->DispatchTableCount);
421 
422  RPCRT4_Send(conn, response, NULL, 0);
423  RPCRT4_FreeHeader(response);
424  }
425  func = sif->If->DispatchTable->DispatchTable[msg->ProcNum];
426  }
427 
428  /* put in the drep. FIXME: is this more universally applicable?
429  perhaps we should move this outward... */
430  msg->DataRepresentation =
431  MAKELONG( MAKEWORD(hdr->common.drep[0], hdr->common.drep[1]),
432  MAKEWORD(hdr->common.drep[2], hdr->common.drep[3]));
433 
434  exception = FALSE;
435 
436  /* dispatch */
438  __TRY {
439  if (func) func(msg);
440  } __EXCEPT_ALL {
441  WARN("exception caught with code 0x%08x = %d\n", GetExceptionCode(), GetExceptionCode());
442  exception = TRUE;
445  else
447  response = RPCRT4_BuildFaultHeader(msg->DataRepresentation,
449  } __ENDTRY
451 
452  /* release any unmarshalled context handles */
453  while ((context_handle = RPCRT4_PopThreadContextHandle()) != NULL)
454  RpcServerAssoc_ReleaseContextHandle(conn->server_binding->Assoc, context_handle, TRUE);
455 
456  if (!exception)
457  response = RPCRT4_BuildResponseHeader(msg->DataRepresentation,
458  msg->BufferLength);
459 
460  /* send response packet */
461  if (response) {
462  status = RPCRT4_Send(conn, response, exception ? NULL : msg->Buffer,
463  exception ? 0 : msg->BufferLength);
464  RPCRT4_FreeHeader(response);
465  } else
466  ERR("out of memory\n");
467 
468  msg->RpcInterfaceInformation = NULL;
470 
471  if (msg->Buffer == buf) buf = NULL;
472  TRACE("freeing Buffer=%p\n", buf);
473  I_RpcFree(buf);
474 
475  return status;
476 }
GLenum func
Definition: glext.h:6028
#define TRUE
Definition: types.h:120
static RpcServerInterface * RPCRT4_find_interface(UUID *object, const RPC_SYNTAX_IDENTIFIER *if_id, const RPC_SYNTAX_IDENTIFIER *transfer_syntax, BOOL check_object)
Definition: rpc_server.c:133
char hdr[14]
Definition: iptest.cpp:33
PRPC_DISPATCH_TABLE DispatchTable
Definition: rpcdcep.h:106
#define NCA_S_UNK_IF
Definition: ncastatus.h:25
void WINAPI I_RpcFree(void *Object)
Definition: rpcrt4_main.c:725
#define MAKEWORD(a, b)
Definition: typedefs.h:247
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
#define exception
Definition: math.h:26
void(__RPC_STUB * RPC_DISPATCH_FUNCTION)(PRPC_MESSAGE Message)
Definition: rpcdcep.h:82
#define WARN(fmt,...)
Definition: debug.h:111
#define NCA_S_OP_RNG_ERROR
Definition: ncastatus.h:24
VOID RPCRT4_FreeHeader(RpcPktHdr *Header)
Definition: rpc_message.c:403
#define RPC_IF_OLE
Definition: rpcdce.h:314
RpcPktHdr * RPCRT4_BuildFaultHeader(ULONG DataRepresentation, RPC_STATUS Status)
Definition: rpc_message.c:170
RPC_DISPATCH_FUNCTION * DispatchTable
Definition: rpcdcep.h:88
int WINAPI UuidIsNil(UUID *Uuid, RPC_STATUS *Status)
Definition: rpcrt4_main.c:269
long RPC_STATUS
Definition: rpc.h:52
#define ERROR_NOACCESS
Definition: winerror.h:578
unsigned int BOOL
Definition: ntddk_ex.h:94
#define MAKELONG(a, b)
Definition: typedefs.h:248
unsigned int DispatchTableCount
Definition: rpcdcep.h:87
smooth NULL
Definition: ftsmooth.c:416
#define __TRY
Definition: compat.h:70
#define debugstr_guid
Definition: kernel32.h:35
#define GetExceptionCode()
Definition: exception.h:65
#define TRACE(s)
Definition: solgame.cpp:4
NCA_STATUS RPC2NCA_STATUS(RPC_STATUS status)
Definition: rpc_message.c:408
RPC_MGR_EPV * MgrEpv
Definition: rpc_server.h:68
NDR_SCONTEXT RPCRT4_PopThreadContextHandle(void) DECLSPEC_HIDDEN
Definition: rpcrt4_main.c:1017
#define RPC_FLG_OBJECT_UUID
Definition: rpc_defs.h:181
#define __ENDTRY
Definition: compat.h:72
static void RPCRT4_release_server_interface(RpcServerInterface *sif)
Definition: rpc_server.c:162
RPC_SERVER_INTERFACE * If
Definition: rpc_server.h:66
struct _RpcBinding * server_binding
Definition: rpc_binding.h:96
#define ERR(fmt,...)
Definition: debug.h:109
unsigned int RpcServerAssoc_ReleaseContextHandle(RpcAssoc *assoc, NDR_SCONTEXT SContext, BOOL release_lock)
Definition: rpc_assoc.c:564
#define NDR_LOCAL_DATA_REPRESENTATION
Definition: rpcndr.h:107
RPC_STATUS RPCRT4_SetBindingObject(RpcBinding *Binding, const UUID *ObjectUuid)
Definition: rpc_binding.c:225
#define STATUS_ACCESS_VIOLATION
Definition: ntstatus.h:228
RPC_STATUS RPCRT4_Send(RpcConnection *Connection, RpcPktHdr *Header, void *Buffer, unsigned int BufferLength)
Definition: rpc_message.c:1223
#define msg(x)
Definition: auth_time.c:54
void RPCRT4_SetThreadCurrentCallHandle(RpcBinding *Binding) DECLSPEC_HIDDEN
Definition: rpcrt4_main.c:965
static SERVICE_STATUS status
Definition: service.c:31
RpcPktHdr * RPCRT4_BuildResponseHeader(ULONG DataRepresentation, ULONG BufferLength)
Definition: rpc_message.c:154
#define RPC_S_OK
Definition: rpcnterr.h:22
RPC_SYNTAX_IDENTIFIER ActiveInterface
Definition: rpc_binding.h:92
#define __EXCEPT_ALL
Definition: exception.h:60
Definition: ps.c:97

Referenced by RPCRT4_process_packet().

◆ RpcMgmtEnableIdleCleanup()

RPC_STATUS WINAPI RpcMgmtEnableIdleCleanup ( void  )

Definition at line 1614 of file rpc_server.c.

1615 {
1616  FIXME("(): stub\n");
1617  return RPC_S_OK;
1618 }
#define FIXME(fmt,...)
Definition: debug.h:110
#define RPC_S_OK
Definition: rpcnterr.h:22

◆ RpcMgmtEpEltInqBegin()

RPC_STATUS WINAPI RpcMgmtEpEltInqBegin ( RPC_BINDING_HANDLE  Binding,
ULONG  InquiryType,
RPC_IF_ID IfId,
ULONG  VersOption,
UUID ObjectUuid,
RPC_EP_INQ_HANDLE InquiryContext 
)

Definition at line 1696 of file rpc_server.c.

1698 {
1699  FIXME("(%p,%u,%p,%u,%p,%p): stub\n",
1700  Binding, InquiryType, IfId, VersOption, ObjectUuid, InquiryContext);
1701  return RPC_S_INVALID_BINDING;
1702 }
#define FIXME(fmt,...)
Definition: debug.h:110
#define RPC_S_INVALID_BINDING
Definition: winerror.h:1013

◆ RpcMgmtInqIfIds()

RPC_STATUS WINAPI RpcMgmtInqIfIds ( RPC_BINDING_HANDLE  Binding,
RPC_IF_ID_VECTOR **  IfIdVector 
)

Definition at line 1653 of file rpc_server.c.

1654 {
1655  FIXME("(%p,%p): stub\n", Binding, IfIdVector);
1656  return RPC_S_INVALID_BINDING;
1657 }
#define FIXME(fmt,...)
Definition: debug.h:110
#define RPC_S_INVALID_BINDING
Definition: winerror.h:1013

◆ RpcMgmtInqStats()

RPC_STATUS WINAPI RpcMgmtInqStats ( RPC_BINDING_HANDLE  Binding,
RPC_STATS_VECTOR **  Statistics 
)

Definition at line 1662 of file rpc_server.c.

1663 {
1664  RPC_STATS_VECTOR *stats;
1665 
1666  FIXME("(%p,%p)\n", Binding, Statistics);
1667 
1668  if ((stats = HeapAlloc(GetProcessHeap(), 0, sizeof(RPC_STATS_VECTOR))))
1669  {
1670  stats->Count = 1;
1671  stats->Stats[0] = 0;
1672  *Statistics = stats;
1673  return RPC_S_OK;
1674  }
1675  return RPC_S_OUT_OF_RESOURCES;
1676 }
unsigned int Count
Definition: rpcdce.h:84
#define FIXME(fmt,...)
Definition: debug.h:110
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
#define RPC_S_OUT_OF_RESOURCES
Definition: winerror.h:1032
ULONG Stats[1]
Definition: rpcdce.h:85
#define RPC_S_OK
Definition: rpcnterr.h:22

◆ RpcMgmtIsServerListening()

RPC_STATUS WINAPI RpcMgmtIsServerListening ( RPC_BINDING_HANDLE  Binding)

Definition at line 1707 of file rpc_server.c.

1708 {
1710 
1711  TRACE("(%p)\n", Binding);
1712 
1713  if (Binding) {
1714  RpcBinding *rpc_binding = (RpcBinding*)Binding;
1715  status = RPCRT4_IsServerListening(rpc_binding->Protseq, rpc_binding->Endpoint);
1716  }else {
1720  }
1721 
1722  return status;
1723 }
LPSTR Protseq
Definition: rpc_binding.h:130
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
long RPC_STATUS
Definition: rpc.h:52
LPSTR Endpoint
Definition: rpc_binding.h:132
#define RPC_S_NOT_LISTENING
Definition: winerror.h:1026
RPC_STATUS RPCRT4_IsServerListening(const char *protseq, const char *endpoint) DECLSPEC_HIDDEN
#define TRACE(s)
Definition: solgame.cpp:4
static CRITICAL_SECTION listen_cs
Definition: rpc_server.c:84
static HANDLE listen_done_event
Definition: rpc_server.c:107
static BOOL std_listen
Definition: rpc_server.c:103
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
static SERVICE_STATUS status
Definition: service.c:31
#define RPC_S_OK
Definition: rpcnterr.h:22
Definition: ps.c:97

Referenced by _test_is_server_listening(), and _test_is_server_listening2().

◆ RpcMgmtSetAuthorizationFn()

RPC_STATUS WINAPI RpcMgmtSetAuthorizationFn ( RPC_MGMT_AUTHORIZATION_FN  fn)

Definition at line 1728 of file rpc_server.c.

1729 {
1730  FIXME("(%p): stub\n", fn);
1731  return RPC_S_OK;
1732 }
static GLenum _GLUfuncptr fn
Definition: wgl_font.c:159
#define FIXME(fmt,...)
Definition: debug.h:110
#define RPC_S_OK
Definition: rpcnterr.h:22

◆ RpcMgmtSetServerStackSize()

RPC_STATUS WINAPI RpcMgmtSetServerStackSize ( ULONG  ThreadStackSize)

Definition at line 1737 of file rpc_server.c.

1738 {
1739  FIXME("(0x%x): stub\n", ThreadStackSize);
1740  return RPC_S_OK;
1741 }
#define FIXME(fmt,...)
Definition: debug.h:110
#define RPC_S_OK
Definition: rpcnterr.h:22

Referenced by CallPerInstanceInitFunctions().

◆ RpcMgmtStatsVectorFree()

RPC_STATUS WINAPI RpcMgmtStatsVectorFree ( RPC_STATS_VECTOR **  StatsVector)

Definition at line 1681 of file rpc_server.c.

1682 {
1683  FIXME("(%p)\n", StatsVector);
1684 
1685  if (StatsVector)
1686  {
1687  HeapFree(GetProcessHeap(), 0, *StatsVector);
1688  *StatsVector = NULL;
1689  }
1690  return RPC_S_OK;
1691 }
#define FIXME(fmt,...)
Definition: debug.h:110
smooth NULL
Definition: ftsmooth.c:416
#define GetProcessHeap()
Definition: compat.h:395
#define HeapFree(x, y, z)
Definition: compat.h:394
#define RPC_S_OK
Definition: rpcnterr.h:22

◆ RpcMgmtStopServerListening()

RPC_STATUS WINAPI RpcMgmtStopServerListening ( RPC_BINDING_HANDLE  Binding)

Definition at line 1599 of file rpc_server.c.

1600 {
1601  TRACE("(Binding == (RPC_BINDING_HANDLE)^%p)\n", Binding);
1602 
1603  if (Binding) {
1604  FIXME("client-side invocation not implemented.\n");
1606  }
1607 
1608  return RPCRT4_stop_listen(FALSE);
1609 }
#define RPC_S_WRONG_KIND_OF_BINDING
Definition: winerror.h:1012
#define FIXME(fmt,...)
Definition: debug.h:110
#define TRACE(s)
Definition: solgame.cpp:4
static RPC_STATUS RPCRT4_stop_listen(BOOL auto_listen)
Definition: rpc_server.c:786

Referenced by _ServiceControlHandlerEx(), RpcpStopRpcServer(), RpcpStopRpcServerEx(), s_stop(), SamrShutdownSamServer(), service_handler(), ServiceControlHandler(), test_rpc_ncacn_ip_tcp(), test_server_listening(), and test_stop_wait_for_call().

◆ RpcMgmtWaitServerListen()

RPC_STATUS WINAPI RpcMgmtWaitServerListen ( void  )

Definition at line 1546 of file rpc_server.c.

1547 {
1548  RpcServerProtseq *protseq;
1549  HANDLE event, wait_thread;
1550 
1551  TRACE("()\n");
1552 
1554  event = listen_done_event;
1556 
1557  if (!event)
1558  return RPC_S_NOT_LISTENING;
1559 
1560  TRACE( "waiting for server calls to finish\n" );
1562  TRACE( "done waiting\n" );
1563 
1565  /* wait for server threads to finish */
1566  while(1)
1567  {
1568  if (listen_count)
1569  break;
1570 
1571  wait_thread = NULL;
1574  {
1575  if ((wait_thread = protseq->server_thread))
1576  break;
1577  }
1579  if (!wait_thread)
1580  break;
1581 
1582  TRACE("waiting for thread %u\n", GetThreadId(wait_thread));
1584  WaitForSingleObject(wait_thread, INFINITE);
1586  }
1587  if (listen_done_event == event)
1588  {
1590  CloseHandle( event );
1591  }
1593  return RPC_S_OK;
1594 }
static struct list protseqs
Definition: rpc_server.c:71
#define CloseHandle
Definition: compat.h:398
DWORD WINAPI GetThreadId(IN HANDLE Thread)
Definition: thread.c:912
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
static CRITICAL_SECTION server_cs
Definition: rpc_server.c:75
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
Definition: synch.c:82
#define LIST_FOR_EACH_ENTRY(elem, list, type, field)
Definition: list.h:198
smooth NULL
Definition: ftsmooth.c:416
#define RPC_S_NOT_LISTENING
Definition: winerror.h:1026
#define TRACE(s)
Definition: solgame.cpp:4
HANDLE server_thread
Definition: rpc_server.h:41
static LONG listen_count
Definition: rpc_server.c:105
uint32_t entry
Definition: isohybrid.c:63
static CRITICAL_SECTION listen_cs
Definition: rpc_server.c:84
struct _cl_event * event
Definition: glext.h:7739
static HANDLE listen_done_event
Definition: rpc_server.c:107
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
#define INFINITE
Definition: serial.h:102
#define RPC_S_OK
Definition: rpcnterr.h:22

Referenced by RpcpStopRpcServer(), RpcpStopRpcServerEx(), RpcServerListen(), run_server(), server(), test_rpc_ncacn_ip_tcp(), test_server_listening(), and wait_listen_proc().

◆ RpcObjectSetType()

RPC_STATUS WINAPI RpcObjectSetType ( UUID ObjUuid,
UUID TypeUuid 
)

Definition at line 1288 of file rpc_server.c.

1289 {
1290  RpcObjTypeMap *map = RpcObjTypeMaps, *prev = NULL;
1291  RPC_STATUS dummy;
1292 
1293  TRACE("(ObjUUID == %s, TypeUuid == %s).\n", debugstr_guid(ObjUuid), debugstr_guid(TypeUuid));
1294  if ((! ObjUuid) || UuidIsNil(ObjUuid, &dummy)) {
1295  /* nil uuid cannot be remapped */
1296  return RPC_S_INVALID_OBJECT;
1297  }
1298 
1299  /* find the mapping for this object if there is one ... */
1300  while (map) {
1301  if (! UuidCompare(ObjUuid, &map->Object, &dummy)) break;
1302  prev = map;
1303  map = map->next;
1304  }
1305  if ((! TypeUuid) || UuidIsNil(TypeUuid, &dummy)) {
1306  /* ... and drop it from the list */
1307  if (map) {
1308  if (prev)
1309  prev->next = map->next;
1310  else
1311  RpcObjTypeMaps = map->next;
1312  HeapFree(GetProcessHeap(), 0, map);
1313  }
1314  } else {
1315  /* ... , fail if we found it ... */
1316  if (map)
1317  return RPC_S_ALREADY_REGISTERED;
1318  /* ... otherwise create a new one and add it in. */
1319  map = HeapAlloc(GetProcessHeap(), 0, sizeof(RpcObjTypeMap));
1320  map->Object = *ObjUuid;
1321  map->Type = *TypeUuid;
1322  map->next = NULL;
1323  if (prev)
1324  prev->next = map; /* prev is the last map in the linklist */
1325  else
1326  RpcObjTypeMaps = map;
1327  }
1328 
1329  return RPC_S_OK;
1330 }
int WINAPI UuidCompare(UUID *Uuid1, UUID *Uuid2, RPC_STATUS *Status)
Definition: rpcrt4_main.c:210
int WINAPI UuidIsNil(UUID *Uuid, RPC_STATUS *Status)
Definition: rpcrt4_main.c:269
long RPC_STATUS
Definition: rpc.h:52
#define RPC_S_INVALID_OBJECT
Definition: winerror.h:1142
smooth NULL
Definition: ftsmooth.c:416
#define debugstr_guid
Definition: kernel32.h:35
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
Definition: _map.h:44
unsigned char dummy
Definition: maze.c:118
#define HeapFree(x, y, z)
Definition: compat.h:394
#define RPC_S_ALREADY_REGISTERED
Definition: winerror.h:1022
#define RPC_S_OK
Definition: rpcnterr.h:22
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint GLenum GLenum GLenum GLint GLuint GLenum GLenum GLfloat GLenum GLfloat GLenum map
Definition: glfuncs.h:262
static RpcObjTypeMap * RpcObjTypeMaps
Definition: rpc_server.c:68

◆ RPCRT4_destroy_all_protseqs()

void RPCRT4_destroy_all_protseqs ( void  )

Definition at line 1101 of file rpc_server.c.

1102 {
1103  RpcServerProtseq *cps, *cursor2;
1104 
1105  if (listen_count != 0)
1106  std_listen = FALSE;
1107 
1110  {
1111  if (listen_count != 0)
1114  }
1118 }
static struct list protseqs
Definition: rpc_server.c:71
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
static CRITICAL_SECTION server_cs
Definition: rpc_server.c:75
void WINAPI DeleteCriticalSection(PCRITICAL_SECTION)
static void RPCRT4_sync_with_server_thread(RpcServerProtseq *ps)
Definition: rpc_server.c:715
static LONG listen_count
Definition: rpc_server.c:105
uint32_t entry
Definition: isohybrid.c:63
static CRITICAL_SECTION listen_cs
Definition: rpc_server.c:84
#define LIST_FOR_EACH_ENTRY_SAFE(cursor, cursor2, list, type, field)
Definition: list.h:204
static BOOL std_listen
Definition: rpc_server.c:103
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
static void destroy_serverprotoseq(RpcServerProtseq *ps)
Definition: rpc_server.c:982

Referenced by DllMain().

◆ RPCRT4_find_interface()

static RpcServerInterface* RPCRT4_find_interface ( UUID object,
const RPC_SYNTAX_IDENTIFIER if_id,
const RPC_SYNTAX_IDENTIFIER transfer_syntax,
BOOL  check_object 
)
static

Definition at line 133 of file rpc_server.c.

137 {
138  UUID* MgrType = NULL;
139  RpcServerInterface* cif;
141 
142  if (check_object)
143  MgrType = LookupObjType(object);
146  if (!memcmp(if_id, &cif->If->InterfaceId, sizeof(RPC_SYNTAX_IDENTIFIER)) &&
147  (!transfer_syntax || !memcmp(transfer_syntax, &cif->If->TransferSyntax, sizeof(RPC_SYNTAX_IDENTIFIER))) &&
148  (check_object == FALSE || UuidEqual(MgrType, &cif->MgrTypeUuid, &status)) &&
149  std_listen) {
151  break;
152  }
153  }
155  if (&cif->entry == &server_interfaces) cif = NULL;
156  TRACE("returning %p for object %s, if_id { %d.%d %s }\n", cif,
157  debugstr_guid(object), if_id->SyntaxVersion.MajorVersion,
159  return cif;
160 }
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
Definition: utclib.c:112
unsigned short MajorVersion
Definition: rpcdcep.h:27
int WINAPI UuidEqual(UUID *Uuid1, UUID *Uuid2, RPC_STATUS *Status)
Definition: rpcrt4_main.c:253
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
static CRITICAL_SECTION server_cs
Definition: rpc_server.c:75
static UUID * LookupObjType(UUID *ObjUuid)
Definition: rpc_server.c:124
RPC_SYNTAX_IDENTIFIER InterfaceId
Definition: rpcdcep.h:104
long RPC_STATUS
Definition: rpc.h:52
#define LIST_FOR_EACH_ENTRY(elem, list, type, field)
Definition: list.h:198
RPC_VERSION SyntaxVersion
Definition: rpcdcep.h:33
smooth NULL
Definition: ftsmooth.c:416
#define debugstr_guid
Definition: kernel32.h:35
RPC_SYNTAX_IDENTIFIER TransferSyntax
Definition: rpcdcep.h:105
#define TRACE(s)
Definition: solgame.cpp:4
struct list entry
Definition: rpc_server.h:65
unsigned short MinorVersion
Definition: rpcdcep.h:28
uint32_t entry
Definition: isohybrid.c:63
RPC_SERVER_INTERFACE * If
Definition: rpc_server.h:66
#define InterlockedIncrement
Definition: armddk.h:53
static BOOL std_listen
Definition: rpc_server.c:103
static struct list server_interfaces
Definition: rpc_server.c:72
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
static SERVICE_STATUS status
Definition: service.c:31
Definition: ps.c:97

Referenced by process_bind_packet_no_send(), and process_request_packet().

◆ RPCRT4_get_or_create_serverprotseq()

static RPC_STATUS RPCRT4_get_or_create_serverprotseq ( UINT  MaxCalls,
const char Protseq,
RpcServerProtseq **  ps 
)
static

Definition at line 994 of file rpc_server.c.

995 {
997  RpcServerProtseq *cps;
998 
1000 
1002  if (!strcmp(cps->Protseq, Protseq))
1003  {
1004  TRACE("found existing protseq object for %s\n", Protseq);
1005  *ps = cps;
1007  return S_OK;
1008  }
1009 
1010  status = alloc_serverprotoseq(MaxCalls, Protseq, ps);
1011 
1013 
1014  return status;
1015 }
static struct list protseqs
Definition: rpc_server.c:71
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
static CRITICAL_SECTION server_cs
Definition: rpc_server.c:75
long RPC_STATUS
Definition: rpc.h:52
#define LIST_FOR_EACH_ENTRY(elem, list, type, field)
Definition: list.h:198
#define TRACE(s)
Definition: solgame.cpp:4
uint32_t entry
Definition: isohybrid.c:63
#define S_OK
Definition: intsafe.h:59
int strcmp(const char *String1, const char *String2)
Definition: utclib.c:469
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
static RPC_STATUS alloc_serverprotoseq(UINT MaxCalls, const char *Protseq, RpcServerProtseq **ps)
Definition: rpc_server.c:953
static SERVICE_STATUS status
Definition: service.c:31
Definition: ps.c:97

Referenced by RpcServerUseProtseqA(), RpcServerUseProtseqEpExA(), RpcServerUseProtseqEpExW(), and RpcServerUseProtseqW().

◆ RPCRT4_io_thread()

static DWORD CALLBACK RPCRT4_io_thread ( LPVOID  the_arg)
static

Definition at line 546 of file rpc_server.c.

547 {
548  RpcConnection* conn = the_arg;
549  RpcPktHdr *hdr;
550  RPC_MESSAGE *msg;
552  RpcPacket *packet;
553  unsigned char *auth_data;
554  ULONG auth_length;
555 
556  TRACE("(%p)\n", conn);
557 
558  for (;;) {
560  if (!msg) break;
561 
562  status = RPCRT4_ReceiveWithAuth(conn, &hdr, msg, &auth_data, &auth_length);
563  if (status != RPC_S_OK) {
564  WARN("receive failed with error %x\n", status);
565  HeapFree(GetProcessHeap(), 0, msg);
566  break;
567  }
568 
569  switch (hdr->common.ptype) {
570  case PKT_BIND:
571  TRACE("got bind packet\n");
572 
573  status = process_bind_packet(conn, &hdr->bind, msg, auth_data,
574  auth_length);
575  break;
576 
577  case PKT_REQUEST:
578  TRACE("got request packet\n");
579 
580  packet = HeapAlloc(GetProcessHeap(), 0, sizeof(RpcPacket));
581  if (!packet) {
582  I_RpcFree(msg->Buffer);
584  HeapFree(GetProcessHeap(), 0, msg);
585  HeapFree(GetProcessHeap(), 0, auth_data);
586  goto exit;
587  }
588  packet->conn = RPCRT4_GrabConnection( conn );
589  packet->hdr = hdr;
590  packet->msg = msg;
591  packet->auth_data = auth_data;
592  packet->auth_length = auth_length;
594  ERR("couldn't queue work item for worker thread, error was %d\n", GetLastError());
597  } else {
598  continue;
599  }
600  break;
601 
602  case PKT_AUTH3:
603  TRACE("got auth3 packet\n");
604 
605  status = process_auth3_packet(conn, &hdr->common, msg, auth_data,
606  auth_length);
607  break;
608  default:
609  FIXME("unhandled packet type %u\n", hdr->common.ptype);
610  break;
611  }
612 
613  I_RpcFree(msg->Buffer);
615  HeapFree(GetProcessHeap(), 0, msg);
616  HeapFree(GetProcessHeap(), 0, auth_data);
617 
618  if (status != RPC_S_OK) {
619  WARN("processing packet failed with error %u\n", status);
620  break;
621  }
622  }
623 exit:
625  return 0;
626 }
char hdr[14]
Definition: iptest.cpp:33
UCHAR packet[_PAGE_SIZE]
Definition: serial.c:53
void WINAPI I_RpcFree(void *Object)
Definition: rpcrt4_main.c:725
#define WARN(fmt,...)
Definition: debug.h:111
VOID RPCRT4_FreeHeader(RpcPktHdr *Header)
Definition: rpc_message.c:403
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
static DWORD CALLBACK RPCRT4_worker_thread(LPVOID the_arg)
Definition: rpc_server.c:536
RpcConnection * RPCRT4_GrabConnection(RpcConnection *conn) DECLSPEC_HIDDEN
long RPC_STATUS
Definition: rpc.h:52
#define FIXME(fmt,...)
Definition: debug.h:110
Definition: dhcpd.h:135
void RPCRT4_ReleaseConnection(RpcConnection *Connection) DECLSPEC_HIDDEN
#define WT_EXECUTELONGFUNCTION
Definition: winnt_old.h:1076
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
RPC_STATUS RPCRT4_ReceiveWithAuth(RpcConnection *Connection, RpcPktHdr **Header, PRPC_MESSAGE pMsg, unsigned char **auth_data_out, ULONG *auth_length_out)
Definition: rpc_message.c:1376
BOOL WINAPI QueueUserWorkItem(IN LPTHREAD_START_ROUTINE Function, IN PVOID Context, IN ULONG Flags)
Definition: thread.c:1064
static RPC_STATUS process_bind_packet(RpcConnection *conn, RpcPktBindHdr *hdr, RPC_MESSAGE *msg, unsigned char *auth_data, ULONG auth_length)
Definition: rpc_server.c:340
static RPC_STATUS process_auth3_packet(RpcConnection *conn, RpcPktCommonHdr *hdr, RPC_MESSAGE *msg, unsigned char *auth_data, ULONG auth_length)
Definition: rpc_server.c:478
#define ERR(fmt,...)
Definition: debug.h:109
#define RPC_S_OUT_OF_RESOURCES
Definition: winerror.h:1032
#define HEAP_ZERO_MEMORY
Definition: compat.h:123
#define msg(x)
Definition: auth_time.c:54
unsigned int ULONG
Definition: retypes.h:1
void exit(int exitcode)
Definition: _exit.c:33
static SERVICE_STATUS status
Definition: service.c:31
#define HeapFree(x, y, z)
Definition: compat.h:394
#define RPC_S_OK
Definition: rpcnterr.h:22
Definition: ps.c:97

Referenced by RPCRT4_new_client().

◆ RPCRT4_new_client()

void RPCRT4_new_client ( RpcConnection conn)

Definition at line 628 of file rpc_server.c.

629 {
631  if (!thread) {
632  DWORD err = GetLastError();
633  ERR("failed to create thread, error=%08x\n", err);
635  }
636  /* we could set conn->thread, but then we'd have to make the io_thread wait
637  * for that, otherwise the thread might finish, destroy the connection, and
638  * free the memory we'd write to before we did, causing crashes and stuff -
639  * so let's implement that later, when we really need conn->thread */
640 
641  CloseHandle( thread );
642 }
#define CloseHandle
Definition: compat.h:398
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
HANDLE WINAPI DECLSPEC_HOTPATCH CreateThread(IN LPSECURITY_ATTRIBUTES lpThreadAttributes, IN DWORD dwStackSize, IN LPTHREAD_START_ROUTINE lpStartAddress, IN LPVOID lpParameter, IN DWORD dwCreationFlags, OUT LPDWORD lpThreadId)
Definition: thread.c:136
smooth NULL
Definition: ftsmooth.c:416
void RPCRT4_ReleaseConnection(RpcConnection *Connection) DECLSPEC_HIDDEN
unsigned long DWORD
Definition: ntddk_ex.h:95
static HANDLE thread
Definition: service.c:33
#define err(...)
#define ERR(fmt,...)
Definition: debug.h:109
static DWORD CALLBACK RPCRT4_io_thread(LPVOID the_arg)
Definition: rpc_server.c:546

Referenced by rpcrt4_protseq_np_wait_for_new_connection(), and rpcrt4_protseq_sock_wait_for_new_connection().

◆ RPCRT4_process_packet()

static void RPCRT4_process_packet ( RpcConnection conn,
RpcPktHdr hdr,
RPC_MESSAGE msg,
unsigned char auth_data,
ULONG  auth_length 
)
static

Definition at line 503 of file rpc_server.c.

506 {
507  msg->Handle = (RPC_BINDING_HANDLE)conn->server_binding;
508 
509  switch (hdr->common.ptype) {
510  case PKT_BIND:
511  TRACE("got bind packet\n");
512  process_bind_packet(conn, &hdr->bind, msg, auth_data, auth_length);
513  break;
514 
515  case PKT_REQUEST:
516  TRACE("got request packet\n");
517  process_request_packet(conn, &hdr->request, msg);
518  break;
519 
520  case PKT_AUTH3:
521  TRACE("got auth3 packet\n");
522  process_auth3_packet(conn, &hdr->common, msg, auth_data, auth_length);
523  break;
524  default:
525  FIXME("unhandled packet type %u\n", hdr->common.ptype);
526  break;
527  }
528 
529  /* clean up */
530  I_RpcFree(msg->Buffer);
532  HeapFree(GetProcessHeap(), 0, msg);
533  HeapFree(GetProcessHeap(), 0, auth_data);
534 }
char hdr[14]
Definition: iptest.cpp:33
void WINAPI I_RpcFree(void *Object)
Definition: rpcrt4_main.c:725
VOID RPCRT4_FreeHeader(RpcPktHdr *Header)
Definition: rpc_message.c:403
#define FIXME(fmt,...)
Definition: debug.h:110
switch(r->id)
Definition: btrfs.c:2932
static RPC_STATUS process_request_packet(RpcConnection *conn, RpcPktRequestHdr *hdr, RPC_MESSAGE *msg)
Definition: rpc_server.c:365
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:395
static RPC_STATUS process_bind_packet(RpcConnection *conn, RpcPktBindHdr *hdr, RPC_MESSAGE *msg, unsigned char *auth_data, ULONG auth_length)
Definition: rpc_server.c:340
struct _RpcBinding * server_binding
Definition: rpc_binding.h:96
static RPC_STATUS process_auth3_packet(RpcConnection *conn, RpcPktCommonHdr *hdr, RPC_MESSAGE *msg, unsigned char *auth_data, ULONG auth_length)
Definition: rpc_server.c:478
#define msg(x)
Definition: auth_time.c:54
I_RPC_HANDLE RPC_BINDING_HANDLE
Definition: rpcdce.h:50
#define HeapFree(x, y, z)
Definition: compat.h:394

Referenced by RPCRT4_worker_thread().

◆ RPCRT4_protseq_is_endpoint_registered()

static BOOL RPCRT4_protseq_is_endpoint_registered ( RpcServerProtseq protseq,
const char endpoint 
)
static

Definition at line 824 of file rpc_server.c.

825 {
826  RpcConnection *conn;
827  BOOL registered = FALSE;
828  EnterCriticalSection(&protseq->cs);
829  LIST_FOR_EACH_ENTRY(conn, &protseq->listeners, RpcConnection, protseq_entry) {
830  if (!endpoint || !strcmp(endpoint, conn->Endpoint)) {
831  registered = TRUE;
832  break;
833  }
834  }
835  LeaveCriticalSection(&protseq->cs);
836  return registered;
837 }
#define TRUE
Definition: types.h:120
struct list listeners
Definition: rpc_server.h:36
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
#define LIST_FOR_EACH_ENTRY(elem, list, type, field)
Definition: list.h:198
unsigned int BOOL
Definition: ntddk_ex.h:94
CRITICAL_SECTION cs
Definition: rpc_server.h:38
Definition: nis.h:10
int strcmp(const char *String1, const char *String2)
Definition: utclib.c:469
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)

Referenced by RPCRT4_use_protseq().

◆ RPCRT4_release_server_interface()

static void RPCRT4_release_server_interface ( RpcServerInterface sif)
static

Definition at line 162 of file rpc_server.c.

163 {
164  if (!InterlockedDecrement(&sif->CurrentCalls) &&
165  sif->Delete) {
166  /* sif must have been removed from server_interfaces before
167  * CallsCompletedEvent is set */
168  if (sif->CallsCompletedEvent)
170  HeapFree(GetProcessHeap(), 0, sif);
171  }
172 }
BOOL WINAPI DECLSPEC_HOTPATCH SetEvent(IN HANDLE hEvent)
Definition: synch.c:733
HANDLE CallsCompletedEvent
Definition: rpc_server.h:76
#define GetProcessHeap()
Definition: compat.h:395
#define InterlockedDecrement
Definition: armddk.h:52
#define HeapFree(x, y, z)
Definition: compat.h:394

Referenced by process_bind_packet_no_send(), and process_request_packet().

◆ RPCRT4_server_thread()

static DWORD CALLBACK RPCRT4_server_thread ( LPVOID  the_arg)
static

Definition at line 644 of file rpc_server.c.

645 {
646  int res;
647  unsigned int count;
648  void *objs = NULL;
649  RpcServerProtseq* cps = the_arg;
650  RpcConnection* conn;
651  BOOL set_ready_event = FALSE;
652 
653  TRACE("(the_arg == ^%p)\n", the_arg);
654 
655  for (;;) {
656  objs = cps->ops->get_wait_array(cps, objs, &count);
657 
658  if (set_ready_event)
659  {
660  /* signal to function that changed state that we are now sync'ed */
662  set_ready_event = FALSE;
663  }
664 
665  /* start waiting */
666  res = cps->ops->wait_for_new_connection(cps, count, objs);
667 
668  if (res == -1 || (res == 0 && !std_listen))
669  {
670  /* cleanup */
671  cps->ops->free_wait_array(cps, objs);
672  break;
673  }
674  else if (res == 0)
675  set_ready_event = TRUE;
676  }
677 
678  TRACE("closing connections\n");
679 
680  EnterCriticalSection(&cps->cs);
681  LIST_FOR_EACH_ENTRY(conn, &cps->listeners, RpcConnection, protseq_entry)
683  LIST_FOR_EACH_ENTRY(conn, &cps->connections, RpcConnection, protseq_entry)
684  {
685  RPCRT4_GrabConnection(conn);
687  }
688  LeaveCriticalSection(&cps->cs);
689 
690  if (res == 0 && !std_listen)
692 
693  TRACE("waiting for active connections to close\n");
694 
695  EnterCriticalSection(&cps->cs);
696  while (!list_empty(&cps->connections))
697  {
698  conn = LIST_ENTRY(list_head(&cps->connections), RpcConnection, protseq_entry);
699  LeaveCriticalSection(&cps->cs);
701  EnterCriticalSection(&cps->cs);
702  }
703  LeaveCriticalSection(&cps->cs);
704 
707  cps->server_thread = NULL;
709  TRACE("done\n");
710  return 0;
711 }
HANDLE server_ready_event
Definition: rpc_server.h:45
#define TRUE
Definition: types.h:120
#define CloseHandle
Definition: compat.h:398
struct list listeners
Definition: rpc_server.h:36
GLuint GLuint GLsizei count
Definition: gl.h:1545
BOOL WINAPI DECLSPEC_HOTPATCH SetEvent(IN HANDLE hEvent)
Definition: synch.c:733
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
__WINE_SERVER_LIST_INLINE struct list * list_head(const struct list *list)
Definition: list.h:131
RpcConnection * RPCRT4_GrabConnection(RpcConnection *conn) DECLSPEC_HIDDEN
#define LIST_FOR_EACH_ENTRY(elem, list, type, field)
Definition: list.h:198
unsigned int BOOL
Definition: ntddk_ex.h:94
static void rpcrt4_conn_close_read(RpcConnection *connection)
Definition: rpc_binding.h:205
const struct protseq_ops * ops
Definition: rpc_server.h:31
smooth NULL
Definition: ftsmooth.c:416
struct list connections
Definition: rpc_server.h:37
CRITICAL_SECTION cs
Definition: rpc_server.h:38
#define TRACE(s)
Definition: solgame.cpp:4
void rpcrt4_conn_release_and_wait(RpcConnection *connection) DECLSPEC_HIDDEN
HANDLE server_thread
Definition: rpc_server.h:41
static CRITICAL_SECTION listen_cs
Definition: rpc_server.c:84
__WINE_SERVER_LIST_INLINE int list_empty(const struct list *list)
Definition: list.h:143
GLuint res
Definition: glext.h:9613
static BOOL std_listen
Definition: rpc_server.c:103
RPC_STATUS RPCRT4_CloseConnection(RpcConnection *Connection) DECLSPEC_HIDDEN
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
#define LIST_ENTRY(type)
Definition: queue.h:175

Referenced by RPCRT4_start_listen_protseq().

◆ RPCRT4_ServerFreeAllRegisteredAuthInfo()

void RPCRT4_ServerFreeAllRegisteredAuthInfo ( void  )

Definition at line 1403 of file rpc_server.c.

1404 {
1405  struct rpc_server_registered_auth_info *auth_info, *cursor2;
1406 
1409  {
1410  HeapFree(GetProcessHeap(), 0, auth_info->package_name);
1411  HeapFree(GetProcessHeap(), 0, auth_info->principal);
1412  HeapFree(GetProcessHeap(), 0, auth_info);
1413  }
1416 }
static CRITICAL_SECTION server_auth_info_cs
Definition: rpc_server.c:93
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
static struct list server_registered_auth_info
Definition: rpc_server.c:73
#define GetProcessHeap()
Definition: compat.h:395
void WINAPI DeleteCriticalSection(PCRITICAL_SECTION)
uint32_t entry
Definition: isohybrid.c:63
#define LIST_FOR_EACH_ENTRY_SAFE(cursor, cursor2, list, type, field)
Definition: list.h:204
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
#define HeapFree(x, y, z)
Definition: compat.h:394

Referenced by DllMain().

◆ RPCRT4_ServerGetRegisteredAuthInfo()

RPC_STATUS RPCRT4_ServerGetRegisteredAuthInfo ( USHORT  auth_type,
CredHandle cred,
TimeStamp exp,
ULONG max_token 
)

Definition at line 1372 of file rpc_server.c.

1374 {
1376  struct rpc_server_registered_auth_info *auth_info;
1377  SECURITY_STATUS sec_status;
1378 
1381  {
1382  if (auth_info->auth_type == auth_type)
1383  {
1384  sec_status = AcquireCredentialsHandleW((SEC_WCHAR *)auth_info->principal, auth_info->package_name,
1386  cred, exp);
1387  if (sec_status != SEC_E_OK)
1388  {
1390  break;
1391  }
1392 
1393  *max_token = auth_info->max_token;
1394  status = RPC_S_OK;
1395  break;
1396  }
1397  }
1399 
1400  return status;
1401 }
SECURITY_STATUS WINAPI AcquireCredentialsHandleW(SEC_WCHAR *pszPrincipal, SEC_WCHAR *pszPackage, ULONG fCredentialsUse, PLUID pvLogonID, PVOID pAuthData, SEC_GET_KEY_FN pGetKeyFn, PVOID pvGetKeyArgument, PCredHandle phCredential, PTimeStamp ptsExpiry)
Definition: wrapper.c:105
WCHAR SEC_WCHAR
Definition: sspi.h:29
static CRITICAL_SECTION server_auth_info_cs
Definition: rpc_server.c:93
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
long RPC_STATUS
Definition: rpc.h:52
#define LIST_FOR_EACH_ENTRY(elem, list, type, field)
Definition: list.h:198
#define SECPKG_CRED_INBOUND
Definition: sspi.h:276
#define RPC_S_SEC_PKG_ERROR
Definition: winerror.h:1132
smooth NULL
Definition: ftsmooth.c:416
LONG SECURITY_STATUS
Definition: sspi.h:34
static struct list server_registered_auth_info
Definition: rpc_server.c:73
#define RPC_S_UNKNOWN_AUTHN_SERVICE
Definition: winerror.h:1055
uint32_t entry
Definition: isohybrid.c:63
#define SEC_E_OK
Definition: winerror.h:2356
DWORD exp
Definition: msg.c:15681
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
static SERVICE_STATUS status
Definition: service.c:31
#define RPC_S_OK
Definition: rpcnterr.h:22
Definition: ps.c:97

Referenced by RPCRT4_ServerConnectionAuth().

◆ RPCRT4_start_listen()

static RPC_STATUS RPCRT4_start_listen ( BOOL  auto_listen)
static

Definition at line 748 of file rpc_server.c.

749 {
751  RpcServerProtseq *cps;
752 
753  TRACE("\n");
754 
756  if (auto_listen || !listen_done_event)
757  {
758  status = RPC_S_OK;
759  if(!auto_listen)
761  if (++listen_count == 1)
762  std_listen = TRUE;
763  }
765  if (status) return status;
766 
767  if (std_listen)
768  {
771  {
773  if (status != RPC_S_OK)
774  break;
775 
776  /* make sure server is actually listening on the interface before
777  * returning */
779  }
781  }
782 
783  return status;
784 }
static struct list protseqs
Definition: rpc_server.c:71
#define TRUE
Definition: types.h:120
static RPC_STATUS RPCRT4_start_listen_protseq(RpcServerProtseq *ps, BOOL auto_listen)
Definition: rpc_server.c:730
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
static CRITICAL_SECTION server_cs
Definition: rpc_server.c:75
HANDLE WINAPI DECLSPEC_HOTPATCH CreateEventW(IN LPSECURITY_ATTRIBUTES lpEventAttributes OPTIONAL, IN BOOL bManualReset, IN BOOL bInitialState, IN LPCWSTR lpName OPTIONAL)
Definition: synch.c:651
long RPC_STATUS
Definition: rpc.h:52
#define LIST_FOR_EACH_ENTRY(elem, list, type, field)
Definition: list.h:198
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
static void RPCRT4_sync_with_server_thread(RpcServerProtseq *ps)
Definition: rpc_server.c:715
static LONG listen_count
Definition: rpc_server.c:105
uint32_t entry
Definition: isohybrid.c:63
static CRITICAL_SECTION listen_cs
Definition: rpc_server.c:84
#define RPC_S_ALREADY_LISTENING
Definition: winerror.h:1024
static HANDLE listen_done_event
Definition: rpc_server.c:107
static BOOL std_listen
Definition: rpc_server.c:103
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
static SERVICE_STATUS status
Definition: service.c:31
#define RPC_S_OK
Definition: rpcnterr.h:22
Definition: ps.c:97

Referenced by RpcServerListen(), and RpcServerRegisterIf3().

◆ RPCRT4_start_listen_protseq()

static RPC_STATUS RPCRT4_start_listen_protseq ( RpcServerProtseq ps,
BOOL  auto_listen 
)
static

Definition at line 730 of file rpc_server.c.

731 {
733 
735  if (ps->server_thread) goto done;
736 
737  if (!ps->mgr_mutex) ps->mgr_mutex = CreateMutexW(NULL, FALSE, NULL);
740  if (!ps->server_thread)
742 
743 done:
745  return status;
746 }
HANDLE server_ready_event
Definition: rpc_server.h:45
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
HANDLE WINAPI DECLSPEC_HOTPATCH CreateEventW(IN LPSECURITY_ATTRIBUTES lpEventAttributes OPTIONAL, IN BOOL bManualReset, IN BOOL bInitialState, IN LPCWSTR lpName OPTIONAL)
Definition: synch.c:651
long RPC_STATUS
Definition: rpc.h:52
HANDLE WINAPI DECLSPEC_HOTPATCH CreateThread(IN LPSECURITY_ATTRIBUTES lpThreadAttributes, IN DWORD dwStackSize, IN LPTHREAD_START_ROUTINE lpStartAddress, IN LPVOID lpParameter, IN DWORD dwCreationFlags, OUT LPDWORD lpThreadId)
Definition: thread.c:136
smooth NULL
Definition: ftsmooth.c:416
static DWORD CALLBACK RPCRT4_server_thread(LPVOID the_arg)
Definition: rpc_server.c:644
HANDLE server_thread
Definition: rpc_server.h:41
static CRITICAL_SECTION listen_cs
Definition: rpc_server.c:84
HANDLE WINAPI DECLSPEC_HOTPATCH CreateMutexW(IN LPSECURITY_ATTRIBUTES lpMutexAttributes OPTIONAL, IN BOOL bInitialOwner, IN LPCWSTR lpName OPTIONAL)
Definition: synch.c:576
#define RPC_S_OUT_OF_RESOURCES
Definition: winerror.h:1032
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
static SERVICE_STATUS status
Definition: service.c:31
#define RPC_S_OK
Definition: rpcnterr.h:22
Definition: ps.c:97

Referenced by RPCRT4_start_listen(), and RPCRT4_use_protseq().

◆ RPCRT4_stop_listen()

static RPC_STATUS RPCRT4_stop_listen ( BOOL  auto_listen)
static

Definition at line 786 of file rpc_server.c.

787 {
788  BOOL stop_listen = FALSE;
790 
792  if (!std_listen && (auto_listen || !listen_done_event))
793  {
795  }
796  else
797  {
798  stop_listen = listen_count != 0 && --listen_count == 0;
799  assert(listen_count >= 0);
800  if (stop_listen)
801  std_listen = FALSE;
802  }
804 
805  if (status) return status;
806 
807  if (stop_listen) {
808  RpcServerProtseq *cps;
813  }
814 
815  if (!auto_listen)
816  {
820  }
821  return RPC_S_OK;
822 }
static struct list protseqs
Definition: rpc_server.c:71
#define assert(x)
Definition: debug.h:53
BOOL WINAPI DECLSPEC_HOTPATCH SetEvent(IN HANDLE hEvent)
Definition: synch.c:733
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
static CRITICAL_SECTION server_cs
Definition: rpc_server.c:75
long RPC_STATUS
Definition: rpc.h:52
#define LIST_FOR_EACH_ENTRY(elem, list, type, field)
Definition: list.h:198
unsigned int BOOL
Definition: ntddk_ex.h:94
#define RPC_S_NOT_LISTENING
Definition: winerror.h:1026
static void RPCRT4_sync_with_server_thread(RpcServerProtseq *ps)
Definition: rpc_server.c:715
static LONG listen_count
Definition: rpc_server.c:105
uint32_t entry
Definition: isohybrid.c:63
static CRITICAL_SECTION listen_cs
Definition: rpc_server.c:84
static HANDLE listen_done_event
Definition: rpc_server.c:107
static BOOL std_listen
Definition: rpc_server.c:103
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
static SERVICE_STATUS status
Definition: service.c:31
#define RPC_S_OK
Definition: rpcnterr.h:22
Definition: ps.c:97

Referenced by RpcMgmtStopServerListening().

◆ RPCRT4_sync_with_server_thread()

static void RPCRT4_sync_with_server_thread ( RpcServerProtseq ps)
static

Definition at line 715 of file rpc_server.c.

716 {
717  /* make sure we are the only thread sync'ing the server state, otherwise
718  * there is a race with the server thread setting an older state and setting
719  * the server_ready_event when the new state hasn't yet been applied */
721 
722  ps->ops->signal_state_changed(ps);
723 
724  /* wait for server thread to make the requested changes before returning */
726 
727  ReleaseMutex(ps->mgr_mutex);
728 }
HANDLE server_ready_event
Definition: rpc_server.h:45
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
Definition: synch.c:82
const struct protseq_ops * ops
Definition: rpc_server.h:31
BOOL WINAPI DECLSPEC_HOTPATCH ReleaseMutex(IN HANDLE hMutex)
Definition: synch.c:618
#define INFINITE
Definition: serial.h:102

Referenced by RPCRT4_destroy_all_protseqs(), RPCRT4_start_listen(), RPCRT4_stop_listen(), and RPCRT4_use_protseq().

◆ RPCRT4_use_protseq()

static RPC_STATUS RPCRT4_use_protseq ( RpcServerProtseq ps,
const char endpoint 
)
static

Definition at line 839 of file rpc_server.c.

840 {
842 
843  EnterCriticalSection(&ps->cs);
844 
846  status = RPC_S_OK;
847  else
848  status = ps->ops->open_endpoint(ps, endpoint);
849 
850  LeaveCriticalSection(&ps->cs);
851 
852  if (status != RPC_S_OK)
853  return status;
854 
855  if (std_listen)
856  {
858  if (status == RPC_S_OK)
860  }
861 
862  return status;
863 }
static BOOL RPCRT4_protseq_is_endpoint_registered(RpcServerProtseq *protseq, const char *endpoint)
Definition: rpc_server.c:824
static RPC_STATUS RPCRT4_start_listen_protseq(RpcServerProtseq *ps, BOOL auto_listen)
Definition: rpc_server.c:730
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
long RPC_STATUS
Definition: rpc.h:52
const struct protseq_ops * ops
Definition: rpc_server.h:31
CRITICAL_SECTION cs
Definition: rpc_server.h:38
static void RPCRT4_sync_with_server_thread(RpcServerProtseq *ps)
Definition: rpc_server.c:715
Definition: nis.h:10
static BOOL std_listen
Definition: rpc_server.c:103
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
static SERVICE_STATUS status
Definition: service.c:31
#define RPC_S_OK
Definition: rpcnterr.h:22
Definition: ps.c:97

Referenced by RpcServerUseProtseqA(), RpcServerUseProtseqEpExA(), RpcServerUseProtseqEpExW(), and RpcServerUseProtseqW().

◆ RPCRT4_worker_thread()

static DWORD CALLBACK RPCRT4_worker_thread ( LPVOID  the_arg)
static

Definition at line 536 of file rpc_server.c.

537 {
538  RpcPacket *pkt = the_arg;
539  RPCRT4_process_packet(pkt->conn, pkt->hdr, pkt->msg, pkt->auth_data,
540  pkt->auth_length);
542  HeapFree(GetProcessHeap(), 0, pkt);
543  return 0;
544 }
unsigned char * auth_data
Definition: rpc_server.c:56
static void RPCRT4_process_packet(RpcConnection *conn, RpcPktHdr *hdr, RPC_MESSAGE *msg, unsigned char *auth_data, ULONG auth_length)
Definition: rpc_server.c:503
ULONG auth_length
Definition: rpc_server.c:57
RPC_MESSAGE * msg
Definition: rpc_server.c:55
struct _RpcConnection * conn
Definition: rpc_server.c:53
void RPCRT4_ReleaseConnection(RpcConnection *Connection) DECLSPEC_HIDDEN
#define GetProcessHeap()
Definition: compat.h:395
#define HeapFree(x, y, z)
Definition: compat.h:394
RpcPktHdr * hdr
Definition: rpc_server.c:54

Referenced by RPCRT4_io_thread().

◆ RpcServerInqBindings()

RPC_STATUS WINAPI RpcServerInqBindings ( RPC_BINDING_VECTOR **  BindingVector)

Definition at line 868 of file rpc_server.c.

869 {
871  DWORD count;
872  RpcServerProtseq* ps;
873  RpcConnection* conn;
874 
875  if (BindingVector)
876  TRACE("(*BindingVector == ^%p)\n", *BindingVector);
877  else
878  ERR("(BindingVector == NULL!!?)\n");
879 
881  /* count connections */
882  count = 0;
884  EnterCriticalSection(&ps->cs);
885  LIST_FOR_EACH_ENTRY(conn, &ps->listeners, RpcConnection, protseq_entry)
886  count++;
887  LeaveCriticalSection(&ps->cs);
888  }
889  if (count) {
890  /* export bindings */
891  *BindingVector = HeapAlloc(GetProcessHeap(), 0,
892  sizeof(RPC_BINDING_VECTOR) +
893  sizeof(RPC_BINDING_HANDLE)*(count-1));
894  (*BindingVector)->Count = count;
895  count = 0;
897  EnterCriticalSection(&ps->cs);
898  LIST_FOR_EACH_ENTRY(conn, &ps->listeners, RpcConnection, protseq_entry) {
899  RPCRT4_MakeBinding((RpcBinding**)&(*BindingVector)->BindingH[count],
900  conn);
901  count++;
902  }
903  LeaveCriticalSection(&ps->cs);
904  }
905  status = RPC_S_OK;
906  } else {
907  *BindingVector = NULL;
909  }
911  return status;
912 }
static struct list protseqs
Definition: rpc_server.c:71
struct list listeners
Definition: rpc_server.h:36
GLuint GLuint GLsizei count
Definition: gl.h:1545
#define RPC_S_NO_BINDINGS
Definition: winerror.h:1029
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
static CRITICAL_SECTION server_cs
Definition: rpc_server.c:75
long RPC_STATUS
Definition: rpc.h:52
#define LIST_FOR_EACH_ENTRY(elem, list, type, field)
Definition: list.h:198
smooth NULL
Definition: ftsmooth.c:416
CRITICAL_SECTION cs
Definition: rpc_server.h:38
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
unsigned long DWORD
Definition: ntddk_ex.h:95
uint32_t entry
Definition: isohybrid.c:63
RPC_STATUS RPCRT4_MakeBinding(RpcBinding **Binding, RpcConnection *Connection)
Definition: rpc_binding.c:233
#define ERR(fmt,...)
Definition: debug.h:109
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
static SERVICE_STATUS status
Definition: service.c:31
#define RPC_S_OK
Definition: rpcnterr.h:22
Definition: ps.c:97

Referenced by test_endpoint_mapper(), and test_RpcServerUseProtseq().

◆ RpcServerInqDefaultPrincNameA()

RPC_STATUS RPC_ENTRY RpcServerInqDefaultPrincNameA ( ULONG  AuthnSvc,
RPC_CSTR PrincName 
)

Definition at line 1488 of file rpc_server.c.

1489 {
1490  RPC_STATUS ret;
1491  RPC_WSTR principalW;
1492 
1493  TRACE("%u, %p\n", AuthnSvc, PrincName);
1494 
1495  if ((ret = RpcServerInqDefaultPrincNameW( AuthnSvc, &principalW )) == RPC_S_OK)
1496  {
1497  if (!(*PrincName = (RPC_CSTR)RPCRT4_strdupWtoA( principalW ))) return RPC_S_OUT_OF_MEMORY;
1498  RpcStringFreeW( &principalW );
1499  }
1500  return ret;
1501 }
RPC_STATUS WINAPI RpcStringFreeW(RPC_WSTR *String)
Definition: rpcrt4_main.c:177
unsigned short * RPC_WSTR
Definition: rpcdce.h:46
LPSTR RPCRT4_strdupWtoA(LPCWSTR src)
Definition: rpc_binding.c:59
long RPC_STATUS
Definition: rpc.h:52
#define RPC_S_OUT_OF_MEMORY
Definition: rpcnterr.h:24
unsigned char * RPC_CSTR
Definition: rpcdce.h:45
#define TRACE(s)
Definition: solgame.cpp:4
int ret
RPC_STATUS RPC_ENTRY RpcServerInqDefaultPrincNameW(ULONG AuthnSvc, RPC_WSTR *PrincName)
Definition: rpc_server.c:1506
#define RPC_S_OK
Definition: rpcnterr.h:22

Referenced by test_RpcServerInqDefaultPrincName().

◆ RpcServerInqDefaultPrincNameW()

RPC_STATUS RPC_ENTRY RpcServerInqDefaultPrincNameW ( ULONG  AuthnSvc,
RPC_WSTR PrincName 
)

Definition at line 1506 of file rpc_server.c.

1507 {
1508  ULONG len = 0;
1509 
1510  FIXME("%u, %p\n", AuthnSvc, PrincName);
1511 
1512  if (AuthnSvc != RPC_C_AUTHN_WINNT) return RPC_S_UNKNOWN_AUTHN_SERVICE;
1513 
1514  GetUserNameExW( NameSamCompatible, NULL, &len );
1516 
1517  if (!(*PrincName = HeapAlloc( GetProcessHeap(), 0, len * sizeof(WCHAR) )))
1518  return RPC_S_OUT_OF_MEMORY;
1519 
1520  GetUserNameExW( NameSamCompatible, *PrincName, &len );
1521  return RPC_S_OK;
1522 }
#define RPC_C_AUTHN_WINNT
Definition: rpcdce.h:158
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
#define RPC_S_OUT_OF_MEMORY
Definition: rpcnterr.h:24
#define FIXME(fmt,...)
Definition: debug.h:110
smooth NULL
Definition: ftsmooth.c:416
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define RPC_S_UNKNOWN_AUTHN_SERVICE
Definition: winerror.h:1055
GLenum GLsizei len
Definition: glext.h:6722
#define RPC_S_INTERNAL_ERROR
Definition: winerror.h:1074
#define ERROR_MORE_DATA
Definition: dderror.h:13
BOOLEAN WINAPI GetUserNameExW(EXTENDED_NAME_FORMAT NameFormat, LPWSTR lpNameBuffer, PULONG nSize)
Definition: sspi.c:1079
unsigned int ULONG
Definition: retypes.h:1
#define RPC_S_OK
Definition: rpcnterr.h:22

Referenced by RpcServerInqDefaultPrincNameA().

◆ RpcServerListen()

RPC_STATUS WINAPI RpcServerListen ( UINT  MinimumCallThreads,
UINT  MaxCalls,
UINT  DontWait 
)

Definition at line 1527 of file rpc_server.c.

1528 {
1530 
1531  TRACE("(%u,%u,%u)\n", MinimumCallThreads, MaxCalls, DontWait);
1532 
1533  if (list_empty(&protseqs))
1535 
1537 
1538  if (DontWait || (status != RPC_S_OK)) return status;
1539 
1540  return RpcMgmtWaitServerListen();
1541 }
static struct list protseqs
Definition: rpc_server.c:71
#define RPC_S_NO_PROTSEQS_REGISTERED
Definition: winerror.h:1025
long RPC_STATUS
Definition: rpc.h:52
#define TRACE(s)
Definition: solgame.cpp:4
__WINE_SERVER_LIST_INLINE int list_empty(const struct list *list)
Definition: list.h:143
RPC_STATUS WINAPI RpcMgmtWaitServerListen(void)
Definition: rpc_server.c:1546
static RPC_STATUS RPCRT4_start_listen(BOOL auto_listen)
Definition: rpc_server.c:748
static SERVICE_STATUS status
Definition: service.c:31
#define RPC_S_OK
Definition: rpcnterr.h:22
Definition: ps.c:97

Referenced by LrpcThreadProc(), LsarStartRpcServer(), main(), RpcpStartRpcServer(), RpcServerThread(), RPCSS_Initialize(), RpcThreadRoutine(), run_server(), SampStartRpcServer(), ScmStartRpcServer(), server(), StartRpcServer(), test_ndr_buffer(), test_rpc_ncacn_ip_tcp(), test_server_listening(), and test_stop_wait_for_call().

◆ RpcServerRegisterAuthInfoA()

RPC_STATUS WINAPI RpcServerRegisterAuthInfoA ( RPC_CSTR  ServerPrincName,
ULONG  AuthnSvc,
RPC_AUTH_KEY_RETRIEVAL_FN  GetKeyFn,
LPVOID  Arg 
)

Definition at line 1421 of file rpc_server.c.

1423 {
1424  WCHAR *principal_name = NULL;
1426 
1427  TRACE("(%s,%u,%p,%p)\n", ServerPrincName, AuthnSvc, GetKeyFn, Arg);
1428 
1429  if(ServerPrincName && !(principal_name = RPCRT4_strdupAtoW((const char*)ServerPrincName)))
1430  return RPC_S_OUT_OF_RESOURCES;
1431 
1432  status = RpcServerRegisterAuthInfoW(principal_name, AuthnSvc, GetKeyFn, Arg);
1433 
1434  HeapFree(GetProcessHeap(), 0, principal_name);
1435  return status;
1436 }
RPC_STATUS WINAPI RpcServerRegisterAuthInfoW(RPC_WSTR ServerPrincName, ULONG AuthnSvc, RPC_AUTH_KEY_RETRIEVAL_FN GetKeyFn, LPVOID Arg)
Definition: rpc_server.c:1441
long RPC_STATUS
Definition: rpc.h:52
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:395
__wchar_t WCHAR
Definition: xmlstorage.h:180
LPWSTR RPCRT4_strdupAtoW(LPCSTR src)
Definition: rpc_binding.c:70
#define RPC_S_OUT_OF_RESOURCES
Definition: winerror.h:1032
static SERVICE_STATUS status
Definition: service.c:31
#define HeapFree(x, y, z)
Definition: compat.h:394
Definition: ps.c:97

Referenced by test_RpcServerInqDefaultPrincName().

◆ RpcServerRegisterAuthInfoW()

RPC_STATUS WINAPI RpcServerRegisterAuthInfoW ( RPC_WSTR  ServerPrincName,
ULONG  AuthnSvc,
RPC_AUTH_KEY_RETRIEVAL_FN  GetKeyFn,
LPVOID  Arg 
)

Definition at line 1441 of file rpc_server.c.

1443 {
1444  struct rpc_server_registered_auth_info *auth_info;
1445  SecPkgInfoW *packages, *package;
1447  ULONG max_token;
1449 
1450  TRACE("(%s,%u,%p,%p)\n", debugstr_w(ServerPrincName), AuthnSvc, GetKeyFn, Arg);
1451 
1452  status = find_security_package(AuthnSvc, &packages, &package);
1453  if (status != RPC_S_OK)
1454  return status;
1455 
1456  package_name = RPCRT4_strdupW(package->Name);
1457  max_token = package->cbMaxToken;
1458  FreeContextBuffer(packages);
1459  if (!package_name)
1460  return RPC_S_OUT_OF_RESOURCES;
1461 
1462  auth_info = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*auth_info));
1463  if (!auth_info) {
1465  return RPC_S_OUT_OF_RESOURCES;
1466  }
1467 
1468  if (ServerPrincName && !(auth_info->principal = RPCRT4_strdupW(ServerPrincName))) {
1470  HeapFree(GetProcessHeap(), 0, auth_info);
1471  return RPC_S_OUT_OF_RESOURCES;
1472  }
1473 
1474  auth_info->auth_type = AuthnSvc;
1475  auth_info->package_name = package_name;
1476  auth_info->max_token = max_token;
1477 
1481 
1482  return RPC_S_OK;
1483 }
SECURITY_STATUS WINAPI FreeContextBuffer(PVOID pv)
Definition: sspi.c:699
static CRITICAL_SECTION server_auth_info_cs
Definition: rpc_server.c:93
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
__WINE_SERVER_LIST_INLINE void list_add_tail(struct list *list, struct list *elem)
Definition: list.h:102
long RPC_STATUS
Definition: rpc.h:52
ULONG cbMaxToken
Definition: sspi.h:104
#define debugstr_w
Definition: kernel32.h:32
SEC_WCHAR * Name
Definition: sspi.h:105
static struct list server_registered_auth_info
Definition: rpc_server.c:73
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define RPC_S_OUT_OF_RESOURCES
Definition: winerror.h:1032
#define HEAP_ZERO_MEMORY
Definition: compat.h:123
unsigned int ULONG
Definition: retypes.h:1
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
#define RPCRT4_strdupW(x)
Definition: rpc_binding.h:152
static SERVICE_STATUS status
Definition: service.c:31
static RPC_STATUS find_security_package(ULONG auth_type, SecPkgInfoW **packages_buf, SecPkgInfoW **ret)
Definition: rpc_server.c:1341
#define HeapFree(x, y, z)
Definition: compat.h:394
#define RPC_S_OK
Definition: rpcnterr.h:22
Definition: ps.c:97

Referenced by RpcServerRegisterAuthInfoA(), and test_RpcServerRegisterAuthInfo().

◆ RpcServerRegisterIf()

RPC_STATUS WINAPI RpcServerRegisterIf ( RPC_IF_HANDLE  IfSpec,
UUID MgrTypeUuid,
RPC_MGR_EPV MgrEpv 
)

Definition at line 1123 of file rpc_server.c.

1124 {
1125  TRACE("(%p,%s,%p)\n", IfSpec, debugstr_guid(MgrTypeUuid), MgrEpv);
1126  return RpcServerRegisterIf3( IfSpec, MgrTypeUuid, MgrEpv, 0, RPC_C_LISTEN_MAX_CALLS_DEFAULT, (UINT)-1, NULL, NULL );
1127 }
#define RPC_C_LISTEN_MAX_CALLS_DEFAULT
Definition: rpcdce.h:122
smooth NULL
Definition: ftsmooth.c:416
#define debugstr_guid
Definition: kernel32.h:35
#define TRACE(s)
Definition: solgame.cpp:4
unsigned int UINT
Definition: ndis.h:50
RPC_STATUS WINAPI RpcServerRegisterIf3(RPC_IF_HANDLE IfSpec, UUID *MgrTypeUuid, RPC_MGR_EPV *MgrEpv, UINT Flags, UINT MaxCalls, UINT MaxRpcSize, RPC_IF_CALLBACK_FN *IfCallbackFn, void *SecurityDescriptor)
Definition: rpc_server.c:1151

Referenced by DsSetupInit(), LrpcThreadProc(), LsarStartRpcServer(), main(), RpcpAddInterface(), RpcServerThread(), RPCSS_Initialize(), RpcThreadRoutine(), run_server(), SampStartRpcServer(), ScmStartRpcServer(), server(), StartRpcServer(), test_endpoint_mapper(), test_ndr_buffer(), test_rpc_ncacn_ip_tcp(), and test_server_listening().

◆ RpcServerRegisterIf2()

RPC_STATUS WINAPI RpcServerRegisterIf2 ( RPC_IF_HANDLE  IfSpec,
UUID MgrTypeUuid,
RPC_MGR_EPV MgrEpv,
UINT  Flags,
UINT  MaxCalls,
UINT  MaxRpcSize,
RPC_IF_CALLBACK_FN IfCallbackFn 
)

Definition at line 1142 of file rpc_server.c.

1144 {
1145  return RpcServerRegisterIf3( IfSpec, MgrTypeUuid, MgrEpv, Flags, MaxCalls, MaxRpcSize, IfCallbackFn, NULL );
1146 }
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
smooth NULL
Definition: ftsmooth.c:416
RPC_STATUS WINAPI RpcServerRegisterIf3(RPC_IF_HANDLE IfSpec, UUID *MgrTypeUuid, RPC_MGR_EPV *MgrEpv, UINT Flags, UINT MaxCalls, UINT MaxRpcSize, RPC_IF_CALLBACK_FN *IfCallbackFn, void *SecurityDescriptor)
Definition: rpc_server.c:1151

◆ RpcServerRegisterIf3()

RPC_STATUS WINAPI RpcServerRegisterIf3 ( RPC_IF_HANDLE  IfSpec,
UUID MgrTypeUuid,
RPC_MGR_EPV MgrEpv,
UINT  Flags,
UINT  MaxCalls,
UINT  MaxRpcSize,
RPC_IF_CALLBACK_FN IfCallbackFn,
void SecurityDescriptor 
)

Definition at line 1151 of file rpc_server.c.

1153 {
1154  PRPC_SERVER_INTERFACE If = IfSpec;
1155  RpcServerInterface* sif;
1156  unsigned int i;
1157 
1158  TRACE("(%p,%s,%p,%u,%u,%u,%p,%p)\n", IfSpec, debugstr_guid(MgrTypeUuid), MgrEpv, Flags, MaxCalls,
1159  MaxRpcSize, IfCallbackFn, SecurityDescriptor);
1160 
1161  if (SecurityDescriptor)
1162  FIXME("Unsupported SecurityDescriptor argument.\n");
1163 
1164  TRACE(" interface id: %s %d.%d\n", debugstr_guid(&If->InterfaceId.SyntaxGUID),
1167  TRACE(" transfer syntax: %s %d.%d\n", debugstr_guid(&If->TransferSyntax.SyntaxGUID),
1170  TRACE(" dispatch table: %p\n", If->DispatchTable);
1171  if (If->DispatchTable) {
1172  TRACE(" dispatch table count: %d\n", If->DispatchTable->DispatchTableCount);
1173  for (i=0; i<If->DispatchTable->DispatchTableCount; i++) {
1174  TRACE(" entry %d: %p\n", i, If->DispatchTable->DispatchTable[i]);
1175  }
1176  TRACE(" reserved: %ld\n", If->DispatchTable->Reserved);
1177  }
1178  TRACE(" protseq endpoint count: %d\n", If->RpcProtseqEndpointCount);
1179  TRACE(" default manager epv: %p\n", If->DefaultManagerEpv);
1180  TRACE(" interpreter info: %p\n", If->InterpreterInfo);
1181 
1183  sif->If = If;
1184  if (MgrTypeUuid) {
1185  sif->MgrTypeUuid = *MgrTypeUuid;
1186  sif->MgrEpv = MgrEpv;
1187  } else {
1188  memset(&sif->MgrTypeUuid, 0, sizeof(UUID));
1189  sif->MgrEpv = If->DefaultManagerEpv;
1190  }
1191  sif->Flags = Flags;
1192  sif->MaxCalls = MaxCalls;
1193  sif->MaxRpcSize = MaxRpcSize;
1194  sif->IfCallbackFn = IfCallbackFn;
1195 
1199 
1200  if (sif->Flags & RPC_IF_AUTOLISTEN)
1202 
1203  return RPC_S_OK;
1204 }
void const * InterpreterInfo
Definition: rpcdcep.h:110
#define TRUE
Definition: types.h:120
PRPC_DISPATCH_TABLE DispatchTable
Definition: rpcdcep.h:106
unsigned short MajorVersion
Definition: rpcdcep.h:27
_In_ USHORT _In_ ULONG _In_ PSOCKADDR _In_ PSOCKADDR _Reserved_ ULONG _In_opt_ PVOID _In_opt_ const WSK_CLIENT_CONNECTION_DISPATCH _In_opt_ PEPROCESS _In_opt_ PETHREAD _In_opt_ PSECURITY_DESCRIPTOR SecurityDescriptor
Definition: wsk.h:182
__WINE_SERVER_LIST_INLINE void list_add_head(struct list *list, struct list *elem)
Definition: list.h:96
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
#define RPC_IF_AUTOLISTEN
Definition: rpcdce.h:313
static CRITICAL_SECTION server_cs
Definition: rpc_server.c:75
RPC_DISPATCH_FUNCTION * DispatchTable
Definition: rpcdcep.h:88
RPC_SYNTAX_IDENTIFIER InterfaceId
Definition: rpcdcep.h:104
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define FIXME(fmt,...)
Definition: debug.h:110
RPC_MGR_EPV * DefaultManagerEpv
Definition: rpcdcep.h:109
RPC_IF_CALLBACK_FN * IfCallbackFn
Definition: rpc_server.h:72
unsigned int DispatchTableCount
Definition: rpcdcep.h:87
RPC_VERSION SyntaxVersion
Definition: rpcdcep.h:33
#define debugstr_guid
Definition: kernel32.h:35
RPC_SYNTAX_IDENTIFIER TransferSyntax
Definition: rpcdcep.h:105
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
RPC_MGR_EPV * MgrEpv
Definition: rpc_server.h:68
struct list entry
Definition: rpc_server.h:65
LONG_PTR Reserved
Definition: rpcdcep.h:89
unsigned short MinorVersion
Definition: rpcdcep.h:28
RPC_SERVER_INTERFACE * If
Definition: rpc_server.h:66
#define HEAP_ZERO_MEMORY
Definition: compat.h:123
static struct list server_interfaces
Definition: rpc_server.c:72
static RPC_STATUS RPCRT4_start_listen(BOOL auto_listen)
Definition: rpc_server.c:748
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
#define memset(x, y, z)
Definition: compat.h:39
#define RPC_S_OK
Definition: rpcnterr.h:22
unsigned int RpcProtseqEndpointCount
Definition: rpcdcep.h:107

Referenced by RpcServerRegisterIf(), RpcServerRegisterIf2(), and RpcServerRegisterIfEx().

◆ RpcServerRegisterIfEx()

RPC_STATUS WINAPI RpcServerRegisterIfEx ( RPC_IF_HANDLE  IfSpec,
UUID MgrTypeUuid,
RPC_MGR_EPV MgrEpv,
UINT  Flags,
UINT  MaxCalls,
RPC_IF_CALLBACK_FN IfCallbackFn 
)

Definition at line 1132 of file rpc_server.c.

1134 {
1135  TRACE("(%p,%s,%p,%u,%u,%p)\n", IfSpec, debugstr_guid(MgrTypeUuid), MgrEpv, Flags, MaxCalls, IfCallbackFn);
1136  return RpcServerRegisterIf3( IfSpec, MgrTypeUuid, MgrEpv, Flags, MaxCalls, (UINT)-1, IfCallbackFn, NULL );
1137 }
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
smooth NULL
Definition: ftsmooth.c:416
#define debugstr_guid
Definition: kernel32.h:35
#define TRACE(s)
Definition: solgame.cpp:4
unsigned int UINT
Definition: ndis.h:50
RPC_STATUS WINAPI RpcServerRegisterIf3(RPC_IF_HANDLE IfSpec, UUID *MgrTypeUuid, RPC_MGR_EPV *MgrEpv, UINT Flags, UINT MaxCalls, UINT MaxRpcSize, RPC_IF_CALLBACK_FN *IfCallbackFn, void *SecurityDescriptor)
Definition: rpc_server.c:1151

Referenced by RPC_RegisterInterface().

◆ RpcServerUnregisterIf()

RPC_STATUS WINAPI RpcServerUnregisterIf ( RPC_IF_HANDLE  IfSpec,
UUID MgrTypeUuid,
UINT  WaitForCallsToComplete 
)

Definition at line 1209 of file rpc_server.c.

1210 {
1211  PRPC_SERVER_INTERFACE If = IfSpec;
1212  HANDLE event = NULL;
1213  BOOL found = FALSE;
1214  BOOL completed = TRUE;
1215  RpcServerInterface *cif;
1217 
1218  TRACE("(IfSpec == (RPC_IF_HANDLE)^%p (%s), MgrTypeUuid == %s, WaitForCallsToComplete == %u)\n",
1219  IfSpec, debugstr_guid(&If->InterfaceId.SyntaxGUID), debugstr_guid(MgrTypeUuid), WaitForCallsToComplete);
1220 
1223  if (((!IfSpec && !(cif->Flags & RPC_IF_AUTOLISTEN)) ||
1224  (IfSpec && !memcmp(&If->InterfaceId, &cif->If->InterfaceId, sizeof(RPC_SYNTAX_IDENTIFIER)))) &&
1225  UuidEqual(MgrTypeUuid, &cif->MgrTypeUuid, &status)) {
1226  list_remove(&cif->entry);
1227  TRACE("unregistering cif %p\n", cif);
1228  if (cif->CurrentCalls) {
1229  completed = FALSE;
1230  cif->Delete = TRUE;
1231  if (WaitForCallsToComplete)
1232  cif->CallsCompletedEvent = event = CreateEventW(NULL, FALSE, FALSE, NULL);
1233  }
1234  found = TRUE;
1235  break;
1236  }
1237  }
1239 
1240  if (!found) {
1241  ERR("not found for object %s\n", debugstr_guid(MgrTypeUuid));
1242  return RPC_S_UNKNOWN_IF;
1243  }
1244 
1245  if (completed)
1246  HeapFree(GetProcessHeap(), 0, cif);
1247  else if (event) {
1248  /* sif will be freed when the last call is completed, so be careful not to
1249  * touch that memory here as that could happen before we get here */
1251  CloseHandle(event);
1252  }
1253 
1254  return RPC_S_OK;
1255 }
#define RPC_S_UNKNOWN_IF
Definition: winerror.h:1028
#define TRUE
Definition: types.h:120
#define CloseHandle
Definition: compat.h:398
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
Definition: utclib.c:112
int WINAPI UuidEqual(UUID *Uuid1, UUID *Uuid2, RPC_STATUS *Status)
Definition: rpcrt4_main.c:253
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
#define RPC_IF_AUTOLISTEN
Definition: rpcdce.h:313
static CRITICAL_SECTION server_cs
Definition: rpc_server.c:75
HANDLE WINAPI DECLSPEC_HOTPATCH CreateEventW(IN LPSECURITY_ATTRIBUTES lpEventAttributes OPTIONAL, IN BOOL bManualReset, IN BOOL bInitialState, IN LPCWSTR lpName OPTIONAL)
Definition: synch.c:651
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
Definition: synch.c:82
RPC_SYNTAX_IDENTIFIER InterfaceId
Definition: rpcdcep.h:104
long RPC_STATUS
Definition: rpc.h:52
#define LIST_FOR_EACH_ENTRY(elem, list, type, field)
Definition: list.h:198
HANDLE CallsCompletedEvent
Definition: rpc_server.h:76
unsigned int BOOL
Definition: ntddk_ex.h:94
smooth NULL
Definition: ftsmooth.c:416
#define debugstr_guid
Definition: kernel32.h:35
__WINE_SERVER_LIST_INLINE void list_remove(struct list *elem)
Definition: list.h:108
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:395
struct list entry
Definition: rpc_server.h:65
uint32_t entry
Definition: isohybrid.c:63
struct _cl_event * event
Definition: glext.h:7739
RPC_SERVER_INTERFACE * If
Definition: rpc_server.h:66
#define ERR(fmt,...)
Definition: debug.h:109
static struct list server_interfaces
Definition: rpc_server.c:72
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
#define INFINITE
Definition: serial.h:102
static SERVICE_STATUS status
Definition: service.c:31
#define HeapFree(x, y, z)
Definition: compat.h:394
#define RPC_S_OK
Definition: rpcnterr.h:22
Definition: ps.c:97

Referenced by RPC_UnregisterInterface(), RpcpStopRpcServer(), RPCSS_Initialize(), s_stop(), s_stop_autolisten(), server(), service_handler(), test_endpoint_mapper(), test_ndr_buffer(), and test_rpc_ncacn_ip_tcp().

◆ RpcServerUnregisterIfEx()

RPC_STATUS WINAPI RpcServerUnregisterIfEx ( RPC_IF_HANDLE  IfSpec,
UUID MgrTypeUuid,
int  RundownContextHandles 
)

Definition at line 1260 of file rpc_server.c.

1261 {
1262  FIXME("(IfSpec == (RPC_IF_HANDLE)^%p, MgrTypeUuid == %s, RundownContextHandles == %d): stub\n",
1263  IfSpec, debugstr_guid(MgrTypeUuid), RundownContextHandles);
1264 
1265  return RPC_S_OK;
1266 }
#define FIXME(fmt,...)
Definition: debug.h:110
#define debugstr_guid
Definition: kernel32.h:35
#define RPC_S_OK
Definition: rpcnterr.h:22

Referenced by RpcpStopRpcServerEx().

◆ RpcServerUseProtseqA()

RPC_STATUS WINAPI RpcServerUseProtseqA ( RPC_CSTR  Protseq,
unsigned int  MaxCalls,
void SecurityDescriptor 
)

Definition at line 1067 of file rpc_server.c.

1068 {
1070  RpcServerProtseq* ps;
1071 
1072  TRACE("(Protseq == %s, MaxCalls == %d, SecurityDescriptor == ^%p)\n", debugstr_a((char*)Protseq), MaxCalls, SecurityDescriptor);
1073 
1074  status = RPCRT4_get_or_create_serverprotseq(MaxCalls, (const char *)Protseq, &ps);
1075  if (status != RPC_S_OK)
1076  return status;
1077 
1078  return RPCRT4_use_protseq(ps, NULL);
1079 }
static RPC_STATUS RPCRT4_get_or_create_serverprotseq(UINT MaxCalls, const char *Protseq, RpcServerProtseq **ps)
Definition: rpc_server.c:994
static RPC_STATUS RPCRT4_use_protseq(RpcServerProtseq *ps, const char *endpoint)
Definition: rpc_server.c:839
_In_ USHORT _In_ ULONG _In_ PSOCKADDR _In_ PSOCKADDR _Reserved_ ULONG _In_opt_ PVOID _In_opt_ const WSK_CLIENT_CONNECTION_DISPATCH _In_opt_ PEPROCESS _In_opt_ PETHREAD _In_opt_ PSECURITY_DESCRIPTOR SecurityDescriptor
Definition: wsk.h:182
long RPC_STATUS
Definition: rpc.h:52
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
#define debugstr_a
Definition: kernel32.h:31
static SERVICE_STATUS status
Definition: service.c:31
#define RPC_S_OK
Definition: rpcnterr.h:22
Definition: ps.c:97

Referenced by test_RpcServerUseProtseq().

◆ RpcServerUseProtseqEpA()

RPC_STATUS WINAPI RpcServerUseProtseqEpA ( RPC_CSTR  Protseq,
UINT  MaxCalls,
RPC_CSTR  Endpoint,
LPVOID  SecurityDescriptor 
)

Definition at line 917 of file rpc_server.c.

918 {
919  RPC_POLICY policy;
920 
921  TRACE( "(%s,%u,%s,%p)\n", Protseq, MaxCalls, Endpoint, SecurityDescriptor );
922 
923  /* This should provide the default behaviour */
924  policy.Length = sizeof( policy );
925  policy.EndpointFlags = 0;
926  policy.NICFlags = 0;
927 
928  return RpcServerUseProtseqEpExA( Protseq, MaxCalls, Endpoint, SecurityDescriptor, &policy );
929 }
RPC_STATUS WINAPI RpcServerUseProtseqEpExA(RPC_CSTR Protseq, UINT MaxCalls, RPC_CSTR Endpoint, LPVOID SecurityDescriptor, PRPC_POLICY lpPolicy)
Definition: rpc_server.c:1020
_In_ USHORT _In_ ULONG _In_ PSOCKADDR _In_ PSOCKADDR _Reserved_ ULONG _In_opt_ PVOID _In_opt_ const WSK_CLIENT_CONNECTION_DISPATCH _In_opt_ PEPROCESS _In_opt_ PETHREAD _In_opt_ PSECURITY_DESCRIPTOR SecurityDescriptor
Definition: wsk.h:182
ULONG NICFlags
Definition: rpcdce.h:218
unsigned int Length
Definition: rpcdce.h:216
#define TRACE(s)
Definition: solgame.cpp:4
ULONG EndpointFlags
Definition: rpcdce.h:217

Referenced by run_server(), server(), test_ndr_buffer(), test_rpc_ncacn_ip_tcp(), test_RpcServerUseProtseq(), and test_server_listening().

◆ RpcServerUseProtseqEpExA()

RPC_STATUS WINAPI RpcServerUseProtseqEpExA ( RPC_CSTR  Protseq,
UINT  MaxCalls,
RPC_CSTR  Endpoint,
LPVOID  SecurityDescriptor,
PRPC_POLICY  lpPolicy 
)

Definition at line 1020 of file rpc_server.c.

1022 {
1023  RpcServerProtseq* ps;
1025 
1026  TRACE("(%s,%u,%s,%p,{%u,%u,%u})\n", debugstr_a((const char *)Protseq),
1027  MaxCalls, debugstr_a((const char *)Endpoint), SecurityDescriptor,
1028  lpPolicy->Length, lpPolicy->EndpointFlags, lpPolicy->NICFlags );
1029 
1030  status = RPCRT4_get_or_create_serverprotseq(MaxCalls, (const char *)Protseq, &ps);
1031  if (status != RPC_S_OK)
1032  return status;
1033 
1034  return RPCRT4_use_protseq(ps, (const char *)Endpoint);
1035 }
static RPC_STATUS RPCRT4_get_or_create_serverprotseq(UINT MaxCalls, const char *Protseq, RpcServerProtseq **ps)
Definition: rpc_server.c:994
static RPC_STATUS RPCRT4_use_protseq(RpcServerProtseq *ps, const char *endpoint)
Definition: rpc_server.c:839
_In_ USHORT _In_ ULONG _In_ PSOCKADDR _In_ PSOCKADDR _Reserved_ ULONG _In_opt_ PVOID _In_opt_ const WSK_CLIENT_CONNECTION_DISPATCH _In_opt_ PEPROCESS _In_opt_ PETHREAD _In_opt_ PSECURITY_DESCRIPTOR SecurityDescriptor
Definition: wsk.h:182
ULONG NICFlags
Definition: rpcdce.h:218
unsigned int Length
Definition: rpcdce.h:216
long RPC_STATUS
Definition: rpc.h:52
#define TRACE(s)
Definition: solgame.cpp:4
#define debugstr_a
Definition: kernel32.h:31
ULONG EndpointFlags
Definition: rpcdce.h:217
static SERVICE_STATUS status
Definition: service.c:31
#define RPC_S_OK
Definition: rpcnterr.h:22
Definition: ps.c:97

Referenced by RpcServerUseProtseqEpA().

◆ RpcServerUseProtseqEpExW()

RPC_STATUS WINAPI RpcServerUseProtseqEpExW ( RPC_WSTR  Protseq,
UINT  MaxCalls,
RPC_WSTR  Endpoint,
LPVOID  SecurityDescriptor,
PRPC_POLICY  lpPolicy 
)

Definition at line 1040 of file rpc_server.c.

1042 {
1043  RpcServerProtseq* ps;
1045  LPSTR ProtseqA;
1046  LPSTR EndpointA;
1047 
1048  TRACE("(%s,%u,%s,%p,{%u,%u,%u})\n", debugstr_w( Protseq ), MaxCalls,
1049  debugstr_w( Endpoint ), SecurityDescriptor,
1050  lpPolicy->Length, lpPolicy->EndpointFlags, lpPolicy->NICFlags );
1051 
1052  ProtseqA = RPCRT4_strdupWtoA(Protseq);
1053  status = RPCRT4_get_or_create_serverprotseq(MaxCalls, ProtseqA, &ps);
1054  RPCRT4_strfree(ProtseqA);
1055  if (status != RPC_S_OK)
1056  return status;
1057 
1058  EndpointA = RPCRT4_strdupWtoA(Endpoint);
1059  status = RPCRT4_use_protseq(ps, EndpointA);
1060  RPCRT4_strfree(EndpointA);
1061  return status;
1062 }
static RPC_STATUS RPCRT4_get_or_create_serverprotseq(UINT MaxCalls, const char *Protseq, RpcServerProtseq **ps)
Definition: rpc_server.c:994
static RPC_STATUS RPCRT4_use_protseq(RpcServerProtseq *ps, const char *endpoint)
Definition: rpc_server.c:839
_In_ USHORT _In_ ULONG _In_ PSOCKADDR _In_ PSOCKADDR _Reserved_ ULONG _In_opt_ PVOID _In_opt_ const WSK_CLIENT_CONNECTION_DISPATCH _In_opt_ PEPROCESS _In_opt_ PETHREAD _In_opt_ PSECURITY_DESCRIPTOR SecurityDescriptor
Definition: wsk.h:182
ULONG NICFlags
Definition: rpcdce.h:218
char * LPSTR
Definition: xmlstorage.h:182
unsigned int Length
Definition: rpcdce.h:216
LPSTR RPCRT4_strdupWtoA(LPCWSTR src)
Definition: rpc_binding.c:59
long RPC_STATUS
Definition: rpc.h:52
void RPCRT4_strfree(LPSTR src)
Definition: rpc_binding.c:105
#define debugstr_w
Definition: kernel32.h:32
#define TRACE(s)
Definition: solgame.cpp:4
ULONG EndpointFlags
Definition: rpcdce.h:217
static SERVICE_STATUS status
Definition: service.c:31
#define RPC_S_OK
Definition: rpcnterr.h:22
Definition: ps.c:97

Referenced by RpcServerUseProtseqEpW().

◆ RpcServerUseProtseqEpW()

RPC_STATUS WINAPI RpcServerUseProtseqEpW ( RPC_WSTR  Protseq,
UINT  MaxCalls,
RPC_WSTR  Endpoint,
LPVOID  SecurityDescriptor 
)

Definition at line 934 of file rpc_server.c.

935 {
936  RPC_POLICY policy;
937 
938  TRACE( "(%s,%u,%s,%p)\n", debugstr_w( Protseq ), MaxCalls, debugstr_w( Endpoint ), SecurityDescriptor );
939 
940  /* This should provide the default behaviour */
941  policy.Length = sizeof( policy );
942  policy.EndpointFlags = 0;
943  policy.NICFlags = 0;
944 
945  return RpcServerUseProtseqEpExW( Protseq, MaxCalls, Endpoint, SecurityDescriptor, &policy );
946 }
_In_ USHORT _In_ ULONG _In_ PSOCKADDR _In_ PSOCKADDR _Reserved_ ULONG _In_opt_ PVOID _In_opt_ const WSK_CLIENT_CONNECTION_DISPATCH _In_opt_ PEPROCESS _In_opt_ PETHREAD _In_opt_ PSECURITY_DESCRIPTOR SecurityDescriptor
Definition: wsk.h:182
ULONG NICFlags
Definition: rpcdce.h:218
unsigned int Length
Definition: rpcdce.h:216
RPC_STATUS WINAPI RpcServerUseProtseqEpExW(RPC_WSTR Protseq, UINT MaxCalls, RPC_WSTR Endpoint, LPVOID SecurityDescriptor, PRPC_POLICY lpPolicy)
Definition: rpc_server.c:1040
#define debugstr_w
Definition: kernel32.h:32
#define TRACE(s)
Definition: solgame.cpp:4
ULONG EndpointFlags
Definition: rpcdce.h:217

Referenced by LrpcThreadProc(), LsarStartRpcServer(), RPC_StartRemoting(), RpcpAddInterface(), RpcServerThread(), RPCSS_Initialize(), RpcThreadRoutine(), SampStartRpcServer(), ScmStartRpcServer(), and StartRpcServer().

◆ RpcServerUseProtseqW()

RPC_STATUS WINAPI RpcServerUseProtseqW ( RPC_WSTR  Protseq,
unsigned int  MaxCalls,
void SecurityDescriptor 
)

Definition at line 1084 of file rpc_server.c.

1085 {
1087  RpcServerProtseq* ps;
1088  LPSTR ProtseqA;
1089 
1090  TRACE("Protseq == %s, MaxCalls == %d, SecurityDescriptor == ^%p)\n", debugstr_w(Protseq), MaxCalls, SecurityDescriptor);
1091 
1092  ProtseqA = RPCRT4_strdupWtoA(Protseq);
1093  status = RPCRT4_get_or_create_serverprotseq(MaxCalls, ProtseqA, &ps);
1094  RPCRT4_strfree(ProtseqA);
1095  if (status != RPC_S_OK)
1096  return status;
1097 
1098  return RPCRT4_use_protseq(ps, NULL);
1099 }
static RPC_STATUS RPCRT4_get_or_create_serverprotseq(UINT MaxCalls, const char *Protseq, RpcServerProtseq **ps)
Definition: rpc_server.c:994
static RPC_STATUS RPCRT4_use_protseq(RpcServerProtseq *ps, const char *endpoint)
Definition: rpc_server.c:839
_In_ USHORT _In_ ULONG _In_ PSOCKADDR _In_ PSOCKADDR _Reserved_ ULONG _In_opt_ PVOID _In_opt_ const WSK_CLIENT_CONNECTION_DISPATCH _In_opt_ PEPROCESS _In_opt_ PETHREAD _In_opt_ PSECURITY_DESCRIPTOR SecurityDescriptor
Definition: wsk.h:182
char * LPSTR
Definition: xmlstorage.h:182
LPSTR RPCRT4_strdupWtoA(LPCWSTR src)
Definition: rpc_binding.c:59
long RPC_STATUS
Definition: rpc.h:52
void RPCRT4_strfree(LPSTR src)
Definition: rpc_binding.c:105
#define debugstr_w
Definition: kernel32.h:32
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
static SERVICE_STATUS status
Definition: service.c:31
#define RPC_S_OK
Definition: rpcnterr.h:22
Definition: ps.c:97

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( rpc  )

Variable Documentation

◆ listen_count

LONG listen_count
static

◆ listen_cs

◆ listen_cs_debug

CRITICAL_SECTION_DEBUG listen_cs_debug
static
Initial value:
=
{
0, 0, &listen_cs,
0, 0, { (DWORD_PTR)(__FILE__ ": listen_cs") }
}
#define DWORD_PTR
Definition: treelist.c:76
static CRITICAL_SECTION_DEBUG listen_cs_debug
Definition: rpc_server.c:85
static CRITICAL_SECTION listen_cs
Definition: rpc_server.c:84
LIST_ENTRY ProcessLocksList
Definition: winbase.h:848

Definition at line 85 of file rpc_server.c.

◆ listen_done_event

HANDLE listen_done_event
static

◆ protseqs

◆ RpcObjTypeMaps

RpcObjTypeMap* RpcObjTypeMaps
static

Definition at line 68 of file rpc_server.c.

Referenced by LookupObjTypeMap(), and RpcObjectSetType().

◆ server_auth_info_cs

static CRITICAL_SECTION server_auth_info_cs = { &server_auth_info_cs_debug, -1, 0, 0, 0, 0 }
static

◆ server_auth_info_cs_debug

CRITICAL_SECTION_DEBUG server_auth_info_cs_debug
static
Initial value:
=
{
0, 0, { (DWORD_PTR)(__FILE__ ": server_auth_info_cs") }
}
#define DWORD_PTR
Definition: treelist.c:76
static CRITICAL_SECTION server_auth_info_cs
Definition: rpc_server.c:93
static CRITICAL_SECTION_DEBUG server_auth_info_cs_debug
Definition: rpc_server.c:94
LIST_ENTRY ProcessLocksList
Definition: winbase.h:848

Definition at line 94 of file rpc_server.c.

◆ server_cs

◆ server_cs_debug

CRITICAL_SECTION_DEBUG server_cs_debug
static
Initial value:
=
{
0, 0, &server_cs,
0, 0, { (DWORD_PTR)(__FILE__ ": server_cs") }
}
#define DWORD_PTR
Definition: treelist.c:76
static CRITICAL_SECTION server_cs
Definition: rpc_server.c:75
static CRITICAL_SECTION_DEBUG server_cs_debug
Definition: rpc_server.c:76
LIST_ENTRY ProcessLocksList
Definition: winbase.h:848

Definition at line 76 of file rpc_server.c.

◆ server_interfaces

struct list server_interfaces = LIST_INIT(server_interfaces)
static

Definition at line 72 of file rpc_server.c.

Referenced by RPCRT4_find_interface(), RpcServerRegisterIf3(), and RpcServerUnregisterIf().

◆ server_registered_auth_info

struct list server_registered_auth_info = LIST_INIT(server_registered_auth_info)
static

◆ std_listen

◆ uuid_nil

UUID uuid_nil
static

Definition at line 109 of file rpc_server.c.

Referenced by LookupObjType().