summaryrefslogtreecommitdiff
path: root/source4/torture/dcom
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2005-01-09 21:35:37 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:08:35 -0500
commit1b1b678cc8c79dacc3b80de4f8203154d47c0345 (patch)
tree91a0bea56f16740a41ff64ba95914c4c06f89b11 /source4/torture/dcom
parent1303f51099c2054c3966c6ba34490c5ffad85c13 (diff)
downloadsamba-1b1b678cc8c79dacc3b80de4f8203154d47c0345.tar.gz
samba-1b1b678cc8c79dacc3b80de4f8203154d47c0345.tar.bz2
samba-1b1b678cc8c79dacc3b80de4f8203154d47c0345.zip
r4624: Several crash fixes for DCOM
More work on the example class implementation (This used to be commit 1f8f4dd179d5aa0472c676d115dc2fc1749ce32d)
Diffstat (limited to 'source4/torture/dcom')
-rw-r--r--source4/torture/dcom/simple.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/source4/torture/dcom/simple.c b/source4/torture/dcom/simple.c
index 9dd750baad..102a3f0dab 100644
--- a/source4/torture/dcom/simple.c
+++ b/source4/torture/dcom/simple.c
@@ -26,11 +26,10 @@
#define CLSID_SIMPLE "5e9ddec7-5767-11cf-beab-00aa006c3606"
#define DEFAULT_TRANS 4096
-BOOL torture_dcom_simple(void)
+static BOOL test_readwrite(TALLOC_CTX *mem_ctx, const char *host)
{
NTSTATUS status;
struct dcerpc_pipe *p = NULL;
- TALLOC_CTX *mem_ctx;
BOOL ret = True;
struct GUID IID[2];
struct GUID clsid;
@@ -45,18 +44,15 @@ BOOL torture_dcom_simple(void)
extern NTSTATUS dcom_IUnknown_init(void);
extern NTSTATUS dcom_IStream_init(void);
- mem_ctx = talloc_init("torture_dcom_simple");
-
torture_dcom_init(&ctx);
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(ctx, &clsid,
- lp_parm_string(-1, "torture", "dcomhost"), 2, IID,
+ host, 2, IID,
&interfaces,
results);
-
if (!W_ERROR_IS_OK(error)) {
printf("dcom_create_object failed - %s\n", win_errstr(error));
@@ -102,5 +98,17 @@ BOOL torture_dcom_simple(void)
talloc_destroy(mem_ctx);
torture_rpc_close(p);
+
+ return True;
+}
+
+BOOL torture_dcom_simple(void)
+{
+ BOOL ret = True;
+ TALLOC_CTX *mem_ctx = talloc_init("torture_dcom_simple");
+
+ ret &= test_readwrite(mem_ctx, NULL);
+ ret &= test_readwrite(mem_ctx, lp_parm_string(-1, "torture", "dcomhost"));
+
return ret;
}