mirror of
https://github.com/reactos/reactos.git
synced 2025-07-31 11:02:16 +00:00
Move all context handle stuff to ndr_contexth.c
svn path=/trunk/; revision=21567
This commit is contained in:
parent
e38c527480
commit
bf22683420
3 changed files with 1 additions and 176 deletions
|
@ -3229,167 +3229,3 @@ static void WINAPI NdrBaseTypeFree(PMIDL_STUB_MESSAGE pStubMsg,
|
|||
|
||||
/* nothing to do */
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* NDRCContextMarshall
|
||||
*/
|
||||
void WINAPI NDRCContextMarshall(NDR_CCONTEXT CContext, void *pBuff )
|
||||
{
|
||||
CContextHandle *ctx = (CContextHandle*)CContext;
|
||||
memcpy(pBuff, &ctx->Ndr, sizeof(ContextHandleNdr));
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* NdrClientContextMarshall
|
||||
*/
|
||||
void WINAPI NdrClientContextMarshall(PMIDL_STUB_MESSAGE pStubMsg,
|
||||
NDR_CCONTEXT ContextHandle,
|
||||
int fCheck)
|
||||
{
|
||||
|
||||
if(!ContextHandle)
|
||||
RpcRaiseException(ERROR_INVALID_HANDLE);
|
||||
|
||||
NDRCContextMarshall(ContextHandle, pStubMsg->Buffer);
|
||||
|
||||
pStubMsg->Buffer += sizeof(ContextHandleNdr);
|
||||
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* NDRCContextUnmarshall
|
||||
*/
|
||||
void WINAPI NDRCContextUnmarshall(NDR_CCONTEXT *pCContext,
|
||||
RPC_BINDING_HANDLE hBinding,
|
||||
void *pBuff,
|
||||
unsigned long DataRepresentation )
|
||||
{
|
||||
CContextHandle *ctx = (CContextHandle*)*pCContext;
|
||||
ContextHandleNdr *ndr = (ContextHandleNdr*)pBuff;
|
||||
RPC_STATUS status;
|
||||
|
||||
if(UuidIsNil(&ndr->uuid, &status))
|
||||
{
|
||||
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, ndr, sizeof(ContextHandleNdr));
|
||||
*pCContext = (NDR_CCONTEXT)ctx;
|
||||
}
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* NdrClientContextUnmarshall
|
||||
*/
|
||||
void WINAPI NdrClientContextUnmarshall(PMIDL_STUB_MESSAGE pStubMsg,
|
||||
NDR_CCONTEXT * pContextHandle,
|
||||
RPC_BINDING_HANDLE BindHandle)
|
||||
{
|
||||
if(!pContextHandle)
|
||||
RpcRaiseException(ERROR_INVALID_HANDLE);
|
||||
|
||||
NDRCContextUnmarshall(pContextHandle,
|
||||
((CContextHandle*)pContextHandle)->Binding,
|
||||
pStubMsg->Buffer,
|
||||
pStubMsg->RpcMsg->DataRepresentation);
|
||||
|
||||
pStubMsg->Buffer += sizeof(ContextHandleNdr);
|
||||
}
|
||||
|
||||
void WINAPI NdrServerContextMarshall(PMIDL_STUB_MESSAGE pStubMsg,
|
||||
NDR_SCONTEXT ContextHandle,
|
||||
NDR_RUNDOWN RundownRoutine )
|
||||
{
|
||||
FIXME("(%p, %p, %p): stub\n", pStubMsg, ContextHandle, RundownRoutine);
|
||||
}
|
||||
|
||||
NDR_SCONTEXT WINAPI NdrServerContextUnmarshall(PMIDL_STUB_MESSAGE pStubMsg)
|
||||
{
|
||||
FIXME("(%p): stub\n", pStubMsg);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void WINAPI NdrContextHandleSize(PMIDL_STUB_MESSAGE pStubMsg,
|
||||
unsigned char* pMemory,
|
||||
PFORMAT_STRING pFormat)
|
||||
{
|
||||
FIXME("(%p, %p, %p): stub\n", pStubMsg, pMemory, pFormat);
|
||||
}
|
||||
|
||||
NDR_SCONTEXT WINAPI NdrContextHandleInitialize(PMIDL_STUB_MESSAGE pStubMsg,
|
||||
PFORMAT_STRING pFormat)
|
||||
{
|
||||
FIXME("(%p, %p): stub\n", pStubMsg, pFormat);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void WINAPI NdrServerContextNewMarshall(PMIDL_STUB_MESSAGE pStubMsg,
|
||||
NDR_SCONTEXT ContextHandle,
|
||||
NDR_RUNDOWN RundownRoutine,
|
||||
PFORMAT_STRING pFormat)
|
||||
{
|
||||
FIXME("(%p, %p, %p, %p): stub\n", pStubMsg, ContextHandle, RundownRoutine, pFormat);
|
||||
}
|
||||
|
||||
NDR_SCONTEXT WINAPI NdrServerContextNewUnmarshall(PMIDL_STUB_MESSAGE pStubMsg,
|
||||
PFORMAT_STRING pFormat)
|
||||
{
|
||||
FIXME("(%p, %p): stub\n", pStubMsg, pFormat);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* NDRCContextBinding
|
||||
*/
|
||||
RPC_BINDING_HANDLE WINAPI NDRCContextBinding(NDR_CCONTEXT CContext)
|
||||
{
|
||||
if(!CContext)
|
||||
RpcRaiseException(ERROR_INVALID_HANDLE);
|
||||
|
||||
return (RPC_BINDING_HANDLE)((CContextHandle*)CContext)->Binding;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* RpcSmDestroyClientContext
|
||||
*/
|
||||
RPC_STATUS WINAPI RpcSmDestroyClientContext(void** ContextHandle)
|
||||
{
|
||||
CContextHandle *ctx = (CContextHandle*)ContextHandle;
|
||||
|
||||
if(!ctx)
|
||||
return RPC_X_SS_CONTEXT_MISMATCH;
|
||||
|
||||
RPCRT4_DestroyBinding(ctx->Binding);
|
||||
HeapFree(GetProcessHeap(), 0, ctx);
|
||||
*ContextHandle = NULL;
|
||||
|
||||
return RPC_S_OK;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* RpcSsDestroyClientContext
|
||||
*/
|
||||
void WINAPI RpcSsDestroyClientContext(void** ContextHandle)
|
||||
{
|
||||
RPC_STATUS status;
|
||||
|
||||
status = RpcSmDestroyClientContext(ContextHandle);
|
||||
|
||||
if(status != RPC_S_OK)
|
||||
RpcRaiseException(status);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -53,18 +53,6 @@ typedef struct _RpcBinding
|
|||
RpcConnection* FromConn;
|
||||
} RpcBinding;
|
||||
|
||||
typedef struct _ContextHandleNdr
|
||||
{
|
||||
UINT attributes;
|
||||
UUID uuid;
|
||||
} ContextHandleNdr;
|
||||
|
||||
typedef struct _CContextHandle
|
||||
{
|
||||
RpcBinding *Binding;
|
||||
ContextHandleNdr Ndr;
|
||||
} CContextHandle;
|
||||
|
||||
LPSTR RPCRT4_strndupA(LPCSTR src, INT len);
|
||||
LPWSTR RPCRT4_strndupW(LPWSTR src, INT len);
|
||||
LPSTR RPCRT4_strdupWtoA(LPWSTR src);
|
||||
|
|
|
@ -29,6 +29,7 @@
|
|||
<file>rpc_epmap.c</file>
|
||||
<file>rpc_message.c</file>
|
||||
<file>rpc_server.c</file>
|
||||
<file>ndr_contexth.c</file>
|
||||
<file>rpcrt4_main.c</file>
|
||||
<file>rpcss_np_client.c</file>
|
||||
<file>rpcrt4.rc</file>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue