rpcrt4: Stash away NetworkOptions passed in from the binding string so that transports can look at the string if needed.
This commit is contained in:
parent
9c76a0b37a
commit
961455c7f0
|
@ -79,7 +79,7 @@ LPWSTR RPCRT4_strdupAtoW(LPSTR src)
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
||||||
LPWSTR RPCRT4_strndupW(LPWSTR src, INT slen)
|
LPWSTR RPCRT4_strndupW(LPCWSTR src, INT slen)
|
||||||
{
|
{
|
||||||
DWORD len;
|
DWORD len;
|
||||||
LPWSTR s;
|
LPWSTR s;
|
||||||
|
@ -149,6 +149,8 @@ RPC_STATUS RPCRT4_CompleteBindingA(RpcBinding* Binding, LPSTR NetworkAddr, LPST
|
||||||
} else {
|
} else {
|
||||||
Binding->Endpoint = RPCRT4_strdupA("");
|
Binding->Endpoint = RPCRT4_strdupA("");
|
||||||
}
|
}
|
||||||
|
HeapFree(GetProcessHeap(), 0, Binding->NetworkOptions);
|
||||||
|
Binding->NetworkOptions = RPCRT4_strdupAtoW(NetworkOptions);
|
||||||
if (!Binding->Endpoint) ERR("out of memory?\n");
|
if (!Binding->Endpoint) ERR("out of memory?\n");
|
||||||
|
|
||||||
return RPC_S_OK;
|
return RPC_S_OK;
|
||||||
|
@ -168,6 +170,8 @@ RPC_STATUS RPCRT4_CompleteBindingW(RpcBinding* Binding, LPWSTR NetworkAddr, LPWS
|
||||||
Binding->Endpoint = RPCRT4_strdupA("");
|
Binding->Endpoint = RPCRT4_strdupA("");
|
||||||
}
|
}
|
||||||
if (!Binding->Endpoint) ERR("out of memory?\n");
|
if (!Binding->Endpoint) ERR("out of memory?\n");
|
||||||
|
HeapFree(GetProcessHeap(), 0, Binding->NetworkOptions);
|
||||||
|
Binding->NetworkOptions = RPCRT4_strdupW(NetworkOptions);
|
||||||
|
|
||||||
return RPC_S_OK;
|
return RPC_S_OK;
|
||||||
}
|
}
|
||||||
|
@ -224,6 +228,7 @@ RPC_STATUS RPCRT4_DestroyBinding(RpcBinding* Binding)
|
||||||
RPCRT4_strfree(Binding->Endpoint);
|
RPCRT4_strfree(Binding->Endpoint);
|
||||||
RPCRT4_strfree(Binding->NetworkAddr);
|
RPCRT4_strfree(Binding->NetworkAddr);
|
||||||
RPCRT4_strfree(Binding->Protseq);
|
RPCRT4_strfree(Binding->Protseq);
|
||||||
|
HeapFree(GetProcessHeap(), 0, Binding->NetworkOptions);
|
||||||
if (Binding->AuthInfo) RpcAuthInfo_Release(Binding->AuthInfo);
|
if (Binding->AuthInfo) RpcAuthInfo_Release(Binding->AuthInfo);
|
||||||
if (Binding->QOS) RpcQualityOfService_Release(Binding->QOS);
|
if (Binding->QOS) RpcQualityOfService_Release(Binding->QOS);
|
||||||
HeapFree(GetProcessHeap(), 0, Binding);
|
HeapFree(GetProcessHeap(), 0, Binding);
|
||||||
|
@ -259,8 +264,8 @@ RPC_STATUS RPCRT4_OpenBinding(RpcBinding* Binding, RpcConnection** Connection,
|
||||||
/* create a new connection */
|
/* create a new connection */
|
||||||
status = RPCRT4_CreateConnection(&NewConnection, Binding->server,
|
status = RPCRT4_CreateConnection(&NewConnection, Binding->server,
|
||||||
Binding->Protseq, Binding->NetworkAddr,
|
Binding->Protseq, Binding->NetworkAddr,
|
||||||
Binding->Endpoint, NULL, Binding->AuthInfo,
|
Binding->Endpoint, Binding->NetworkOptions,
|
||||||
Binding->QOS, Binding);
|
Binding->AuthInfo, Binding->QOS, Binding);
|
||||||
if (status != RPC_S_OK)
|
if (status != RPC_S_OK)
|
||||||
return status;
|
return status;
|
||||||
|
|
||||||
|
@ -873,6 +878,7 @@ RPC_STATUS RPC_ENTRY RpcBindingCopy(
|
||||||
DestBinding->Protseq = RPCRT4_strndupA(SrcBinding->Protseq, -1);
|
DestBinding->Protseq = RPCRT4_strndupA(SrcBinding->Protseq, -1);
|
||||||
DestBinding->NetworkAddr = RPCRT4_strndupA(SrcBinding->NetworkAddr, -1);
|
DestBinding->NetworkAddr = RPCRT4_strndupA(SrcBinding->NetworkAddr, -1);
|
||||||
DestBinding->Endpoint = RPCRT4_strndupA(SrcBinding->Endpoint, -1);
|
DestBinding->Endpoint = RPCRT4_strndupA(SrcBinding->Endpoint, -1);
|
||||||
|
DestBinding->NetworkOptions = RPCRT4_strdupW(SrcBinding->NetworkOptions);
|
||||||
|
|
||||||
if (SrcBinding->AuthInfo) RpcAuthInfo_AddRef(SrcBinding->AuthInfo);
|
if (SrcBinding->AuthInfo) RpcAuthInfo_AddRef(SrcBinding->AuthInfo);
|
||||||
DestBinding->AuthInfo = SrcBinding->AuthInfo;
|
DestBinding->AuthInfo = SrcBinding->AuthInfo;
|
||||||
|
|
|
@ -52,6 +52,7 @@ typedef struct _RpcConnection
|
||||||
BOOL server;
|
BOOL server;
|
||||||
LPSTR NetworkAddr;
|
LPSTR NetworkAddr;
|
||||||
LPSTR Endpoint;
|
LPSTR Endpoint;
|
||||||
|
LPWSTR NetworkOptions;
|
||||||
const struct connection_ops *ops;
|
const struct connection_ops *ops;
|
||||||
USHORT MaxTransmissionSize;
|
USHORT MaxTransmissionSize;
|
||||||
/* The active interface bound to server. */
|
/* The active interface bound to server. */
|
||||||
|
@ -92,6 +93,7 @@ typedef struct _RpcBinding
|
||||||
LPSTR Protseq;
|
LPSTR Protseq;
|
||||||
LPSTR NetworkAddr;
|
LPSTR NetworkAddr;
|
||||||
LPSTR Endpoint;
|
LPSTR Endpoint;
|
||||||
|
LPWSTR NetworkOptions;
|
||||||
RPC_BLOCKING_FN BlockingFn;
|
RPC_BLOCKING_FN BlockingFn;
|
||||||
ULONG ServerTid;
|
ULONG ServerTid;
|
||||||
RpcConnection* FromConn;
|
RpcConnection* FromConn;
|
||||||
|
@ -102,7 +104,7 @@ typedef struct _RpcBinding
|
||||||
} RpcBinding;
|
} RpcBinding;
|
||||||
|
|
||||||
LPSTR RPCRT4_strndupA(LPCSTR src, INT len);
|
LPSTR RPCRT4_strndupA(LPCSTR src, INT len);
|
||||||
LPWSTR RPCRT4_strndupW(LPWSTR src, INT len);
|
LPWSTR RPCRT4_strndupW(LPCWSTR src, INT len);
|
||||||
LPSTR RPCRT4_strdupWtoA(LPWSTR src);
|
LPSTR RPCRT4_strdupWtoA(LPWSTR src);
|
||||||
LPWSTR RPCRT4_strdupAtoW(LPSTR src);
|
LPWSTR RPCRT4_strdupAtoW(LPSTR src);
|
||||||
void RPCRT4_strfree(LPSTR src);
|
void RPCRT4_strfree(LPSTR src);
|
||||||
|
@ -117,7 +119,7 @@ ULONG RpcQualityOfService_Release(RpcQualityOfService *qos);
|
||||||
|
|
||||||
RpcConnection *RPCRT4_GetIdleConnection(const RPC_SYNTAX_IDENTIFIER *InterfaceId, const RPC_SYNTAX_IDENTIFIER *TransferSyntax, LPCSTR Protseq, LPCSTR NetworkAddr, LPCSTR Endpoint, const RpcAuthInfo* AuthInfo, const RpcQualityOfService *QOS);
|
RpcConnection *RPCRT4_GetIdleConnection(const RPC_SYNTAX_IDENTIFIER *InterfaceId, const RPC_SYNTAX_IDENTIFIER *TransferSyntax, LPCSTR Protseq, LPCSTR NetworkAddr, LPCSTR Endpoint, const RpcAuthInfo* AuthInfo, const RpcQualityOfService *QOS);
|
||||||
void RPCRT4_ReleaseIdleConnection(RpcConnection *Connection);
|
void RPCRT4_ReleaseIdleConnection(RpcConnection *Connection);
|
||||||
RPC_STATUS RPCRT4_CreateConnection(RpcConnection** Connection, BOOL server, LPCSTR Protseq, LPCSTR NetworkAddr, LPCSTR Endpoint, LPCSTR NetworkOptions, RpcAuthInfo* AuthInfo, RpcQualityOfService *QOS, RpcBinding* Binding);
|
RPC_STATUS RPCRT4_CreateConnection(RpcConnection** Connection, BOOL server, LPCSTR Protseq, LPCSTR NetworkAddr, LPCSTR Endpoint, LPCWSTR NetworkOptions, RpcAuthInfo* AuthInfo, RpcQualityOfService *QOS, RpcBinding* Binding);
|
||||||
RPC_STATUS RPCRT4_DestroyConnection(RpcConnection* Connection);
|
RPC_STATUS RPCRT4_DestroyConnection(RpcConnection* Connection);
|
||||||
RPC_STATUS RPCRT4_OpenClientConnection(RpcConnection* Connection);
|
RPC_STATUS RPCRT4_OpenClientConnection(RpcConnection* Connection);
|
||||||
RPC_STATUS RPCRT4_CloseConnection(RpcConnection* Connection);
|
RPC_STATUS RPCRT4_CloseConnection(RpcConnection* Connection);
|
||||||
|
|
|
@ -1336,7 +1336,7 @@ RPC_STATUS RPCRT4_CloseConnection(RpcConnection* Connection)
|
||||||
|
|
||||||
RPC_STATUS RPCRT4_CreateConnection(RpcConnection** Connection, BOOL server,
|
RPC_STATUS RPCRT4_CreateConnection(RpcConnection** Connection, BOOL server,
|
||||||
LPCSTR Protseq, LPCSTR NetworkAddr, LPCSTR Endpoint,
|
LPCSTR Protseq, LPCSTR NetworkAddr, LPCSTR Endpoint,
|
||||||
LPCSTR NetworkOptions, RpcAuthInfo* AuthInfo, RpcQualityOfService *QOS,
|
LPCWSTR NetworkOptions, RpcAuthInfo* AuthInfo, RpcQualityOfService *QOS,
|
||||||
RpcBinding* Binding)
|
RpcBinding* Binding)
|
||||||
{
|
{
|
||||||
const struct connection_ops *ops;
|
const struct connection_ops *ops;
|
||||||
|
@ -1355,6 +1355,7 @@ RPC_STATUS RPCRT4_CreateConnection(RpcConnection** Connection, BOOL server,
|
||||||
NewConnection->ops = ops;
|
NewConnection->ops = ops;
|
||||||
NewConnection->NetworkAddr = RPCRT4_strdupA(NetworkAddr);
|
NewConnection->NetworkAddr = RPCRT4_strdupA(NetworkAddr);
|
||||||
NewConnection->Endpoint = RPCRT4_strdupA(Endpoint);
|
NewConnection->Endpoint = RPCRT4_strdupA(Endpoint);
|
||||||
|
NewConnection->NetworkOptions = RPCRT4_strdupW(NetworkOptions);
|
||||||
NewConnection->Used = Binding;
|
NewConnection->Used = Binding;
|
||||||
NewConnection->MaxTransmissionSize = RPC_MAX_PACKET_SIZE;
|
NewConnection->MaxTransmissionSize = RPC_MAX_PACKET_SIZE;
|
||||||
memset(&NewConnection->ActiveInterface, 0, sizeof(NewConnection->ActiveInterface));
|
memset(&NewConnection->ActiveInterface, 0, sizeof(NewConnection->ActiveInterface));
|
||||||
|
@ -1430,6 +1431,7 @@ RPC_STATUS RPCRT4_DestroyConnection(RpcConnection* Connection)
|
||||||
RPCRT4_CloseConnection(Connection);
|
RPCRT4_CloseConnection(Connection);
|
||||||
RPCRT4_strfree(Connection->Endpoint);
|
RPCRT4_strfree(Connection->Endpoint);
|
||||||
RPCRT4_strfree(Connection->NetworkAddr);
|
RPCRT4_strfree(Connection->NetworkAddr);
|
||||||
|
HeapFree(GetProcessHeap(), 0, Connection->NetworkOptions);
|
||||||
if (Connection->AuthInfo) RpcAuthInfo_Release(Connection->AuthInfo);
|
if (Connection->AuthInfo) RpcAuthInfo_Release(Connection->AuthInfo);
|
||||||
if (Connection->QOS) RpcQualityOfService_Release(Connection->QOS);
|
if (Connection->QOS) RpcQualityOfService_Release(Connection->QOS);
|
||||||
HeapFree(GetProcessHeap(), 0, Connection);
|
HeapFree(GetProcessHeap(), 0, Connection);
|
||||||
|
|
Loading…
Reference in New Issue