Author: tretiakov
Date: Fri Mar 31 17:31:36 2006
New Revision: 21427
URL:
http://svn.reactos.ru/svn/reactos?rev=21427&view=rev
Log:
Implement NdrClientContextUnmarshall()
Modified:
trunk/reactos/dll/win32/rpcrt4/ndr_marshall.c
trunk/reactos/dll/win32/rpcrt4/rpc_binding.h
Modified: trunk/reactos/dll/win32/rpcrt4/ndr_marshall.c
URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/win32/rpcrt4/ndr_marsha…
==============================================================================
--- trunk/reactos/dll/win32/rpcrt4/ndr_marshall.c (original)
+++ trunk/reactos/dll/win32/rpcrt4/ndr_marshall.c Fri Mar 31 17:31:36 2006
@@ -3236,7 +3236,7 @@
void WINAPI NDRCContextMarshall(NDR_CCONTEXT CContext, void *pBuff )
{
CContextHandle *ctx = (CContextHandle*)CContext;
- memcpy(pBuff, ctx->Ndr, 20);
+ memcpy(pBuff, ctx->Ndr, CONTEXT_HANDLE_NDR_SIZE);
}
/***********************************************************************
@@ -3252,7 +3252,7 @@
NDRCContextMarshall(ContextHandle, pStubMsg->Buffer);
- pStubMsg->Buffer += 20;
+ pStubMsg->Buffer += CONTEXT_HANDLE_NDR_SIZE;
}
@@ -3270,9 +3270,9 @@
char *buf = (char*)pBuff;
int i;
- for(i = 0; i < 20 && !buf[i]; i++);
+ for(i = 0; i < CONTEXT_HANDLE_NDR_SIZE && !buf[i]; i++);
- if(i == 20)
+ if(i == CONTEXT_HANDLE_NDR_SIZE)
{
ctx = (CContextHandle*)*pCContext;
if(ctx)
@@ -3290,7 +3290,7 @@
status = RpcBindingCopy(hBinding, (RPC_BINDING_HANDLE*) &ctx->Binding);
if(status != RPC_S_OK) RpcRaiseException(status);
- memcpy(ctx->Ndr, pBuff, 20);
+ memcpy(ctx->Ndr, pBuff, CONTEXT_HANDLE_NDR_SIZE);
*pCContext = (NDR_CCONTEXT)ctx;
}
}
@@ -3302,7 +3302,15 @@
NDR_CCONTEXT * pContextHandle,
RPC_BINDING_HANDLE BindHandle)
{
- FIXME("(%p, %p, %p): stub\n", pStubMsg, pContextHandle, BindHandle);
+ if(!pContextHandle)
+ RpcRaiseException(ERROR_INVALID_HANDLE);
+
+ NDRCContextUnmarshall(pContextHandle,
+ ((CContextHandle*)pContextHandle)->Binding,
+ pStubMsg->Buffer,
+ pStubMsg->RpcMsg->DataRepresentation);
+
+ pStubMsg->Buffer += CONTEXT_HANDLE_NDR_SIZE;
}
void WINAPI NdrServerContextMarshall(PMIDL_STUB_MESSAGE pStubMsg,
Modified: trunk/reactos/dll/win32/rpcrt4/rpc_binding.h
URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/win32/rpcrt4/rpc_bindin…
==============================================================================
--- trunk/reactos/dll/win32/rpcrt4/rpc_binding.h (original)
+++ trunk/reactos/dll/win32/rpcrt4/rpc_binding.h Fri Mar 31 17:31:36 2006
@@ -53,11 +53,12 @@
RpcConnection* FromConn;
} RpcBinding;
+#define CONTEXT_HANDLE_NDR_SIZE 20
typedef struct _CContextHandle
{
RpcBinding *Binding;
- BYTE Ndr[20];
+ BYTE Ndr[CONTEXT_HANDLE_NDR_SIZE];
} CContextHandle;
LPSTR RPCRT4_strndupA(LPCSTR src, INT len);