From 1b1b678cc8c79dacc3b80de4f8203154d47c0345 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sun, 9 Jan 2005 21:35:37 +0000 Subject: r4624: Several crash fixes for DCOM More work on the example class implementation (This used to be commit 1f8f4dd179d5aa0472c676d115dc2fc1749ce32d) --- source4/torture/dcom/simple.c | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) (limited to 'source4/torture') 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; } -- cgit