mirror of
https://github.com/reactos/reactos.git
synced 2024-12-29 02:25:17 +00:00
[RPCRT4] Set binding handle for server functions
This enables us to impersonate server functions using RpcImpersonateClient.
This commit is contained in:
parent
8f9ef68ea7
commit
e54b32b434
1 changed files with 8 additions and 0 deletions
|
@ -1330,6 +1330,7 @@ LONG WINAPI NdrStubCall2(
|
||||||
LONG_PTR *retval_ptr = NULL;
|
LONG_PTR *retval_ptr = NULL;
|
||||||
/* correlation cache */
|
/* correlation cache */
|
||||||
ULONG_PTR NdrCorrCache[256];
|
ULONG_PTR NdrCorrCache[256];
|
||||||
|
unsigned short BindingHandleOffset = (USHORT)-1;
|
||||||
|
|
||||||
TRACE("pThis %p, pChannel %p, pRpcMsg %p, pdwStubPhase %p\n", pThis, pChannel, pRpcMsg, pdwStubPhase);
|
TRACE("pThis %p, pChannel %p, pRpcMsg %p, pdwStubPhase %p\n", pThis, pChannel, pRpcMsg, pdwStubPhase);
|
||||||
|
|
||||||
|
@ -1367,12 +1368,15 @@ LONG WINAPI NdrStubCall2(
|
||||||
switch (*pFormat) /* handle_type */
|
switch (*pFormat) /* handle_type */
|
||||||
{
|
{
|
||||||
case FC_BIND_PRIMITIVE: /* explicit primitive */
|
case FC_BIND_PRIMITIVE: /* explicit primitive */
|
||||||
|
BindingHandleOffset = ((NDR_EHD_PRIMITIVE*)pFormat)->offset;
|
||||||
pFormat += sizeof(NDR_EHD_PRIMITIVE);
|
pFormat += sizeof(NDR_EHD_PRIMITIVE);
|
||||||
break;
|
break;
|
||||||
case FC_BIND_GENERIC: /* explicit generic */
|
case FC_BIND_GENERIC: /* explicit generic */
|
||||||
|
BindingHandleOffset = ((NDR_EHD_GENERIC*)pFormat)->offset;
|
||||||
pFormat += sizeof(NDR_EHD_GENERIC);
|
pFormat += sizeof(NDR_EHD_GENERIC);
|
||||||
break;
|
break;
|
||||||
case FC_BIND_CONTEXT: /* explicit context */
|
case FC_BIND_CONTEXT: /* explicit context */
|
||||||
|
BindingHandleOffset = ((NDR_EHD_CONTEXT*)pFormat)->offset;
|
||||||
pFormat += sizeof(NDR_EHD_CONTEXT);
|
pFormat += sizeof(NDR_EHD_CONTEXT);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
@ -1421,6 +1425,10 @@ LONG WINAPI NdrStubCall2(
|
||||||
if (pThis)
|
if (pThis)
|
||||||
*(void **)args = ((CStdStubBuffer *)pThis)->pvServerObject;
|
*(void **)args = ((CStdStubBuffer *)pThis)->pvServerObject;
|
||||||
|
|
||||||
|
/* add the binding handle to the stack if we are using explicit binding handles */
|
||||||
|
if (BindingHandleOffset != (USHORT)-1)
|
||||||
|
*(RPC_BINDING_HANDLE*)&(args[BindingHandleOffset]) = pRpcMsg->Handle;
|
||||||
|
|
||||||
if (is_oicf_stubdesc(pStubDesc))
|
if (is_oicf_stubdesc(pStubDesc))
|
||||||
{
|
{
|
||||||
const NDR_PROC_PARTIAL_OIF_HEADER *pOIFHeader = (const NDR_PROC_PARTIAL_OIF_HEADER *)pFormat;
|
const NDR_PROC_PARTIAL_OIF_HEADER *pOIFHeader = (const NDR_PROC_PARTIAL_OIF_HEADER *)pFormat;
|
||||||
|
|
Loading…
Reference in a new issue