svn commit: samba r5675 - in branches/SAMBA_4_0/source: build/pidl lib/com lib/com/classes lib/com/dcom librpc torture/com torture/rpc

jelmer at samba.org jelmer at samba.org
Sun Mar 6 22:37:31 GMT 2005


Author: jelmer
Date: 2005-03-06 22:37:31 +0000 (Sun, 06 Mar 2005)
New Revision: 5675

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=5675

Log:
- More DCOM bug fixes
- Keep COM and DCOM more seperated

Added:
   branches/SAMBA_4_0/source/lib/com/dcom/dcom.h
Modified:
   branches/SAMBA_4_0/source/build/pidl/pidl.pl
   branches/SAMBA_4_0/source/lib/com/classes/simple.c
   branches/SAMBA_4_0/source/lib/com/com.h
   branches/SAMBA_4_0/source/lib/com/dcom/main.c
   branches/SAMBA_4_0/source/librpc/config.mk
   branches/SAMBA_4_0/source/torture/com/simple.c
   branches/SAMBA_4_0/source/torture/rpc/oxidresolve.c
   branches/SAMBA_4_0/source/torture/rpc/remact.c


Changeset:
Modified: branches/SAMBA_4_0/source/build/pidl/pidl.pl
===================================================================
--- branches/SAMBA_4_0/source/build/pidl/pidl.pl	2005-03-06 21:43:54 UTC (rev 5674)
+++ branches/SAMBA_4_0/source/build/pidl/pidl.pl	2005-03-06 22:37:31 UTC (rev 5675)
@@ -177,7 +177,7 @@
 			util::FileSave($client, 
 			"#include \"includes.h\"\n" .
 			"#include \"librpc/gen_ndr/com_$basename.h\"\n" . 
-			"#include \"lib/dcom/common/orpc.h\"\n". $res);
+			"#include \"lib/com/dcom/dcom.h\"\n" .$res);
 		}
 		$opt_odl = 1;
 	}

Modified: branches/SAMBA_4_0/source/lib/com/classes/simple.c
===================================================================
--- branches/SAMBA_4_0/source/lib/com/classes/simple.c	2005-03-06 21:43:54 UTC (rev 5674)
+++ branches/SAMBA_4_0/source/lib/com/classes/simple.c	2005-03-06 22:37:31 UTC (rev 5675)
@@ -22,8 +22,8 @@
 #include "lib/com/com.h"
 #include "librpc/gen_ndr/com_dcom.h"
 
-extern const struct IClassFactory_vtable simple_classobject_vtable;
-extern const struct IStream_vtable simple_IStream_vtable;
+extern struct IClassFactory_vtable simple_classobject_vtable;
+extern struct IStream_vtable simple_IStream_vtable;
 
 static WERROR simple_IUnknown_QueryInterface (struct IUnknown *d, TALLOC_CTX *mem_ctx, struct GUID *iid, struct IUnknown **iun)
 {
@@ -69,7 +69,7 @@
 	ret->vtable = &simple_IStream_vtable;
 	ret->object_data = NULL;
 
-	*ppv = ret;
+	*ppv = (struct IUnknown *)ret;
 	
 	return WERR_OK;
 }
@@ -85,7 +85,8 @@
 }
 
 /* Everything below this line should be autogenerated later on */
