summaryrefslogtreecommitdiff
path: root/librpc
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2010-03-11 20:20:48 +0100
committerGünther Deschner <gd@samba.org>2010-03-11 20:23:47 +0100
commite0d85f87b7a6a3c887bc0a7f93b26380369e269c (patch)
tree5192a92cf2f0f24d8bd85d6ce05333697566057e /librpc
parent96a38e387e9655b14504c0c3d181db95cc84cc3d (diff)
downloadsamba-e0d85f87b7a6a3c887bc0a7f93b26380369e269c.tar.gz
samba-e0d85f87b7a6a3c887bc0a7f93b26380369e269c.tar.bz2
samba-e0d85f87b7a6a3c887bc0a7f93b26380369e269c.zip
winreg: add winreg_KeyType enum.
Guenther
Diffstat (limited to 'librpc')
-rw-r--r--librpc/gen_ndr/cli_winreg.c12
-rw-r--r--librpc/gen_ndr/cli_winreg.h8
-rw-r--r--librpc/gen_ndr/ndr_winreg.c38
-rw-r--r--librpc/gen_ndr/ndr_winreg.h1
-rw-r--r--librpc/gen_ndr/winreg.h19
-rw-r--r--librpc/idl/winreg.idl10
6 files changed, 68 insertions, 20 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
);