diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2004-11-07 16:47:46 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:05:38 -0500 |
commit | 485df40bf96abbd80d69ff2a9fdca86516a4eae7 (patch) | |
tree | 1693fd3073bb4d5d0db2f465b8d4c5c2f604fdee /source4/torture | |
parent | 63b2fef51ec3d2e4a8eaddc85ebb1a1ddbf95031 (diff) | |
download | samba-485df40bf96abbd80d69ff2a9fdca86516a4eae7.tar.gz samba-485df40bf96abbd80d69ff2a9fdca86516a4eae7.tar.bz2 samba-485df40bf96abbd80d69ff2a9fdca86516a4eae7.zip |
r3601: Lots of smaller DCOM updates and fixes. Adds oxid tables, proper
use of contexts.
(This used to be commit 93eb3cd99c4fb065a69eabcead0c33804259c976)
Diffstat (limited to 'source4/torture')
-rw-r--r-- | source4/torture/dcom/simple.c | 30 | ||||
-rw-r--r-- | source4/torture/rpc/remact.c | 4 |
2 files changed, 25 insertions, 9 deletions
diff --git a/source4/torture/dcom/simple.c b/source4/torture/dcom/simple.c index 112ebcacc6..d057bf9627 100644 --- a/source4/torture/dcom/simple.c +++ b/source4/torture/dcom/simple.c @@ -38,13 +38,23 @@ BOOL torture_dcom_simple(void) struct dcom_interface *interfaces; struct IStream_Read r_read; struct IStream_Write r_write; + WERROR results[2]; + struct dcom_context *ctx; mem_ctx = talloc_init("torture_dcom_simple"); + dcom_init(&ctx, lp_parm_string(-1, "torture", "userdomain"), + lp_parm_string(-1, "torture", "username"), + lp_parm_string(-1, "torture", "password")); + GUID_from_string(DCERPC_ISTREAM_UUID, &IID[0]); GUID_from_string(DCERPC_IUNKNOWN_UUID, &IID[1]); GUID_from_string(CLSID_SIMPLE, &clsid); - error = dcom_create_object(mem_ctx, &clsid, lp_parm_string(-1, "torture", "binding"), 2, IID, &interfaces, lp_parm_string(-1, "torture", "userdomain"), lp_parm_string(-1, "torture", "username"), lp_parm_string(-1, "torture", "password")); + error = dcom_create_object(ctx, &clsid, + lp_parm_string(-1, "torture", "binding"), 2, IID, + &interfaces, + results); + if (!W_ERROR_IS_OK(error)) { printf("dcom_create_object failed - %s\n", win_errstr(error)); @@ -52,19 +62,23 @@ BOOL torture_dcom_simple(void) } ZERO_STRUCT(r_read); - status = dcerpc_IStream_Read(interfaces[0].pipe, NULL, mem_ctx, &r_read); - if (NT_STATUS_IS_ERR(error)) { - printf("IStream::Read() failed - %s\n", win_errstr(error)); + status = dcerpc_IStream_Read(&interfaces[0], mem_ctx, &r_read); + if (NT_STATUS_IS_ERR(status)) { + printf("IStream::Read() failed - %s\n", nt_errstr(status)); return False; } - status = dcerpc_IStream_Write(interfaces[0].pipe, NULL, mem_ctx, &r_write); - if (NT_STATUS_IS_ERR(error)) { - printf("IStream::Write() failed - %s\n", win_errstr(error)); + status = dcerpc_IStream_Write(&interfaces[0], mem_ctx, &r_write); + if (NT_STATUS_IS_ERR(status)) { + printf("IStream::Write() failed - %s\n", nt_errstr(status)); return False; } - /*FIXME: dcerpc_IUnknown_Release();*/ + status = dcerpc_IUnknown_Release(&interfaces[1], mem_ctx, NULL); + if (NT_STATUS_IS_ERR(status)) { + printf("IUnknown::Release() failed - %s\n", nt_errstr(status)); + return False; + } talloc_destroy(mem_ctx); diff --git a/source4/torture/rpc/remact.c b/source4/torture/rpc/remact.c index 073b8177c6..2e09f84da6 100644 --- a/source4/torture/rpc/remact.c +++ b/source4/torture/rpc/remact.c @@ -42,8 +42,9 @@ static int test_RemoteActivation(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx) r.in.ClientImpLevel = RPC_C_IMP_LEVEL_IDENTIFY; r.in.num_protseqs = 3; r.in.protseq = protseq; - r.in.Interfaces = 1; + r.in.Interfaces = 2; GUID_from_string(DCERPC_IUNKNOWN_UUID, &iids[0]); + GUID_from_string(DCERPC_ISTREAM_UUID, &iids[1]); r.in.pIIDs = iids; status = dcerpc_RemoteActivation(p, mem_ctx, &r); @@ -68,6 +69,7 @@ static int test_RemoteActivation(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx) } GUID_from_string(DCERPC_ICLASSFACTORY_UUID, &iids[0]); + r.in.Interfaces = 1; r.in.Mode = MODE_GET_CLASS_OBJECT; status = dcerpc_RemoteActivation(p, mem_ctx, &r); |