ReactOS 0.4.16-dev-1946-g52006dd
rpc_binding.c File Reference
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include "windef.h"
#include "winbase.h"
#include "winnls.h"
#include "winerror.h"
#include "winternl.h"
#include "rpc.h"
#include "rpcndr.h"
#include "wine/debug.h"
#include "rpc_binding.h"
#include "rpc_assoc.h"
Include dependency graph for rpc_binding.c:

Go to the source code of this file.

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (rpc)
 
LPSTR RPCRT4_strdupWtoA (LPCWSTR src)
 
LPWSTR RPCRT4_strdupAtoW (LPCSTR src)
 
static LPWSTR RPCRT4_strndupAtoW (LPCSTR src, INT slen)
 
LPWSTR RPCRT4_strndupW (LPCWSTR src, INT slen)
 
static RPC_STATUS RPCRT4_AllocBinding (RpcBinding **Binding, BOOL server)
 
static RPC_STATUS RPCRT4_CreateBindingA (RpcBinding **Binding, BOOL server, LPCSTR Protseq)
 
static RPC_STATUS RPCRT4_CreateBindingW (RpcBinding **Binding, BOOL server, LPCWSTR Protseq)
 
static RPC_STATUS RPCRT4_CompleteBindingA (RpcBinding *Binding, LPCSTR NetworkAddr, LPCSTR Endpoint, LPCSTR NetworkOptions)
 
static RPC_STATUS RPCRT4_CompleteBindingW (RpcBinding *Binding, LPCWSTR NetworkAddr, LPCWSTR Endpoint, LPCWSTR NetworkOptions)
 
RPC_STATUS RPCRT4_ResolveBinding (RpcBinding *Binding, LPCSTR Endpoint)
 
RPC_STATUS RPCRT4_SetBindingObject (RpcBinding *Binding, const UUID *ObjectUuid)
 
RPC_STATUS RPCRT4_MakeBinding (RpcBinding **Binding, RpcConnection *Connection)
 
void RPCRT4_AddRefBinding (RpcBinding *Binding)
 
RPC_STATUS RPCRT4_ReleaseBinding (RpcBinding *Binding)
 
RPC_STATUS RPCRT4_OpenBinding (RpcBinding *Binding, RpcConnection **Connection, const RPC_SYNTAX_IDENTIFIER *TransferSyntax, const RPC_SYNTAX_IDENTIFIER *InterfaceId, BOOL *from_cache)
 
RPC_STATUS RPCRT4_CloseBinding (RpcBinding *Binding, RpcConnection *Connection)
 
static LPSTR RPCRT4_strconcatA (LPSTR dst, LPCSTR src)
 
static LPWSTR RPCRT4_strconcatW (LPWSTR dst, LPCWSTR src)
 
static RPC_CSTR escape_string_binding_component (RPC_CSTR string_binding, const unsigned char *component)
 
static RPC_WSTR escape_string_binding_componentW (RPC_WSTR string_binding, const WCHAR *component)
 
static const unsigned charstring_binding_find_delimiter (const unsigned char *string_binding, unsigned char delim)
 
static const WCHARstring_binding_find_delimiterW (const WCHAR *string_binding, WCHAR delim)
 
static RPC_CSTR unescape_string_binding_component (const unsigned char *string_binding, int len)
 
static RPC_WSTR unescape_string_binding_componentW (const WCHAR *string_binding, int len)
 
RPC_STATUS WINAPI RpcStringBindingComposeA (RPC_CSTR ObjUuid, RPC_CSTR Protseq, RPC_CSTR NetworkAddr, RPC_CSTR Endpoint, RPC_CSTR Options, RPC_CSTR *StringBinding)
 
RPC_STATUS WINAPI RpcStringBindingComposeW (RPC_WSTR ObjUuid, RPC_WSTR Protseq, RPC_WSTR NetworkAddr, RPC_WSTR Endpoint, RPC_WSTR Options, RPC_WSTR *StringBinding)
 
RPC_STATUS WINAPI RpcStringBindingParseA (RPC_CSTR StringBinding, RPC_CSTR *ObjUuid, RPC_CSTR *Protseq, RPC_CSTR *NetworkAddr, RPC_CSTR *Endpoint, RPC_CSTR *Options)
 
RPC_STATUS WINAPI RpcStringBindingParseW (RPC_WSTR StringBinding, RPC_WSTR *ObjUuid, RPC_WSTR *Protseq, RPC_WSTR *NetworkAddr, RPC_WSTR *Endpoint, RPC_WSTR *Options)
 
RPC_STATUS WINAPI RpcBindingFree (RPC_BINDING_HANDLE *Binding)
 
RPC_STATUS WINAPI RpcBindingVectorFree (RPC_BINDING_VECTOR **BindingVector)
 
RPC_STATUS WINAPI RpcBindingInqObject (RPC_BINDING_HANDLE Binding, UUID *ObjectUuid)
 
RPC_STATUS WINAPI RpcBindingSetObject (RPC_BINDING_HANDLE Binding, UUID *ObjectUuid)
 
RPC_STATUS WINAPI RpcBindingFromStringBindingA (RPC_CSTR StringBinding, RPC_BINDING_HANDLE *Binding)
 
RPC_STATUS WINAPI RpcBindingFromStringBindingW (RPC_WSTR StringBinding, RPC_BINDING_HANDLE *Binding)
 
RPC_STATUS WINAPI RpcBindingToStringBindingA (RPC_BINDING_HANDLE Binding, RPC_CSTR *StringBinding)
 
RPC_STATUS WINAPI RpcBindingToStringBindingW (RPC_BINDING_HANDLE Binding, RPC_WSTR *StringBinding)
 
RPC_STATUS WINAPI I_RpcBindingInqTransportType (RPC_BINDING_HANDLE Binding, unsigned int *Type)
 
RPC_STATUS WINAPI I_RpcBindingSetAsync (RPC_BINDING_HANDLE Binding, RPC_BLOCKING_FN BlockingFn)
 
RPC_STATUS RPC_ENTRY RpcBindingCopy (RPC_BINDING_HANDLE SourceBinding, RPC_BINDING_HANDLE *DestinationBinding)
 
RPC_STATUS RPC_ENTRY RpcBindingReset (RPC_BINDING_HANDLE Binding)
 
RPC_STATUS WINAPI RpcImpersonateClient (RPC_BINDING_HANDLE BindingHandle)
 
RPC_STATUS WINAPI RpcRevertToSelfEx (RPC_BINDING_HANDLE BindingHandle)
 
static BOOL has_nt_auth_identity (ULONG AuthnLevel)
 
RPC_STATUS RpcAuthInfo_Create (ULONG AuthnLevel, ULONG AuthnSvc, CredHandle cred, TimeStamp exp, ULONG cbMaxToken, RPC_AUTH_IDENTITY_HANDLE identity, RpcAuthInfo **ret)
 
ULONG RpcAuthInfo_AddRef (RpcAuthInfo *AuthInfo)
 
ULONG RpcAuthInfo_Release (RpcAuthInfo *AuthInfo)
 
BOOL RpcAuthInfo_IsEqual (const RpcAuthInfo *AuthInfo1, const RpcAuthInfo *AuthInfo2)
 
static RPC_STATUS RpcQualityOfService_Create (const RPC_SECURITY_QOS *qos_src, BOOL unicode, RpcQualityOfService **qos_dst)
 
ULONG RpcQualityOfService_AddRef (RpcQualityOfService *qos)
 
ULONG RpcQualityOfService_Release (RpcQualityOfService *qos)
 
BOOL RpcQualityOfService_IsEqual (const RpcQualityOfService *qos1, const RpcQualityOfService *qos2)
 
RPC_STATUS WINAPI RpcRevertToSelf (void)
 
RPC_STATUS WINAPI RpcMgmtSetComTimeout (RPC_BINDING_HANDLE BindingHandle, unsigned int Timeout)
 
RPCRTAPI RPC_STATUS RPC_ENTRY RpcBindingInqAuthInfoExA (RPC_BINDING_HANDLE Binding, RPC_CSTR *ServerPrincName, ULONG *AuthnLevel, ULONG *AuthnSvc, RPC_AUTH_IDENTITY_HANDLE *AuthIdentity, ULONG *AuthzSvc, ULONG RpcQosVersion, RPC_SECURITY_QOS *SecurityQOS)
 
RPCRTAPI RPC_STATUS RPC_ENTRY RpcBindingInqAuthInfoExW (RPC_BINDING_HANDLE Binding, RPC_WSTR *ServerPrincName, ULONG *AuthnLevel, ULONG *AuthnSvc, RPC_AUTH_IDENTITY_HANDLE *AuthIdentity, ULONG *AuthzSvc, ULONG RpcQosVersion, RPC_SECURITY_QOS *SecurityQOS)
 
RPCRTAPI RPC_STATUS RPC_ENTRY RpcBindingInqAuthInfoA (RPC_BINDING_HANDLE Binding, RPC_CSTR *ServerPrincName, ULONG *AuthnLevel, ULONG *AuthnSvc, RPC_AUTH_IDENTITY_HANDLE *AuthIdentity, ULONG *AuthzSvc)
 
RPCRTAPI RPC_STATUS RPC_ENTRY RpcBindingInqAuthInfoW (RPC_BINDING_HANDLE Binding, RPC_WSTR *ServerPrincName, ULONG *AuthnLevel, ULONG *AuthnSvc, RPC_AUTH_IDENTITY_HANDLE *AuthIdentity, ULONG *AuthzSvc)
 
RPCRTAPI RPC_STATUS RPC_ENTRY RpcBindingInqAuthClientA (RPC_BINDING_HANDLE ClientBinding, RPC_AUTHZ_HANDLE *Privs, RPC_CSTR *ServerPrincName, ULONG *AuthnLevel, ULONG *AuthnSvc, ULONG *AuthzSvc)
 
RPCRTAPI RPC_STATUS RPC_ENTRY RpcBindingInqAuthClientW (RPC_BINDING_HANDLE ClientBinding, RPC_AUTHZ_HANDLE *Privs, RPC_WSTR *ServerPrincName, ULONG *AuthnLevel, ULONG *AuthnSvc, ULONG *AuthzSvc)
 
RPCRTAPI RPC_STATUS RPC_ENTRY RpcBindingInqAuthClientExA (RPC_BINDING_HANDLE ClientBinding, RPC_AUTHZ_HANDLE *Privs, RPC_CSTR *ServerPrincName, ULONG *AuthnLevel, ULONG *AuthnSvc, ULONG *AuthzSvc, ULONG Flags)
 
RPCRTAPI RPC_STATUS RPC_ENTRY RpcBindingInqAuthClientExW (RPC_BINDING_HANDLE ClientBinding, RPC_AUTHZ_HANDLE *Privs, RPC_WSTR *ServerPrincName, ULONG *AuthnLevel, ULONG *AuthnSvc, ULONG *AuthzSvc, ULONG Flags)
 
RPCRTAPI RPC_STATUS RPC_ENTRY RpcBindingServerFromClient (RPC_BINDING_HANDLE ClientBinding, RPC_BINDING_HANDLE *ServerBinding)
 
RPCRTAPI RPC_STATUS RPC_ENTRY RpcBindingSetAuthInfoExA (RPC_BINDING_HANDLE Binding, RPC_CSTR ServerPrincName, ULONG AuthnLevel, ULONG AuthnSvc, RPC_AUTH_IDENTITY_HANDLE AuthIdentity, ULONG AuthzSvr, RPC_SECURITY_QOS *SecurityQos)
 
RPCRTAPI RPC_STATUS RPC_ENTRY RpcBindingSetAuthInfoExW (RPC_BINDING_HANDLE Binding, RPC_WSTR ServerPrincName, ULONG AuthnLevel, ULONG AuthnSvc, RPC_AUTH_IDENTITY_HANDLE AuthIdentity, ULONG AuthzSvr, RPC_SECURITY_QOS *SecurityQos)
 
RPCRTAPI RPC_STATUS RPC_ENTRY RpcBindingSetAuthInfoA (RPC_BINDING_HANDLE Binding, RPC_CSTR ServerPrincName, ULONG AuthnLevel, ULONG AuthnSvc, RPC_AUTH_IDENTITY_HANDLE AuthIdentity, ULONG AuthzSvr)
 
RPCRTAPI RPC_STATUS RPC_ENTRY RpcBindingSetAuthInfoW (RPC_BINDING_HANDLE Binding, RPC_WSTR ServerPrincName, ULONG AuthnLevel, ULONG AuthnSvc, RPC_AUTH_IDENTITY_HANDLE AuthIdentity, ULONG AuthzSvr)
 
RPC_STATUS WINAPI RpcBindingSetOption (RPC_BINDING_HANDLE BindingHandle, ULONG Option, ULONG_PTR OptionValue)
 
RPC_STATUS WINAPI I_RpcBindingInqLocalClientPID (RPC_BINDING_HANDLE ClientBinding, ULONG *ClientPID)
 

Function Documentation

◆ escape_string_binding_component()

static RPC_CSTR escape_string_binding_component ( RPC_CSTR  string_binding,
const unsigned char component 
)
static

Definition at line 321 of file rpc_binding.c.

323{
324 for (; *component; component++) {
325 switch (*component) {
326 case '@':
327 case ':':
328 case '[':
329 case ']':
330 case '\\':
331 *string_binding++ = '\\';
332 *string_binding++ = *component;
333 break;
334 default:
335 *string_binding++ = *component;
336 break;
337 }
338 }
339 return string_binding;
340}

Referenced by RpcStringBindingComposeA().

◆ escape_string_binding_componentW()

static RPC_WSTR escape_string_binding_componentW ( RPC_WSTR  string_binding,
const WCHAR component 
)
static

Definition at line 342 of file rpc_binding.c.

344{
345 for (; *component; component++) {
346 switch (*component) {
347 case '@':
348 case ':':
349 case '[':
350 case ']':
351 case '\\':
352 *string_binding++ = '\\';
353 *string_binding++ = *component;
354 break;
355 default:
356 *string_binding++ = *component;
357 break;
358 }
359 }
360 return string_binding;
361}

Referenced by RpcStringBindingComposeW().

◆ has_nt_auth_identity()

static BOOL has_nt_auth_identity ( ULONG  AuthnLevel)
inlinestatic

Definition at line 1086 of file rpc_binding.c.

1087{
1088 switch (AuthnLevel)
1089 {
1091 case RPC_C_AUTHN_WINNT:
1093 return TRUE;
1094 default:
1095 return FALSE;
1096 }
1097}
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define RPC_C_AUTHN_WINNT
Definition: rpcdce.h:158
#define RPC_C_AUTHN_GSS_NEGOTIATE
Definition: rpcdce.h:157
#define RPC_C_AUTHN_GSS_KERBEROS
Definition: rpcdce.h:160

Referenced by RpcAuthInfo_Create(), and RpcAuthInfo_IsEqual().

◆ I_RpcBindingInqLocalClientPID()

RPC_STATUS WINAPI I_RpcBindingInqLocalClientPID ( RPC_BINDING_HANDLE  ClientBinding,
ULONG ClientPID 
)

