diff options
author | Tim Potter <tpot@samba.org> | 2003-11-21 06:14:14 +0000 |
---|---|---|
committer | Tim Potter <tpot@samba.org> | 2003-11-21 06:14:14 +0000 |
commit | 82d6f5587b6052a226f90a82314573fb348fb0ce (patch) | |
tree | 2b6dd68275d7debd16855d5388815c3ea237d58b /source4/torture | |
parent | 49c02c66349237b6b8b62321589564d2d31ab11e (diff) | |
download | samba-82d6f5587b6052a226f90a82314573fb348fb0ce.tar.gz samba-82d6f5587b6052a226f90a82314573fb348fb0ce.tar.bz2 samba-82d6f5587b6052a226f90a82314573fb348fb0ce.zip |
Implement DeleteKey, DeleteValue, FlushKey.
(This used to be commit 49f1654510f0ea7681b386296b67282791c4b319)
Diffstat (limited to 'source4/torture')
-rw-r--r-- | source4/torture/rpc/winreg.c | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/source4/torture/rpc/winreg.c b/source4/torture/rpc/winreg.c index 4931f54ea1..88a450e52c 100644 --- a/source4/torture/rpc/winreg.c +++ b/source4/torture/rpc/winreg.c @@ -21,6 +21,13 @@ #include "includes.h" +static void init_winreg_String(struct winreg_String *name, const char *s) +{ + name->name = s; + name->name_len = 2*strlen_m(s); + name->name_size = name->name_len; +} + static BOOL test_GetVersion(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, struct policy_handle *handle) { @@ -61,6 +68,47 @@ static BOOL test_CloseKey(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, return True; } +static BOOL test_FlushKey(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, + struct policy_handle *handle) +{ + NTSTATUS status; + struct winreg_FlushKey r; + + printf("\ntesting FlushKey\n"); + + r.in.handle = handle; + + status = dcerpc_winreg_FlushKey(p, mem_ctx, &r); + + if (!NT_STATUS_IS_OK(status)) { + printf("FlushKey failed - %s\n", nt_errstr(status)); + return False; + } + + return True; +} + +static BOOL test_DeleteKey(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, + struct policy_handle *handle, char *key) +{ + NTSTATUS status; + struct winreg_DeleteKey r; + + printf("\ntesting DeleteKey\n"); + + r.in.handle = handle; + init_winreg_String(&r.in.key, key); + + status = dcerpc_winreg_DeleteKey(p, mem_ctx, &r); + + if (!NT_STATUS_IS_OK(status)) { + printf("DeleteKey failed - %s\n", nt_errstr(status)); + return False; + } + + return True; +} + static BOOL test_OpenHKLM(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx) { NTSTATUS status; @@ -88,6 +136,10 @@ static BOOL test_OpenHKLM(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx) ret = False; } + if (!test_DeleteKey(p, mem_ctx, &handle, "spottyfoot")) { + ret = False; + } + if (!test_CloseKey(p, mem_ctx, &handle)) { ret = False; } |