[ros-diffs] [tretiakov] 21568: Oops, forget to add these.

tretiakov at svn.reactos.org tretiakov at svn.reactos.org
Wed Apr 12 21:18:23 CEST 2006


Author: tretiakov
Date: Wed Apr 12 23:18:22 2006
New Revision: 21568

URL: http://svn.reactos.ru/svn/reactos?rev=21568&view=rev
Log:
Oops, forget to add these.

Added:
    trunk/reactos/dll/win32/rpcrt4/ndr_contexth.c
    trunk/reactos/dll/win32/rpcrt4/ndr_contexth.h

Added: trunk/reactos/dll/win32/rpcrt4/ndr_contexth.c
URL: http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/win32/rpcrt4/ndr_contexth.c?rev=21568&view=auto
==============================================================================
--- trunk/reactos/dll/win32/rpcrt4/ndr_contexth.c (added)
+++ trunk/reactos/dll/win32/rpcrt4/ndr_contexth.c Wed Apr 12 23:18:22 2006
@@ -1,0 +1,206 @@
+/*
+ * Context Handle Functions
+ *
+ * Copyright 2006 Saveliy Tretiakov
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+#include "rpc.h"
+#include "rpcndr.h"
+#include "wine/debug.h"
+
+#include "rpc_binding.h"
+#include "ndr_contexth.h"
+
+
+/***********************************************************************
+ *           NDRCContextBinding
+ */
+RPC_BINDING_HANDLE WINAPI NDRCContextBinding(NDR_CCONTEXT CContext)
+{
+    if(!CContext)
+		RpcRaiseException(ERROR_INVALID_HANDLE);
+
+    return (RPC_BINDING_HANDLE)((CContextHandle*)CContext)->Binding;
+}
+
+/***********************************************************************
+ *           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);
+}
+
+/***********************************************************************
+ *           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);
+}
+
+/***********************************************************************
+ *           NdrServerContextMarshall
+ */
+void WINAPI NdrServerContextMarshall(PMIDL_STUB_MESSAGE pStubMsg,
+                                     NDR_SCONTEXT ContextHandle,
+                                     NDR_RUNDOWN RundownRoutine )
+{
+    FIXME("(%p, %p, %p): stub\n", pStubMsg, ContextHandle, RundownRoutine);
+}
+
+/***********************************************************************
+ *           NdrServerContextUnmarshall
+ */
+NDR_SCONTEXT WINAPI NdrServerContextUnmarshall(PMIDL_STUB_MESSAGE pStubMsg)
+{
+    FIXME("(%p): stub\n", pStubMsg);
+    return NULL;
+}
+
+/***********************************************************************
+ *           NdrContextHandleSize
+ */
+void WINAPI NdrContextHandleSize(PMIDL_STUB_MESSAGE pStubMsg,
+                                 unsigned char* pMemory,
+                                 PFORMAT_STRING pFormat)
+{
+    FIXME("(%p, %p, %p): stub\n", pStubMsg, pMemory, pFormat);
+}
+
+/***********************************************************************
+ *           NdrContextHandleInitialize
+ */
+NDR_SCONTEXT WINAPI NdrContextHandleInitialize(PMIDL_STUB_MESSAGE pStubMsg,
+                                               PFORMAT_STRING pFormat)
+{
+    FIXME("(%p, %p): stub\n", pStubMsg, pFormat);
+    return NULL;
+}
+
+/***********************************************************************
+ *           NdrServerContextNewMarshall
+ */
+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);
+}
+
+/***********************************************************************
+ *           NdrServerContextNewUnmarshall
+ */
+NDR_SCONTEXT WINAPI NdrServerContextNewUnmarshall(PMIDL_STUB_MESSAGE pStubMsg,
+                                                  PFORMAT_STRING pFormat)
+{
+    FIXME("(%p, %p): stub\n", pStubMsg, pFormat);
+    return NULL;
+}

Added: trunk/reactos/dll/win32/rpcrt4/ndr_contexth.h
URL: http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/win32/rpcrt4/ndr_contexth.h?rev=21568&view=auto
==============================================================================
--- trunk/reactos/dll/win32/rpcrt4/ndr_contexth.h (added)
+++ trunk/reactos/dll/win32/rpcrt4/ndr_contexth.h Wed Apr 12 23:18:22 2006
@@ -1,0 +1,39 @@
+/*
+ * Context Handle Functions
+ *
+ * Copyright 2006 Saveliy Tretiakov
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+ 
+ 
+#ifndef __WINE_NDR_CONTEXTH_H
+#define __WINE_NDR_CONTEXTH_H
+
+#include "wine/rpcss_shared.h"
+
+typedef struct _ContextHandleNdr
+{
+	UINT attributes;
+	UUID uuid;
+} ContextHandleNdr;
+
+typedef struct _CContextHandle
+{
+	RpcBinding *Binding;
+	ContextHandleNdr Ndr;
+} CContextHandle;
+
+#endif //__WINE_NDR_CONTEXTH_H




More information about the Ros-diffs mailing list