Author: tretiakov Date: Thu Mar 30 23:07:08 2006 New Revision: 21419
URL: http://svn.reactos.ru/svn/reactos?rev=21419&view=rev Log: Implement NDRCContextUnmarshall()
Modified: trunk/reactos/dll/win32/rpcrt4/ndr_marshall.c trunk/reactos/dll/win32/rpcrt4/rpcrt4.spec
Modified: trunk/reactos/dll/win32/rpcrt4/ndr_marshall.c URL: http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/win32/rpcrt4/ndr_marshal... ============================================================================== --- trunk/reactos/dll/win32/rpcrt4/ndr_marshall.c (original) +++ trunk/reactos/dll/win32/rpcrt4/ndr_marshall.c Thu Mar 30 23:07:08 2006 @@ -3233,10 +3233,10 @@ /*********************************************************************** * 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); }
/*********************************************************************** @@ -3254,6 +3254,45 @@ pStubMsg->Buffer += 20;
+} + + +/*********************************************************************** + * 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; + } }
/***********************************************************************
Modified: trunk/reactos/dll/win32/rpcrt4/rpcrt4.spec URL: http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/win32/rpcrt4/rpcrt4.spec... ============================================================================== --- trunk/reactos/dll/win32/rpcrt4/rpcrt4.spec (original) +++ trunk/reactos/dll/win32/rpcrt4/rpcrt4.spec Thu Mar 30 23:07:08 2006 @@ -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