ReactOS 0.4.15-dev-7834-g00c4b3d
rpc_binding.h File Reference
#include "rpcndr.h"
#include "security.h"
#include "wine/list.h"
#include "rpc_defs.h"
Include dependency graph for rpc_binding.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  _RpcAuthInfo
 
struct  _RpcQualityOfService
 
struct  _RpcConnection
 
struct  connection_ops
 
struct  _RpcBinding
 

Macros

#define RPCRT4_strdupA(x)   RPCRT4_strndupA((x),-1)
 
#define RPCRT4_strdupW(x)   RPCRT4_strndupW((x),-1)
 

Typedefs

typedef struct _RpcAuthInfo RpcAuthInfo
 
typedef struct _RpcQualityOfService RpcQualityOfService
 
typedef struct _RpcConnection RpcConnection
 
typedef struct _RpcBinding RpcBinding
 

Enumerations

enum  secure_packet_direction { SECURE_PACKET_SEND , SECURE_PACKET_RECEIVE }
 

Functions

LPSTR RPCRT4_strndupA (LPCSTR src, INT len) DECLSPEC_HIDDEN
 
LPWSTR RPCRT4_strndupW (LPCWSTR src, INT len) DECLSPEC_HIDDEN
 
LPSTR RPCRT4_strdupWtoA (LPCWSTR src) DECLSPEC_HIDDEN
 
LPWSTR RPCRT4_strdupAtoW (LPCSTR src) DECLSPEC_HIDDEN
 
void RPCRT4_strfree (LPSTR src) DECLSPEC_HIDDEN
 
RPC_STATUS RpcAuthInfo_Create (ULONG AuthnLevel, ULONG AuthnSvc, CredHandle cred, TimeStamp exp, ULONG cbMaxToken, RPC_AUTH_IDENTITY_HANDLE identity, RpcAuthInfo **ret) DECLSPEC_HIDDEN
 
ULONG RpcAuthInfo_AddRef (RpcAuthInfo *AuthInfo) DECLSPEC_HIDDEN
 
ULONG RpcAuthInfo_Release (RpcAuthInfo *AuthInfo) DECLSPEC_HIDDEN
 
BOOL RpcAuthInfo_IsEqual (const RpcAuthInfo *AuthInfo1, const RpcAuthInfo *AuthInfo2) DECLSPEC_HIDDEN
 
ULONG RpcQualityOfService_AddRef (RpcQualityOfService *qos) DECLSPEC_HIDDEN
 
ULONG RpcQualityOfService_Release (RpcQualityOfService *qos) DECLSPEC_HIDDEN
 
BOOL RpcQualityOfService_IsEqual (const RpcQualityOfService *qos1, const RpcQualityOfService *qos2) DECLSPEC_HIDDEN
 
RPC_STATUS RPCRT4_CreateConnection (RpcConnection **Connection, BOOL server, LPCSTR Protseq, LPCSTR NetworkAddr, LPCSTR Endpoint, LPCWSTR NetworkOptions, RpcAuthInfo *AuthInfo, RpcQualityOfService *QOS, LPCWSTR CookieAuth) DECLSPEC_HIDDEN
 
RpcConnectionRPCRT4_GrabConnection (RpcConnection *conn) DECLSPEC_HIDDEN
 
void RPCRT4_ReleaseConnection (RpcConnection *Connection) DECLSPEC_HIDDEN
 
RPC_STATUS RPCRT4_OpenClientConnection (RpcConnection *Connection) DECLSPEC_HIDDEN
 
RPC_STATUS RPCRT4_CloseConnection (RpcConnection *Connection) DECLSPEC_HIDDEN
 
RPC_STATUS RPCRT4_IsServerListening (const char *protseq, const char *endpoint) DECLSPEC_HIDDEN
 
RPC_STATUS RPCRT4_ResolveBinding (RpcBinding *Binding, LPCSTR Endpoint) DECLSPEC_HIDDEN
 
RPC_STATUS RPCRT4_SetBindingObject (RpcBinding *Binding, const UUID *ObjectUuid) DECLSPEC_HIDDEN
 
RPC_STATUS RPCRT4_MakeBinding (RpcBinding **Binding, RpcConnection *Connection) DECLSPEC_HIDDEN
 
void RPCRT4_AddRefBinding (RpcBinding *Binding) DECLSPEC_HIDDEN
 
RPC_STATUS RPCRT4_ReleaseBinding (RpcBinding *Binding) DECLSPEC_HIDDEN
 
RPC_STATUS RPCRT4_OpenBinding (RpcBinding *Binding, RpcConnection **Connection, const RPC_SYNTAX_IDENTIFIER *TransferSyntax, const RPC_SYNTAX_IDENTIFIER *InterfaceId, BOOL *from_cache) DECLSPEC_HIDDEN
 
RPC_STATUS RPCRT4_CloseBinding (RpcBinding *Binding, RpcConnection *Connection) DECLSPEC_HIDDEN
 
void rpcrt4_conn_release_and_wait (RpcConnection *connection) DECLSPEC_HIDDEN
 
static const charrpcrt4_conn_get_name (const RpcConnection *Connection)
 
static int rpcrt4_conn_read (RpcConnection *Connection, void *buffer, unsigned int len)
 
static int rpcrt4_conn_write (RpcConnection *Connection, const void *buffer, unsigned int len)
 
static int rpcrt4_conn_close (RpcConnection *Connection)
 
static void rpcrt4_conn_close_read (RpcConnection *connection)
 
static void rpcrt4_conn_cancel_call (RpcConnection *Connection)
 
static RPC_STATUS rpcrt4_conn_handoff (RpcConnection *old_conn, RpcConnection *new_conn)
 
static BOOL rpcrt4_conn_is_authorized (RpcConnection *Connection)
 
static RPC_STATUS rpcrt4_conn_authorize (RpcConnection *conn, BOOL first_time, unsigned char *in_buffer, unsigned int in_len, unsigned char *out_buffer, unsigned int *out_len)
 
static RPC_STATUS rpcrt4_conn_secure_packet (RpcConnection *conn, enum secure_packet_direction dir, RpcPktHdr *hdr, unsigned int hdr_size, unsigned char *stub_data, unsigned int stub_data_size, RpcAuthVerifier *auth_hdr, unsigned char *auth_value, unsigned int auth_value_size)
 
static RPC_STATUS rpcrt4_conn_impersonate_client (RpcConnection *conn)
 
static RPC_STATUS rpcrt4_conn_revert_to_self (RpcConnection *conn)
 
static RPC_STATUS rpcrt4_conn_inquire_auth_client (RpcConnection *conn, RPC_AUTHZ_HANDLE *privs, RPC_WSTR *server_princ_name, ULONG *authn_level, ULONG *authn_svc, ULONG *authz_svc, ULONG flags)
 
RPC_STATUS RpcTransport_GetTopOfTower (unsigned char *tower_data, size_t *tower_size, const char *protseq, const char *networkaddr, const char *endpoint) DECLSPEC_HIDDEN
 
RPC_STATUS RpcTransport_ParseTopOfTower (const unsigned char *tower_data, size_t tower_size, char **protseq, char **networkaddr, char **endpoint) DECLSPEC_HIDDEN
 
void RPCRT4_SetThreadCurrentConnection (RpcConnection *Connection) DECLSPEC_HIDDEN
 