Definition at line 1969 of file rpc_binding.c.

1970{
1971 RpcConnection *connection = NULL;
1973
1974 TRACE("%p %p\n", ClientBinding, ClientPID);
1975
1976 binding = ClientBinding ? ClientBinding : RPCRT4_GetThreadCurrentCallHandle();
1977 if (!binding)
1978 return RPC_S_NO_CALL_ACTIVE;
1979
1980 connection = binding->FromConn;
1981 if (!connection->ops->inquire_client_pid)
1982 return RPC_S_INVALID_BINDING;
1983
1984 return connection->ops->inquire_client_pid(connection, ClientPID);
1985}
#define NULL
Definition: types.h:112
static RPC_BINDING_HANDLE binding
Definition: server.c:166
RpcBinding * RPCRT4_GetThreadCurrentCallHandle(void)
Definition: rpcrt4_main.c:1003
#define TRACE(s)
Definition: solgame.cpp:4
const struct connection_ops * ops
Definition: rpc_binding.h:70
#define RPC_S_NO_CALL_ACTIVE
Definition: winerror.h:1392
#define RPC_S_INVALID_BINDING
Definition: winerror.h:1369

Referenced by s_Shutdown(), s_test_I_RpcBindingInqLocalClientPID(), and test_I_RpcBindingInqLocalClientPID_thread_func().

◆ I_RpcBindingInqTransportType()

RPC_STATUS WINAPI I_RpcBindingInqTransportType ( RPC_BINDING_HANDLE  Binding,
unsigned int Type 
)

Definition at line 943 of file rpc_binding.c.

944{
945
946 FIXME( "(%p,%p): stub\n", Binding, Type);
948 return RPC_S_OK;
949}
Type
Definition: Type.h:7
#define FIXME(fmt,...)
Definition: precomp.h:53
#define TRANSPORT_TYPE_LPC
Definition: rpcdcep.h:137
#define RPC_S_OK
Definition: rpcnterr.h:22

◆ I_RpcBindingSetAsync()

RPC_STATUS WINAPI I_RpcBindingSetAsync ( RPC_BINDING_HANDLE  Binding,
RPC_BLOCKING_FN  BlockingFn 
)

Definition at line 957 of file rpc_binding.c.

958{
960
961 TRACE( "(%p,%p): stub\n", Binding, BlockingFn );
962
963 bind->BlockingFn = BlockingFn;
964
965 return RPC_S_OK;
966}
INT WSAAPI bind(IN SOCKET s, IN CONST struct sockaddr *name, IN INT namelen)
Definition: socklife.c:36

◆ RpcAuthInfo_AddRef()

ULONG RpcAuthInfo_AddRef ( RpcAuthInfo AuthInfo)

Definition at line 1165 of file rpc_binding.c.

1166{
1167 return InterlockedIncrement(&AuthInfo->refs);
1168}
#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 1099 of file rpc_binding.c.

1104{
1105 RpcAuthInfo *AuthInfo = malloc(sizeof(*AuthInfo));
1106 if (!AuthInfo)
1107 return RPC_S_OUT_OF_MEMORY;
1108
1109 AuthInfo->refs = 1;
1110 AuthInfo->AuthnLevel = AuthnLevel;
1111 AuthInfo->AuthnSvc = AuthnSvc;
1112 AuthInfo->cred = cred;
1113 AuthInfo->exp = exp;
1114 AuthInfo->cbMaxToken = cbMaxToken;
1115 AuthInfo->identity = identity;
1116 AuthInfo->server_principal_name = NULL;
1117
1118 /* duplicate the SEC_WINNT_AUTH_IDENTITY structure, if applicable, to
1119 * enable better matching in RpcAuthInfo_IsEqual */
1120 if (identity && has_nt_auth_identity(AuthnSvc))
1121 {
1122 const SEC_WINNT_AUTH_IDENTITY_W *nt_identity = identity;
1123 AuthInfo->nt_identity = malloc(sizeof(*AuthInfo->nt_identity));
1124 if (!AuthInfo->nt_identity)
1125 {
1126 free(AuthInfo);
1127 return RPC_S_OUT_OF_MEMORY;
1128 }
1129
1131 if (nt_identity->Flags & SEC_WINNT_AUTH_IDENTITY_UNICODE)
1132 AuthInfo->nt_identity->User = RPCRT4_strndupW(nt_identity->User, nt_identity->UserLength);
1133 else
1134 AuthInfo->nt_identity->User = RPCRT4_strndupAtoW((const char *)nt_identity->User, nt_identity->UserLength);
1135 AuthInfo->nt_identity->UserLength = nt_identity->UserLength;
1136 if (nt_identity->Flags & SEC_WINNT_AUTH_IDENTITY_UNICODE)
1137 AuthInfo->nt_identity->Domain = RPCRT4_strndupW(nt_identity->Domain, nt_identity->DomainLength);
1138 else
1139 AuthInfo->nt_identity->Domain = RPCRT4_strndupAtoW((const char *)nt_identity->Domain, nt_identity->DomainLength);
1140 AuthInfo->nt_identity->DomainLength = nt_identity->DomainLength;
1141 if (nt_identity->Flags & SEC_WINNT_AUTH_IDENTITY_UNICODE)
1142 AuthInfo->nt_identity->Password = RPCRT4_strndupW(nt_identity->Password, nt_identity->PasswordLength);
1143 else
1144 AuthInfo->nt_identity->Password = RPCRT4_strndupAtoW((const char *)nt_identity->Password, nt_identity->PasswordLength);
1145 AuthInfo->nt_identity->PasswordLength = nt_identity->PasswordLength;
1146
1147 if ((nt_identity->User && !AuthInfo->nt_identity->User) ||
1148 (nt_identity->Domain && !AuthInfo->nt_identity->Domain) ||
1149 (nt_identity->Password && !AuthInfo->nt_identity->Password))
1150 {
1151 free(AuthInfo->nt_identity->User);
1152 free(AuthInfo->nt_identity->Domain);
1153 free(AuthInfo->nt_identity->Password);
1154 free(AuthInfo->nt_identity);
1155 free(AuthInfo);
1156 return RPC_S_OUT_OF_MEMORY;
1157 }
1158 }
1159 else
1160 AuthInfo->nt_identity = NULL;
1161 *ret = AuthInfo;
1162 return RPC_S_OK;
1163}
#define free
Definition: debug_ros.c:5
#define malloc
Definition: debug_ros.c:4
return ret
Definition: mutex.c:146
DWORD exp
Definition: msg.c:16058
static BOOL has_nt_auth_identity(ULONG AuthnLevel)
Definition: rpc_binding.c:1086
LPWSTR RPCRT4_strndupW(LPCWSTR src, INT slen)
Definition: rpc_binding.c:79
static LPWSTR RPCRT4_strndupAtoW(LPCSTR src, INT slen)
Definition: rpc_binding.c:68
#define SEC_WINNT_AUTH_IDENTITY_UNICODE
Definition: rpcdce.h:310
#define RPC_S_OUT_OF_MEMORY
Definition: rpcnterr.h:24
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

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

◆ RpcAuthInfo_IsEqual()

BOOL RpcAuthInfo_IsEqual ( const RpcAuthInfo AuthInfo1,
const RpcAuthInfo AuthInfo2 
)

Definition at line 1191 of file rpc_binding.c.

1192{
1193 if (AuthInfo1 == AuthInfo2)
1194 return TRUE;
1195
1196 if (!AuthInfo1 || !AuthInfo2)
1197 return FALSE;
1198
1199 if ((AuthInfo1->AuthnLevel != AuthInfo2->AuthnLevel) ||
1200 (AuthInfo1->AuthnSvc != AuthInfo2->AuthnSvc))
1201 return FALSE;
1202
1203 if (AuthInfo1->identity == AuthInfo2->identity)
1204 return TRUE;
1205
1206 if (!AuthInfo1->identity || !AuthInfo2->identity)
1207 return FALSE;
1208
1209 if (has_nt_auth_identity(AuthInfo1->AuthnSvc))
1210 {
1211 const SEC_WINNT_AUTH_IDENTITY_W *identity1 = AuthInfo1->nt_identity;
1212 const SEC_WINNT_AUTH_IDENTITY_W *identity2 = AuthInfo2->nt_identity;
1213 /* compare user names */
1214 if (identity1->UserLength != identity2->UserLength ||
1215 memcmp(identity1->User, identity2->User, identity1->UserLength))
1216 return FALSE;
1217 /* compare domain names */
1218 if (identity1->DomainLength != identity2->DomainLength ||
1219 memcmp(identity1->Domain, identity2->Domain, identity1->DomainLength))
1220 return FALSE;
1221 /* compare passwords */
1222 if (identity1->PasswordLength != identity2->PasswordLength ||
1223 memcmp(identity1->Password, identity2->Password, identity1->PasswordLength))
1224 return FALSE;
1225 }
1226 else
1227 return FALSE;
1228
1229 return TRUE;
1230}
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
Definition: utclib.c:112

Referenced by RpcAssoc_GetIdleConnection().

◆ RpcAuthInfo_Release()

ULONG RpcAuthInfo_Release ( RpcAuthInfo AuthInfo)

Definition at line 1170 of file rpc_binding.c.

1171{
1172 ULONG refs = InterlockedDecrement(&AuthInfo->refs);
1173
1174 if (!refs)
1175 {
1176 FreeCredentialsHandle(&AuthInfo->cred);
1177 if (AuthInfo->nt_identity)
1178 {
1179 free(AuthInfo->nt_identity->User);
1180 free(AuthInfo->nt_identity->Domain);
1181 free(AuthInfo->nt_identity->Password);
1182 free(AuthInfo->nt_identity);
1183 }
1184 free(AuthInfo->server_principal_name);
1185 free(AuthInfo);
1186 }
1187
1188 return refs;
1189}
#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().

◆ RpcBindingCopy()

RPC_STATUS RPC_ENTRY RpcBindingCopy ( RPC_BINDING_HANDLE  SourceBinding,
RPC_BINDING_HANDLE DestinationBinding 
)

Definition at line 971 of file rpc_binding.c.

974{
975 RpcBinding *DestBinding;
976 RpcBinding *SrcBinding = SourceBinding;
978
979 TRACE("(%p, %p)\n", SourceBinding, DestinationBinding);
980
981 status = RPCRT4_AllocBinding(&DestBinding, SrcBinding->server);
982 if (status != RPC_S_OK) return status;
983
984 DestBinding->ObjectUuid = SrcBinding->ObjectUuid;
985 DestBinding->BlockingFn = SrcBinding->BlockingFn;
986 DestBinding->Protseq = strdup(SrcBinding->Protseq);
987 DestBinding->NetworkAddr = strdup(SrcBinding->NetworkAddr);
988 DestBinding->Endpoint = strdup(SrcBinding->Endpoint);
989 DestBinding->NetworkOptions = wcsdup(SrcBinding->NetworkOptions);
990 DestBinding->CookieAuth = wcsdup(SrcBinding->CookieAuth);
991 if (SrcBinding->Assoc) SrcBinding->Assoc->refs++;
992 DestBinding->Assoc = SrcBinding->Assoc;
993
994 if (SrcBinding->AuthInfo) RpcAuthInfo_AddRef(SrcBinding->AuthInfo);
995 DestBinding->AuthInfo = SrcBinding->AuthInfo;
996 if (SrcBinding->QOS) RpcQualityOfService_AddRef(SrcBinding->QOS);
997 DestBinding->QOS = SrcBinding->QOS;
998
999 *DestinationBinding = DestBinding;
1000 return RPC_S_OK;
1001}
static RPC_STATUS RPCRT4_AllocBinding(RpcBinding **Binding, BOOL server)
Definition: rpc_binding.c:92
ULONG RpcAuthInfo_AddRef(RpcAuthInfo *AuthInfo)
Definition: rpc_binding.c:1165
ULONG RpcQualityOfService_AddRef(RpcQualityOfService *qos)
Definition: rpc_binding.c:1342
_Check_return_ _CRTIMP char *__cdecl strdup(_In_opt_z_ const char *_Src)
_Check_return_ _CRTIMP wchar_t *__cdecl wcsdup(_In_z_ const wchar_t *_Str)
long RPC_STATUS
Definition: rpc.h:48
RPC_BLOCKING_FN BlockingFn
Definition: rpc_binding.h:135
LPSTR NetworkAddr
Definition: rpc_binding.h:132
LPWSTR NetworkOptions
Definition: rpc_binding.h:134
LPWSTR CookieAuth
Definition: rpc_binding.h:143
RpcAuthInfo * AuthInfo
Definition: rpc_binding.h:141
LPSTR Endpoint
Definition: rpc_binding.h:133
LPSTR Protseq
Definition: rpc_binding.h:131
struct _RpcAssoc * Assoc
Definition: rpc_binding.h:138
UUID ObjectUuid
Definition: rpc_binding.h:130
RpcQualityOfService * QOS
Definition: rpc_binding.h:142
Definition: ps.c:97

Referenced by get_epm_handle_client(), and ndr_update_context_handle().

◆ RpcBindingFree()

RPC_STATUS WINAPI RpcBindingFree ( RPC_BINDING_HANDLE Binding)

◆ RpcBindingFromStringBindingA()

RPC_STATUS WINAPI RpcBindingFromStringBindingA ( RPC_CSTR  StringBinding,
RPC_BINDING_HANDLE Binding 
)

Definition at line 822 of file rpc_binding.c.

823{
826 RPC_CSTR ObjectUuid, Protseq, NetworkAddr, Endpoint, Options;
827 UUID Uuid;
828
829 TRACE("(%s,%p)\n", debugstr_a((char*)StringBinding), Binding);
830
831 ret = RpcStringBindingParseA(StringBinding, &ObjectUuid, &Protseq,
832 &NetworkAddr, &Endpoint, &Options);
833 if (ret != RPC_S_OK) return ret;
834
835 ret = UuidFromStringA(ObjectUuid, &Uuid);
836
837 if (ret == RPC_S_OK)
838 ret = RPCRT4_CreateBindingA(&bind, FALSE, (char*)Protseq);
839 if (ret == RPC_S_OK) {
841 if (ret == RPC_S_OK)
842 ret = RPCRT4_CompleteBindingA(bind, (char*)NetworkAddr, (char*)Endpoint, (char*)Options);
843
844 if (ret == RPC_S_OK)
846 else
848 }
849
851 RpcStringFreeA(&Endpoint);
852 RpcStringFreeA(&NetworkAddr);
853 RpcStringFreeA(&Protseq);
854 RpcStringFreeA(&ObjectUuid);
855
856 return ret;
857}
#define debugstr_a
Definition: kernel32.h:31
RPC_STATUS WINAPI RpcStringBindingParseA(RPC_CSTR StringBinding, RPC_CSTR *ObjUuid, RPC_CSTR *Protseq, RPC_CSTR *NetworkAddr, RPC_CSTR *Endpoint, RPC_CSTR *Options)
Definition: rpc_binding.c:547
static RPC_STATUS RPCRT4_CreateBindingA(RpcBinding **Binding, BOOL server, LPCSTR Protseq)
Definition: rpc_binding.c:105
RPC_STATUS RPCRT4_SetBindingObject(RpcBinding *Binding, const UUID *ObjectUuid)
Definition: rpc_binding.c:207
static RPC_STATUS RPCRT4_CompleteBindingA(RpcBinding *Binding, LPCSTR NetworkAddr, LPCSTR Endpoint, LPCSTR NetworkOptions)
Definition: rpc_binding.c:131
I_RPC_HANDLE RPC_BINDING_HANDLE
Definition: rpcdce.h:50
unsigned char * RPC_CSTR
Definition: rpcdce.h:45
RPC_STATUS WINAPI RpcStringFreeA(RPC_CSTR *String)
Definition: rpcrt4_main.c:164
RPC_STATUS WINAPI UuidFromStringA(RPC_CSTR s, UUID *uuid)
Definition: rpcrt4_main.c:615
_In_ PWDFDEVICE_INIT _In_ PWDF_REMOVE_LOCK_OPTIONS Options
Definition: wdfdevice.h:3540

