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/dcom | |
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/dcom')
-rw-r--r-- | source4/torture/dcom/simple.c | 30 |
1 files changed, 22 insertions, 8 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); |