diff options
Diffstat (limited to 'source4/torture')
-rw-r--r-- | source4/torture/dcom/simple.c | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/source4/torture/dcom/simple.c b/source4/torture/dcom/simple.c index 287e35142e..85bf194091 100644 --- a/source4/torture/dcom/simple.c +++ b/source4/torture/dcom/simple.c @@ -35,16 +35,21 @@ BOOL torture_dcom_simple(void) struct GUID IID[2]; struct GUID clsid; WERROR error; - struct dcom_interface *interfaces; - struct IStream_Read r_read; - struct IStream_Write r_write; + struct dcom_interface_p **interfaces; + struct Read r_read; + struct Write r_write; WERROR results[2]; struct dcom_context *ctx; char test_data[5]; int i; + extern NTSTATUS dcom_IUnknown_init(void); + extern NTSTATUS dcom_IStream_init(void); mem_ctx = talloc_init("torture_dcom_simple"); + dcom_IUnknown_init(); + dcom_IStream_init(); + dcom_init(&ctx, lp_parm_string(-1, "torture", "userdomain"), lp_parm_string(-1, "torture", "username"), lp_parm_string(-1, "torture", "password")); @@ -62,10 +67,15 @@ BOOL torture_dcom_simple(void) printf("dcom_create_object failed - %s\n", win_errstr(error)); return False; } + + if (!W_ERROR_IS_OK(results[0])) { + printf("dcom_create_object didn't return IStream interface - %s\n", win_errstr(results[0])); + return False; + } ZERO_STRUCT(r_read); r_read.in.num_requested = 20; /* Give me 20 0xFF bytes... */ - status = dcerpc_IStream_Read(&interfaces[0], mem_ctx, &r_read); + status = dcom_IStream_Read(interfaces[0], mem_ctx, &r_read); if (NT_STATUS_IS_ERR(status)) { printf("IStream::Read() failed - %s\n", nt_errstr(status)); ret = False; @@ -79,7 +89,7 @@ BOOL torture_dcom_simple(void) } r_write.in.num_requested = 5; r_write.in.data = (uint8_t *)&test_data; - status = dcerpc_IStream_Write(&interfaces[0], mem_ctx, &r_write); + status = dcom_IStream_Write(interfaces[0], mem_ctx, &r_write); if (NT_STATUS_IS_ERR(status)) { printf("IStream::Write() failed - %s\n", nt_errstr(status)); ret = False; @@ -88,7 +98,7 @@ BOOL torture_dcom_simple(void) ret = False; } - status = dcerpc_IUnknown_Release(&interfaces[1], mem_ctx, NULL); + status = dcom_IUnknown_Release(interfaces[1], mem_ctx, NULL); if (NT_STATUS_IS_ERR(status)) { printf("IUnknown::Release() failed - %s\n", nt_errstr(status)); return False; |