diff options
-rw-r--r-- | librpc/gen_ndr/cli_winreg.c | 12 | ||||
-rw-r--r-- | librpc/gen_ndr/cli_winreg.h | 8 | ||||
-rw-r--r-- | librpc/gen_ndr/ndr_winreg.c | 38 | ||||
-rw-r--r-- | librpc/gen_ndr/ndr_winreg.h | 1 | ||||
-rw-r--r-- | librpc/gen_ndr/winreg.h | 19 | ||||
-rw-r--r-- | librpc/idl/winreg.idl | 10 | ||||
-rw-r--r-- | source4/lib/registry/rpc.c | 2 | ||||
-rw-r--r-- | source4/torture/ndr/winreg.c | 2 | ||||
-rw-r--r-- | source4/torture/rpc/samba3rpc.c | 4 | ||||
-rw-r--r-- | source4/torture/rpc/spoolss.c | 2 | ||||
-rw-r--r-- | source4/torture/rpc/winreg.c | 2 |
11 files changed, 74 insertions, 26 deletions
diff --git a/librpc/gen_ndr/cli_winreg.c b/librpc/gen_ndr/cli_winreg.c index 1c37f51986..0afc00ce16 100644 --- a/librpc/gen_ndr/cli_winreg.c +++ b/librpc/gen_ndr/cli_winreg.c @@ -939,7 +939,7 @@ struct tevent_req *rpccli_winreg_CreateKey_send(TALLOC_CTX *mem_ctx, struct policy_handle *_handle /* [in] [ref] */, struct winreg_String _name /* [in] */, struct winreg_String _keyclass /* [in] */, - uint32_t _options /* [in] */, + enum winreg_KeyType _options /* [in] */, uint32_t _access_mask /* [in] */, struct winreg_SecBuf *_secdesc /* [in] [unique] */, struct policy_handle *_new_handle /* [out] [ref] */, @@ -1058,7 +1058,7 @@ NTSTATUS rpccli_winreg_CreateKey(struct rpc_pipe_client *cli, struct policy_handle *handle /* [in] [ref] */, struct winreg_String name /* [in] */, struct winreg_String keyclass /* [in] */, - uint32_t options /* [in] */, + enum winreg_KeyType options /* [in] */, uint32_t access_mask /* [in] */, struct winreg_SecBuf *secdesc /* [in] [unique] */, struct policy_handle *new_handle /* [out] [ref] */, @@ -2388,7 +2388,7 @@ struct tevent_req *rpccli_winreg_OpenKey_send(TALLOC_CTX *mem_ctx, struct rpc_pipe_client *cli, struct policy_handle *_parent_handle /* [in] [ref] */, struct winreg_String _keyname /* [in] */, - uint32_t _unknown /* [in] */, + enum winreg_KeyType _options /* [in] */, uint32_t _access_mask /* [in] */, struct policy_handle *_handle /* [out] [ref] */) { @@ -2407,7 +2407,7 @@ struct tevent_req *rpccli_winreg_OpenKey_send(TALLOC_CTX *mem_ctx, /* In parameters */ state->orig.in.parent_handle = _parent_handle; state->orig.in.keyname = _keyname; - state->orig.in.unknown = _unknown; + state->orig.in.options = _options; state->orig.in.access_mask = _access_mask; /* Out parameters */ @@ -2497,7 +2497,7 @@ NTSTATUS rpccli_winreg_OpenKey(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, struct policy_handle *parent_handle /* [in] [ref] */, struct winreg_String keyname /* [in] */, - uint32_t unknown /* [in] */, + enum winreg_KeyType options /* [in] */, uint32_t access_mask /* [in] */, struct policy_handle *handle /* [out] [ref] */, WERROR *werror) @@ -2508,7 +2508,7 @@ NTSTATUS rpccli_winreg_OpenKey(struct rpc_pipe_client *cli, /* In parameters */ r.in.parent_handle = parent_handle; r.in.keyname = keyname; - r.in.unknown = unknown; + r.in.options = options; r.in.access_mask = access_mask; status = cli->dispatch(cli, diff --git a/librpc/gen_ndr/cli_winreg.h b/librpc/gen_ndr/cli_winreg.h index bbd9e9a305..bccdbc437b 100644 --- a/librpc/gen_ndr/cli_winreg.h +++ b/librpc/gen_ndr/cli_winreg.h @@ -93,7 +93,7 @@ struct tevent_req *rpccli_winreg_CreateKey_send(TALLOC_CTX *mem_ctx, struct policy_handle *_handle /* [in] [ref] */, struct winreg_String _name /* [in] */, struct winreg_String _keyclass /* [in] */, - uint32_t _options /* [in] */, + enum winreg_KeyType _options /* [in] */, uint32_t _access_mask /* [in] */, struct winreg_SecBuf *_secdesc /* [in] [unique] */, struct policy_handle *_new_handle /* [out] [ref] */, @@ -106,7 +106,7 @@ NTSTATUS rpccli_winreg_CreateKey(struct rpc_pipe_client *cli, struct policy_handle *handle /* [in] [ref] */, struct winreg_String name /* [in] */, struct winreg_String keyclass /* [in] */, - uint32_t options /* [in] */, + enum winreg_KeyType options /* [in] */, uint32_t access_mask /* [in] */, struct winreg_SecBuf *secdesc /* [in] [unique] */, struct policy_handle *new_handle /* [out] [ref] */, @@ -249,7 +249,7 @@ struct tevent_req *rpccli_winreg_OpenKey_send(TALLOC_CTX *mem_ctx, struct rpc_pipe_client *cli, struct policy_handle *_parent_handle /* [in] [ref] */, struct winreg_String _keyname /* [in] */, - uint32_t _unknown /* [in] */, + enum winreg_KeyType _options /* [in] */, uint32_t _access_mask /* [in] */, struct policy_handle *_handle /* [out] [ref] */); NTSTATUS rpccli_winreg_OpenKey_recv(struct tevent_req *req, @@ -259,7 +259,7 @@ NTSTATUS rpccli_winreg_OpenKey(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, struct policy_handle *parent_handle /* [in] [ref] */, struct winreg_String keyname /* [in] */, - uint32_t unknown /* [in] */, + enum winreg_KeyType options /* [in] */, uint32_t access_mask /* [in] */, struct policy_handle *handle /* [out] [ref] */, WERROR *werror); diff --git a/librpc/gen_ndr/ndr_winreg.c b/librpc/gen_ndr/ndr_winreg.c index 6f432d37c5..609cc59cc5 100644 --- a/librpc/gen_ndr/ndr_winreg.c +++ b/librpc/gen_ndr/ndr_winreg.c @@ -217,6 +217,32 @@ _PUBLIC_ void ndr_print_winreg_SecBuf(struct ndr_print *ndr, const char *name, c ndr->depth--; } +static enum ndr_err_code ndr_push_winreg_KeyType(struct ndr_push *ndr, int ndr_flags, enum winreg_KeyType r) +{ + NDR_CHECK(ndr_push_enum_uint32(ndr, NDR_SCALARS, r)); + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_winreg_KeyType(struct ndr_pull *ndr, int ndr_flags, enum winreg_KeyType *r) +{ + uint32_t v; + NDR_CHECK(ndr_pull_enum_uint32(ndr, NDR_SCALARS, &v)); + *r = v; + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_winreg_KeyType(struct ndr_print *ndr, const char *name, enum winreg_KeyType r) +{ + const char *val = NULL; + + switch (r) { + case REG_KEYTYPE_NON_VOLATILE: val = "REG_KEYTYPE_NON_VOLATILE"; break; + case REG_KEYTYPE_VOLATILE: val = "REG_KEYTYPE_VOLATILE"; break; + case REG_KEYTYPE_SYMLINK: val = "REG_KEYTYPE_SYMLINK"; break; + } + ndr_print_enum(ndr, name, "ENUM", val, r); +} + static enum ndr_err_code ndr_push_winreg_CreateAction(struct ndr_push *ndr, int ndr_flags, enum winreg_CreateAction r) { NDR_CHECK(ndr_push_enum_uint32(ndr, NDR_SCALARS, r)); @@ -1041,7 +1067,7 @@ _PUBLIC_ enum ndr_err_code ndr_push_winreg_CreateKey(struct ndr_push *ndr, int f NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle)); NDR_CHECK(ndr_push_winreg_String(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.name)); NDR_CHECK(ndr_push_winreg_String(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.keyclass)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.options)); + NDR_CHECK(ndr_push_winreg_KeyType(ndr, NDR_SCALARS, r->in.options)); NDR_CHECK(ndr_push_winreg_AccessMask(ndr, NDR_SCALARS, r->in.access_mask)); NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.secdesc)); if (r->in.secdesc) { @@ -1086,7 +1112,7 @@ _PUBLIC_ enum ndr_err_code ndr_pull_winreg_CreateKey(struct ndr_pull *ndr, int f NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC); NDR_CHECK(ndr_pull_winreg_String(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.name)); NDR_CHECK(ndr_pull_winreg_String(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.keyclass)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.options)); + NDR_CHECK(ndr_pull_winreg_KeyType(ndr, NDR_SCALARS, &r->in.options)); NDR_CHECK(ndr_pull_winreg_AccessMask(ndr, NDR_SCALARS, &r->in.access_mask)); NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_secdesc)); if (_ptr_secdesc) { @@ -1156,7 +1182,7 @@ _PUBLIC_ void ndr_print_winreg_CreateKey(struct ndr_print *ndr, const char *name ndr->depth--; ndr_print_winreg_String(ndr, "name", &r->in.name); ndr_print_winreg_String(ndr, "keyclass", &r->in.keyclass); - ndr_print_uint32(ndr, "options", r->in.options); + ndr_print_winreg_KeyType(ndr, "options", r->in.options); ndr_print_winreg_AccessMask(ndr, "access_mask", r->in.access_mask); ndr_print_ptr(ndr, "secdesc", r->in.secdesc); ndr->depth++; @@ -2153,7 +2179,7 @@ _PUBLIC_ enum ndr_err_code ndr_push_winreg_OpenKey(struct ndr_push *ndr, int fla } NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.parent_handle)); NDR_CHECK(ndr_push_winreg_String(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.keyname)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.unknown)); + NDR_CHECK(ndr_push_winreg_KeyType(ndr, NDR_SCALARS, r->in.options)); NDR_CHECK(ndr_push_winreg_AccessMask(ndr, NDR_SCALARS, r->in.access_mask)); } if (flags & NDR_OUT) { @@ -2181,7 +2207,7 @@ _PUBLIC_ enum ndr_err_code ndr_pull_winreg_OpenKey(struct ndr_pull *ndr, int fla NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.parent_handle)); NDR_PULL_SET_MEM_CTX(ndr, _mem_save_parent_handle_0, LIBNDR_FLAG_REF_ALLOC); NDR_CHECK(ndr_pull_winreg_String(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.keyname)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.unknown)); + NDR_CHECK(ndr_pull_winreg_KeyType(ndr, NDR_SCALARS, &r->in.options)); NDR_CHECK(ndr_pull_winreg_AccessMask(ndr, NDR_SCALARS, &r->in.access_mask)); NDR_PULL_ALLOC(ndr, r->out.handle); ZERO_STRUCTP(r->out.handle); @@ -2214,7 +2240,7 @@ _PUBLIC_ void ndr_print_winreg_OpenKey(struct ndr_print *ndr, const char *name, ndr_print_policy_handle(ndr, "parent_handle", r->in.parent_handle); ndr->depth--; ndr_print_winreg_String(ndr, "keyname", &r->in.keyname); - ndr_print_uint32(ndr, "unknown", r->in.unknown); + ndr_print_winreg_KeyType(ndr, "options", r->in.options); ndr_print_winreg_AccessMask(ndr, "access_mask", r->in.access_mask); ndr->depth--; } diff --git a/librpc/gen_ndr/ndr_winreg.h b/librpc/gen_ndr/ndr_winreg.h index a496d4ccc6..8bee4dad35 100644 --- a/librpc/gen_ndr/ndr_winreg.h +++ b/librpc/gen_ndr/ndr_winreg.h @@ -88,6 +88,7 @@ enum ndr_err_code ndr_pull_winreg_String(struct ndr_pull *ndr, int ndr_flags, st void ndr_print_winreg_String(struct ndr_print *ndr, const char *name, const struct winreg_String *r); void ndr_print_KeySecurityData(struct ndr_print *ndr, const char *name, const struct KeySecurityData *r); void ndr_print_winreg_SecBuf(struct ndr_print *ndr, const char *name, const struct winreg_SecBuf *r); +void ndr_print_winreg_KeyType(struct ndr_print *ndr, const char *name, enum winreg_KeyType r); void ndr_print_winreg_CreateAction(struct ndr_print *ndr, const char *name, enum winreg_CreateAction r); void ndr_print_winreg_StringBuf(struct ndr_print *ndr, const char *name, const struct winreg_StringBuf *r); void ndr_print_winreg_ValNameBuf(struct ndr_print *ndr, const char *name, const struct winreg_ValNameBuf *r); diff --git a/librpc/gen_ndr/winreg.h b/librpc/gen_ndr/winreg.h index 53d9a35b62..64d978f321 100644 --- a/librpc/gen_ndr/winreg.h +++ b/librpc/gen_ndr/winreg.h @@ -42,6 +42,21 @@ struct winreg_SecBuf { uint8_t inherit; }; +enum winreg_KeyType +#ifndef USE_UINT_ENUMS + { + REG_KEYTYPE_NON_VOLATILE=(int)(0x00000000), + REG_KEYTYPE_VOLATILE=(int)(0x00000001), + REG_KEYTYPE_SYMLINK=(int)(0x00000002) +} +#else + { __donnot_use_enum_winreg_KeyType=0x7FFFFFFF} +#define REG_KEYTYPE_NON_VOLATILE ( 0x00000000 ) +#define REG_KEYTYPE_VOLATILE ( 0x00000001 ) +#define REG_KEYTYPE_SYMLINK ( 0x00000002 ) +#endif +; + enum winreg_CreateAction #ifndef USE_UINT_ENUMS { @@ -177,7 +192,7 @@ struct winreg_CreateKey { struct policy_handle *handle;/* [ref] */ struct winreg_String name; struct winreg_String keyclass; - uint32_t options; + enum winreg_KeyType options; uint32_t access_mask; struct winreg_SecBuf *secdesc;/* [unique] */ enum winreg_CreateAction *action_taken;/* [unique] */ @@ -323,7 +338,7 @@ struct winreg_OpenKey { struct { struct policy_handle *parent_handle;/* [ref] */ struct winreg_String keyname; - uint32_t unknown; + enum winreg_KeyType options; uint32_t access_mask; } in; diff --git a/librpc/idl/winreg.idl b/librpc/idl/winreg.idl index 70206916e0..a21bbd4a62 100644 --- a/librpc/idl/winreg.idl +++ b/librpc/idl/winreg.idl @@ -113,6 +113,12 @@ import "lsa.idl", "security.idl", "misc.idl"; } winreg_SecBuf; typedef [v1_enum] enum { + REG_KEYTYPE_NON_VOLATILE = 0x00000000, + REG_KEYTYPE_VOLATILE = 0x00000001, + REG_KEYTYPE_SYMLINK = 0x00000002 + } winreg_KeyType; + + typedef [v1_enum] enum { REG_ACTION_NONE = 0, /* used by caller */ REG_CREATED_NEW_KEY = 1, REG_OPENED_EXISTING_KEY = 2 @@ -122,7 +128,7 @@ import "lsa.idl", "security.idl", "misc.idl"; [in,ref] policy_handle *handle, [in] winreg_String name, [in] winreg_String keyclass, - [in] uint32 options, + [in] winreg_KeyType options, [in] winreg_AccessMask access_mask, [in,unique] winreg_SecBuf *secdesc, [out,ref] policy_handle *new_handle, @@ -230,7 +236,7 @@ import "lsa.idl", "security.idl", "misc.idl"; [public] WERROR winreg_OpenKey( [in,ref] policy_handle *parent_handle, [in] winreg_String keyname, - [in] uint32 unknown, + [in] winreg_KeyType options, [in] winreg_AccessMask access_mask, [out,ref] policy_handle *handle ); diff --git a/source4/lib/registry/rpc.c b/source4/lib/registry/rpc.c index 0cb6b118a5..0064e17c9a 100644 --- a/source4/lib/registry/rpc.c +++ b/source4/lib/registry/rpc.c @@ -170,7 +170,7 @@ static WERROR rpc_open_key(TALLOC_CTX *mem_ctx, struct registry_key *h, ZERO_STRUCT(r); r.in.parent_handle = &parentkeydata->pol; r.in.keyname.name = name; - r.in.unknown = 0x00000000; + r.in.options = 0x00000000; r.in.access_mask = 0x02000000; r.out.handle = &mykeydata->pol; diff --git a/source4/torture/ndr/winreg.c b/source4/torture/ndr/winreg.c index de804b7721..14ee84484a 100644 --- a/source4/torture/ndr/winreg.c +++ b/source4/torture/ndr/winreg.c @@ -323,7 +323,7 @@ static const uint8_t openkey_in_data[] = { static bool openkey_in_check(struct torture_context *tctx, struct winreg_OpenKey *r) { - torture_assert_int_equal(tctx, r->in.unknown, 0, "unknown"); + torture_assert_int_equal(tctx, r->in.options, 0, "unknown"); torture_assert_int_equal(tctx, r->in.access_mask, 0x02000000, "access mask"); torture_assert_str_equal(tctx, r->in.keyname.name, "spottyfoot", "keyname"); /* FIXME: parent handle */ diff --git a/source4/torture/rpc/samba3rpc.c b/source4/torture/rpc/samba3rpc.c index 9e7b18b4d7..56b48ad8e6 100644 --- a/source4/torture/rpc/samba3rpc.c +++ b/source4/torture/rpc/samba3rpc.c @@ -3097,7 +3097,7 @@ static NTSTATUS enumkeys(struct dcerpc_pipe *p, struct policy_handle *handle, o.in.parent_handle = handle; o.in.keyname.name = r.out.name->name; - o.in.unknown = 0; + o.in.options = 0; o.in.access_mask = SEC_FLAG_MAXIMUM_ALLOWED; o.out.handle = &key_handle; @@ -3453,7 +3453,7 @@ static NTSTATUS torture_samba3_setconfig(struct smbcli_state *cli, status = NT_STATUS_NO_MEMORY; goto done; } - o.in.unknown = 0; + o.in.options = 0; o.in.access_mask = SEC_FLAG_MAXIMUM_ALLOWED; o.out.handle = &key_handle; diff --git a/source4/torture/rpc/spoolss.c b/source4/torture/rpc/spoolss.c index d5dfee9e75..5b2bc86825 100644 --- a/source4/torture/rpc/spoolss.c +++ b/source4/torture/rpc/spoolss.c @@ -3311,7 +3311,7 @@ static bool test_winreg_OpenKey(struct torture_context *tctx, r.in.parent_handle = hive_handle; init_winreg_String(&r.in.keyname, keyname); - r.in.unknown = 0x00000000; + r.in.options = REG_KEYTYPE_NON_VOLATILE; r.in.access_mask = SEC_FLAG_MAXIMUM_ALLOWED; r.out.handle = key_handle; diff --git a/source4/torture/rpc/winreg.c b/source4/torture/rpc/winreg.c index 486826c8c9..aab5dc3b69 100644 --- a/source4/torture/rpc/winreg.c +++ b/source4/torture/rpc/winreg.c @@ -365,7 +365,7 @@ static bool _test_OpenKey(struct dcerpc_pipe *p, struct torture_context *tctx, ZERO_STRUCT(r); r.in.parent_handle = hive_handle; init_winreg_String(&r.in.keyname, keyname); - r.in.unknown = 0x00000000; + r.in.options = REG_KEYTYPE_NON_VOLATILE; r.in.access_mask = access_mask; r.out.handle = key_handle; |