1
0
mirror of https://github.com/samba-team/samba.git synced 2025-11-26 04:23:49 +03:00

r3513: Add (the infrastructure for) DCOM support. Contents:

- Support for sending over the object UUID in DCERPC calls
 - Simple torture test for the DCOM "Simple" object
 - Generate extra argument for "object" interfaces in pidl
 - Some stubs for common DCOM functions
This commit is contained in:
Jelmer Vernooij
2004-11-03 20:32:28 +00:00
committed by Gerald (Jerry) Carter
parent f631069582
commit c052f2e1ed
24 changed files with 309 additions and 69 deletions

View File

@@ -34,39 +34,6 @@ static WERROR dcom_tower_from_oxid(TALLOC_CTX *mem_ctx, HYPER_T oxid, struct epm
return WERR_NOT_SUPPORTED;
}
static WERROR dcom_get_class_object (struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, struct GUID clsid)
{
struct RemoteActivation r;
NTSTATUS status;
struct GUID iids[2];
uint16 protseq[3] = { EPM_PROTOCOL_TCP, EPM_PROTOCOL_NCALRPC, EPM_PROTOCOL_UUID };
ZERO_STRUCT(r.in);
r.in.this.version.MajorVersion = 5;
r.in.this.version.MinorVersion = 1;
uuid_generate_random(&r.in.this.cid);
r.in.Clsid = clsid;
r.in.ClientImpLevel = RPC_C_IMP_LEVEL_IDENTIFY;
r.in.num_protseqs = 3;
r.in.protseq = protseq;
r.in.Interfaces = 1;
GUID_from_string(DCERPC_IUNKNOWN_UUID, &iids[0]);
r.in.pIIDs = iids;
r.in.Mode = MODE_GET_CLASS_OBJECT;
status = dcerpc_RemoteActivation(p, mem_ctx, &r);
if(NT_STATUS_IS_ERR(status)) {
fprintf(stderr, "RemoteActivation: %s\n", nt_errstr(status));
return ntstatus_to_werror(status);
}
if(!W_ERROR_IS_OK(r.out.result)) { return r.out.result; }
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]; }
return WERR_OK;
}
static WERROR dcom_create_instance (struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, struct GUID clsid)
{
return WERR_NOT_SUPPORTED;
@@ -90,3 +57,43 @@ static WERROR IUnknown_QueryInterface(struct GUID *riid, void **data)
* call RemQueryInterface if necessary */
return WERR_NOT_SUPPORTED;
}
WERROR dcom_create_object(TALLOC_CTX *mem_ctx, struct GUID *clsid, const char *server, int num_ifaces, struct GUID *iid, struct dcom_interface **ip)
{
return WERR_NOT_SUPPORTED;
}
WERROR dcom_get_class_object(TALLOC_CTX *mem_ctx, struct GUID *clsid, const char *server, struct GUID *iid, struct dcom_interface **ip)
{
struct RemoteActivation r;
struct dcerpc_pipe *p = NULL; /* FIXME */
NTSTATUS status;
struct GUID iids[2];
uint16 protseq[3] = { EPM_PROTOCOL_TCP, EPM_PROTOCOL_NCALRPC, EPM_PROTOCOL_UUID };
ZERO_STRUCT(r.in);
r.in.this.version.MajorVersion = 5;
r.in.this.version.MinorVersion = 1;
uuid_generate_random(&r.in.this.cid);
r.in.Clsid = *clsid;
r.in.ClientImpLevel = RPC_C_IMP_LEVEL_IDENTIFY;
r.in.num_protseqs = 3;
r.in.protseq = protseq;
r.in.Interfaces = 1;
GUID_from_string(DCERPC_IUNKNOWN_UUID, &iids[0]);
r.in.pIIDs = iids;
r.in.Mode = MODE_GET_CLASS_OBJECT;
status = dcerpc_RemoteActivation(p, mem_ctx, &r);
if(NT_STATUS_IS_ERR(status)) {
fprintf(stderr, "RemoteActivation: %s\n", nt_errstr(status));
return ntstatus_to_werror(status);
}
if(!W_ERROR_IS_OK(r.out.result)) { return r.out.result; }
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]; }
return WERR_NOT_SUPPORTED;
}