Referenced by client(), EVENTLOG_HANDLE_A_bind(), get_epm_handle_server(), listen_test_client_thread(), SVCCTL_HANDLEA_bind(), test_endpoint_mapper(), test_ndr_buffer(), test_reconnect(), test_rpc_ncacn_ip_tcp(), and test_RpcStringBindingFromBinding().

◆ RpcBindingFromStringBindingW()

RPC_STATUS WINAPI RpcBindingFromStringBindingW ( RPC_WSTR  StringBinding,
RPC_BINDING_HANDLE Binding 
)

Definition at line 862 of file rpc_binding.c.

863{
866 RPC_WSTR ObjectUuid, Protseq, NetworkAddr, Endpoint, Options;
867 UUID Uuid;
868
869 TRACE("(%s,%p)\n", debugstr_w(StringBinding), Binding);
870
871 ret = RpcStringBindingParseW(StringBinding, &ObjectUuid, &Protseq,
872 &NetworkAddr, &Endpoint, &Options);
873 if (ret != RPC_S_OK) return ret;
874
875 ret = UuidFromStringW(ObjectUuid, &Uuid);
876
877 if (ret == RPC_S_OK)
878 ret = RPCRT4_CreateBindingW(&bind, FALSE, Protseq);
879 if (ret == RPC_S_OK) {
881 if (ret == RPC_S_OK)
882 ret = RPCRT4_CompleteBindingW(bind, NetworkAddr, Endpoint, Options);
883
884 if (ret == RPC_S_OK)
886 else
888 }
889
891 RpcStringFreeW(&Endpoint);
892 RpcStringFreeW(&NetworkAddr);
893 RpcStringFreeW(&Protseq);
894 RpcStringFreeW(&ObjectUuid);
895
896 return ret;
897}
#define debugstr_w
Definition: kernel32.h:32
static RPC_STATUS RPCRT4_CreateBindingW(RpcBinding **Binding, BOOL server, LPCWSTR Protseq)
Definition: rpc_binding.c:118
RPC_STATUS WINAPI RpcStringBindingParseW(RPC_WSTR StringBinding, RPC_WSTR *ObjUuid, RPC_WSTR *Protseq, RPC_WSTR *NetworkAddr, RPC_WSTR *Endpoint, RPC_WSTR *Options)
Definition: rpc_binding.c:659
static RPC_STATUS RPCRT4_CompleteBindingW(RpcBinding *Binding, LPCWSTR NetworkAddr, LPCWSTR Endpoint, LPCWSTR NetworkOptions)
Definition: rpc_binding.c:159
unsigned short * RPC_WSTR
Definition: rpcdce.h:46
RPC_STATUS WINAPI RpcStringFreeW(RPC_WSTR *String)
Definition: rpcrt4_main.c:181
RPC_STATUS WINAPI UuidFromStringW(RPC_WSTR s, UUID *uuid)
Definition: rpcrt4_main.c:655

Referenced by __wine_msi_call_dll_function(), ATSVC_HANDLE_bind(), BROWSER_IDENTIFY_HANDLE_bind(), CreateProcessWithLogonW(), DNSRSLVR_HANDLE_bind(), DsSetupBind(), EVENTLOG_HANDLE_W_bind(), get_irot_handle(), LOGONSRV_HANDLE_bind(), NetpBind(), PDHCP_SERVER_NAME_bind(), PLSAPR_SERVER_NAME_bind(), PnpBindRpc(), PREGISTRY_SERVER_NAME_bind(), PSAMPR_SERVER_NAME_bind(), RPC_CreateClientChannel(), ScCreateStatusBinding(), SRVSVC_HANDLE_bind(), SVCCTL_HANDLEW_bind(), WINSPOOL_HANDLE_bind(), WKSSVC_IDENTIFY_HANDLE_bind(), WKSSVC_IMPERSONATE_HANDLE_bind(), and WLANSVC_HANDLE_bind().

◆ RpcBindingInqAuthClientA()

RPCRTAPI RPC_STATUS RPC_ENTRY RpcBindingInqAuthClientA ( RPC_BINDING_HANDLE  ClientBinding,
RPC_AUTHZ_HANDLE Privs,
RPC_CSTR ServerPrincName,
ULONG AuthnLevel,
ULONG AuthnSvc,
ULONG AuthzSvc 
)

Definition at line 1554 of file rpc_binding.c.

1557{
1558 return RpcBindingInqAuthClientExA(ClientBinding, Privs, ServerPrincName, AuthnLevel,
1559 AuthnSvc, AuthzSvc, 0);
1560}
RPCRTAPI RPC_STATUS RPC_ENTRY RpcBindingInqAuthClientExA(RPC_BINDING_HANDLE ClientBinding, RPC_AUTHZ_HANDLE *Privs, RPC_CSTR *ServerPrincName, ULONG *AuthnLevel, ULONG *AuthnSvc, ULONG *AuthzSvc, ULONG Flags)
Definition: rpc_binding.c:1578

Referenced by s_authinfo_test().

◆ RpcBindingInqAuthClientExA()

RPCRTAPI RPC_STATUS RPC_ENTRY RpcBindingInqAuthClientExA ( RPC_BINDING_HANDLE  ClientBinding,
RPC_AUTHZ_HANDLE Privs,
RPC_CSTR ServerPrincName,
ULONG AuthnLevel,
ULONG AuthnSvc,
ULONG AuthzSvc,
ULONG  Flags 
)

Definition at line 1578 of file rpc_binding.c.

1581{
1583 RPC_WSTR principal;
1584
1585 TRACE("%p %p %p %p %p %p 0x%lx\n", ClientBinding, Privs, ServerPrincName, AuthnLevel,
1586 AuthnSvc, AuthzSvc, Flags);
1587
1588 status = RpcBindingInqAuthClientExW(ClientBinding, Privs, ServerPrincName ? &principal : NULL,
1589 AuthnLevel, AuthnSvc, AuthzSvc, Flags);
1590 if (status == RPC_S_OK && ServerPrincName)
1591 {
1592 *ServerPrincName = (RPC_CSTR)RPCRT4_strdupWtoA(principal);
1593 if (!*ServerPrincName && principal) status = RPC_S_OUT_OF_MEMORY;
1594 RpcStringFreeW(&principal);
1595 }
1596
1597 return status;
1598}
LPSTR RPCRT4_strdupWtoA(LPCWSTR src)
Definition: rpc_binding.c:46
RPCRTAPI RPC_STATUS RPC_ENTRY RpcBindingInqAuthClientExW(RPC_BINDING_HANDLE ClientBinding, RPC_AUTHZ_HANDLE *Privs, RPC_WSTR *ServerPrincName, ULONG *AuthnLevel, ULONG *AuthnSvc, ULONG *AuthzSvc, ULONG Flags)
Definition: rpc_binding.c:1604
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170

Referenced by RpcBindingInqAuthClientA(), and s_authinfo_test().

◆ RpcBindingInqAuthClientExW()

RPCRTAPI RPC_STATUS RPC_ENTRY RpcBindingInqAuthClientExW ( RPC_BINDING_HANDLE  ClientBinding,
RPC_AUTHZ_HANDLE Privs,
RPC_WSTR ServerPrincName,
ULONG AuthnLevel,
ULONG AuthnSvc,
ULONG AuthzSvc,
ULONG  Flags 
)

Definition at line 1604 of file rpc_binding.c.

1607{
1609
1610 TRACE("%p %p %p %p %p %p 0x%lx\n", ClientBinding, Privs, ServerPrincName, AuthnLevel,
1611 AuthnSvc, AuthzSvc, Flags);
1612
1613 if (!ClientBinding) ClientBinding = I_RpcGetCurrentCallHandle();
1614 if (!ClientBinding) return RPC_S_INVALID_BINDING;
1615
1616 bind = ClientBinding;
1617 if (!bind->FromConn) return RPC_S_INVALID_BINDING;
1618
1619 return rpcrt4_conn_inquire_auth_client(bind->FromConn, Privs,
1620 ServerPrincName, AuthnLevel,
1621 AuthnSvc, AuthzSvc, Flags);
1622}
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)
Definition: rpc_binding.h:249
RPC_BINDING_HANDLE WINAPI I_RpcGetCurrentCallHandle(void)
Definition: rpc_server.c:1743

Referenced by RpcBindingInqAuthClientExA(), and RpcBindingInqAuthClientW().

◆ RpcBindingInqAuthClientW()

RPCRTAPI RPC_STATUS RPC_ENTRY RpcBindingInqAuthClientW ( RPC_BINDING_HANDLE  ClientBinding,
RPC_AUTHZ_HANDLE Privs,
RPC_WSTR ServerPrincName,
ULONG AuthnLevel,
ULONG AuthnSvc,
ULONG AuthzSvc 
)

Definition at line 1566 of file rpc_binding.c.

1569{
1570 return RpcBindingInqAuthClientExW(ClientBinding, Privs, ServerPrincName, AuthnLevel,
1571 AuthnSvc, AuthzSvc, 0);
1572}

◆ RpcBindingInqAuthInfoA()

RPCRTAPI RPC_STATUS RPC_ENTRY RpcBindingInqAuthInfoA ( RPC_BINDING_HANDLE  Binding,
RPC_CSTR ServerPrincName,
ULONG AuthnLevel,
ULONG AuthnSvc,
RPC_AUTH_IDENTITY_HANDLE AuthIdentity,
ULONG AuthzSvc 
)

Definition at line 1532 of file rpc_binding.c.

1534{
1535 return RpcBindingInqAuthInfoExA(Binding, ServerPrincName, AuthnLevel, AuthnSvc, AuthIdentity,
1536 AuthzSvc, 0, NULL);
1537}
RPCRTAPI RPC_STATUS RPC_ENTRY RpcBindingInqAuthInfoExA(RPC_BINDING_HANDLE Binding, RPC_CSTR *ServerPrincName, ULONG *AuthnLevel, ULONG *AuthnSvc, RPC_AUTH_IDENTITY_HANDLE *AuthIdentity, ULONG *AuthzSvc, ULONG RpcQosVersion, RPC_SECURITY_QOS *SecurityQOS)
Definition: rpc_binding.c:1464

Referenced by test_rpc_ncacn_ip_tcp().

◆ RpcBindingInqAuthInfoExA()

RPCRTAPI RPC_STATUS RPC_ENTRY RpcBindingInqAuthInfoExA ( RPC_BINDING_HANDLE  Binding,
RPC_CSTR ServerPrincName,
ULONG AuthnLevel,
ULONG AuthnSvc,
RPC_AUTH_IDENTITY_HANDLE AuthIdentity,
ULONG AuthzSvc,
ULONG  RpcQosVersion,
RPC_SECURITY_QOS SecurityQOS 
)

Definition at line 1464 of file rpc_binding.c.

1467{
1469 RPC_WSTR principal;
1470
1471 TRACE("%p %p %p %p %p %p %lu %p\n", Binding, ServerPrincName, AuthnLevel,
1472 AuthnSvc, AuthIdentity, AuthzSvc, RpcQosVersion, SecurityQOS);
1473
1474 status = RpcBindingInqAuthInfoExW(Binding, ServerPrincName ? &principal : NULL, AuthnLevel,
1475 AuthnSvc, AuthIdentity, AuthzSvc, RpcQosVersion, SecurityQOS);
1476 if (status == RPC_S_OK && ServerPrincName)
1477 {
1478 *ServerPrincName = (RPC_CSTR)RPCRT4_strdupWtoA(principal);
1479 RpcStringFreeW(&principal);
1480 if (!*ServerPrincName) return RPC_S_OUT_OF_MEMORY;
1481 }
1482
1483 return status;
1484}
RPCRTAPI RPC_STATUS RPC_ENTRY RpcBindingInqAuthInfoExW(RPC_BINDING_HANDLE Binding, RPC_WSTR *ServerPrincName, ULONG *AuthnLevel, ULONG *AuthnSvc, RPC_AUTH_IDENTITY_HANDLE *AuthIdentity, ULONG *AuthzSvc, ULONG RpcQosVersion, RPC_SECURITY_QOS *SecurityQOS)
Definition: rpc_binding.c:1490

Referenced by RpcBindingInqAuthInfoA().

◆ RpcBindingInqAuthInfoExW()

RPCRTAPI RPC_STATUS RPC_ENTRY RpcBindingInqAuthInfoExW ( RPC_BINDING_HANDLE  Binding,
RPC_WSTR ServerPrincName,
ULONG AuthnLevel,
ULONG AuthnSvc,
RPC_AUTH_IDENTITY_HANDLE AuthIdentity,
ULONG AuthzSvc,
ULONG  RpcQosVersion,
RPC_SECURITY_QOS SecurityQOS 
)

Definition at line 1490 of file rpc_binding.c.

1493{
1495
1496 TRACE("%p %p %p %p %p %p %lu %p\n", Binding, ServerPrincName, AuthnLevel,
1497 AuthnSvc, AuthIdentity, AuthzSvc, RpcQosVersion, SecurityQOS);
1498
1499 if (!bind->AuthInfo) return RPC_S_BINDING_HAS_NO_AUTH;
1500
1501 if (SecurityQOS)
1502 {
1503 FIXME("QOS not implemented\n");
1504 return RPC_S_INVALID_BINDING;
1505 }
1506
1507 if (ServerPrincName)
1508 {
1509 if (bind->AuthInfo->server_principal_name)
1510 {
1511 *ServerPrincName = wcsdup(bind->AuthInfo->server_principal_name);
1512 if (!*ServerPrincName) return RPC_S_OUT_OF_MEMORY;
1513 }
1514 else *ServerPrincName = NULL;
1515 }
1516 if (AuthnLevel) *AuthnLevel = bind->AuthInfo->AuthnLevel;
1517 if (AuthnSvc) *AuthnSvc = bind->AuthInfo->AuthnSvc;
1518 if (AuthIdentity) *AuthIdentity = bind->AuthInfo->identity;
1519 if (AuthzSvc)
1520 {
1521 FIXME("authorization service not implemented\n");
1522 *AuthzSvc = RPC_C_AUTHZ_NONE;
1523 }
1524
1525 return RPC_S_OK;
1526}
#define RPC_C_AUTHZ_NONE
Definition: rpcdce.h:167
#define RPC_S_BINDING_HAS_NO_AUTH
Definition: winerror.h:1411