void RPCRT4_SetThreadCurrentCallHandle (RpcBinding *Binding) DECLSPEC_HIDDEN
 
RpcBindingRPCRT4_GetThreadCurrentCallHandle (void) DECLSPEC_HIDDEN
 
void RPCRT4_PushThreadContextHandle (NDR_SCONTEXT SContext) DECLSPEC_HIDDEN
 
void RPCRT4_RemoveThreadContextHandle (NDR_SCONTEXT SContext) DECLSPEC_HIDDEN
 
NDR_SCONTEXT RPCRT4_PopThreadContextHandle (void) DECLSPEC_HIDDEN
 

Macro Definition Documentation

◆ RPCRT4_strdupA

#define RPCRT4_strdupA (   x)    RPCRT4_strndupA((x),-1)

Definition at line 151 of file rpc_binding.h.

◆ RPCRT4_strdupW

#define RPCRT4_strdupW (   x)    RPCRT4_strndupW((x),-1)

Definition at line 152 of file rpc_binding.h.

Typedef Documentation

◆ RpcAuthInfo

◆ RpcBinding

◆ RpcConnection

◆ RpcQualityOfService

Enumeration Type Documentation

◆ secure_packet_direction

Enumerator
SECURE_PACKET_SEND 
SECURE_PACKET_RECEIVE 

Definition at line 30 of file rpc_binding.h.

31{
34};
@ SECURE_PACKET_SEND
Definition: rpc_binding.h:32
@ SECURE_PACKET_RECEIVE
Definition: rpc_binding.h:33

Function Documentation

◆ RpcAuthInfo_AddRef()

ULONG RpcAuthInfo_AddRef ( RpcAuthInfo AuthInfo)

Definition at line 1183 of file rpc_binding.c.

1184{
1185 return InterlockedIncrement(&AuthInfo->refs);
1186}
#define InterlockedIncrement
Definition: armddk.h:53

Referenced by RpcBindingCopy(), and RPCRT4_CreateConnection().

◆ RpcAuthInfo_Create()

RPC_STATUS RpcAuthInfo_Create ( ULONG  AuthnLevel,
ULONG  AuthnSvc,
CredHandle  cred,
TimeStamp  exp,
ULONG  cbMaxToken,
RPC_AUTH_IDENTITY_HANDLE  identity,
RpcAuthInfo **  ret 
)

Definition at line 1117 of file rpc_binding.c.

1122{
1123 RpcAuthInfo *AuthInfo = HeapAlloc(GetProcessHeap(), 0, sizeof(*AuthInfo));
1124 if (!AuthInfo)
1125 return RPC_S_OUT_OF_MEMORY;
1126
1127 AuthInfo->refs = 1;
1128 AuthInfo->AuthnLevel = AuthnLevel;
1129 AuthInfo->AuthnSvc = AuthnSvc;
1130 AuthInfo->cred = cred;
1131 AuthInfo->exp = exp;
1132 AuthInfo->cbMaxToken = cbMaxToken;
1133 AuthInfo->identity = identity;
1134 AuthInfo->server_principal_name = NULL;
1135
1136 /* duplicate the SEC_WINNT_AUTH_IDENTITY structure, if applicable, to
1137 * enable better matching in RpcAuthInfo_IsEqual */
1138 if (identity && has_nt_auth_identity(AuthnSvc))
1139 {
1140 const SEC_WINNT_AUTH_IDENTITY_W *nt_identity = identity;
1141 AuthInfo->nt_identity = HeapAlloc(GetProcessHeap(), 0, sizeof(*AuthInfo->nt_identity));
1142 if (!AuthInfo->nt_identity)
1143 {
1144 HeapFree(GetProcessHeap(), 0, AuthInfo);
1145 return RPC_S_OUT_OF_MEMORY;
1146 }
1147
1149 if (nt_identity->Flags & SEC_WINNT_AUTH_IDENTITY_UNICODE)
1150 AuthInfo->nt_identity->User = RPCRT4_strndupW(nt_identity->User, nt_identity->UserLength);
1151 else
1152 AuthInfo->nt_identity->User = RPCRT4_strndupAtoW((const char *)nt_identity->User, nt_identity->UserLength);
1153 AuthInfo->nt_identity->UserLength = nt_identity->UserLength;
1154 if (nt_identity->Flags & SEC_WINNT_AUTH_IDENTITY_UNICODE)
1155 AuthInfo->nt_identity->Domain = RPCRT4_strndupW(nt_identity->Domain, nt_identity->DomainLength);
1156 else
1157 AuthInfo->nt_identity->Domain = RPCRT4_strndupAtoW((const char *)nt_identity->Domain, nt_identity->DomainLength);
1158 AuthInfo->nt_identity->DomainLength = nt_identity->DomainLength;
1159 if (nt_identity->Flags & SEC_WINNT_AUTH_IDENTITY_UNICODE)
1160 AuthInfo->nt_identity->Password = RPCRT4_strndupW(nt_identity->Password, nt_identity->PasswordLength);
1161 else
1162 AuthInfo->nt_identity->Password = RPCRT4_strndupAtoW((const char *)nt_identity->Password, nt_identity->PasswordLength);
1163 AuthInfo->nt_identity->PasswordLength = nt_identity->PasswordLength;
1164
1165 if ((nt_identity->User && !AuthInfo->nt_identity->User) ||
1166 (nt_identity->Domain && !AuthInfo->nt_identity->Domain) ||
1167 (nt_identity->Password && !AuthInfo->nt_identity->Password))
1168 {
1169 HeapFree(GetProcessHeap(), 0, AuthInfo->nt_identity->User);
1170 HeapFree(GetProcessHeap(), 0, AuthInfo->nt_identity->Domain);
1171 HeapFree(GetProcessHeap(), 0, AuthInfo->nt_identity->Password);
1172 HeapFree(GetProcessHeap(), 0, AuthInfo->nt_identity);
1173 HeapFree(GetProcessHeap(), 0, AuthInfo);
1174 return RPC_S_OUT_OF_MEMORY;
1175 }
1176 }
1177 else
1178 AuthInfo->nt_identity = NULL;
1179 *ret = AuthInfo;
1180 return RPC_S_OK;
1181}
#define NULL
Definition: types.h:112
#define GetProcessHeap()
Definition: compat.h:736
#define HeapAlloc
Definition: compat.h:733
#define HeapFree(x, y, z)
Definition: compat.h:735
DWORD exp
Definition: msg.c:16058
static BOOL has_nt_auth_identity(ULONG AuthnLevel)
Definition: rpc_binding.c:1104
LPWSTR RPCRT4_strndupW(LPCWSTR src, INT slen)
Definition: rpc_binding.c:91
static LPWSTR RPCRT4_strndupAtoW(LPCSTR src, INT slen)
Definition: rpc_binding.c:80
#define SEC_WINNT_AUTH_IDENTITY_UNICODE
Definition: rpcdce.h:310
#define RPC_S_OUT_OF_MEMORY
Definition: rpcnterr.h:24
#define RPC_S_OK
Definition: rpcnterr.h:22
RPC_AUTH_IDENTITY_HANDLE * identity
Definition: rpc_binding.h:46
ULONG AuthnLevel
Definition: rpc_binding.h:40
ULONG AuthnSvc
Definition: rpc_binding.h:41
TimeStamp exp
Definition: rpc_binding.h:43
CredHandle cred
Definition: rpc_binding.h:42
SEC_WINNT_AUTH_IDENTITY_W * nt_identity
Definition: rpc_binding.h:49
ULONG cbMaxToken
Definition: rpc_binding.h:44
LPWSTR server_principal_name
Definition: rpc_binding.h:50
unsigned short * Domain
Definition: rpcdce.h:225
unsigned short * User
Definition: rpcdce.h:223
unsigned short * Password
Definition: rpcdce.h:227
int ret

