summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
Diffstat (limited to 'source4')
-rw-r--r--source4/librpc/idl/winreg.idl17
-rw-r--r--source4/torture/rpc/winreg.c52
2 files changed, 63 insertions, 6 deletions
diff --git a/source4/librpc/idl/winreg.idl b/source4/librpc/idl/winreg.idl
index c41f75a3b2..68b13f8245 100644
--- a/source4/librpc/idl/winreg.idl
+++ b/source4/librpc/idl/winreg.idl
@@ -7,6 +7,12 @@
pointer_default(unique)
] interface winreg
{
+ typedef struct {
+ [value(2*strlen_m(r->name))] uint16 name_len;
+ [value(r->name_len)] uint16 name_size;
+ unistr_noterm *name;
+ } winreg_String;
+
/******************/
/* Function: 0x00 */
NTSTATUS winreg_OpenHKCR(
@@ -54,11 +60,15 @@
/******************/
/* Function: 0x07 */
NTSTATUS winreg_DeleteKey(
+ [in,ref] policy_handle *handle,
+ [in] winreg_String key
);
/******************/
/* Function: 0x08 */
NTSTATUS winreg_DeleteValue(
+ [in,ref] policy_handle *handle,
+ [in] winreg_String value
);
typedef struct {
@@ -66,12 +76,6 @@
uint32 high;
} winreg_Time;
- typedef struct {
- [value(2*strlen_m(r->name))] uint16 name_len;
- [value(r->name_len)] uint16 name_size;
- unistr_noterm *name;
- } winreg_String;
-
/******************/
/* Function: 0x09 */
NTSTATUS winreg_EnumKey(
@@ -85,6 +89,7 @@
/******************/
/* Function: 0x0b */
NTSTATUS winreg_FlushKey(
+ [in,ref] policy_handle *handle
);
/******************/
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;
}