Referenced by RpcBindingInqAuthInfoExA(), and RpcBindingInqAuthInfoW().

◆ RpcBindingInqAuthInfoW()

RPCRTAPI RPC_STATUS RPC_ENTRY RpcBindingInqAuthInfoW ( RPC_BINDING_HANDLE  Binding,
RPC_WSTR ServerPrincName,
ULONG AuthnLevel,
ULONG AuthnSvc,
RPC_AUTH_IDENTITY_HANDLE AuthIdentity,
ULONG AuthzSvc 
)

Definition at line 1543 of file rpc_binding.c.

1545{
1546 return RpcBindingInqAuthInfoExW(Binding, ServerPrincName, AuthnLevel, AuthnSvc, AuthIdentity,
1547 AuthzSvc, 0, NULL);
1548}

◆ RpcBindingInqObject()

RPC_STATUS WINAPI RpcBindingInqObject ( RPC_BINDING_HANDLE  Binding,
UUID ObjectUuid 
)

Definition at line 798 of file rpc_binding.c.

799{
801
802 TRACE("(%p,%p) = %s\n", Binding, ObjectUuid, debugstr_guid(&bind->ObjectUuid));
803 *ObjectUuid = bind->ObjectUuid;
804 return RPC_S_OK;
805}
#define debugstr_guid
Definition: kernel32.h:35

Referenced by ClientRpcChannelBuffer_GetBuffer(), and dispatch_rpc().

◆ RpcBindingReset()

RPC_STATUS RPC_ENTRY RpcBindingReset ( RPC_BINDING_HANDLE  Binding)

Definition at line 1006 of file rpc_binding.c.

1007{
1009
1010 TRACE("(%p)\n", Binding);
1011
1012 free(bind->Endpoint);
1013 bind->Endpoint = NULL;
1014 if (bind->Assoc) RpcAssoc_Release(bind->Assoc);
1015 bind->Assoc = NULL;
1016
1017 return RPC_S_OK;
1018}
ULONG RpcAssoc_Release(RpcAssoc *assoc)
Definition: rpc_assoc.c:187

Referenced by test_endpoint_mapper().

◆ RpcBindingServerFromClient()

RPCRTAPI RPC_STATUS RPC_ENTRY RpcBindingServerFromClient ( RPC_BINDING_HANDLE  ClientBinding,
RPC_BINDING_HANDLE ServerBinding 
)

Definition at line 1628 of file rpc_binding.c.

1629{
1630 RpcBinding* bind = ClientBinding;
1631 RpcBinding* NewBinding;
1632
1633 if (!bind)
1635
1636 if (!bind->server)
1637 return RPC_S_INVALID_BINDING;
1638
1639 RPCRT4_AllocBinding(&NewBinding, TRUE);
1640 NewBinding->Protseq = strdup(bind->Protseq);
1641 NewBinding->NetworkAddr = strdup(bind->NetworkAddr);
1642
1643 *ServerBinding = NewBinding;
1644
1645 return RPC_S_OK;
1646}

Referenced by CreateJob(), and s_context_handle_test().

◆ RpcBindingSetAuthInfoA()

RPCRTAPI RPC_STATUS RPC_ENTRY RpcBindingSetAuthInfoA ( RPC_BINDING_HANDLE  Binding,
RPC_CSTR  ServerPrincName,
ULONG  AuthnLevel,
ULONG  AuthnSvc,
RPC_AUTH_IDENTITY_HANDLE  AuthIdentity,
ULONG  AuthzSvr 
)

Definition at line 1915 of file rpc_binding.c.

1917{
1918 TRACE("%p %s %lu %lu %p %lu\n", Binding, debugstr_a((const char*)ServerPrincName),
1919 AuthnLevel, AuthnSvc, AuthIdentity, AuthzSvr);
1920 return RpcBindingSetAuthInfoExA(Binding, ServerPrincName, AuthnLevel, AuthnSvc, AuthIdentity, AuthzSvr, NULL);
1921}
RPCRTAPI RPC_STATUS RPC_ENTRY RpcBindingSetAuthInfoExA(RPC_BINDING_HANDLE Binding, RPC_CSTR ServerPrincName, ULONG AuthnLevel, ULONG AuthnSvc, RPC_AUTH_IDENTITY_HANDLE AuthIdentity, ULONG AuthzSvr, RPC_SECURITY_QOS *SecurityQos)
Definition: rpc_binding.c:1652

Referenced by test_rpc_ncacn_ip_tcp().

◆ RpcBindingSetAuthInfoExA()

RPCRTAPI RPC_STATUS RPC_ENTRY RpcBindingSetAuthInfoExA ( RPC_BINDING_HANDLE  Binding,
RPC_CSTR  ServerPrincName,
ULONG  AuthnLevel,
ULONG  AuthnSvc,
RPC_AUTH_IDENTITY_HANDLE  AuthIdentity,
ULONG  AuthzSvr,
RPC_SECURITY_QOS SecurityQos 
)

Definition at line 1652 of file rpc_binding.c.

1656{
1659 CredHandle cred;
1660 TimeStamp exp;
1661 ULONG package_count;
1662 ULONG i;
1663 PSecPkgInfoA packages;
1664 ULONG cbMaxToken;
1665
1666 TRACE("%p %s %lu %lu %p %lu %p\n", Binding, debugstr_a((const char*)ServerPrincName),
1667 AuthnLevel, AuthnSvc, AuthIdentity, AuthzSvr, SecurityQos);
1668
1669 if (SecurityQos)
1670 {
1672
1673 TRACE("SecurityQos { Version=%ld, Capabilities=0x%lx, IdentityTracking=%ld, ImpersonationLevel=%ld",
1674 SecurityQos->Version, SecurityQos->Capabilities, SecurityQos->IdentityTracking, SecurityQos->ImpersonationType);
1675 if (SecurityQos->Version >= 2)
1676 {
1677 const RPC_SECURITY_QOS_V2_A *SecurityQos2 = (const RPC_SECURITY_QOS_V2_A *)SecurityQos;
1678 TRACE(", AdditionalSecurityInfoType=%ld", SecurityQos2->AdditionalSecurityInfoType);
1680 TRACE(", { %p, 0x%lx, %ld, %ld, %p(%lu), %s }",
1681 SecurityQos2->u.HttpCredentials->TransportCredentials,
1682 SecurityQos2->u.HttpCredentials->Flags,
1683 SecurityQos2->u.HttpCredentials->AuthenticationTarget,
1684 SecurityQos2->u.HttpCredentials->NumberOfAuthnSchemes,
1685 SecurityQos2->u.HttpCredentials->AuthnSchemes,
1686 SecurityQos2->u.HttpCredentials->AuthnSchemes ? *SecurityQos2->u.HttpCredentials->AuthnSchemes : 0,
1688 }
1689 TRACE("}\n");
1690 status = RpcQualityOfService_Create(SecurityQos, FALSE, &bind->QOS);
1691 if (status != RPC_S_OK)
1692 return status;
1693 }
1694 else
1695 {
1696 if (bind->QOS) RpcQualityOfService_Release(bind->QOS);
1697 bind->QOS = NULL;
1698 }
1699
1700 if (AuthnSvc == RPC_C_AUTHN_DEFAULT)
1701 AuthnSvc = RPC_C_AUTHN_WINNT;
1702
1703 /* FIXME: the mapping should probably be retrieved using SSPI somehow */
1704 if (AuthnLevel == RPC_C_AUTHN_LEVEL_DEFAULT)
1705 AuthnLevel = RPC_C_AUTHN_LEVEL_NONE;
1706
1707 if ((AuthnLevel == RPC_C_AUTHN_LEVEL_NONE) || (AuthnSvc == RPC_C_AUTHN_NONE))
1708 {
1709 if (bind->AuthInfo) RpcAuthInfo_Release(bind->AuthInfo);
1710 bind->AuthInfo = NULL;
1711 return RPC_S_OK;
1712 }
1713
1714 if (AuthnLevel > RPC_C_AUTHN_LEVEL_PKT_PRIVACY)
1715 {
1716 FIXME("unknown AuthnLevel %lu\n", AuthnLevel);
1718 }
1719
1720 /* RPC_C_AUTHN_WINNT ignores the AuthzSvr parameter */
1721 if (AuthzSvr && AuthnSvc != RPC_C_AUTHN_WINNT)
1722 {
1723 FIXME("unsupported AuthzSvr %lu\n", AuthzSvr);
1725 }
1726
1727 r = EnumerateSecurityPackagesA(&package_count, &packages);
1728 if (r != SEC_E_OK)
1729 {
1730 ERR("EnumerateSecurityPackagesA failed with error 0x%08lx\n", r);
1731 return RPC_S_SEC_PKG_ERROR;
1732 }
1733
1734 for (i = 0; i < package_count; i++)
1735 if (packages[i].wRPCID == AuthnSvc)
1736 break;
1737
1738 if (i == package_count)
1739 {
1740 FIXME("unsupported AuthnSvc %lu\n", AuthnSvc);
1741 FreeContextBuffer(packages);
1743 }
1744
1745 TRACE("found package %s for service %lu\n", packages[i].Name, AuthnSvc);
1747 AuthIdentity, NULL, NULL, &cred, &exp);
1748 cbMaxToken = packages[i].cbMaxToken;
1749 FreeContextBuffer(packages);
1750 if (r == ERROR_SUCCESS)
1751 {
1752 RpcAuthInfo *new_auth_info;
1753 r = RpcAuthInfo_Create(AuthnLevel, AuthnSvc, cred, exp, cbMaxToken,
1754 AuthIdentity, &new_auth_info);
1755 if (r == RPC_S_OK)
1756 {
1757 new_auth_info->server_principal_name = RPCRT4_strdupAtoW((char *)ServerPrincName);
1758 if (!ServerPrincName || new_auth_info->server_principal_name)
1759 {
1760 if (bind->AuthInfo) RpcAuthInfo_Release(bind->AuthInfo);
1761 bind->AuthInfo = new_auth_info;
1762 }
1763 else
1764 {
1765 RpcAuthInfo_Release(new_auth_info);
1767 }
1768 }
1769 else
1770 FreeCredentialsHandle(&cred);
1771 return r;
1772 }
1773 else
1774 {
1775 ERR("AcquireCredentialsHandleA failed with error 0x%08lx\n", r);
1776 return RPC_S_SEC_PKG_ERROR;
1777 }
1778}
#define ERR(fmt,...)
Definition: precomp.h:57
#define ERROR_SUCCESS
Definition: deptool.c:10
LPWSTR Name
Definition: desk.c:124
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
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
LONG SECURITY_STATUS
Definition: sspi.h:34
#define SECPKG_CRED_OUTBOUND
Definition: sspi.h:291
RPC_STATUS RpcAuthInfo_Create(ULONG AuthnLevel, ULONG AuthnSvc, CredHandle cred, TimeStamp exp, ULONG cbMaxToken, RPC_AUTH_IDENTITY_HANDLE identity, RpcAuthInfo **ret)
Definition: rpc_binding.c:1099
ULONG RpcAuthInfo_Release(RpcAuthInfo *AuthInfo)
Definition: rpc_binding.c:1170
static RPC_STATUS RpcQualityOfService_Create(const RPC_SECURITY_QOS *qos_src, BOOL unicode, RpcQualityOfService **qos_dst)
Definition: rpc_binding.c:1232
LPWSTR RPCRT4_strdupAtoW(LPCSTR src)
Definition: rpc_binding.c:57
ULONG RpcQualityOfService_Release(RpcQualityOfService *qos)
Definition: rpc_binding.c:1347
#define RPC_C_AUTHN_DEFAULT
Definition: rpcdce.h:165
#define RPC_C_AUTHN_LEVEL_PKT_PRIVACY
Definition: rpcdce.h:151
#define RPC_C_AUTHN_LEVEL_NONE
Definition: rpcdce.h:146
#define RPC_C_AUTHN_LEVEL_DEFAULT
Definition: rpcdce.h:145
#define RPC_C_AUTHN_INFO_TYPE_HTTP
Definition: rpcdce.h:195
#define RPC_C_AUTHN_NONE
Definition: rpcdce.h:153
SECURITY_STATUS WINAPI FreeContextBuffer(PVOID pv)
Definition: sspi.c:699
SECURITY_STATUS WINAPI EnumerateSecurityPackagesA(PULONG pcPackages, PSecPkgInfoA *ppPackageInfo)
Definition: sspi.c:855
SEC_WINNT_AUTH_IDENTITY_A * TransportCredentials
Definition: rpcdce.h:255
unsigned char * ServerCertificateSubject
Definition: rpcdce.h:260
ULONG AdditionalSecurityInfoType
Definition: rpcdce.h:289
union _RPC_SECURITY_QOS_V2_A::@3415 u
RPC_HTTP_TRANSPORT_CREDENTIALS_A * HttpCredentials
Definition: rpcdce.h:292
ULONG ImpersonationType
Definition: rpcdce.h:267
ULONG Capabilities
Definition: rpcdce.h:265
ULONG IdentityTracking
Definition: rpcdce.h:266
ULONG cbMaxToken
Definition: sspi.h:107
#define SEC_E_OK
Definition: winerror.h:3450
#define RPC_S_UNKNOWN_AUTHN_LEVEL
Definition: winerror.h:1413
#define RPC_S_UNKNOWN_AUTHN_SERVICE
Definition: winerror.h:1412
#define RPC_S_SEC_PKG_ERROR
Definition: winerror.h:1489
#define RPC_S_UNKNOWN_AUTHZ_SERVICE
Definition: winerror.h:1415
SECURITY_STATUS WINAPI AcquireCredentialsHandleA(SEC_CHAR *pszPrincipal, SEC_CHAR *pszPackage, ULONG fCredentialsUse, PLUID pvLogonID, PVOID pAuthData, SEC_GET_KEY_FN pGetKeyFn, PVOID pvGetKeyArgument, PCredHandle phCredential, PTimeStamp ptsExpiry)
Definition: wrapper.c:59

Referenced by RpcBindingSetAuthInfoA().

◆ RpcBindingSetAuthInfoExW()

RPCRTAPI RPC_STATUS RPC_ENTRY RpcBindingSetAuthInfoExW ( RPC_BINDING_HANDLE  Binding,
RPC_WSTR  ServerPrincName,
ULONG  AuthnLevel,
ULONG  AuthnSvc,
RPC_AUTH_IDENTITY_HANDLE  AuthIdentity,
ULONG  AuthzSvr,
RPC_SECURITY_QOS SecurityQos 
)

Definition at line 1784 of file rpc_binding.c.

