From 43ddb0a7ae419d7050cb93e1c8836db7672c7093 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sat, 11 Dec 2004 23:28:48 +0000 Subject: r4156: GetKeySecurity() IDL and torture test (This used to be commit 1c49de51aeb6041a3b53b8da7dc8e2bcf089bfe0) --- source4/torture/rpc/winreg.c | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) (limited to 'source4/torture') diff --git a/source4/torture/rpc/winreg.c b/source4/torture/rpc/winreg.c index be1ca03b6f..183128d371 100644 --- a/source4/torture/rpc/winreg.c +++ b/source4/torture/rpc/winreg.c @@ -95,6 +95,36 @@ static BOOL test_CreateKey(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, return True; } +static BOOL test_GetKeySecurity(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, + struct policy_handle *handle) +{ + NTSTATUS status; + struct winreg_GetKeySecurity r; + + printf("\ntesting GetKeySecurity\n"); + + ZERO_STRUCT(r); + + r.in.handle = handle; + r.in.data = r.out.data = talloc_zero_p(mem_ctx, struct KeySecurityData); + r.in.data->size = 0xffff; + r.in.access_mask = SEC_FLAG_MAXIMUM_ALLOWED; + + status = dcerpc_winreg_GetKeySecurity(p, mem_ctx, &r); + + if (!NT_STATUS_IS_OK(status)) { + printf("GetKeySecurity failed - %s\n", nt_errstr(status)); + return False; + } + + if (!W_ERROR_IS_OK(r.out.result)) { + printf("GetKeySecurity failed - %s\n", win_errstr(r.out.result)); + return False; + } + + return False; +} + static BOOL test_CloseKey(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, struct policy_handle *handle) { @@ -540,12 +570,17 @@ static BOOL test_key(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, if (!test_QueryInfoKey(p, mem_ctx, handle, NULL)) { } + + if (!test_GetKeySecurity(p, mem_ctx, handle)) { + } + if (!test_EnumKey(p, mem_ctx, handle, depth)) { } if (!test_EnumValue(p, mem_ctx, handle, 0xFF, 0xFFFF)) { } + test_CloseKey(p, mem_ctx, handle); return True; -- cgit