diff --git a/reactos/dll/win32/rpcrt4/ndr_marshall.c b/reactos/dll/win32/rpcrt4/ndr_marshall.c index eb6f676616b..c0c68768b6b 100644 --- a/reactos/dll/win32/rpcrt4/ndr_marshall.c +++ b/reactos/dll/win32/rpcrt4/ndr_marshall.c @@ -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); -} - - diff --git a/reactos/dll/win32/rpcrt4/rpc_binding.h b/reactos/dll/win32/rpcrt4/rpc_binding.h index caeb90a81a4..e0f39aad4ed 100644 --- a/reactos/dll/win32/rpcrt4/rpc_binding.h +++ b/reactos/dll/win32/rpcrt4/rpc_binding.h @@ -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); diff --git a/reactos/dll/win32/rpcrt4/rpcrt4.rbuild b/reactos/dll/win32/rpcrt4/rpcrt4.rbuild index 7b0a32e5fad..515c20d83cd 100644 --- a/reactos/dll/win32/rpcrt4/rpcrt4.rbuild +++ b/reactos/dll/win32/rpcrt4/rpcrt4.rbuild @@ -29,6 +29,7 @@ rpc_epmap.c rpc_message.c rpc_server.c + ndr_contexth.c rpcrt4_main.c rpcss_np_client.c rpcrt4.rc