1787{
1790 CredHandle cred;
1791 TimeStamp exp;
1792 ULONG package_count;
1793 ULONG i;
1794 PSecPkgInfoW packages;
1795 ULONG cbMaxToken;
1796
1797 TRACE("%p %s %lu %lu %p %lu %p\n", Binding, debugstr_w(ServerPrincName),
1798 AuthnLevel, AuthnSvc, AuthIdentity, AuthzSvr, SecurityQos);
1799
1800 if (SecurityQos)
1801 {
1803
1804 TRACE("SecurityQos { Version=%ld, Capabilities=0x%lx, IdentityTracking=%ld, ImpersonationLevel=%ld",
1805 SecurityQos->Version, SecurityQos->Capabilities, SecurityQos->IdentityTracking, SecurityQos->ImpersonationType);
1806 if (SecurityQos->Version >= 2)
1807 {
1808 const RPC_SECURITY_QOS_V2_W *SecurityQos2 = (const RPC_SECURITY_QOS_V2_W *)SecurityQos;
1809 TRACE(", AdditionalSecurityInfoType=%ld", SecurityQos2->AdditionalSecurityInfoType);
1811 TRACE(", { %p, 0x%lx, %ld, %ld, %p(%lu), %s }",
1812 SecurityQos2->u.HttpCredentials->TransportCredentials,
1813 SecurityQos2->u.HttpCredentials->Flags,
1814 SecurityQos2->u.HttpCredentials->AuthenticationTarget,
1815 SecurityQos2->u.HttpCredentials->NumberOfAuthnSchemes,
1816 SecurityQos2->u.HttpCredentials->AuthnSchemes,
1817 SecurityQos2->u.HttpCredentials->AuthnSchemes ? *SecurityQos2->u.HttpCredentials->AuthnSchemes : 0,
1819 }
1820 TRACE("}\n");
1821 status = RpcQualityOfService_Create(SecurityQos, TRUE, &bind->QOS);
1822 if (status != RPC_S_OK)
1823 return status;
1824 }
1825 else
1826 {
1827 if (bind->QOS) RpcQualityOfService_Release(bind->QOS);
1828 bind->QOS = NULL;
1829 }
1830
1831 if (AuthnSvc == RPC_C_AUTHN_DEFAULT)
1832 AuthnSvc = RPC_C_AUTHN_WINNT;
1833
1834 /* FIXME: the mapping should probably be retrieved using SSPI somehow */
1835 if (AuthnLevel == RPC_C_AUTHN_LEVEL_DEFAULT)
1836 AuthnLevel = RPC_C_AUTHN_LEVEL_NONE;
1837
1838 if ((AuthnLevel == RPC_C_AUTHN_LEVEL_NONE) || (AuthnSvc == RPC_C_AUTHN_NONE))
1839 {
1840 if (bind->AuthInfo) RpcAuthInfo_Release(bind->AuthInfo);
1841 bind->AuthInfo = NULL;
1842 return RPC_S_OK;
1843 }
1844
1845 if (AuthnLevel > RPC_C_AUTHN_LEVEL_PKT_PRIVACY)
1846 {
1847 FIXME("unknown AuthnLevel %lu\n", AuthnLevel);
1849 }
1850
1851 /* RPC_C_AUTHN_WINNT ignores the AuthzSvr parameter */
1852 if (AuthzSvr && AuthnSvc != RPC_C_AUTHN_WINNT)
1853 {
1854 FIXME("unsupported AuthzSvr %lu\n", AuthzSvr);
1856 }
1857
1858 r = EnumerateSecurityPackagesW(&package_count, &packages);
1859 if (r != SEC_E_OK)
1860 {
1861 ERR("EnumerateSecurityPackagesW failed with error 0x%08lx\n", r);
1862 return RPC_S_SEC_PKG_ERROR;
1863 }
1864
1865 for (i = 0; i < package_count; i++)
1866 if (packages[i].wRPCID == AuthnSvc)
1867 break;
1868
1869 if (i == package_count)
1870 {
1871 FIXME("unsupported AuthnSvc %lu\n", AuthnSvc);
1872 FreeContextBuffer(packages);
1874 }
1875
1876 TRACE("found package %s for service %lu\n", debugstr_w(packages[i].Name), AuthnSvc);
1878 AuthIdentity, NULL, NULL, &cred, &exp);
1879 cbMaxToken = packages[i].cbMaxToken;
1880 FreeContextBuffer(packages);
1881 if (r == ERROR_SUCCESS)
1882 {
1883 RpcAuthInfo *new_auth_info;
1884 r = RpcAuthInfo_Create(AuthnLevel, AuthnSvc, cred, exp, cbMaxToken,
1885 AuthIdentity, &new_auth_info);
1886 if (r == RPC_S_OK)
1887 {
1888 new_auth_info->server_principal_name = wcsdup(ServerPrincName);
1889 if (!ServerPrincName || new_auth_info->server_principal_name)
1890 {
1891 if (bind->AuthInfo) RpcAuthInfo_Release(bind->AuthInfo);
1892 bind->AuthInfo = new_auth_info;
1893 }
1894 else
1895 {
1896 RpcAuthInfo_Release(new_auth_info);
1898 }
1899 }
1900 else
1901 FreeCredentialsHandle(&cred);
1902 return r;
1903 }
1904 else
1905 {
1906 ERR("AcquireCredentialsHandleW failed with error 0x%08lx\n", r);
1907 return RPC_S_SEC_PKG_ERROR;
1908 }
1909}
SECURITY_STATUS WINAPI EnumerateSecurityPackagesW(PULONG pcPackages, PSecPkgInfoW *ppPackageInfo)
Definition: sspi.c:709
SEC_WINNT_AUTH_IDENTITY_W * TransportCredentials
Definition: rpcdce.h:245
unsigned short * ServerCertificateSubject
Definition: rpcdce.h:250
union _RPC_SECURITY_QOS_V2_W::@3414 u
RPC_HTTP_TRANSPORT_CREDENTIALS_W * HttpCredentials
Definition: rpcdce.h:279
ULONG AdditionalSecurityInfoType
Definition: rpcdce.h:276
ULONG cbMaxToken
Definition: sspi.h:117
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

Referenced by RpcBindingSetAuthInfoW().

◆ RpcBindingSetAuthInfoW()

RPCRTAPI RPC_STATUS RPC_ENTRY RpcBindingSetAuthInfoW ( RPC_BINDING_HANDLE  Binding,
RPC_WSTR  ServerPrincName,
ULONG  AuthnLevel,
ULONG  AuthnSvc,
RPC_AUTH_IDENTITY_HANDLE  AuthIdentity,
ULONG  AuthzSvr 
)

Definition at line 1927 of file rpc_binding.c.

1929{
1930 TRACE("%p %s %lu %lu %p %lu\n", Binding, debugstr_w(ServerPrincName),
1931 AuthnLevel, AuthnSvc, AuthIdentity, AuthzSvr);
1932 return RpcBindingSetAuthInfoExW(Binding, ServerPrincName, AuthnLevel, AuthnSvc, AuthIdentity, AuthzSvr, NULL);
1933}
RPCRTAPI RPC_STATUS RPC_ENTRY RpcBindingSetAuthInfoExW(RPC_BINDING_HANDLE Binding, RPC_WSTR ServerPrincName, ULONG AuthnLevel, ULONG AuthnSvc, RPC_AUTH_IDENTITY_HANDLE AuthIdentity, ULONG AuthzSvr, RPC_SECURITY_QOS *SecurityQos)
Definition: rpc_binding.c:1784

◆ RpcBindingSetObject()

RPC_STATUS WINAPI RpcBindingSetObject ( RPC_BINDING_HANDLE  Binding,
UUID ObjectUuid 
)

Definition at line 810 of file rpc_binding.c.

811{
813
814 TRACE("(%p,%s)\n", Binding, debugstr_guid(ObjectUuid));
815 if (bind->server) return RPC_S_WRONG_KIND_OF_BINDING;
816 return RPCRT4_SetBindingObject(Binding, ObjectUuid);
817}
#define RPC_S_WRONG_KIND_OF_BINDING
Definition: winerror.h:1368

Referenced by RPC_CreateClientChannel().

◆ RpcBindingSetOption()

RPC_STATUS WINAPI RpcBindingSetOption ( RPC_BINDING_HANDLE  BindingHandle,
ULONG  Option,
ULONG_PTR  OptionValue 
)

Definition at line 1938 of file rpc_binding.c.

1939{
1940 TRACE("(%p, %ld, %Id)\n", BindingHandle, Option, OptionValue);
1941
1942 switch (Option)
1943 {
1945 {
1948 int len = MultiByteToWideChar(CP_ACP, 0, cookie->Buffer, cookie->BufferSize, NULL, 0);
1949 WCHAR *str;
1950
1951 if (!(str = malloc((len + 1) * sizeof(WCHAR)))) return RPC_S_OUT_OF_MEMORY;
1952 MultiByteToWideChar(CP_ACP, 0, cookie->Buffer, cookie->BufferSize, str, len);
1953 str[len] = 0;
1954 free(binding->CookieAuth);
1955 binding->CookieAuth = str;
1956 break;
1957 }
1958 default:
1959 FIXME("option %lu not supported\n", Option);
1960 break;
1961 }
1962 return RPC_S_OK;
1963}
#define CP_ACP
Definition: compat.h:109
#define MultiByteToWideChar
Definition: compat.h:110
GLenum GLsizei len
Definition: glext.h:6722
const WCHAR * str
#define RPC_C_OPT_COOKIE_AUTH
Definition: rpcdcep.h:127
Definition: cookie.c:34
_In_ ULONG _Out_ HANDLE * BindingHandle
Definition: tdikrnl.h:1147
__wchar_t WCHAR
Definition: xmlstorage.h:180

◆ RpcBindingToStringBindingA()

RPC_STATUS WINAPI RpcBindingToStringBindingA ( RPC_BINDING_HANDLE  Binding,
RPC_CSTR StringBinding 
)

Definition at line 902 of file rpc_binding.c.

903{
906 RPC_CSTR ObjectUuid;
907
908 TRACE("(%p,%p)\n", Binding, StringBinding);
909
910 if (UuidIsNil(&bind->ObjectUuid, &ret))
911 ObjectUuid = NULL;
912 else
913 {
914 ret = UuidToStringA(&bind->ObjectUuid, &ObjectUuid);
915 if (ret != RPC_S_OK) return ret;
916 }
917
918 ret = RpcStringBindingComposeA(ObjectUuid, (unsigned char*)bind->Protseq, (unsigned char*) bind->NetworkAddr,
919 (unsigned char*) bind->Endpoint, NULL, StringBinding);
920
921 RpcStringFreeA(&ObjectUuid);
922
923 return ret;
924}
RPC_STATUS WINAPI RpcStringBindingComposeA(RPC_CSTR ObjUuid, RPC_CSTR Protseq, RPC_CSTR NetworkAddr, RPC_CSTR Endpoint, RPC_CSTR Options, RPC_CSTR *StringBinding)
Definition: rpc_binding.c:440
RPC_STATUS WINAPI UuidToStringA(UUID *Uuid, RPC_CSTR *StringUuid)
Definition: rpcrt4_main.c:539
int WINAPI UuidIsNil(UUID *Uuid, RPC_STATUS *Status)
Definition: rpcrt4_main.c:293

Referenced by RpcBindingToStringBindingW(), s_context_handle_test(), test_RpcServerUseProtseq(), and test_RpcStringBindingFromBinding().

◆ RpcBindingToStringBindingW()

RPC_STATUS WINAPI RpcBindingToStringBindingW ( RPC_BINDING_HANDLE  Binding,
RPC_WSTR StringBinding 
)

Definition at line 929 of file rpc_binding.c.

930{
932 unsigned char *str = NULL;
933 TRACE("(%p,%p)\n", Binding, StringBinding);
935 *StringBinding = RPCRT4_strdupAtoW((char*)str);
937 return ret;
938}
RPC_STATUS WINAPI RpcBindingToStringBindingA(RPC_BINDING_HANDLE Binding, RPC_CSTR *StringBinding)
Definition: rpc_binding.c:902

Referenced by CreateJob().

◆ RpcBindingVectorFree()

RPC_STATUS WINAPI RpcBindingVectorFree ( RPC_BINDING_VECTOR **  BindingVector)

Definition at line 784 of file rpc_binding.c.

785{
786 ULONG c;
787
788 TRACE("(%p)\n", BindingVector);
789 for (c=0; c<(*BindingVector)->Count; c++) RpcBindingFree(&(*BindingVector)->BindingH[c]);
790 free(*BindingVector);
791 *BindingVector = NULL;
792 return RPC_S_OK;
793}
const GLubyte * c
Definition: glext.h:8905
#define c
Definition: ke_i.h:80
RPC_STATUS WINAPI RpcBindingFree(RPC_BINDING_HANDLE *Binding)
Definition: rpc_binding.c:769

Referenced by test_endpoint_mapper(), and test_RpcServerUseProtseq().

◆ RpcImpersonateClient()

RPC_STATUS WINAPI RpcImpersonateClient ( RPC_BINDING_HANDLE  BindingHandle)

Definition at line 1038 of file rpc_binding.c.

1039{
1041
1042 TRACE("(%p)\n", BindingHandle);
1043
1046
1048 if (bind->FromConn)
1049 return rpcrt4_conn_impersonate_client(bind->FromConn);
1051}
static RPC_STATUS rpcrt4_conn_impersonate_client(RpcConnection *conn)
Definition: rpc_binding.h:237

Referenced by _RpcAbortPrinter(), _RpcAddForm(), _RpcAddJob(), _RpcAddMonitor(), _RpcAddPort(), _RpcAddPortEx(), _RpcAddPrinterDriver(), _RpcAddPrinterDriverEx(), _RpcAddPrintProcessor(), _RpcAddPrintProvidor(), _RpcClosePrinter(), _RpcCloseSpoolFileHandle(), _RpcCommitSpoolData(), _RpcCommitSpoolData2(), _RpcConfigurePort(), _RpcDeleteForm(), _RpcDeleteMonitor(), _RpcDeletePort(), _RpcDeletePrinter(), _RpcDeletePrinterDriver(), _RpcDeletePrinterDriverEx(), _RpcDeletePrintProcessor(), _RpcDeletePrintProvidor(), _RpcEndDocPrinter(), _RpcEndPagePrinter(), _RpcEnumForms(), _RpcEnumJobs(), _RpcEnumMonitors(), _RpcEnumPorts(), _RpcEnumPrinterDrivers(), _RpcEnumPrinters(), _RpcEnumPrintProcessorDatatypes(), _RpcEnumPrintProcessors(), _RpcGetForm(), _RpcGetJob(), _RpcGetPrinter(), _RpcGetPrinterDataEx(), _RpcGetPrinterDriver(), _RpcGetPrinterDriver2(), _RpcGetPrinterDriverDirectory(), _RpcGetPrintProcessorDirectory(), _RpcGetSpoolFileInfo(), _RpcGetSpoolFileInfo2(), _RpcOpenPrinter(), _RpcPrinterMessageBox(), _RpcReadPrinter(), _RpcResetPrinterEx(), _RpcScheduleJob(), _RpcSeekPrinter(), _RpcSetForm(), _RpcSetJob(), _RpcSetPort(), _RpcSetPrinterDataEx(), _RpcSpoolerInit(), _RpcStartDocPrinter(), _RpcStartPagePrinter(), _RpcWritePrinter(), _RpcXcvData(), IsCallerInteractive(), LsarSetSecurityObject(), NetpGetClientLogonId(), RSetServiceObjectSecurity(), s_authinfo_test(), and YGetPrinterDriver2().

