mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 18:15:11 +00:00
Implement NDRCContextUnmarshall()
svn path=/trunk/; revision=21419
This commit is contained in:
parent
151663dfeb
commit
e69f650944
2 changed files with 42 additions and 3 deletions
|
@ -3233,10 +3233,10 @@ static void WINAPI NdrBaseTypeFree(PMIDL_STUB_MESSAGE pStubMsg,
|
|||
/***********************************************************************
|
||||
* NDRCContextMarshall
|
||||
*/
|
||||
void WINAPI NDRCContextMarshall(IN NDR_CCONTEXT CContext, OUT void *pBuff )
|
||||
void WINAPI NDRCContextMarshall(NDR_CCONTEXT CContext, void *pBuff )
|
||||
{
|
||||
CContextHandle *ctx = (CContextHandle*)CContext;
|
||||
memcpy(pBuff, ctx->Ndr, sizeof(ctx->Ndr));
|
||||
memcpy(pBuff, ctx->Ndr, 20);
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
|
@ -3256,6 +3256,45 @@ void WINAPI NdrClientContextMarshall(PMIDL_STUB_MESSAGE pStubMsg,
|
|||
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* NDRCContextUnmarshall
|
||||
*/
|
||||
void WINAPI NDRCContextUnmarshall(NDR_CCONTEXT *pCContext,
|
||||
RPC_BINDING_HANDLE hBinding,
|
||||
void *pBuff,
|
||||
unsigned long DataRepresentation )
|
||||
{
|
||||
CContextHandle *ctx;
|
||||
RPC_STATUS status;
|
||||
char *buf = (char*)pBuff;
|
||||
int i;
|
||||
|
||||
for(i = 0; i < 20 && !buf[i]; i++);
|
||||
|
||||
if(i == 20)
|
||||
{
|
||||
ctx = (CContextHandle*)*pCContext;
|
||||
if(ctx)
|
||||
{
|
||||
RPCRT4_DestroyBinding(ctx->Binding);
|
||||
HeapFree(GetProcessHeap(), 0, ctx);
|
||||
}
|
||||
*pCContext = NULL;
|
||||
}
|
||||
else
|
||||
{
|
||||
ctx = HeapAlloc(GetProcessHeap(), 0, sizeof(CContextHandle));
|
||||
if(!ctx) RpcRaiseException(ERROR_OUTOFMEMORY);
|
||||
|
||||
status = RpcBindingCopy(hBinding, (RPC_BINDING_HANDLE*) &ctx->Binding);
|
||||
if(status != RPC_S_OK) RpcRaiseException(status);
|
||||
|
||||
memcpy(ctx->Ndr, pBuff, 20);
|
||||
*pCContext = (NDR_CCONTEXT)ctx;
|
||||
}
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* NdrClientContextUnmarshall
|
||||
*/
|
||||
|
|
|
@ -139,7 +139,7 @@
|
|||
@ stub MqRegisterQueue # win9x
|
||||
@ stdcall NDRCContextBinding(ptr)
|
||||
@ stdcall NDRCContextMarshall(ptr ptr)
|
||||
@ stub NDRCContextUnmarshall
|
||||
@ stdcall NDRCContextUnmarshall(ptr ptr ptr long)
|
||||
@ stub NDRSContextMarshall2
|
||||
@ stub NDRSContextMarshall
|
||||
@ stub NDRSContextMarshallEx
|
||||
|
|
Loading…
Reference in a new issue