summaryrefslogtreecommitdiff
path: root/source4/lib
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2004-11-04 01:09:43 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:05:27 -0500
commit695677f4bb078291c683931d5017f339811abf90 (patch)
tree3711e7f7b111c192067e09a34a6cc255c9a6056d /source4/lib
parent9a65c54c72cb5cbbe3d57df32193568850266b3b (diff)
downloadsamba-695677f4bb078291c683931d5017f339811abf90.tar.gz
samba-695677f4bb078291c683931d5017f339811abf90.tar.bz2
samba-695677f4bb078291c683931d5017f339811abf90.zip
r3515: Fix RemoteActivation correctly this time (-:
Thanks to tridge for some help on this one! (This used to be commit 1104667190aa144e2c7d79ece9a55502b98d0351)
Diffstat (limited to 'source4/lib')
-rw-r--r--source4/lib/dcom/common/dcom.h2
-rw-r--r--source4/lib/dcom/common/main.c19
2 files changed, 16 insertions, 5 deletions
diff --git a/source4/lib/dcom/common/dcom.h b/source4/lib/dcom/common/dcom.h
index 091200d4c1..d97364a125 100644
--- a/source4/lib/dcom/common/dcom.h
+++ b/source4/lib/dcom/common/dcom.h
@@ -28,7 +28,7 @@ struct IUnknown_QueryInterface;
struct dcom_interface
{
struct dcerpc_pipe *pipe;
- struct GUID ipid; /* Appears in object field */
+ struct OBJREF object;
};
#endif /* _DCOM_H */
diff --git a/source4/lib/dcom/common/main.c b/source4/lib/dcom/common/main.c
index 3c95caebe0..5bc8e5c6d4 100644
--- a/source4/lib/dcom/common/main.c
+++ b/source4/lib/dcom/common/main.c
@@ -90,6 +90,7 @@ NTSTATUS dcerpc_IUnknown_QueryInterface(struct dcerpc_pipe *p, struct GUID *o, T
WERROR dcom_create_object(TALLOC_CTX *mem_ctx, struct GUID *clsid, const char *server, int num_ifaces, struct GUID *iid, struct dcom_interface **ip, const char *domain, const char *user, const char *pass)
{
struct RemoteActivation r;
+ int i;
struct dcerpc_pipe *p;
NTSTATUS status;
uint16 protseq[] = DCOM_NEGOTIATED_PROTOCOLS;
@@ -110,7 +111,8 @@ WERROR dcom_create_object(TALLOC_CTX *mem_ctx, struct GUID *clsid, const char *s
r.in.protseq = protseq;
r.in.Interfaces = num_ifaces;
r.in.pIIDs = iid;
-
+ r.out.ifaces = talloc_array_p(mem_ctx, struct pMInterfacePointer, num_ifaces);
+
status = dcerpc_RemoteActivation(p, mem_ctx, &r);
if(NT_STATUS_IS_ERR(status)) {
DEBUG(1, ("Error while running RemoteActivation %s\n", nt_errstr(status)));
@@ -121,15 +123,21 @@ WERROR dcom_create_object(TALLOC_CTX *mem_ctx, struct GUID *clsid, const char *s
if(!W_ERROR_IS_OK(r.out.hr)) { return r.out.hr; }
if(!W_ERROR_IS_OK(r.out.results[0])) { return r.out.results[0]; }
- /* FIXME: Fill ip */
+ *ip = talloc_array_p(mem_ctx, struct dcom_interface, num_ifaces);
+ for (i = 0; i < num_ifaces; i++) {
+ (*ip)[i].object = r.out.ifaces[i].p->obj;
+ (*ip)[i].pipe = NULL; /* FIXME */
+ }
+
return WERR_OK;
}
-WERROR dcom_get_class_object(TALLOC_CTX *mem_ctx, struct GUID *clsid, const char *server, struct GUID *iid, struct dcom_interface **ip, const char *domain, const char *user, const char *pass)
+WERROR dcom_get_class_object(TALLOC_CTX *mem_ctx, struct GUID *clsid, const char *server, struct GUID *iid, struct dcom_interface *ip, const char *domain, const char *user, const char *pass)
{
struct RemoteActivation r;
struct dcerpc_pipe *p;
NTSTATUS status;
+ struct pMInterfacePointer pm;
uint16 protseq[] = DCOM_NEGOTIATED_PROTOCOLS;
status = dcom_connect(&p, server, domain, user, pass);
@@ -149,6 +157,7 @@ WERROR dcom_get_class_object(TALLOC_CTX *mem_ctx, struct GUID *clsid, const char
r.in.Interfaces = 1;
r.in.pIIDs = iid;
r.in.Mode = MODE_GET_CLASS_OBJECT;
+ r.out.ifaces = &pm;
status = dcerpc_RemoteActivation(p, mem_ctx, &r);
if(NT_STATUS_IS_ERR(status)) {
@@ -160,6 +169,8 @@ WERROR dcom_get_class_object(TALLOC_CTX *mem_ctx, struct GUID *clsid, const char
if(!W_ERROR_IS_OK(r.out.hr)) { return r.out.hr; }
if(!W_ERROR_IS_OK(r.out.results[0])) { return r.out.results[0]; }
- /* FIXME: Fill ip */
+ ip->pipe = NULL; /* FIXME */
+ ip->object = pm.p->obj;
+
return WERR_OK;
}