◆ RpcMgmtSetComTimeout()

RPC_STATUS WINAPI RpcMgmtSetComTimeout ( RPC_BINDING_HANDLE  BindingHandle,
unsigned int  Timeout 
)

Definition at line 1454 of file rpc_binding.c.

1455{
1456 FIXME("(%p, %d): stub\n", BindingHandle, Timeout);
1457 return RPC_S_OK;
1458}
static ULONG Timeout
Definition: ping.c:61

◆ RpcQualityOfService_AddRef()

ULONG RpcQualityOfService_AddRef ( RpcQualityOfService qos)

Definition at line 1342 of file rpc_binding.c.

1343{
1344 return InterlockedIncrement(&qos->refs);
1345}

Referenced by RpcBindingCopy(), and RPCRT4_CreateConnection().

◆ RpcQualityOfService_Create()

static RPC_STATUS RpcQualityOfService_Create ( const RPC_SECURITY_QOS qos_src,
BOOL  unicode,
RpcQualityOfService **  qos_dst 
)
static

Definition at line 1232 of file rpc_binding.c.

1233{
1234 RpcQualityOfService *qos = malloc(sizeof(*qos));
1235
1236 if (!qos)
1238
1239 qos->refs = 1;
1240 qos->qos = malloc(sizeof(*qos->qos));
1241 if (!qos->qos) goto error;
1242 qos->qos->Version = qos_src->Version;
1243 qos->qos->Capabilities = qos_src->Capabilities;
1244 qos->qos->IdentityTracking = qos_src->IdentityTracking;
1245 qos->qos->ImpersonationType = qos_src->ImpersonationType;
1247
1248 if (qos_src->Version >= 2)
1249 {
1250 const RPC_SECURITY_QOS_V2_W *qos_src2 = (const RPC_SECURITY_QOS_V2_W *)qos_src;
1253 {
1254 const RPC_HTTP_TRANSPORT_CREDENTIALS_W *http_credentials_src = qos_src2->u.HttpCredentials;
1255 RPC_HTTP_TRANSPORT_CREDENTIALS_W *http_credentials_dst;
1256
1257 http_credentials_dst = malloc(sizeof(*http_credentials_dst));
1258 qos->qos->u.HttpCredentials = http_credentials_dst;
1259 if (!http_credentials_dst) goto error;
1260 http_credentials_dst->TransportCredentials = NULL;
1261 http_credentials_dst->Flags = http_credentials_src->Flags;
1262 http_credentials_dst->AuthenticationTarget = http_credentials_src->AuthenticationTarget;
1263 http_credentials_dst->NumberOfAuthnSchemes = http_credentials_src->NumberOfAuthnSchemes;
1264 http_credentials_dst->AuthnSchemes = NULL;
1265 http_credentials_dst->ServerCertificateSubject = NULL;
1266 if (http_credentials_src->TransportCredentials)
1267 {
1268 SEC_WINNT_AUTH_IDENTITY_W *cred_dst;
1269 cred_dst = http_credentials_dst->TransportCredentials = calloc(1, sizeof(*cred_dst));
1270 if (!cred_dst) goto error;
1272 if (unicode)
1273 {
1274 const SEC_WINNT_AUTH_IDENTITY_W *cred_src = http_credentials_src->TransportCredentials;
1275 cred_dst->UserLength = cred_src->UserLength;
1276 cred_dst->PasswordLength = cred_src->PasswordLength;
1277 cred_dst->DomainLength = cred_src->DomainLength;
1278 cred_dst->User = RPCRT4_strndupW(cred_src->User, cred_src->UserLength);
1279 cred_dst->Password = RPCRT4_strndupW(cred_src->Password, cred_src->PasswordLength);
1280 cred_dst->Domain = RPCRT4_strndupW(cred_src->Domain, cred_src->DomainLength);
1281 }
1282 else
1283 {
1284 const SEC_WINNT_AUTH_IDENTITY_A *cred_src = (const SEC_WINNT_AUTH_IDENTITY_A *)http_credentials_src->TransportCredentials;
1285 cred_dst->UserLength = MultiByteToWideChar(CP_ACP, 0, (char *)cred_src->User, cred_src->UserLength, NULL, 0);
1286 cred_dst->DomainLength = MultiByteToWideChar(CP_ACP, 0, (char *)cred_src->Domain, cred_src->DomainLength, NULL, 0);
1287 cred_dst->PasswordLength = MultiByteToWideChar(CP_ACP, 0, (char *)cred_src->Password, cred_src->PasswordLength, NULL, 0);
1288 cred_dst->User = malloc(cred_dst->UserLength * sizeof(WCHAR));
1289 cred_dst->Password = malloc(cred_dst->PasswordLength * sizeof(WCHAR));
1290 cred_dst->Domain = malloc(cred_dst->DomainLength * sizeof(WCHAR));
1291 if (!cred_dst->Password || !cred_dst->Domain) goto error;
1292 MultiByteToWideChar(CP_ACP, 0, (char *)cred_src->User, cred_src->UserLength, cred_dst->User, cred_dst->UserLength);
1293 MultiByteToWideChar(CP_ACP, 0, (char *)cred_src->Domain, cred_src->DomainLength, cred_dst->Domain, cred_dst->DomainLength);
1294 MultiByteToWideChar(CP_ACP, 0, (char *)cred_src->Password, cred_src->PasswordLength, cred_dst->Password, cred_dst->PasswordLength);
1295 }
1296 }
1297 if (http_credentials_src->NumberOfAuthnSchemes)
1298 {
1299 http_credentials_dst->AuthnSchemes = malloc(http_credentials_src->NumberOfAuthnSchemes * sizeof(*http_credentials_dst->AuthnSchemes));
1300 if (!http_credentials_dst->AuthnSchemes) goto error;
1301 memcpy(http_credentials_dst->AuthnSchemes, http_credentials_src->AuthnSchemes, http_credentials_src->NumberOfAuthnSchemes * sizeof(*http_credentials_dst->AuthnSchemes));
1302 }
1303 if (http_credentials_src->ServerCertificateSubject)
1304 {
1305 if (unicode)
1306 http_credentials_dst->ServerCertificateSubject =
1307 RPCRT4_strndupW(http_credentials_src->ServerCertificateSubject,
1308 lstrlenW(http_credentials_src->ServerCertificateSubject));
1309 else
1310 http_credentials_dst->ServerCertificateSubject =
1311 RPCRT4_strdupAtoW((char *)http_credentials_src->ServerCertificateSubject);
1312 if (!http_credentials_dst->ServerCertificateSubject) goto error;
1313 }
1314 }
1315 }
1316 *qos_dst = qos;
1317 return RPC_S_OK;
1318
1319error:
1320 if (qos->qos)
1321 {
1323 qos->qos->u.HttpCredentials)
1324 {
1326 {
1331 }
1334 free(qos->qos->u.HttpCredentials);
1335 }
1336 free(qos->qos);
1337 }
1338 free(qos);
1340}
#define lstrlenW
Definition: compat.h:750
#define error(str)
Definition: mkdosfs.c:1605
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
#define calloc
Definition: rosglue.h:14
RPC_SECURITY_QOS_V2_W * qos
Definition: rpc_binding.h:57
unsigned char * Domain
Definition: rpcdce.h:236
unsigned char * User
Definition: rpcdce.h:234
unsigned char * Password
Definition: rpcdce.h:238
#define RPC_S_OUT_OF_RESOURCES
Definition: winerror.h:1388

Referenced by RpcBindingSetAuthInfoExA(), and RpcBindingSetAuthInfoExW().

◆ RpcQualityOfService_IsEqual()

BOOL RpcQualityOfService_IsEqual ( const RpcQualityOfService qos1,
const RpcQualityOfService qos2 
)

Definition at line 1372 of file rpc_binding.c.