-const struct IClassFactory_vtable simple_classobject_vtable = {
+struct IClassFactory_vtable simple_classobject_vtable = {
+	{},
 	simpleclass_IUnknown_QueryInterface, 
 	simpleclass_IUnknown_AddRef, 
 	simpleclass_IUnknown_Release,
@@ -95,7 +96,8 @@
 	NULL
 };
 
-const struct IStream_vtable simple_IStream_vtable = {
+struct IStream_vtable simple_IStream_vtable = {
+	{},
 	simple_IUnknown_QueryInterface,
 	simple_IUnknown_AddRef, 
 	simple_IUnknown_Release,
@@ -113,6 +115,8 @@
 	class_object->vtable = (struct IUnknown_vtable *)&simple_classobject_vtable;
 
 	GUID_from_string(CLSID_SIMPLE, &clsid);
+	GUID_from_string(COM_ICLASSFACTORY_UUID, &simple_classobject_vtable.iid);
+	GUID_from_string(COM_ISTREAM_UUID, &simple_IStream_vtable.iid);
 
 	return com_register_running_class(&clsid, PROGID_SIMPLE, class_object);
 }

Modified: branches/SAMBA_4_0/source/lib/com/com.h
===================================================================
--- branches/SAMBA_4_0/source/lib/com/com.h	2005-03-06 21:43:54 UTC (rev 5674)
+++ branches/SAMBA_4_0/source/lib/com/com.h	2005-03-06 22:37:31 UTC (rev 5675)
@@ -25,17 +25,7 @@
 
 struct com_context 
 {
-	struct {
-		const char *domain;
-		const char *user;
-		const char *password;
-		struct dcom_object_exporter {
-			uint64_t oxid;	
-			struct DUALSTRINGARRAY bindings;
-			struct dcerpc_pipe *pipe;
-			struct dcom_object_exporter *prev, *next;
-		} *object_exporters;
-	} dcom;
+	struct dcom_client_context *dcom;
 };
 
 typedef struct IUnknown *(*get_class_object_function) (const struct GUID *clsid);

Added: branches/SAMBA_4_0/source/lib/com/dcom/dcom.h
===================================================================
--- branches/SAMBA_4_0/source/lib/com/dcom/dcom.h	2005-03-06 21:43:54 UTC (rev 5674)
+++ branches/SAMBA_4_0/source/lib/com/dcom/dcom.h	2005-03-06 22:37:31 UTC (rev 5675)
@@ -0,0 +1,36 @@
+/* 
+   Unix SMB/CIFS implementation.
+   COM standard objects
+   Copyright (C) Jelmer Vernooij					  2004-2005.
+   
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
+   
+   This program 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 General Public License for more details.
+   
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+*/
+
+#ifndef _DCOM_H /* _DCOM_H */
+#define _DCOM_H 
+
+struct dcom_client_context {
+	const char *domain;
+	const char *user;
+	const char *password;
+	struct dcom_object_exporter {
+		uint64_t oxid;	
+		struct DUALSTRINGARRAY bindings;
+		struct dcerpc_pipe *pipe;
+		struct dcom_object_exporter *prev, *next;
+	} *object_exporters;
+};
+
+#endif /* _DCOM_H */

Modified: branches/SAMBA_4_0/source/lib/com/dcom/main.c
===================================================================
--- branches/SAMBA_4_0/source/lib/com/dcom/main.c	2005-03-06 21:43:54 UTC (rev 5674)
+++ branches/SAMBA_4_0/source/lib/com/dcom/main.c	2005-03-06 22:37:31 UTC (rev 5675)
@@ -26,6 +26,7 @@
 #include "librpc/gen_ndr/ndr_oxidresolver.h"
 #include "librpc/gen_ndr/ndr_dcom.h"
 #include "librpc/gen_ndr/com_dcom.h"
+#include "lib/com/dcom/dcom.h"
 
 #define DCOM_NEGOTIATED_PROTOCOLS { EPM_PROTOCOL_TCP, EPM_PROTOCOL_SMB, EPM_PROTOCOL_NCALRPC }
 
@@ -71,7 +72,7 @@
 		return dcerpc_pipe_connect_b(p, &bd, 
 					DCERPC_IREMOTEACTIVATION_UUID, 
 					DCERPC_IREMOTEACTIVATION_VERSION, 
-					ctx->dcom.domain, ctx->dcom.user, ctx->dcom.password);
+					ctx->dcom->domain, ctx->dcom->user, ctx->dcom->password);
 	}
 
 	/* Allow server name to contain a binding string */
@@ -79,7 +80,7 @@
 		status = dcerpc_pipe_connect_b(p, &bd, 
 					DCERPC_IREMOTEACTIVATION_UUID, 
 					DCERPC_IREMOTEACTIVATION_VERSION, 
-					ctx->dcom.domain, ctx->dcom.user, ctx->dcom.password);
+					ctx->dcom->domain, ctx->dcom->user, ctx->dcom->password);
 
 		talloc_free(mem_ctx);
 		return status;