Referenced by RpcBindingSetAuthInfoExA(), RpcBindingSetAuthInfoExW(), and RPCRT4_ServerConnectionAuth().

◆ RpcAuthInfo_IsEqual()

BOOL RpcAuthInfo_IsEqual ( const RpcAuthInfo AuthInfo1,
const RpcAuthInfo AuthInfo2 
)

Definition at line 1209 of file rpc_binding.c.

1210{
1211 if (AuthInfo1 == AuthInfo2)
1212 return TRUE;
1213
1214 if (!AuthInfo1 || !AuthInfo2)
1215 return FALSE;
1216
1217 if ((AuthInfo1->AuthnLevel != AuthInfo2->AuthnLevel) ||
1218 (AuthInfo1->AuthnSvc != AuthInfo2->AuthnSvc))
1219 return FALSE;
1220
1221 if (AuthInfo1->identity == AuthInfo2->identity)
1222 return TRUE;
1223
1224 if (!AuthInfo1->identity || !AuthInfo2->identity)
1225 return FALSE;
1226
1227 if (has_nt_auth_identity(AuthInfo1->AuthnSvc))
1228 {
1229 const SEC_WINNT_AUTH_IDENTITY_W *identity1 = AuthInfo1->nt_identity;
1230 const SEC_WINNT_AUTH_IDENTITY_W *identity2 = AuthInfo2->nt_identity;
1231 /* compare user names */
1232 if (identity1->UserLength != identity2->UserLength ||
1233 memcmp(identity1->User, identity2->User, identity1->UserLength))
1234 return FALSE;
1235 /* compare domain names */
1236 if (identity1->DomainLength != identity2->DomainLength ||
1237 memcmp(identity1->Domain, identity2->Domain, identity1->DomainLength))
1238 return FALSE;
1239 /* compare passwords */
1240 if (identity1->PasswordLength != identity2->PasswordLength ||
1241 memcmp(identity1->Password, identity2->Password, identity1->PasswordLength))
1242 return FALSE;
1243 }
1244 else
1245 return FALSE;
1246
1247 return TRUE;
1248}
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
Definition: utclib.c:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117

Referenced by RpcAssoc_GetIdleConnection().

◆ RpcAuthInfo_Release()

ULONG RpcAuthInfo_Release ( RpcAuthInfo AuthInfo)

Definition at line 1188 of file rpc_binding.c.

1189{
1190 ULONG refs = InterlockedDecrement(&AuthInfo->refs);
1191
1192 if (!refs)
1193 {
1194 FreeCredentialsHandle(&AuthInfo->cred);
1195 if (AuthInfo->nt_identity)
1196 {
1197 HeapFree(GetProcessHeap(), 0, AuthInfo->nt_identity->User);
1198 HeapFree(GetProcessHeap(), 0, AuthInfo->nt_identity->Domain);
1199 HeapFree(GetProcessHeap(), 0, AuthInfo->nt_identity->Password);
1200 HeapFree(GetProcessHeap(), 0, AuthInfo->nt_identity);
1201 }
1203 HeapFree(GetProcessHeap(), 0, AuthInfo);
1204 }
1205
1206 return refs;
1207}
#define InterlockedDecrement
Definition: armddk.h:52
uint32_t ULONG
Definition: typedefs.h:59
SECURITY_STATUS WINAPI FreeCredentialsHandle(PCredHandle phCredential)
Definition: wrapper.c:151

Referenced by get_epm_handle_client(), RpcBindingSetAuthInfoExA(), RpcBindingSetAuthInfoExW(), RPCRT4_ReleaseBinding(), RPCRT4_ReleaseConnection(), and RPCRT4_ServerConnectionAuth().

◆ RpcQualityOfService_AddRef()

ULONG RpcQualityOfService_AddRef ( RpcQualityOfService qos)

Definition at line 1360 of file rpc_binding.c.

1361{
1362 return InterlockedIncrement(&qos->refs);
1363}

Referenced by RpcBindingCopy(), and RPCRT4_CreateConnection().

◆ RpcQualityOfService_IsEqual()

BOOL RpcQualityOfService_IsEqual ( const RpcQualityOfService qos1,
const RpcQualityOfService qos2 
)

Definition at line 1390 of file rpc_binding.c.