1373{
1374 if (qos1 == qos2)
1375 return TRUE;
1376
1377 if (!qos1 || !qos2)
1378 return FALSE;
1379
1380 TRACE("qos1 = { %ld %ld %ld %ld }, qos2 = { %ld %ld %ld %ld }\n",
1381 qos1->qos->Capabilities, qos1->qos->IdentityTracking,
1383 qos2->qos->Capabilities, qos2->qos->IdentityTracking,
1385
1386 if ((qos1->qos->Capabilities != qos2->qos->Capabilities) ||
1387 (qos1->qos->IdentityTracking != qos2->qos->IdentityTracking) ||
1388 (qos1->qos->ImpersonationType != qos2->qos->ImpersonationType) ||
1390 return FALSE;
1391
1393 {
1394 const RPC_HTTP_TRANSPORT_CREDENTIALS_W *http_credentials1 = qos1->qos->u.HttpCredentials;
1395 const RPC_HTTP_TRANSPORT_CREDENTIALS_W *http_credentials2 = qos2->qos->u.HttpCredentials;
1396
1397 if (http_credentials1->Flags != http_credentials2->Flags)
1398 return FALSE;
1399
1400 if (http_credentials1->AuthenticationTarget != http_credentials2->AuthenticationTarget)
1401 return FALSE;
1402
1403 if (http_credentials1->NumberOfAuthnSchemes != http_credentials2->NumberOfAuthnSchemes)
1404 return FALSE;
1405
1406 if ((!http_credentials1->AuthnSchemes && http_credentials2->AuthnSchemes) ||
1407 (http_credentials1->AuthnSchemes && !http_credentials2->AuthnSchemes))
1408 return FALSE;
1409
1410 if (memcmp(http_credentials1->AuthnSchemes, http_credentials2->AuthnSchemes,
1411 http_credentials1->NumberOfAuthnSchemes * sizeof(http_credentials1->AuthnSchemes[0])))
1412 return FALSE;
1413
1414 /* server certificate subject not currently used */
1415
1416 if (http_credentials1->TransportCredentials != http_credentials2->TransportCredentials)
1417 {
1418 const SEC_WINNT_AUTH_IDENTITY_W *identity1 = http_credentials1->TransportCredentials;
1419 const SEC_WINNT_AUTH_IDENTITY_W *identity2 = http_credentials2->TransportCredentials;
1420
1421 if (!identity1 || !identity2)
1422 return FALSE;
1423
1424 /* compare user names */
1425 if (identity1->UserLength != identity2->UserLength ||
1426 memcmp(identity1->User, identity2->User, identity1->UserLength))
1427 return FALSE;
1428 /* compare domain names */
1429 if (identity1->DomainLength != identity2->DomainLength ||
1430 memcmp(identity1->Domain, identity2->Domain, identity1->DomainLength))
1431 return FALSE;
1432 /* compare passwords */
1433 if (identity1->PasswordLength != identity2->PasswordLength ||
1434 memcmp(identity1->Password, identity2->Password, identity1->PasswordLength))
1435 return FALSE;
1436 }
1437 }
1438
1439 return TRUE;
1440}

Referenced by RpcAssoc_GetIdleConnection().

◆ RpcQualityOfService_Release()

ULONG RpcQualityOfService_Release ( RpcQualityOfService qos)

Definition at line 1347 of file rpc_binding.c.

1348{
1349 ULONG refs = InterlockedDecrement(&qos->refs);
1350
1351 if (!refs)
1352 {
1354 {
1356 {
1361 }
1364 free(qos->qos->u.HttpCredentials);
1365 }
1366 free(qos->qos);
1367 free(qos);
1368 }
1369 return refs;
1370}

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

◆ RpcRevertToSelf()

RPC_STATUS WINAPI RpcRevertToSelf ( void  )

Definition at line 1445 of file rpc_binding.c.

1446{
1447 TRACE("\n");
1448 return RpcRevertToSelfEx(NULL);
1449}
RPC_STATUS WINAPI RpcRevertToSelfEx(RPC_BINDING_HANDLE BindingHandle)
Definition: rpc_binding.c:1071

Referenced by _RpcAbortPrinter(), _RpcAddForm(), _RpcAddJob(), _RpcAddMonitor(), _RpcAddPort(), _RpcAddPortEx(), _RpcAddPrinterDriver(), _RpcAddPrinterDriverEx(), _RpcAddPrintProcessor(), _RpcAddPrintProvidor(), _RpcClosePrinter(), _RpcCloseSpoolFileHandle(), _RpcCommitSpoolData(), _RpcCommitSpoolData2(), _RpcConfigurePort(), _RpcDeleteForm(), _RpcDeleteMonitor(), _RpcDeletePort(), _RpcDeletePrinter(), _RpcDeletePrinterDriver(), _RpcDeletePrinterDriverEx(), _RpcDeletePrintProcessor(), _RpcDeletePrintProvidor(), _RpcEndDocPrinter(), _RpcEndPagePrinter(), _RpcEnumForms(), _RpcEnumJobs(), _RpcEnumMonitors(), _RpcEnumPorts(), _RpcEnumPrinterDrivers(), _RpcEnumPrinters(), _RpcEnumPrintProcessorDatatypes(), _RpcEnumPrintProcessors(), _RpcGetForm(), _RpcGetJob(), _RpcGetPrinter(), _RpcGetPrinterDataEx(), _RpcGetPrinterDriver(), _RpcGetPrinterDriver2(), _RpcGetPrinterDriverDirectory(), _RpcGetPrintProcessorDirectory(), _RpcGetSpoolFileInfo(), _RpcGetSpoolFileInfo2(), _RpcOpenPrinter(), _RpcPrinterMessageBox(), _RpcReadPrinter(), _RpcResetPrinterEx(), _RpcScheduleJob(), _RpcSeekPrinter(), _RpcSetForm(), _RpcSetJob(), _RpcSetPort(), _RpcSetPrinterDataEx(), _RpcSpoolerInit(), _RpcStartDocPrinter(), _RpcStartPagePrinter(), _RpcWritePrinter(), _RpcXcvData(), IsCallerInteractive(), LsarSetSecurityObject(), NetpGetClientLogonId(), RSetServiceObjectSecurity(), s_authinfo_test(), and YGetPrinterDriver2().

◆ RpcRevertToSelfEx()

RPC_STATUS WINAPI RpcRevertToSelfEx ( RPC_BINDING_HANDLE  BindingHandle)

Definition at line 1071 of file rpc_binding.c.

1072{
1074
1075 TRACE("(%p)\n", BindingHandle);
1076
1079
1081 if (bind->FromConn)
1082 return rpcrt4_conn_revert_to_self(bind->FromConn);
1084}
static RPC_STATUS rpcrt4_conn_revert_to_self(RpcConnection *conn)
Definition: rpc_binding.h:243

Referenced by RpcRevertToSelf().

◆ RPCRT4_AddRefBinding()

void RPCRT4_AddRefBinding ( RpcBinding Binding)

Definition at line 232 of file rpc_binding.c.

233{
235}

Referenced by I_RpcNegotiateTransferSyntax().

◆ RPCRT4_AllocBinding()

static RPC_STATUS RPCRT4_AllocBinding ( RpcBinding **  Binding,
BOOL  server 
)
static

Definition at line 92 of file rpc_binding.c.

93{
94 RpcBinding* NewBinding;
95
96 NewBinding = calloc(1, sizeof(RpcBinding));
97 NewBinding->refs = 1;
98 NewBinding->server = server;
99
100 *Binding = NewBinding;
101
102 return RPC_S_OK;
103}
static rfbScreenInfoPtr server
Definition: vnc.c:74

Referenced by RpcBindingCopy(), RpcBindingServerFromClient(), RPCRT4_CreateBindingA(), RPCRT4_CreateBindingW(), and RPCRT4_MakeBinding().

◆ RPCRT4_CloseBinding()

RPC_STATUS RPCRT4_CloseBinding ( RpcBinding Binding,
RpcConnection Connection 
)

Definition at line 276 of file rpc_binding.c.

277{
278 TRACE("(Binding == ^%p)\n", Binding);
279 if (!Connection) return RPC_S_OK;
280 if (Binding->server) {
281 /* don't destroy a connection that is cached in the binding */
282 if (Binding->FromConn != Connection)
283 RPCRT4_ReleaseConnection(Connection);
284 }
285 else {
286 RpcAssoc_ReleaseIdleConnection(Binding->Assoc, Connection);
287 }
288 return RPC_S_OK;
289}
void RpcAssoc_ReleaseIdleConnection(RpcAssoc *assoc, RpcConnection *Connection)
Definition: rpc_assoc.c:437
void RPCRT4_ReleaseConnection(RpcConnection *Connection)

Referenced by I_RpcFreeBuffer().

◆ RPCRT4_CompleteBindingA()

static RPC_STATUS RPCRT4_CompleteBindingA ( RpcBinding Binding,
LPCSTR  NetworkAddr,
LPCSTR  Endpoint,
LPCSTR  NetworkOptions 
)
static

Definition at line 131 of file rpc_binding.c.

133{
135
136 TRACE("(RpcBinding == ^%p, NetworkAddr == %s, EndPoint == %s, NetworkOptions == %s)\n", Binding,
137 debugstr_a(NetworkAddr), debugstr_a(Endpoint), debugstr_a(NetworkOptions));
138
139 free(Binding->NetworkAddr);
140 Binding->NetworkAddr = strdup(NetworkAddr);
141 free(Binding->Endpoint);
142 Binding->Endpoint = strdup(Endpoint);
143 free(Binding->NetworkOptions);
144 Binding->NetworkOptions = RPCRT4_strdupAtoW(NetworkOptions);
145
146 /* only attempt to get an association if the binding is complete */
147 if (Endpoint && Endpoint[0] != '\0')
148 {
149 status = RPCRT4_GetAssociation(Binding->Protseq, Binding->NetworkAddr,
150 Binding->Endpoint, Binding->NetworkOptions,
151 &Binding->Assoc);
152 if (status != RPC_S_OK)
153 return status;
154 }
155
156 return RPC_S_OK;
157}
RPC_STATUS RPCRT4_GetAssociation(LPCSTR Protseq, LPCSTR NetworkAddr, LPCSTR Endpoint, LPCWSTR NetworkOptions, RpcAssoc **assoc_out)
Definition: rpc_assoc.c:98

Referenced by RpcBindingFromStringBindingA().

◆ RPCRT4_CompleteBindingW()

static RPC_STATUS RPCRT4_CompleteBindingW ( RpcBinding Binding,
LPCWSTR  NetworkAddr,
LPCWSTR  Endpoint,
LPCWSTR  NetworkOptions 
)
static

Definition at line 159 of file rpc_binding.c.

161{
163
164 TRACE("(RpcBinding == ^%p, NetworkAddr == %s, EndPoint == %s, NetworkOptions == %s)\n", Binding,
165 debugstr_w(NetworkAddr), debugstr_w(Endpoint), debugstr_w(NetworkOptions));
166
167 free(Binding->NetworkAddr);
168 Binding->NetworkAddr = RPCRT4_strdupWtoA(NetworkAddr);
169 free(Binding->Endpoint);
170 Binding->Endpoint = RPCRT4_strdupWtoA(Endpoint);
171 free(Binding->NetworkOptions);
172 Binding->NetworkOptions = wcsdup(NetworkOptions);
173
174 /* only attempt to get an association if the binding is complete */
175 if (Endpoint && Endpoint[0] != '\0')
176 {
177 status = RPCRT4_GetAssociation(Binding->Protseq, Binding->NetworkAddr,
178 Binding->Endpoint, Binding->NetworkOptions,
179 &Binding->Assoc);
180 if (status != RPC_S_OK)
181 return status;
182 }
183
184 return RPC_S_OK;
185}

Referenced by RpcBindingFromStringBindingW().

◆ RPCRT4_CreateBindingA()

static RPC_STATUS RPCRT4_CreateBindingA ( RpcBinding **  Binding,
BOOL  server,
LPCSTR  Protseq 
)
static

Definition at line 105 of file rpc_binding.c.

106{
107 RpcBinding* NewBinding;
108
109 RPCRT4_AllocBinding(&NewBinding, server);
110 NewBinding->Protseq = strdup(Protseq);
111
112 TRACE("binding: %p\n", NewBinding);
113 *Binding = NewBinding;
114
115 return RPC_S_OK;
116}

Referenced by RpcBindingFromStringBindingA().

◆ RPCRT4_CreateBindingW()

static RPC_STATUS RPCRT4_CreateBindingW ( RpcBinding **  Binding,
BOOL  server,
LPCWSTR  Protseq 
)
static

Definition at line 118 of file rpc_binding.c.

119{
120 RpcBinding* NewBinding;
121
122 RPCRT4_AllocBinding(&NewBinding, server);
123 NewBinding->Protseq = RPCRT4_strdupWtoA(Protseq);
124
125 TRACE("binding: %p\n", NewBinding);
126 *Binding = NewBinding;
127
128 return RPC_S_OK;
129}

Referenced by RpcBindingFromStringBindingW().

◆ RPCRT4_MakeBinding()

RPC_STATUS RPCRT4_MakeBinding ( RpcBinding **  Binding,
RpcConnection Connection 
)

Definition at line 215 of file rpc_binding.c.

216{
217 RpcBinding* NewBinding;
218 TRACE("(RpcBinding == ^%p, Connection == ^%p)\n", Binding, Connection);
219
220 RPCRT4_AllocBinding(&NewBinding, Connection->server);
221 NewBinding->Protseq = strdup(rpcrt4_conn_get_name(Connection));
222 NewBinding->NetworkAddr = strdup(Connection->NetworkAddr);
223 NewBinding->Endpoint = strdup(Connection->Endpoint);
224 NewBinding->FromConn = Connection;
225
226 TRACE("binding: %p\n", NewBinding);
227 *Binding = NewBinding;
228
229 return RPC_S_OK;
230}
static const char * rpcrt4_conn_get_name(const RpcConnection *Connection)
Definition: rpc_binding.h:179
RpcConnection * FromConn
Definition: rpc_binding.h:137
LPSTR NetworkAddr
Definition: rpc_binding.h:67

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 255 of file rpc_binding.c.

258{
259 TRACE("(Binding == ^%p)\n", Binding);
260
261 if (!Binding->server) {
262 return RpcAssoc_GetClientConnection(Binding->Assoc, InterfaceId,
263 TransferSyntax, Binding->AuthInfo, Binding->QOS, Binding->CookieAuth, Connection, from_cache);
264 } else {
265 /* we already have a connection with acceptable binding, so use it */
266 if (Binding->FromConn) {
267 *Connection = Binding->FromConn;
268 return RPC_S_OK;
269 } else {
270 ERR("no connection in binding\n");
272 }
273 }
274}
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:1431

Referenced by I_RpcNegotiateTransferSyntax(), and I_RpcSend().

◆ RPCRT4_ReleaseBinding()

RPC_STATUS RPCRT4_ReleaseBinding ( RpcBinding Binding)

Definition at line 237 of file rpc_binding.c.

238{
239 if (InterlockedDecrement(&Binding->refs))
240 return RPC_S_OK;
241
242 TRACE("binding: %p\n", Binding);
243 if (Binding->Assoc) RpcAssoc_Release(Binding->Assoc);
244 free(Binding->Endpoint);
245 free(Binding->NetworkAddr);
246 free(Binding->Protseq);
247 free(Binding->NetworkOptions);
248 free(Binding->CookieAuth);
249 if (Binding->AuthInfo) RpcAuthInfo_Release(Binding->AuthInfo);
251 free(Binding);
252 return RPC_S_OK;
253}

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

◆ RPCRT4_ResolveBinding()

RPC_STATUS RPCRT4_ResolveBinding ( RpcBinding Binding,
LPCSTR  Endpoint 
)

Definition at line 187 of file rpc_binding.c.

188{
190
191 TRACE("(RpcBinding == ^%p, EndPoint == \"%s\"\n", Binding, Endpoint);
192
193 free(Binding->Endpoint);
194 Binding->Endpoint = strdup(Endpoint);
195
196 if (Binding->Assoc) RpcAssoc_Release(Binding->Assoc);
197 Binding->Assoc = NULL;
198 status = RPCRT4_GetAssociation(Binding->Protseq, Binding->NetworkAddr,
199 Binding->Endpoint, Binding->NetworkOptions,
200 &Binding->Assoc);
201 if (status != RPC_S_OK)
202 return status;
203
204 return RPC_S_OK;
205}

Referenced by get_epm_handle_client(), and RpcEpResolveBinding().

◆ RPCRT4_SetBindingObject()

RPC_STATUS RPCRT4_SetBindingObject ( RpcBinding Binding,
const UUID ObjectUuid 
)

Definition at line 207 of file rpc_binding.c.

208{
209 TRACE("(*RpcBinding == ^%p, UUID == %s)\n", Binding, debugstr_guid(ObjectUuid));
210 if (ObjectUuid) Binding->ObjectUuid = *ObjectUuid;
211 else UuidCreateNil(&Binding->ObjectUuid);
212 return RPC_S_OK;
213}
RPC_STATUS WINAPI UuidCreateNil(UUID *Uuid)
Definition: rpcrt4_main.c:309

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

◆ RPCRT4_strconcatA()

static LPSTR RPCRT4_strconcatA ( LPSTR  dst,
LPCSTR  src 
)
static

Definition at line 291 of file rpc_binding.c.

292{
293 DWORD len = strlen(dst), slen = strlen(src);
294 char *ndst = realloc(dst, len + slen + 2);
295 if (!ndst)
296 {
297 free(dst);
298 return NULL;
299 }
300 ndst[len] = ',';
301 memcpy(ndst+len+1, src, slen+1);
302 return ndst;
303}
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
#define realloc
Definition: debug_ros.c:6
unsigned long DWORD
Definition: ntddk_ex.h:95
GLenum src
Definition: glext.h:6340
GLenum GLenum dst
Definition: glext.h:6340

Referenced by RpcStringBindingParseA().

◆ RPCRT4_strconcatW()

static LPWSTR RPCRT4_strconcatW ( LPWSTR  dst,
LPCWSTR  src 
)
static

Definition at line 305 of file rpc_binding.c.

306{
307 DWORD len = lstrlenW(dst), slen = lstrlenW(src);
308 WCHAR *ndst = realloc(dst, (len + slen + 2) * sizeof(WCHAR));
309 if (!ndst)
310 {
311 free(dst);
312 return NULL;
313 }
314 ndst[len] = ',';
315 memcpy(ndst+len+1, src, (slen+1)*sizeof(WCHAR));
316 return ndst;
317}

Referenced by RpcStringBindingParseW().

◆ RPCRT4_strdupAtoW()

LPWSTR RPCRT4_strdupAtoW ( LPCSTR  src)

Definition at line 57 of file rpc_binding.c.

58{
59 DWORD len;
60 LPWSTR s;
61 if (!src) return NULL;
62 len = MultiByteToWideChar(CP_ACP, 0, src, -1, NULL, 0);
63 s = malloc(len * sizeof(WCHAR));
65 return s;
66}
GLdouble s
Definition: gl.h:2039
WCHAR * LPWSTR
Definition: xmlstorage.h:184

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

◆ RPCRT4_strdupWtoA()

◆ RPCRT4_strndupAtoW()

static LPWSTR RPCRT4_strndupAtoW ( LPCSTR  src,
INT  slen 
)
static

Definition at line 68 of file rpc_binding.c.

69{
70 DWORD len;
71 LPWSTR s;
72 if (!src) return NULL;
73 len = MultiByteToWideChar(CP_ACP, 0, src, slen, NULL, 0);
74 s = malloc(len * sizeof(WCHAR));
75 MultiByteToWideChar(CP_ACP, 0, src, slen, s, len);
76 return s;
77}

Referenced by RpcAuthInfo_Create().

◆ RPCRT4_strndupW()

LPWSTR RPCRT4_strndupW ( LPCWSTR  src,
INT  slen 
)

Definition at line 79 of file rpc_binding.c.

80{
81 DWORD len;
82 LPWSTR s;
83 if (!src) return NULL;
84 if (slen == -1) slen = lstrlenW(src);
85 len = slen;
86 s = malloc((len + 1) * sizeof(WCHAR));
87 memcpy(s, src, len*sizeof(WCHAR));
88 s[len] = 0;
89 return s;
90}

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

◆ RpcStringBindingComposeA()

RPC_STATUS WINAPI RpcStringBindingComposeA ( RPC_CSTR  ObjUuid,
RPC_CSTR  Protseq,
RPC_CSTR  NetworkAddr,
RPC_CSTR  Endpoint,
RPC_CSTR  Options,
RPC_CSTR StringBinding 
)

Definition at line 440 of file rpc_binding.c.

443{
444 DWORD len = 1;
446
447 TRACE( "(%s,%s,%s,%s,%s,%p)\n",
448 debugstr_a( (char*)ObjUuid ), debugstr_a( (char*)Protseq ),
449 debugstr_a( (char*)NetworkAddr ), debugstr_a( (char*)Endpoint ),
450 debugstr_a( (char*)Options ), StringBinding );
451
452 /* overestimate for each component for escaping of delimiters */
453 if (ObjUuid && *ObjUuid) len += strlen((char*)ObjUuid) * 2 + 1;
454 if (Protseq && *Protseq) len += strlen((char*)Protseq) * 2 + 1;
455 if (NetworkAddr && *NetworkAddr) len += strlen((char*)NetworkAddr) * 2;
456 if (Endpoint && *Endpoint) len += strlen((char*)Endpoint) * 2 + 2;
457 if (Options && *Options) len += strlen((char*)Options) * 2 + 2;
458
459 data = malloc(len);
460 *StringBinding = data;
461
462 if (ObjUuid && *ObjUuid) {
464 *data++ = '@';
465 }
466 if (Protseq && *Protseq) {
468 *data++ = ':';
469 }
470 if (NetworkAddr && *NetworkAddr)
472
473 if ((Endpoint && *Endpoint) ||
474 (Options && *Options)) {
475 *data++ = '[';
476 if (Endpoint && *Endpoint) {
478 if (Options && *Options) *data++ = ',';
479 }
480 if (Options && *Options) {
482 }
483 *data++ = ']';
484 }
485 *data = 0;
486
487 return RPC_S_OK;
488}
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
static RPC_CSTR escape_string_binding_component(RPC_CSTR string_binding, const unsigned char *component)
Definition: rpc_binding.c:321

Referenced by client(), EVENTLOG_HANDLE_A_bind(), RpcBindingToStringBindingA(), SVCCTL_HANDLEA_bind(), test_endpoint_mapper(), test_ndr_buffer(), test_reconnect(), test_rpc_ncacn_ip_tcp(), test_RpcStringBindingFromBinding(), and test_server_listening().

◆ RpcStringBindingComposeW()

RPC_STATUS WINAPI RpcStringBindingComposeW ( RPC_WSTR  ObjUuid,
RPC_WSTR  Protseq,
RPC_WSTR  NetworkAddr,
RPC_WSTR  Endpoint,
RPC_WSTR  Options,
RPC_WSTR StringBinding 
)

Definition at line 493 of file rpc_binding.c.

496{
497 DWORD len = 1;
499
500 TRACE("(%s,%s,%s,%s,%s,%p)\n",
501 debugstr_w( ObjUuid ), debugstr_w( Protseq ),
502 debugstr_w( NetworkAddr ), debugstr_w( Endpoint ),
503 debugstr_w( Options ), StringBinding);
504
505 /* overestimate for each component for escaping of delimiters */
506 if (ObjUuid && *ObjUuid) len += lstrlenW(ObjUuid) * 2 + 1;
507 if (Protseq && *Protseq) len += lstrlenW(Protseq) * 2 + 1;
508 if (NetworkAddr && *NetworkAddr) len += lstrlenW(NetworkAddr) * 2;
509 if (Endpoint && *Endpoint) len += lstrlenW(Endpoint) * 2 + 2;
510 if (Options && *Options) len += lstrlenW(Options) * 2 + 2;
511
512 data = malloc(len * sizeof(WCHAR));
513 *StringBinding = data;
514
515 if (ObjUuid && *ObjUuid) {
517 *data++ = '@';
518 }
519 if (Protseq && *Protseq) {
521 *data++ = ':';
522 }
523 if (NetworkAddr && *NetworkAddr) {
525 }
526 if ((Endpoint && *Endpoint) ||
527 (Options && *Options)) {
528 *data++ = '[';
529 if (Endpoint && *Endpoint) {
531 if (Options && *Options) *data++ = ',';
532 }
533 if (Options && *Options) {
535 }
536 *data++ = ']';
537 }
538 *data = 0;
539
540 return RPC_S_OK;
541}
static RPC_WSTR escape_string_binding_componentW(RPC_WSTR string_binding, const WCHAR *component)
Definition: rpc_binding.c:342

Referenced by __wine_msi_call_dll_function(), ATSVC_HANDLE_bind(), BROWSER_IDENTIFY_HANDLE_bind(), CreateProcessWithLogonW(), DNSRSLVR_HANDLE_bind(), DsSetupBind(), EVENTLOG_HANDLE_W_bind(), get_irot_handle(), LOGONSRV_HANDLE_bind(), NetpBind(), PDHCP_SERVER_NAME_bind(), PLSAPR_SERVER_NAME_bind(), PnpBindRpc(), PREGISTRY_SERVER_NAME_bind(), PSAMPR_SERVER_NAME_bind(), RPC_CreateClientChannel(), ScCreateStatusBinding(), SRVSVC_HANDLE_bind(), SVCCTL_HANDLEW_bind(), WINSPOOL_HANDLE_bind(), WKSSVC_IDENTIFY_HANDLE_bind(), WKSSVC_IMPERSONATE_HANDLE_bind(), and WLANSVC_HANDLE_bind().

◆ RpcStringBindingParseA()

RPC_STATUS WINAPI RpcStringBindingParseA ( RPC_CSTR  StringBinding,
RPC_CSTR ObjUuid,
RPC_CSTR Protseq,
RPC_CSTR NetworkAddr,
RPC_CSTR Endpoint,
RPC_CSTR Options 
)

Definition at line 547 of file rpc_binding.c.

550{
551 const unsigned char *data, *next;
552 static const char ep_opt[] = "endpoint=";
553 BOOL endpoint_already_found = FALSE;
554
555 TRACE("(%s,%p,%p,%p,%p,%p)\n", debugstr_a((char*)StringBinding),
556 ObjUuid, Protseq, NetworkAddr, Endpoint, Options);
557
558 if (ObjUuid) *ObjUuid = NULL;
559 if (Protseq) *Protseq = NULL;
560 if (NetworkAddr) *NetworkAddr = NULL;
561 if (Endpoint) *Endpoint = NULL;
562 if (Options) *Options = NULL;
563
564 data = StringBinding;
565
567 if (next) {
568 UUID uuid;
571 status = UuidFromStringA(str_uuid, &uuid);
572 if (status != RPC_S_OK) {
573 free(str_uuid);
574 return status;
575 }
576 if (ObjUuid)
577 *ObjUuid = str_uuid;
578 else
579 free(str_uuid);
580 data = next+1;
581 }
582
584 if (next) {
585 if (Protseq) *Protseq = unescape_string_binding_component(data, next - data);
586 data = next+1;
587 } else {
588 goto fail;
589 }
590
592 if (next) {
593 const unsigned char *close;
594 RPC_CSTR opt;
595
596 if (NetworkAddr) *NetworkAddr = unescape_string_binding_component(data, next - data);
597 data = next+1;
599 if (!close) goto fail;
600
601 /* tokenize options */
602 while (data < close) {
604 if (!next || next > close) next = close;
605 /* FIXME: this is kind of inefficient */
607 data = next+1;
608
609 /* parse option */
611 if (!next) {
612 /* not an option, must be an endpoint */
613 if (endpoint_already_found) goto fail;
614 if (Endpoint) *Endpoint = opt;
615 else free(opt);
616 endpoint_already_found = TRUE;
617 } else {
618 if (strncmp((const char *)opt, ep_opt, strlen(ep_opt)) == 0) {
619 /* endpoint option */
620 if (endpoint_already_found) goto fail;
621 if (Endpoint) *Endpoint = unescape_string_binding_component(next+1, -1);
622 free(opt);
623 endpoint_already_found = TRUE;
624 } else {
625 /* network option */
626 if (Options) {
627 if (*Options) {
628 /* FIXME: this is kind of inefficient */
629 *Options = (unsigned char*) RPCRT4_strconcatA( (char*)*Options, (char *)opt);
630 free(opt);
631 } else
632 *Options = opt;
633 } else
634 free(opt);
635 }
636 }
637 }
638
639 data = close+1;
640 if (*data) goto fail;
641 }
642 else if (NetworkAddr)
643 *NetworkAddr = unescape_string_binding_component(data, -1);
644
645 return RPC_S_OK;
646
647fail:
648 if (ObjUuid) RpcStringFreeA(ObjUuid);
649 if (Protseq) RpcStringFreeA(Protseq);
650 if (NetworkAddr) RpcStringFreeA(NetworkAddr);
651 if (Endpoint) RpcStringFreeA(Endpoint);
654}
int strncmp(const char *String1, const char *String2, ACPI_SIZE Count)
Definition: utclib.c:534
#define close
Definition: acwin.h:98
unsigned int BOOL
Definition: ntddk_ex.h:94
Definition: msctf.idl:532
static unsigned __int64 next
Definition: rand_nt.c:6
static LPSTR RPCRT4_strconcatA(LPSTR dst, LPCSTR src)
Definition: rpc_binding.c:291
static const unsigned char * string_binding_find_delimiter(const unsigned char *string_binding, unsigned char delim)
Definition: rpc_binding.c:363
static RPC_CSTR unescape_string_binding_component(const unsigned char *string_binding, int len)
Definition: rpc_binding.c:393
#define RPC_S_INVALID_STRING_BINDING
Definition: winerror.h:1367

Referenced by RpcBindingFromStringBindingA(), s_context_handle_test(), and test_RpcStringBindingParseA().

◆ RpcStringBindingParseW()

RPC_STATUS WINAPI RpcStringBindingParseW ( RPC_WSTR  StringBinding,
RPC_WSTR ObjUuid,
RPC_WSTR Protseq,
RPC_WSTR NetworkAddr,
RPC_WSTR Endpoint,
RPC_WSTR Options 
)

Definition at line 659 of file rpc_binding.c.

662{
663 const WCHAR *data, *next;
664 BOOL endpoint_already_found = FALSE;
665
666 TRACE("(%s,%p,%p,%p,%p,%p)\n", debugstr_w(StringBinding),
667 ObjUuid, Protseq, NetworkAddr, Endpoint, Options);
668
669 if (ObjUuid) *ObjUuid = NULL;
670 if (Protseq) *Protseq = NULL;
671 if (NetworkAddr) *NetworkAddr = NULL;
672 if (Endpoint) *Endpoint = NULL;
673 if (Options) *Options = NULL;
674
675 data = StringBinding;
676
678 if (next) {
679 UUID uuid;
682 status = UuidFromStringW(str_uuid, &uuid);
683 if (status != RPC_S_OK) {
684 free(str_uuid);
685 return status;
686 }
687 if (ObjUuid)
688 *ObjUuid = str_uuid;
689 else
690 free(str_uuid);
691 data = next+1;
692 }
693
695 if (next) {
696 if (Protseq) *Protseq = unescape_string_binding_componentW(data, next - data);
697 data = next+1;
698 } else {
699 goto fail;
700 }
701
703 if (next) {
704 const WCHAR *close;
705 RPC_WSTR opt;
706
707 if (NetworkAddr) *NetworkAddr = unescape_string_binding_componentW(data, next - data);
708 data = next+1;
710 if (!close) goto fail;
711
712 /* tokenize options */
713 while (data < close) {
715 if (!next || next > close) next = close;
716 /* FIXME: this is kind of inefficient */
718 data = next+1;
719
720 /* parse option */
722 if (!next) {
723 /* not an option, must be an endpoint */
724 if (endpoint_already_found) goto fail;
725 if (Endpoint) *Endpoint = opt;
726 else free(opt);
727 endpoint_already_found = TRUE;
728 } else {
729 if (wcsncmp(opt, L"endpoint=", lstrlenW(L"endpoint=")) == 0) {
730 /* endpoint option */
731 if (endpoint_already_found) goto fail;
732 if (Endpoint) *Endpoint = unescape_string_binding_componentW(next+1, -1);
733 free(opt);
734 endpoint_already_found = TRUE;
735 } else {
736 /* network option */
737 if (Options) {
738 if (*Options) {
739 /* FIXME: this is kind of inefficient */
741 free(opt);
742 } else
743 *Options = opt;
744 } else
745 free(opt);
746 }
747 }
748 }
749
750 data = close+1;
751 if (*data) goto fail;
752 } else if (NetworkAddr)
753 *NetworkAddr = unescape_string_binding_componentW(data, -1);
754
755 return RPC_S_OK;
756
757fail:
758 if (ObjUuid) RpcStringFreeW(ObjUuid);
759 if (Protseq) RpcStringFreeW(Protseq);
760 if (NetworkAddr) RpcStringFreeW(NetworkAddr);
761 if (Endpoint) RpcStringFreeW(Endpoint);
764}
#define L(x)
Definition: resources.c:13
static const WCHAR * string_binding_find_delimiterW(const WCHAR *string_binding, WCHAR delim)
Definition: rpc_binding.c:378
static RPC_WSTR unescape_string_binding_componentW(const WCHAR *string_binding, int len)
Definition: rpc_binding.c:415
static LPWSTR RPCRT4_strconcatW(LPWSTR dst, LPCWSTR src)
Definition: rpc_binding.c:305
_Check_return_ _CRTIMP int __cdecl wcsncmp(_In_reads_or_z_(_MaxCount) const wchar_t *_Str1, _In_reads_or_z_(_MaxCount) const wchar_t *_Str2, _In_ size_t _MaxCount)

Referenced by CreateJob(), and RpcBindingFromStringBindingW().

◆ string_binding_find_delimiter()

static const unsigned char * string_binding_find_delimiter ( const unsigned char string_binding,
unsigned char  delim 
)
static

Definition at line 363 of file rpc_binding.c.

365{
366 const unsigned char *next;
367 for (next = string_binding; *next; next++) {
368 if (*next == '\\') {
369 next++;
370 continue;
371 }
372 if (*next == delim)
373 return next;
374 }
375 return NULL;
376}

Referenced by RpcStringBindingParseA().

◆ string_binding_find_delimiterW()

static const WCHAR * string_binding_find_delimiterW ( const WCHAR string_binding,
WCHAR  delim 
)
static

Definition at line 378 of file rpc_binding.c.

380{
381 const WCHAR *next;
382 for (next = string_binding; *next; next++) {
383 if (*next == '\\') {
384 next++;
385 continue;
386 }
387 if (*next == delim)
388 return next;
389 }
390 return NULL;
391}

Referenced by RpcStringBindingParseW().

◆ unescape_string_binding_component()

static RPC_CSTR unescape_string_binding_component ( const unsigned char string_binding,
int  len 
)
static

Definition at line 393 of file rpc_binding.c.

395{
396 RPC_CSTR component, p;
397
398 if (len == -1) len = strlen((const char *)string_binding);
399
400 component = malloc((len + 1) * sizeof(*component));
401 if (!component) return NULL;
402 for (p = component; len > 0; string_binding++, len--) {
403 if (*string_binding == '\\') {
404 string_binding++;
405 len--;
406 *p++ = *string_binding;
407 } else {
408 *p++ = *string_binding;
409 }
410 }
411 *p = '\0';
412 return component;
413}
GLfloat GLfloat p
Definition: glext.h:8902

Referenced by RpcStringBindingParseA().

◆ unescape_string_binding_componentW()

static RPC_WSTR unescape_string_binding_componentW ( const WCHAR string_binding,
int  len 
)
static

Definition at line 415 of file rpc_binding.c.

417{
418 RPC_WSTR component, p;
419
420 if (len == -1) len = lstrlenW(string_binding);
421
422 component = malloc((len + 1) * sizeof(*component));
423 if (!component) return NULL;
424 for (p = component; len > 0; string_binding++, len--) {
425 if (*string_binding == '\\') {
426 string_binding++;
427 len--;
428 *p++ = *string_binding;
429 } else {
430 *p++ = *string_binding;
431 }
432 }
433 *p = '\0';
434 return component;
435}

Referenced by RpcStringBindingParseW().

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( rpc  )