@@ -96,7 +97,7 @@
 		status = dcerpc_pipe_connect_b(p, &bd, 
 						DCERPC_IREMOTEACTIVATION_UUID, 
 						DCERPC_IREMOTEACTIVATION_VERSION, 
-						ctx->dcom.domain, ctx->dcom.user, ctx->dcom.password);
+						ctx->dcom->domain, ctx->dcom->user, ctx->dcom->password);
 
 		if (NT_STATUS_IS_OK(status)) {
 			return status;
@@ -279,8 +280,8 @@
 		} else {
 			status = dcerpc_pipe_connect_b(&p, &binding, 
 						       uuid, 0.0, 
-						       iface->ctx->dcom.domain, iface->ctx->dcom.user, 
-						       iface->ctx->dcom.password);
+						       iface->ctx->dcom->domain, iface->ctx->dcom->user, 
+						       iface->ctx->dcom->password);
 		}
 
 		i++;

Modified: branches/SAMBA_4_0/source/librpc/config.mk
===================================================================
--- branches/SAMBA_4_0/source/librpc/config.mk	2005-03-06 21:43:54 UTC (rev 5674)
+++ branches/SAMBA_4_0/source/librpc/config.mk	2005-03-06 22:37:31 UTC (rev 5675)
@@ -448,7 +448,6 @@
 
 [SUBSYSTEM::DCOM_PROXY_DCOM]
 ADD_OBJ_FILES = librpc/gen_ndr/ndr_dcom_c.o
-INIT_FUNCTION = dcom_dcom_init
 REQUIRED_SUBSYSTEMS = LIBRPC NDR_DCOM
 NOPROTO = YES
 

Modified: branches/SAMBA_4_0/source/torture/com/simple.c
===================================================================
--- branches/SAMBA_4_0/source/torture/com/simple.c	2005-03-06 21:43:54 UTC (rev 5674)
+++ branches/SAMBA_4_0/source/torture/com/simple.c	2005-03-06 22:37:31 UTC (rev 5675)
@@ -23,7 +23,6 @@
 #include "lib/com/com.h"
 #include "librpc/gen_ndr/com_dcom.h"
 
-#define CLSID_SIMPLE "5e9ddec7-5767-11cf-beab-00aa006c3606"
 #define DEFAULT_TRANS 4096
 
 static BOOL test_readwrite(TALLOC_CTX *mem_ctx, const char *host)

Modified: branches/SAMBA_4_0/source/torture/rpc/oxidresolve.c
===================================================================
--- branches/SAMBA_4_0/source/torture/rpc/oxidresolve.c	2005-03-06 21:43:54 UTC (rev 5674)
+++ branches/SAMBA_4_0/source/torture/rpc/oxidresolve.c	2005-03-06 22:37:31 UTC (rev 5675)
@@ -23,11 +23,8 @@
 #include "librpc/gen_ndr/ndr_oxidresolver.h"
 #include "librpc/gen_ndr/ndr_remact.h"
 #include "librpc/gen_ndr/ndr_epmapper.h"
+#include "librpc/gen_ndr/com_dcom.h"
 
-#define CLSID_TEST "00000316-0000-0000-C000-000000000046"
-#define CLSID_SIMPLE "5e9ddec7-5767-11cf-beab-00aa006c3606"
-#define CLSID_COFFEEMACHINE "DB7C21F8-FE33-4C11-AEA5-CEB56F076FBB"
-
 static int test_RemoteActivation(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, uint64_t *oxid, struct GUID *oid)
 {
 	struct RemoteActivation r;

Modified: branches/SAMBA_4_0/source/torture/rpc/remact.c
===================================================================
--- branches/SAMBA_4_0/source/torture/rpc/remact.c	2005-03-06 21:43:54 UTC (rev 5674)
+++ branches/SAMBA_4_0/source/torture/rpc/remact.c	2005-03-06 22:37:31 UTC (rev 5675)
@@ -22,11 +22,8 @@
 #include "includes.h"
 #include "librpc/gen_ndr/ndr_remact.h"
 #include "librpc/gen_ndr/ndr_epmapper.h"
+#include "librpc/gen_ndr/com_dcom.h"
 
-#define CLSID_TEST "00000316-0000-0000-C000-000000000046"
-#define CLSID_SIMPLE "5e9ddec7-5767-11cf-beab-00aa006c3606"
-#define CLSID_COFFEEMACHINE "DB7C21F8-FE33-4C11-AEA5-CEB56F076FBB"
-
 static int test_RemoteActivation(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx)
 {
 	struct RemoteActivation r;



More information about the samba-cvs mailing list