1391{
1392 if (qos1 == qos2)
1393 return TRUE;
1394
1395 if (!qos1 || !qos2)
1396 return FALSE;
1397
1398 TRACE("qos1 = { %d %d %d %d }, qos2 = { %d %d %d %d }\n",
1399 qos1->qos->Capabilities, qos1->qos->IdentityTracking,
1401 qos2->qos->Capabilities, qos2->qos->IdentityTracking,
1403
1404 if ((qos1->qos->Capabilities != qos2->qos->Capabilities) ||
1405 (qos1->qos->IdentityTracking != qos2->qos->IdentityTracking) ||
1406 (qos1->qos->ImpersonationType != qos2->qos->ImpersonationType) ||
1408 return FALSE;
1409
1411 {
1412 const RPC_HTTP_TRANSPORT_CREDENTIALS_W *http_credentials1 = qos1->qos->u.HttpCredentials;
1413 const RPC_HTTP_TRANSPORT_CREDENTIALS_W *http_credentials2 = qos2->qos->u.HttpCredentials;
1414
1415 if (http_credentials1->Flags != http_credentials2->Flags)
1416 return FALSE;
1417
1418 if (http_credentials1->AuthenticationTarget != http_credentials2->AuthenticationTarget)
1419 return FALSE;
1420
1421 if (http_credentials1->NumberOfAuthnSchemes != http_credentials2->NumberOfAuthnSchemes)
1422 return FALSE;
1423
1424 if ((!http_credentials1->AuthnSchemes && http_credentials2->AuthnSchemes) ||
1425 (http_credentials1->AuthnSchemes && !http_credentials2->AuthnSchemes))
1426 return FALSE;
1427
1428 if (memcmp(http_credentials1->AuthnSchemes, http_credentials2->AuthnSchemes,
1429 http_credentials1->NumberOfAuthnSchemes * sizeof(http_credentials1->AuthnSchemes[0])))
1430 return FALSE;
1431
1432 /* server certificate subject not currently used */
1433
1434 if (http_credentials1->TransportCredentials != http_credentials2->TransportCredentials)
1435 {
1436 const SEC_WINNT_AUTH_IDENTITY_W *identity1 = http_credentials1->TransportCredentials;
1437 const SEC_WINNT_AUTH_IDENTITY_W *identity2 = http_credentials2->TransportCredentials;
1438
1439 if (!identity1 || !identity2)
1440 return FALSE;
1441
1442 /* compare user names */
1443 if (identity1->UserLength != identity2->UserLength ||
1444 memcmp(identity1->User, identity2->User, identity1->UserLength))
1445 return FALSE;
1446 /* compare domain names */
1447 if (identity1->DomainLength != identity2->DomainLength ||
1448 memcmp(identity1->Domain, identity2->Domain, identity1->DomainLength))
1449 return FALSE;
1450 /* compare passwords */
1451 if (identity1->PasswordLength != identity2->PasswordLength ||
1452 memcmp(identity1->Password, identity2->Password, identity1->PasswordLength))
1453 return FALSE;
1454 }
1455 }
1456
1457 return TRUE;
1458}
#define RPC_C_AUTHN_INFO_TYPE_HTTP
Definition: rpcdce.h:195
#define TRACE(s)
Definition: solgame.cpp:4
SEC_WINNT_AUTH_IDENTITY_W * TransportCredentials
Definition: rpcdce.h:245
RPC_HTTP_TRANSPORT_CREDENTIALS_W * HttpCredentials
Definition: rpcdce.h:279
ULONG AdditionalSecurityInfoType
Definition: rpcdce.h:276
union _RPC_SECURITY_QOS_V2_W::@3217 u
RPC_SECURITY_QOS_V2_W * qos
Definition: rpc_binding.h:57

Referenced by RpcAssoc_GetIdleConnection().

◆ RpcQualityOfService_Release()

ULONG RpcQualityOfService_Release ( RpcQualityOfService qos)

◆ RPCRT4_AddRefBinding()

void RPCRT4_AddRefBinding ( RpcBinding Binding)

Definition at line 249 of file rpc_binding.c.

250{
252}

Referenced by I_RpcNegotiateTransferSyntax().

◆ RPCRT4_CloseBinding()

RPC_STATUS RPCRT4_CloseBinding ( RpcBinding Binding,
RpcConnection Connection 
)

Definition at line 293 of file rpc_binding.c.

294{
295 TRACE("(Binding == ^%p)\n", Binding);
296 if (!Connection) return RPC_S_OK;
297 if (Binding->server) {
298 /* don't destroy a connection that is cached in the binding */
299 if (Binding->FromConn != Connection)
300 RPCRT4_ReleaseConnection(Connection);
301 }
302 else {
303 RpcAssoc_ReleaseIdleConnection(Binding->Assoc, Connection);
304 }
305 return RPC_S_OK;
306}
void RpcAssoc_ReleaseIdleConnection(RpcAssoc *assoc, RpcConnection *Connection)
Definition: rpc_assoc.c:437
void RPCRT4_ReleaseConnection(RpcConnection *Connection) DECLSPEC_HIDDEN

Referenced by I_RpcFreeBuffer().

◆ RPCRT4_CloseConnection()

RPC_STATUS RPCRT4_CloseConnection ( RpcConnection Connection)

Definition at line 3618 of file rpc_transport.c.

3619{
3620 TRACE("(Connection == ^%p)\n", Connection);
3621 if (SecIsValidHandle(&Connection->ctx))
3622 {
3623 DeleteSecurityContext(&Connection->ctx);
3624 SecInvalidateHandle(&Connection->ctx);
3625 }
3626 rpcrt4_conn_close(Connection);
3627 return RPC_S_OK;
3628}
#define SecIsValidHandle(x)
Definition: sspi.h:63
#define SecInvalidateHandle(x)
Definition: sspi.h:58
static int rpcrt4_conn_close(RpcConnection *Connection)
Definition: rpc_binding.h:200
CtxtHandle ctx
Definition: rpc_binding.h:74
SECURITY_STATUS WINAPI DeleteSecurityContext(PCtxtHandle phContext)
Definition: wrapper.c:450

Referenced by RPCRT4_ReleaseConnection(), and RPCRT4_server_thread().

◆ rpcrt4_conn_authorize()

static RPC_STATUS rpcrt4_conn_authorize ( RpcConnection conn,
BOOL  first_time,
unsigned char in_buffer,
unsigned int  in_len,
unsigned char out_buffer,
unsigned int out_len 
)
inlinestatic

Definition at line 225 of file rpc_binding.h.

228{
229 return conn->ops->authorize(conn, first_time, in_buffer, in_len, out_buffer, out_len);
230}
static unsigned char * in_buffer
Definition: iccvid.c:87
static HANDLE PIO_APC_ROUTINE PVOID PIO_STATUS_BLOCK ULONG PVOID ULONG PVOID out_buffer
Definition: file.c:100
const struct connection_ops * ops
Definition: rpc_binding.h:70

Referenced by RPCRT4_ClientConnectionAuth(), RPCRT4_Send(), and RPCRT4_ServerConnectionAuth().

◆ rpcrt4_conn_cancel_call()

static void rpcrt4_conn_cancel_call ( RpcConnection Connection)
inlinestatic

Definition at line 210 of file rpc_binding.h.

211{
212 Connection->ops->cancel_call(Connection);
213}

Referenced by rpc_cancel_thread().

◆ rpcrt4_conn_close()

static int rpcrt4_conn_close ( RpcConnection Connection)
inlinestatic

Definition at line 200 of file rpc_binding.h.

201{
202 return Connection->ops->close(Connection);
203}

Referenced by RPCRT4_CloseConnection().

◆ rpcrt4_conn_close_read()

static void rpcrt4_conn_close_read ( RpcConnection connection)
inlinestatic

Definition at line 205 of file rpc_binding.h.

206{
207 connection->ops->close_read(connection);
208}

Referenced by RPCRT4_server_thread().

◆ rpcrt4_conn_get_name()

static const char * rpcrt4_conn_get_name ( const RpcConnection Connection)
inlinestatic

Definition at line 183 of file rpc_binding.h.

184{
185 return Connection->ops->name;
186}

Referenced by process_bind_packet_no_send(), RPCRT4_MakeBinding(), and rpcrt4_spawn_connection().

◆ rpcrt4_conn_handoff()

static RPC_STATUS rpcrt4_conn_handoff ( RpcConnection old_conn,
RpcConnection new_conn 
)
inlinestatic

Definition at line 215 of file rpc_binding.h.

216{
217 return old_conn->ops->handoff(old_conn, new_conn);
218}

Referenced by rpcrt4_spawn_connection().

◆ rpcrt4_conn_impersonate_client()

static RPC_STATUS rpcrt4_conn_impersonate_client ( RpcConnection conn)
inlinestatic

Definition at line 241 of file rpc_binding.h.

243{
244 return conn->ops->impersonate_client(conn);
245}

Referenced by RpcImpersonateClient().

◆ rpcrt4_conn_inquire_auth_client()

static RPC_STATUS rpcrt4_conn_inquire_auth_client ( RpcConnection conn,
RPC_AUTHZ_HANDLE privs,
RPC_WSTR server_princ_name,
ULONG authn_level,
ULONG authn_svc,
ULONG authz_svc,
ULONG  flags 
)
inlinestatic

Definition at line 253 of file rpc_binding.h.

256{
257 return conn->ops->inquire_auth_client(conn, privs, server_princ_name, authn_level, authn_svc, authz_svc, flags);
258}
GLbitfield flags
Definition: glext.h:7161

Referenced by RpcBindingInqAuthClientExW().

◆ rpcrt4_conn_is_authorized()

static BOOL rpcrt4_conn_is_authorized ( RpcConnection Connection)
inlinestatic

Definition at line 220 of file rpc_binding.h.

221{
222 return Connection->ops->is_authorized(Connection);
223}

Referenced by RPCRT4_ReceiveWithAuth(), and RPCRT4_Send().

◆ rpcrt4_conn_read()

static int rpcrt4_conn_read ( RpcConnection Connection,
void buffer,
unsigned int  len 
)
inlinestatic

Definition at line 188 of file rpc_binding.h.

190{
191 return Connection->ops->read(Connection, buffer, len);
192}
GLuint buffer
Definition: glext.h:5915
GLenum GLsizei len
Definition: glext.h:6722

Referenced by RPCRT4_default_receive_fragment().

◆ rpcrt4_conn_release_and_wait()

void rpcrt4_conn_release_and_wait ( RpcConnection connection)

Definition at line 3694 of file rpc_transport.c.

3695{
3696 HANDLE event = NULL;
3697
3698 if (connection->ref > 1)
3699 event = connection->wait_release = CreateEventW(NULL, TRUE, FALSE, NULL);
3700
3701 RPCRT4_ReleaseConnection(connection);
3702
3703 if(event)
3704 {
3707 }
3708}
#define CloseHandle
Definition: compat.h:739
#define INFINITE
Definition: serial.h:102
struct _cl_event * event
Definition: glext.h:7739
void RPCRT4_ReleaseConnection(RpcConnection *connection)
HANDLE wait_release
Definition: rpc_binding.h:66
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
Definition: synch.c:82
HANDLE WINAPI DECLSPEC_HOTPATCH CreateEventW(IN LPSECURITY_ATTRIBUTES lpEventAttributes OPTIONAL, IN BOOL bManualReset, IN BOOL bInitialState, IN LPCWSTR lpName OPTIONAL)
Definition: synch.c:651

Referenced by RPCRT4_server_thread().

◆ rpcrt4_conn_revert_to_self()

static RPC_STATUS rpcrt4_conn_revert_to_self ( RpcConnection conn)
inlinestatic

Definition at line 247 of file rpc_binding.h.

249{
250 return conn->ops->revert_to_self(conn);
251}

Referenced by RpcRevertToSelfEx().

◆ rpcrt4_conn_secure_packet()

static RPC_STATUS rpcrt4_conn_secure_packet ( RpcConnection conn,
enum secure_packet_direction  dir,
RpcPktHdr hdr,
unsigned int  hdr_size,
unsigned char stub_data,
unsigned int  stub_data_size,
RpcAuthVerifier auth_hdr,
unsigned char auth_value,
unsigned int  auth_value_size 
)
inlinestatic

Definition at line 232 of file rpc_binding.h.

237{
238 return conn->ops->secure_packet(conn, dir, hdr, hdr_size, stub_data, stub_data_size, auth_hdr, auth_value, auth_value_size);
239}
unsigned int dir
Definition: maze.c:112
char hdr[14]
Definition: iptest.cpp:33

Referenced by RPCRT4_ReceiveWithAuth(), and RPCRT4_SendWithAuth().

◆ rpcrt4_conn_write()

static int rpcrt4_conn_write ( RpcConnection Connection,
const void buffer,
unsigned int  len 
)
inlinestatic

Definition at line 194 of file rpc_binding.h.

196{
197 return Connection->ops->write(Connection, buffer, len);
198}

Referenced by RPCRT4_SendWithAuth().

◆ RPCRT4_CreateConnection()

RPC_STATUS RPCRT4_CreateConnection ( RpcConnection **  Connection,
BOOL  server,
LPCSTR  Protseq,
LPCSTR  NetworkAddr,
LPCSTR  Endpoint,
LPCWSTR  NetworkOptions,
RpcAuthInfo AuthInfo,
RpcQualityOfService QOS,
LPCWSTR  CookieAuth 
)

Definition at line 3630 of file rpc_transport.c.

3633{
3634 static LONG next_id;
3635 const struct connection_ops *ops;
3636 RpcConnection* NewConnection;
3637
3638 ops = rpcrt4_get_conn_protseq_ops(Protseq);
3639 if (!ops)
3640 {
3641 FIXME("not supported for protseq %s\n", Protseq);
3643 }
3644
3645 NewConnection = ops->alloc();
3646 NewConnection->ref = 1;
3647 NewConnection->server = server;
3648 NewConnection->ops = ops;
3649 NewConnection->NetworkAddr = RPCRT4_strdupA(NetworkAddr);
3650 NewConnection->Endpoint = RPCRT4_strdupA(Endpoint);
3651 NewConnection->NetworkOptions = RPCRT4_strdupW(NetworkOptions);
3652 NewConnection->CookieAuth = RPCRT4_strdupW(CookieAuth);
3654 NewConnection->NextCallId = 1;
3655
3656 SecInvalidateHandle(&NewConnection->ctx);
3657 if (AuthInfo) RpcAuthInfo_AddRef(AuthInfo);
3658 NewConnection->AuthInfo = AuthInfo;
3659 NewConnection->auth_context_id = InterlockedIncrement( &next_id );
3661 NewConnection->QOS = QOS;
3662
3663 list_init(&NewConnection->conn_pool_entry);
3664 list_init(&NewConnection->protseq_entry);
3665
3666 TRACE("connection: %p\n", NewConnection);
3667 *Connection = NewConnection;
3668
3669 return RPC_S_OK;
3670}
static void list_init(struct list_entry *head)
Definition: list.h:51
#define FIXME(fmt,...)
Definition: debug.h:111
long LONG
Definition: pedump.c:60
ULONG RpcAuthInfo_AddRef(RpcAuthInfo *AuthInfo)
Definition: rpc_binding.c:1183
ULONG RpcQualityOfService_AddRef(RpcQualityOfService *qos)
Definition: rpc_binding.c:1360
#define RPCRT4_strdupA(x)
Definition: rpc_binding.h:151
#define RPCRT4_strdupW(x)
Definition: rpc_binding.h:152
#define RPC_MAX_PACKET_SIZE
Definition: rpc_defs.h:184
static const struct connection_ops * rpcrt4_get_conn_protseq_ops(const char *protseq)
LPSTR NetworkAddr
Definition: rpc_binding.h:67
struct list conn_pool_entry
Definition: rpc_binding.h:85
RpcAuthInfo * AuthInfo
Definition: rpc_binding.h:77
USHORT NextCallId
Definition: rpc_binding.h:93
LPWSTR NetworkOptions
Definition: rpc_binding.h:69
USHORT MaxTransmissionSize
Definition: rpc_binding.h:71
RpcQualityOfService * QOS
Definition: rpc_binding.h:81
struct list protseq_entry
Definition: rpc_binding.h:94
LPWSTR CookieAuth
Definition: rpc_binding.h:82
ULONG auth_context_id
Definition: rpc_binding.h:78
RpcConnection *(* alloc)(void)
Definition: rpc_binding.h:102
static rfbScreenInfoPtr server
Definition: vnc.c:74
#define RPC_S_PROTSEQ_NOT_SUPPORTED
Definition: winerror.h:1014
struct _QualityOfService QOS

Referenced by RpcAssoc_GetClientConnection(), rpcrt4_protseq_ncacn_ip_tcp_open_endpoint(), rpcrt4_protseq_ncacn_np_open_endpoint(), rpcrt4_protseq_ncalrpc_open_endpoint(), and rpcrt4_spawn_connection().

◆ RPCRT4_GetThreadCurrentCallHandle()

RpcBinding * RPCRT4_GetThreadCurrentCallHandle ( void  )

Definition at line 972 of file rpcrt4_main.c.

973{
974 struct threaddata *tdata = get_or_create_threaddata();
975 if (!tdata) return NULL;
976
977 return tdata->server_binding;
978}
static struct threaddata * get_or_create_threaddata(void)
Definition: rpcrt4_main.c:932
RpcBinding * server_binding
Definition: rpcrt4_main.c:94

Referenced by I_RpcGetCurrentCallHandle().

◆ RPCRT4_GrabConnection()

RpcConnection * RPCRT4_GrabConnection ( RpcConnection conn)

Definition at line 3710 of file rpc_transport.c.

3711{
3712 LONG ref = InterlockedIncrement(&connection->ref);
3713 TRACE("%p ref=%u\n", connection, ref);
3714 return connection;
3715}
Definition: send.c:48

Referenced by RPCRT4_io_thread(), and RPCRT4_server_thread().

◆ RPCRT4_IsServerListening()

RPC_STATUS RPCRT4_IsServerListening ( const char protseq,
const char endpoint 
)

Definition at line 3760 of file rpc_transport.c.

3761{
3762 const struct connection_ops *ops;
3763
3764 ops = rpcrt4_get_conn_protseq_ops(protseq);
3765 if (!ops)
3766 {
3767 FIXME("not supported for protseq %s\n", protseq);
3768 return RPC_S_INVALID_BINDING;
3769 }
3770
3771 return ops->is_server_listening(endpoint);
3772}
RPC_STATUS(* is_server_listening)(const char *endpoint)
Definition: rpc_binding.h:110
Definition: nis.h:10
#define RPC_S_INVALID_BINDING
Definition: winerror.h:1013

Referenced by RpcMgmtIsServerListening().

◆ RPCRT4_MakeBinding()

RPC_STATUS RPCRT4_MakeBinding ( RpcBinding **  Binding,
RpcConnection Connection 
)

Definition at line 232 of file rpc_binding.c.

233{
234 RpcBinding* NewBinding;
235 TRACE("(RpcBinding == ^%p, Connection == ^%p)\n", Binding, Connection);
236
237 RPCRT4_AllocBinding(&NewBinding, Connection->server);
238 NewBinding->Protseq = RPCRT4_strdupA(rpcrt4_conn_get_name(Connection));
239 NewBinding->NetworkAddr = RPCRT4_strdupA(Connection->NetworkAddr);
240 NewBinding->Endpoint = RPCRT4_strdupA(Connection->Endpoint);
241 NewBinding->FromConn = Connection;
242
243 TRACE("binding: %p\n", NewBinding);
244 *Binding = NewBinding;
245
246 return RPC_S_OK;
247}
static RPC_STATUS RPCRT4_AllocBinding(RpcBinding **Binding, BOOL server)
Definition: rpc_binding.c:109
static const char * rpcrt4_conn_get_name(const RpcConnection *Connection)
Definition: rpc_binding.h:183
LPSTR NetworkAddr
Definition: rpc_binding.h:131
RpcConnection * FromConn
Definition: rpc_binding.h:136
LPSTR Endpoint
Definition: rpc_binding.h:132
LPSTR Protseq
Definition: rpc_binding.h:130

Referenced by process_bind_packet_no_send(), and RpcServerInqBindings().

◆ RPCRT4_OpenBinding()

RPC_STATUS RPCRT4_OpenBinding ( RpcBinding Binding,
RpcConnection **  Connection,
const RPC_SYNTAX_IDENTIFIER TransferSyntax,
const RPC_SYNTAX_IDENTIFIER InterfaceId,
BOOL from_cache 
)

Definition at line 272 of file rpc_binding.c.

275{
276 TRACE("(Binding == ^%p)\n", Binding);
277
278 if (!Binding->server) {
279 return RpcAssoc_GetClientConnection(Binding->Assoc, InterfaceId,
280 TransferSyntax, Binding->AuthInfo, Binding->QOS, Binding->CookieAuth, Connection, from_cache);
281 } else {
282 /* we already have a connection with acceptable binding, so use it */
283 if (Binding->FromConn) {
284 *Connection = Binding->FromConn;
285 return RPC_S_OK;
286 } else {
287 ERR("no connection in binding\n");
289 }
290 }
291}
#define ERR(fmt,...)
Definition: debug.h:110
RPC_STATUS RpcAssoc_GetClientConnection(RpcAssoc *assoc, const RPC_SYNTAX_IDENTIFIER *InterfaceId, const RPC_SYNTAX_IDENTIFIER *TransferSyntax, RpcAuthInfo *AuthInfo, RpcQualityOfService *QOS, LPCWSTR CookieAuth, RpcConnection **Connection, BOOL *from_cache)
Definition: rpc_assoc.c:390
#define RPC_S_INTERNAL_ERROR
Definition: winerror.h:1074

Referenced by I_RpcNegotiateTransferSyntax(), and I_RpcSend().

◆ RPCRT4_OpenClientConnection()

RPC_STATUS RPCRT4_OpenClientConnection ( RpcConnection Connection)

Definition at line 3610 of file rpc_transport.c.

3611{
3612 TRACE("(Connection == ^%p)\n", Connection);
3613
3614 assert(!Connection->server);
3615 return Connection->ops->open_connection_client(Connection);
3616}
#define assert(x)
Definition: debug.h:53

Referenced by RpcAssoc_GetClientConnection().

◆ RPCRT4_PopThreadContextHandle()

NDR_SCONTEXT RPCRT4_PopThreadContextHandle ( void  )

Definition at line 1016 of file rpcrt4_main.c.

1017{
1018 struct threaddata *tdata = get_or_create_threaddata();
1021
1022 if (!tdata) return NULL;
1023
1025 if (!context_handle_list) return NULL;
1027
1030 return context_handle;
1031}
NDR_SCONTEXT context_handle
Definition: rpcrt4_main.c:85
struct context_handle_list * next
Definition: rpcrt4_main.c:84
struct context_handle_list * context_handle_list
Definition: rpcrt4_main.c:95

Referenced by process_request_packet().

◆ RPCRT4_PushThreadContextHandle()

void RPCRT4_PushThreadContextHandle ( NDR_SCONTEXT  SContext)

Definition at line 980 of file rpcrt4_main.c.

981{
982 struct threaddata *tdata = get_or_create_threaddata();
984
985 if (!tdata) return;
986
988 if (!context_handle_list) return;
989
993}

Referenced by NDRSContextUnmarshall2().

◆ RPCRT4_ReleaseBinding()

RPC_STATUS RPCRT4_ReleaseBinding ( RpcBinding Binding)

Definition at line 254 of file rpc_binding.c.

255{
256 if (InterlockedDecrement(&Binding->refs))
257 return RPC_S_OK;
258
259 TRACE("binding: %p\n", Binding);
260 if (Binding->Assoc) RpcAssoc_Release(Binding->Assoc);
261 RPCRT4_strfree(Binding->Endpoint);
262 RPCRT4_strfree(Binding->NetworkAddr);
263 RPCRT4_strfree(Binding->Protseq);
264 HeapFree(GetProcessHeap(), 0, Binding->NetworkOptions);
265 HeapFree(GetProcessHeap(), 0, Binding->CookieAuth);
266 if (Binding->AuthInfo) RpcAuthInfo_Release(Binding->AuthInfo);
269 return RPC_S_OK;
270}
ULONG RpcAssoc_Release(RpcAssoc *assoc)
Definition: rpc_assoc.c:187
ULONG RpcAuthInfo_Release(RpcAuthInfo *AuthInfo)
Definition: rpc_binding.c:1188
void RPCRT4_strfree(LPSTR src)
Definition: rpc_binding.c:104
ULONG RpcQualityOfService_Release(RpcQualityOfService *qos)
Definition: rpc_binding.c:1365

Referenced by I_RpcFreeBuffer(), RpcBindingFree(), RpcBindingFromStringBindingA(), RpcBindingFromStringBindingW(), and RPCRT4_ReleaseConnection().

◆ RPCRT4_ReleaseConnection()

void RPCRT4_ReleaseConnection ( RpcConnection Connection)

Definition at line 3717 of file rpc_transport.c.

3718{
3719 LONG ref;
3720
3721 /* protseq stores a list of active connections, but does not own references to them.
3722 * It may need to grab a connection from the list, which could lead to a race if
3723 * connection is being released, but not yet removed from the list. We handle that
3724 * by synchronizing on CS here. */
3725 if (connection->protseq)
3726 {
3727 EnterCriticalSection(&connection->protseq->cs);
3728 ref = InterlockedDecrement(&connection->ref);
3729 if (!ref)
3730 list_remove(&connection->protseq_entry);
3731 LeaveCriticalSection(&connection->protseq->cs);
3732 }
3733 else
3734 {
3735 ref = InterlockedDecrement(&connection->ref);
3736 }
3737
3738 TRACE("%p ref=%u\n", connection, ref);
3739
3740 if (!ref)
3741 {
3742 RPCRT4_CloseConnection(connection);
3743 RPCRT4_strfree(connection->Endpoint);
3744 RPCRT4_strfree(connection->NetworkAddr);
3745 HeapFree(GetProcessHeap(), 0, connection->NetworkOptions);
3746 HeapFree(GetProcessHeap(), 0, connection->CookieAuth);
3747 if (connection->AuthInfo) RpcAuthInfo_Release(connection->AuthInfo);
3748 if (connection->QOS) RpcQualityOfService_Release(connection->QOS);
3749
3750 /* server-only */
3751 if (connection->server_binding) RPCRT4_ReleaseBinding(connection->server_binding);
3752 else if (connection->assoc) RpcAssoc_ConnectionReleased(connection->assoc);
3753
3754 if (connection->wait_release) SetEvent(connection->wait_release);
3755
3756 HeapFree(GetProcessHeap(), 0, connection);
3757 }
3758}
static void list_remove(struct list_entry *entry)
Definition: list.h:90
void RpcAssoc_ConnectionReleased(RpcAssoc *assoc)
Definition: rpc_assoc.c:447
RPC_STATUS RPCRT4_ReleaseBinding(RpcBinding *Binding)
Definition: rpc_binding.c:254
RPC_STATUS RPCRT4_CloseConnection(RpcConnection *Connection)
BOOL WINAPI DECLSPEC_HOTPATCH SetEvent(IN HANDLE hEvent)
Definition: synch.c:733
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)

Referenced by I_RpcReceive(), I_RpcSend(), RpcAssoc_GetClientConnection(), RpcAssoc_Release(), RPCRT4_CloseBinding(), rpcrt4_conn_release_and_wait(), RPCRT4_io_thread(), RPCRT4_new_client(), rpcrt4_protseq_ncacn_ip_tcp_open_endpoint(), and RPCRT4_worker_thread().

◆ RPCRT4_RemoveThreadContextHandle()

void RPCRT4_RemoveThreadContextHandle ( NDR_SCONTEXT  SContext)

Definition at line 995 of file rpcrt4_main.c.

996{
997 struct threaddata *tdata = get_or_create_threaddata();
998 struct context_handle_list *current, *prev;
999
1000 if (!tdata) return;
1001
1002 for (current = tdata->context_handle_list, prev = NULL; current; prev = current, current = current->next)
1003 {
1004 if (current->context_handle == SContext)
1005 {
1006 if (prev)
1007 prev->next = current->next;
1008 else
1009 tdata->context_handle_list = current->next;
1011 return;
1012 }
1013 }
1014}
struct task_struct * current
Definition: linux.c:32

Referenced by NDRSContextMarshall2().

◆ RPCRT4_ResolveBinding()

RPC_STATUS RPCRT4_ResolveBinding ( RpcBinding Binding,
LPCSTR  Endpoint 
)

Definition at line 204 of file rpc_binding.c.

205{
207
208 TRACE("(RpcBinding == ^%p, EndPoint == \"%s\"\n", Binding, Endpoint);
209
210 RPCRT4_strfree(Binding->Endpoint);
211 Binding->Endpoint = RPCRT4_strdupA(Endpoint);
212
213 if (Binding->Assoc) RpcAssoc_Release(Binding->Assoc);
214 Binding->Assoc = NULL;
215 status = RPCRT4_GetAssociation(Binding->Protseq, Binding->NetworkAddr,
216 Binding->Endpoint, Binding->NetworkOptions,
217 &Binding->Assoc);
218 if (status != RPC_S_OK)
219 return status;
220
221 return RPC_S_OK;
222}
RPC_STATUS RPCRT4_GetAssociation(LPCSTR Protseq, LPCSTR NetworkAddr, LPCSTR Endpoint, LPCWSTR NetworkOptions, RpcAssoc **assoc_out)
Definition: rpc_assoc.c:98
long RPC_STATUS
Definition: rpc.h:52
Definition: ps.c:97

Referenced by get_epm_handle_client(), and RpcEpResolveBinding().

◆ RPCRT4_SetBindingObject()

RPC_STATUS RPCRT4_SetBindingObject ( RpcBinding Binding,
const UUID ObjectUuid 
)

Definition at line 224 of file rpc_binding.c.

225{
226 TRACE("(*RpcBinding == ^%p, UUID == %s)\n", Binding, debugstr_guid(ObjectUuid));
227 if (ObjectUuid) Binding->ObjectUuid = *ObjectUuid;
228 else UuidCreateNil(&Binding->ObjectUuid);
229 return RPC_S_OK;
230}
#define debugstr_guid
Definition: kernel32.h:35
RPC_STATUS WINAPI UuidCreateNil(UUID *Uuid)
Definition: rpcrt4_main.c:284

Referenced by process_request_packet(), RpcBindingFromStringBindingA(), RpcBindingFromStringBindingW(), and RpcBindingSetObject().

◆ RPCRT4_SetThreadCurrentCallHandle()

void RPCRT4_SetThreadCurrentCallHandle ( RpcBinding Binding)

Definition at line 964 of file rpcrt4_main.c.

965{
966 struct threaddata *tdata = get_or_create_threaddata();
967 if (!tdata) return;
968
969 tdata->server_binding = Binding;
970}

Referenced by process_request_packet().

◆ RPCRT4_SetThreadCurrentConnection()

void RPCRT4_SetThreadCurrentConnection ( RpcConnection Connection)

Definition at line 954 of file rpcrt4_main.c.

955{
956 struct threaddata *tdata = get_or_create_threaddata();
957 if (!tdata) return;
958
959 EnterCriticalSection(&tdata->cs);
960 tdata->connection = Connection;
961 LeaveCriticalSection(&tdata->cs);
962}
RpcConnection * connection
Definition: rpcrt4_main.c:93
CRITICAL_SECTION cs
Definition: rpcrt4_main.c:91

Referenced by RPCRT4_ReceiveWithAuth(), and RPCRT4_SendWithAuth().

◆ RPCRT4_strdupAtoW()

LPWSTR RPCRT4_strdupAtoW ( LPCSTR  src)

Definition at line 69 of file rpc_binding.c.

70{
71 DWORD len;
72 LPWSTR s;
73 if (!src) return NULL;
74 len = MultiByteToWideChar(CP_ACP, 0, src, -1, NULL, 0);
75 s = HeapAlloc(GetProcessHeap(), 0, len*sizeof(WCHAR));
77 return s;
78}
#define CP_ACP
Definition: compat.h:109
#define MultiByteToWideChar
Definition: compat.h:110
unsigned long DWORD
Definition: ntddk_ex.h:95
GLdouble s
Definition: gl.h:2039
GLenum src
Definition: glext.h:6340
__wchar_t WCHAR
Definition: xmlstorage.h:180
WCHAR * LPWSTR
Definition: xmlstorage.h:184

Referenced by RpcBindingSetAuthInfoExA(), RpcBindingToStringBindingW(), RpcQualityOfService_Create(), RPCRT4_CompleteBindingA(), RpcServerRegisterAuthInfoA(), and UuidToStringW().

◆ RPCRT4_strdupWtoA()

◆ RPCRT4_strfree()

◆ RPCRT4_strndupA()

LPSTR RPCRT4_strndupA ( LPCSTR  src,
INT  len 
)

Definition at line 45 of file rpc_binding.c.

46{
47 DWORD len;
48 LPSTR s;
49 if (!src) return NULL;
50 if (slen == -1) slen = strlen(src);
51 len = slen;
52 s = HeapAlloc(GetProcessHeap(), 0, len+1);
53 memcpy(s, src, len);
54 s[len] = 0;
55 return s;
56}
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878

Referenced by RpcBindingCopy().

◆ RPCRT4_strndupW()

LPWSTR RPCRT4_strndupW ( LPCWSTR  src,
INT  len 
)

Definition at line 91 of file rpc_binding.c.

92{
93 DWORD len;
94 LPWSTR s;
95 if (!src) return NULL;
96 if (slen == -1) slen = lstrlenW(src);
97 len = slen;
98 s = HeapAlloc(GetProcessHeap(), 0, (len+1)*sizeof(WCHAR));
99 memcpy(s, src, len*sizeof(WCHAR));
100 s[len] = 0;
101 return s;
102}
#define lstrlenW
Definition: compat.h:750

Referenced by RpcAuthInfo_Create(), RpcQualityOfService_Create(), and rpcrt4_http_internet_connect().

◆ RpcTransport_GetTopOfTower()

RPC_STATUS RpcTransport_GetTopOfTower ( unsigned char tower_data,
size_t tower_size,
const char protseq,
const char networkaddr,
const char endpoint 
)

Definition at line 3774 of file rpc_transport.c.

3779{
3780 twr_empty_floor_t *protocol_floor;
3782
3783 *tower_size = 0;
3784
3785 if (!protseq_ops)
3787
3788 if (!tower_data)
3789 {
3790 *tower_size = sizeof(*protocol_floor);
3791 *tower_size += protseq_ops->get_top_of_tower(NULL, networkaddr, endpoint);
3792 return RPC_S_OK;
3793 }
3794
3795 protocol_floor = (twr_empty_floor_t *)tower_data;
3796 protocol_floor->count_lhs = sizeof(protocol_floor->protid);
3797 protocol_floor->protid = protseq_ops->epm_protocols[0];
3798 protocol_floor->count_rhs = 0;
3799
3800 tower_data += sizeof(*protocol_floor);
3801
3802 *tower_size = protseq_ops->get_top_of_tower(tower_data, networkaddr, endpoint);
3803 if (!*tower_size)
3804 return EPT_S_NOT_REGISTERED;
3805
3806 *tower_size += sizeof(*protocol_floor);
3807
3808 return RPC_S_OK;
3809}
u_int16 count_lhs
Definition: epm_towers.h:83
u_int16 count_rhs
Definition: epm_towers.h:85
#define EPT_S_NOT_REGISTERED
Definition: winerror.h:1061
#define RPC_S_INVALID_RPC_PROTSEQ
Definition: winerror.h:1015

Referenced by TowerConstruct().

◆ RpcTransport_ParseTopOfTower()

RPC_STATUS RpcTransport_ParseTopOfTower ( const unsigned char tower_data,
size_t  tower_size,
char **  protseq,
char **  networkaddr,
char **  endpoint 
)

Definition at line 3811 of file rpc_transport.c.

3816{
3817 const twr_empty_floor_t *protocol_floor;
3818 const twr_empty_floor_t *floor4;
3819 const struct connection_ops *protseq_ops = NULL;
3821 unsigned int i;
3822
3823 if (tower_size < sizeof(*protocol_floor))
3824 return EPT_S_NOT_REGISTERED;
3825
3826 protocol_floor = (const twr_empty_floor_t *)tower_data;
3827 tower_data += sizeof(*protocol_floor);
3828 tower_size -= sizeof(*protocol_floor);
3829 if ((protocol_floor->count_lhs != sizeof(protocol_floor->protid)) ||
3830 (protocol_floor->count_rhs > tower_size))
3831 return EPT_S_NOT_REGISTERED;
3832 tower_data += protocol_floor->count_rhs;
3833 tower_size -= protocol_floor->count_rhs;
3834
3835 floor4 = (const twr_empty_floor_t *)tower_data;
3836 if ((tower_size < sizeof(*floor4)) ||
3837 (floor4->count_lhs != sizeof(floor4->protid)))
3838 return EPT_S_NOT_REGISTERED;
3839
3840 for(i = 0; i < ARRAY_SIZE(conn_protseq_list); i++)
3841 if ((protocol_floor->protid == conn_protseq_list[i].epm_protocols[0]) &&
3842 (floor4->protid == conn_protseq_list[i].epm_protocols[1]))
3843 {
3845 break;
3846 }
3847
3848 if (!protseq_ops)
3849 return EPT_S_NOT_REGISTERED;
3850
3851 status = protseq_ops->parse_top_of_tower(tower_data, tower_size, networkaddr, endpoint);
3852
3853 if ((status == RPC_S_OK) && protseq)
3854 {
3855 *protseq = I_RpcAllocate(strlen(protseq_ops->name) + 1);
3856 strcpy(*protseq, protseq_ops->name);
3857 }
3858
3859 return status;
3860}
char * strcpy(char *DstString, const char *SrcString)
Definition: utclib.c:388
#define ARRAY_SIZE(A)
Definition: main.h:33
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
static const struct connection_ops conn_protseq_list[]
void *WINAPI I_RpcAllocate(unsigned int Size)
Definition: rpcrt4_main.c:716
const char * name
Definition: rpc_server.h:50

Referenced by TowerExplode().