diff options
Diffstat (limited to 'source4/lib/dcom/common')
-rw-r--r-- | source4/lib/dcom/common/dcom.h | 2 | ||||
-rw-r--r-- | source4/lib/dcom/common/main.c | 19 |
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 = ± 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; } |