Implement NdrClientContextUnmarshall()

svn path=/trunk/; revision=21427
This commit is contained in:
Saveliy Tretiakov 2006-03-31 13:31:36 +00:00
parent a73bbf338a
commit db4d20e4ce
2 changed files with 16 additions and 7 deletions

View file

@ -3236,7 +3236,7 @@ static void WINAPI NdrBaseTypeFree(PMIDL_STUB_MESSAGE pStubMsg,
void WINAPI NDRCContextMarshall(NDR_CCONTEXT CContext, void *pBuff ) void WINAPI NDRCContextMarshall(NDR_CCONTEXT CContext, void *pBuff )
{ {
CContextHandle *ctx = (CContextHandle*)CContext; CContextHandle *ctx = (CContextHandle*)CContext;
memcpy(pBuff, ctx->Ndr, 20); memcpy(pBuff, ctx->Ndr, CONTEXT_HANDLE_NDR_SIZE);
} }
/*********************************************************************** /***********************************************************************
@ -3252,7 +3252,7 @@ void WINAPI NdrClientContextMarshall(PMIDL_STUB_MESSAGE pStubMsg,
NDRCContextMarshall(ContextHandle, pStubMsg->Buffer); NDRCContextMarshall(ContextHandle, pStubMsg->Buffer);
pStubMsg->Buffer += 20; pStubMsg->Buffer += CONTEXT_HANDLE_NDR_SIZE;
} }
@ -3270,9 +3270,9 @@ void WINAPI NDRCContextUnmarshall(NDR_CCONTEXT *pCContext,
char *buf = (char*)pBuff; char *buf = (char*)pBuff;
int i; 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; ctx = (CContextHandle*)*pCContext;
if(ctx) if(ctx)
@ -3290,7 +3290,7 @@ void WINAPI NDRCContextUnmarshall(NDR_CCONTEXT *pCContext,
status = RpcBindingCopy(hBinding, (RPC_BINDING_HANDLE*) &ctx->Binding); status = RpcBindingCopy(hBinding, (RPC_BINDING_HANDLE*) &ctx->Binding);
if(status != RPC_S_OK) RpcRaiseException(status); if(status != RPC_S_OK) RpcRaiseException(status);
memcpy(ctx->Ndr, pBuff, 20); memcpy(ctx->Ndr, pBuff, CONTEXT_HANDLE_NDR_SIZE);
*pCContext = (NDR_CCONTEXT)ctx; *pCContext = (NDR_CCONTEXT)ctx;
} }
} }
@ -3302,7 +3302,15 @@ void WINAPI NdrClientContextUnmarshall(PMIDL_STUB_MESSAGE pStubMsg,
NDR_CCONTEXT * pContextHandle, NDR_CCONTEXT * pContextHandle,
RPC_BINDING_HANDLE BindHandle) 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, void WINAPI NdrServerContextMarshall(PMIDL_STUB_MESSAGE pStubMsg,

View file

@ -53,11 +53,12 @@ typedef struct _RpcBinding
RpcConnection* FromConn; RpcConnection* FromConn;
} RpcBinding; } RpcBinding;
#define CONTEXT_HANDLE_NDR_SIZE 20
typedef struct _CContextHandle typedef struct _CContextHandle
{ {
RpcBinding *Binding; RpcBinding *Binding;
BYTE Ndr[20]; BYTE Ndr[CONTEXT_HANDLE_NDR_SIZE];
} CContextHandle; } CContextHandle;
LPSTR RPCRT4_strndupA(LPCSTR src, INT len); LPSTR RPCRT4_strndupA(LPCSTR src, INT len);