rpcrt4: Support for explicit handle passing.
If explicit_handle is defined in the idl file, c/s use explicit handles, then an explicit handle must be passed in to the server-side interface
This commit is contained in:
parent
c2d56a7e99
commit
9a4de1b727
1 changed files with 38 additions and 31 deletions
|
@ -1365,37 +1365,6 @@ LONG WINAPI NdrStubCall2(
|
||||||
|
|
||||||
TRACE("Oi_flags = 0x%02x\n", pProcHeader->Oi_flags);
|
TRACE("Oi_flags = 0x%02x\n", pProcHeader->Oi_flags);
|
||||||
|
|
||||||
/* binding */
|
|
||||||
switch (pProcHeader->handle_type)
|
|
||||||
{
|
|
||||||
/* explicit binding: parse additional section */
|
|
||||||
case 0:
|
|
||||||
switch (*pFormat) /* handle_type */
|
|
||||||
{
|
|
||||||
case FC_BIND_PRIMITIVE: /* explicit primitive */
|
|
||||||
pFormat += sizeof(NDR_EHD_PRIMITIVE);
|
|
||||||
break;
|
|
||||||
case FC_BIND_GENERIC: /* explicit generic */
|
|
||||||
pFormat += sizeof(NDR_EHD_GENERIC);
|
|
||||||
break;
|
|
||||||
case FC_BIND_CONTEXT: /* explicit context */
|
|
||||||
pFormat += sizeof(NDR_EHD_CONTEXT);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
ERR("bad explicit binding handle type (0x%02x)\n", pProcHeader->handle_type);
|
|
||||||
RpcRaiseException(RPC_X_BAD_STUB_DATA);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case FC_BIND_GENERIC: /* implicit generic */
|
|
||||||
case FC_BIND_PRIMITIVE: /* implicit primitive */
|
|
||||||
case FC_CALLBACK_HANDLE: /* implicit callback */
|
|
||||||
case FC_AUTO_HANDLE: /* implicit auto handle */
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
ERR("bad implicit binding handle type (0x%02x)\n", pProcHeader->handle_type);
|
|
||||||
RpcRaiseException(RPC_X_BAD_STUB_DATA);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (pProcHeader->Oi_flags & Oi_OBJECT_PROC)
|
if (pProcHeader->Oi_flags & Oi_OBJECT_PROC)
|
||||||
NdrStubInitialize(pRpcMsg, &stubMsg, pStubDesc, pChannel);
|
NdrStubInitialize(pRpcMsg, &stubMsg, pStubDesc, pChannel);
|
||||||
else
|
else
|
||||||
|
@ -1422,6 +1391,44 @@ LONG WINAPI NdrStubCall2(
|
||||||
args = calloc(1, stack_size);
|
args = calloc(1, stack_size);
|
||||||
stubMsg.StackTop = args; /* used by conformance of top-level objects */
|
stubMsg.StackTop = args; /* used by conformance of top-level objects */
|
||||||
|
|
||||||
|
/* binding */
|
||||||
|
switch (pProcHeader->handle_type)
|
||||||
|
{
|
||||||
|
/* explicit binding: parse additional section */
|
||||||
|
case 0:
|
||||||
|
switch (*pFormat) /* handle_type */
|
||||||
|
{
|
||||||
|
case FC_BIND_PRIMITIVE: /* explicit primitive */
|
||||||
|
{
|
||||||
|
const NDR_EHD_PRIMITIVE *pDesc = (const NDR_EHD_PRIMITIVE *)pFormat;
|
||||||
|
if (pDesc->flag)
|
||||||
|
**(handle_t **)ARG_FROM_OFFSET(stubMsg.StackTop, pDesc->offset) = pRpcMsg->Handle;
|
||||||
|
else
|
||||||
|
*(handle_t *)ARG_FROM_OFFSET(stubMsg.StackTop, pDesc->offset) = pRpcMsg->Handle;
|
||||||
|
pFormat += sizeof(NDR_EHD_PRIMITIVE);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case FC_BIND_GENERIC: /* explicit generic */
|
||||||
|
pFormat += sizeof(NDR_EHD_GENERIC);
|
||||||
|
break;
|
||||||
|
case FC_BIND_CONTEXT: /* explicit context */
|
||||||
|
pFormat += sizeof(NDR_EHD_CONTEXT);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
ERR("bad explicit binding handle type (0x%02x)\n", pProcHeader->handle_type);
|
||||||
|
RpcRaiseException(RPC_X_BAD_STUB_DATA);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case FC_BIND_GENERIC: /* implicit generic */
|
||||||
|
case FC_BIND_PRIMITIVE: /* implicit primitive */
|
||||||
|
case FC_CALLBACK_HANDLE: /* implicit callback */
|
||||||
|
case FC_AUTO_HANDLE: /* implicit auto handle */
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
ERR("bad implicit binding handle type (0x%02x)\n", pProcHeader->handle_type);
|
||||||
|
RpcRaiseException(RPC_X_BAD_STUB_DATA);
|
||||||
|
}
|
||||||
|
|
||||||
/* add the implicit This pointer as the first arg to the function if we
|
/* add the implicit This pointer as the first arg to the function if we
|
||||||
* are calling an object method */
|
* are calling an object method */
|
||||||
if (pThis)
|
if (pThis)
|
||||||
|
|
Loading…
Add table
Reference in a new issue