summaryrefslogtreecommitdiff
path: root/source3/include/rpc_reg.h
diff options
context:
space:
mode:
authorGerald Carter <jerry@samba.org>2005-03-23 23:26:33 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 10:56:15 -0500
commit5d1cb8e79edea9e8581d3c2c9dd297310cd9a98c (patch)
tree12142ce30c28b602882cb6c3492dfc5811a7eace /source3/include/rpc_reg.h
parent920745f0df024741f28e8557c52187a8db01c5d1 (diff)
downloadsamba-5d1cb8e79edea9e8581d3c2c9dd297310cd9a98c.tar.gz
samba-5d1cb8e79edea9e8581d3c2c9dd297310cd9a98c.tar.bz2
samba-5d1cb8e79edea9e8581d3c2c9dd297310cd9a98c.zip
r6014: rather large change set....
pulling back all recent rpc changes from trunk into 3.0. I've tested a compile and so don't think I've missed any files. But if so, just mail me and I'll clean backup in a couple of hours. Changes include \winreg, \eventlog, \svcctl, and general parse_misc.c updates. I am planning on bracketing the event code with an #ifdef ENABLE_EVENTLOG until I finish merging Marcin's changes (very soon). (This used to be commit 4e0ac63c36527cd8c52ef720cae17e84f67e7221)
Diffstat (limited to 'source3/include/rpc_reg.h')
-rw-r--r--source3/include/rpc_reg.h540
1 files changed, 187 insertions, 353 deletions
diff --git a/source3/include/rpc_reg.h b/source3/include/rpc_reg.h
index bfb5f1e076..9f97d49715 100644
--- a/source3/include/rpc_reg.h
+++ b/source3/include/rpc_reg.h
@@ -4,7 +4,8 @@
Copyright (C) Andrew Tridgell 1992-1997.
Copyright (C) Luke Kenneth Casson Leighton 1996-1997.
Copyright (C) Paul Ashton 1997.
- Copyright (C) Gerald Carter 2002.
+ Copyright (C) Jeremy Cooper 2004.
+ Copyright (C) Gerald Carter 2002-2005.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -28,46 +29,50 @@
/* winreg pipe defines
NOT IMPLEMENTED !!
#define _REG_UNK_01 0x01
-#define _REG_UNK_03 0x03
-#define REG_CREATE_KEY 0x06
-#define REG_DELETE_KEY 0x07
-#define REG_DELETE_VALUE 0x08
-#define REG_FLUSH_KEY 0x0b
-#define REG_GET_KEY_SEC 0x0c
#define _REG_UNK_0D 0x0d
#define _REG_UNK_0E 0x0e
#define _REG_UNK_12 0x12
#define _REG_UNK_13 0x13
-#define REG_SET_KEY_SEC 0x15
-#define REG_CREATE_VALUE 0x16
#define _REG_UNK_17 0x17
+
*/
/* Implemented */
#define REG_OPEN_HKCR 0x00
#define REG_OPEN_HKLM 0x02
+#define REG_OPEN_HKPD 0x03
#define REG_OPEN_HKU 0x04
#define REG_CLOSE 0x05
+#define REG_CREATE_KEY 0x06
+#define REG_DELETE_KEY 0x07
+#define REG_DELETE_VALUE 0x08
#define REG_ENUM_KEY 0x09
#define REG_ENUM_VALUE 0x0a
+#define REG_FLUSH_KEY 0x0b
+#define REG_GET_KEY_SEC 0x0c
#define REG_OPEN_ENTRY 0x0f
#define REG_QUERY_KEY 0x10
#define REG_INFO 0x11
+#define REG_SAVE_KEY 0x14
+#define REG_SET_KEY_SEC 0x15
+#define REG_CREATE_VALUE 0x16
#define REG_SHUTDOWN 0x18
#define REG_ABORT_SHUTDOWN 0x19
-#define REG_SAVE_KEY 0x14 /* no idea what the real name is */
-#define REG_UNKNOWN_1A 0x1a
+#define REG_GETVERSION 0x1a
+#define REG_SHUTDOWN_EX 0x1e
#define HKEY_CLASSES_ROOT 0x80000000
#define HKEY_CURRENT_USER 0x80000001
#define HKEY_LOCAL_MACHINE 0x80000002
#define HKEY_USERS 0x80000003
+#define HKEY_PERFORMANCE_DATA 0x80000004
#define KEY_HKLM "HKLM"
#define KEY_HKU "HKU"
#define KEY_HKCR "HKCR"
#define KEY_PRINTING "HKLM\\SYSTEM\\CurrentControlSet\\Control\\Print"
+#define KEY_EVENTLOG "HKLM\\SYSTEM\\CurrentControlSet\\Services\\Eventlog"
#define KEY_TREE_ROOT ""
/* Registry data types */
@@ -85,6 +90,10 @@
#define REG_FULL_RESOURCE_DESCRIPTOR 9
#define REG_RESOURCE_REQUIREMENTS_LIST 10
+/*
+ * INTERNAL REGISTRY STRUCTURES
+ */
+
/* structure to contain registry values */
typedef struct {
@@ -94,7 +103,7 @@ typedef struct {
uint8 *data_p;
} REGISTRY_VALUE;
-/* container for regostry values */
+/* container for registry values */
typedef struct {
TALLOC_CTX *ctx;
@@ -143,379 +152,224 @@ typedef struct _RegistryKey {
} REGISTRY_KEY;
+/*
+ * RPC REGISTRY STRUCTURES
+ */
-/* REG_Q_OPEN_HKCR */
-typedef struct q_reg_open_hkcr_info
-{
- uint32 ptr;
- uint16 unknown_0; /* 0x5428 - 16 bit unknown */
- uint16 unknown_1; /* random. changes */
- uint32 level; /* 0x0000 0002 - 32 bit unknown */
-
-} REG_Q_OPEN_HKCR ;
-
-/* REG_R_OPEN_HKCR */
-typedef struct r_reg_open_hkcr_info
-{
- POLICY_HND pol; /* policy handle */
- WERROR status; /* return status */
-
-} REG_R_OPEN_HKCR;
+/***********************************************/
+typedef struct {
+ uint16 *server;
+ uint32 access;
+} REG_Q_OPEN_HIVE;
-/* REG_Q_OPEN_HKLM */
-typedef struct q_reg_open_hklm_info
-{
- uint32 ptr;
- uint16 unknown_0; /* 0xE084 - 16 bit unknown */
- uint16 unknown_1; /* random. changes */
- uint32 access_mask;
-
-}
-REG_Q_OPEN_HKLM;
-
-/* REG_R_OPEN_HKLM */
-typedef struct r_reg_open_hklm_info
-{
- POLICY_HND pol; /* policy handle */
- WERROR status; /* return status */
-
-}
-REG_R_OPEN_HKLM;
-
-
-/* REG_Q_OPEN_HKU */
-typedef struct q_reg_open_hku_info
-{
- uint32 ptr;
- uint16 unknown_0;
- uint16 unknown_1;
- uint32 access_mask;
-
-} REG_Q_OPEN_HKU;
-
-/* REG_R_OPEN_HKU */
-typedef struct r_reg_open_hku_info
-{
- POLICY_HND pol; /* policy handle */
- WERROR status; /* return status */
-
-} REG_R_OPEN_HKU;
+typedef struct {
+ POLICY_HND pol;
+ WERROR status;
+} REG_R_OPEN_HIVE;
-/* REG_Q_FLUSH_KEY */
-typedef struct q_reg_open_flush_key_info
-{
- POLICY_HND pol; /* policy handle */
+/***********************************************/
+typedef struct {
+ POLICY_HND pol;
} REG_Q_FLUSH_KEY;
-/* REG_R_FLUSH_KEY */
-typedef struct r_reg_open_flush_key_info
-{
- WERROR status; /* return status */
-
+typedef struct {
+ WERROR status;
} REG_R_FLUSH_KEY;
-/* REG_Q_SET_KEY_SEC */
-typedef struct q_reg_set_key_sec_info
-{
- POLICY_HND pol; /* policy handle */
-
- uint32 sec_info; /* xxxx_SECURITY_INFORMATION */
+/***********************************************/
- uint32 ptr; /* pointer */
- BUFHDR hdr_sec; /* header for security data */
- SEC_DESC_BUF *data; /* security data */
-
+typedef struct {
+ POLICY_HND pol;
+ uint32 sec_info;
+ uint32 ptr;
+ BUFHDR hdr_sec;
+ SEC_DESC_BUF *data;
} REG_Q_SET_KEY_SEC;
-/* REG_R_SET_KEY_SEC */
-typedef struct r_reg_set_key_sec_info
-{
+typedef struct {
WERROR status;
-
} REG_R_SET_KEY_SEC;
-/* REG_Q_GET_KEY_SEC */
-typedef struct q_reg_get_key_sec_info
-{
- POLICY_HND pol; /* policy handle */
+/***********************************************/
- uint32 sec_info; /* xxxx_SECURITY_INFORMATION */
-
- uint32 ptr; /* pointer */
- BUFHDR hdr_sec; /* header for security data */
- SEC_DESC_BUF *data; /* security data */
-
+typedef struct {
+ POLICY_HND pol;
+ uint32 sec_info;
+ uint32 ptr;
+ BUFHDR hdr_sec;
+ SEC_DESC_BUF *data;
} REG_Q_GET_KEY_SEC;
-/* REG_R_GET_KEY_SEC */
-typedef struct r_reg_get_key_sec_info
-{
- uint32 sec_info; /* xxxx_SECURITY_INFORMATION */
-
- uint32 ptr; /* pointer */
- BUFHDR hdr_sec; /* header for security data */
- SEC_DESC_BUF *data; /* security data */
-
+typedef struct {
+ uint32 sec_info;
+ uint32 ptr;
+ BUFHDR hdr_sec;
+ SEC_DESC_BUF *data;
WERROR status;
-
} REG_R_GET_KEY_SEC;
-/* REG_Q_CREATE_VALUE */
-typedef struct q_reg_create_value_info
-{
- POLICY_HND pol; /* policy handle */
-
- UNIHDR hdr_name; /* name of value */
- UNISTR2 uni_name;
-
- uint32 type; /* 1 = UNISTR, 3 = BYTES, 4 = DWORD, 7 = MULTI_UNISTR */
-
- BUFFER3 *buf_value; /* value, in byte buffer */
+/***********************************************/
+typedef struct {
+ POLICY_HND pol;
+ UNISTR4 name;
+ uint32 type;
+ BUFFER3 *value;
} REG_Q_CREATE_VALUE;
-/* REG_R_CREATE_VALUE */
-typedef struct r_reg_create_value_info
-{
- WERROR status; /* return status */
-
+typedef struct {
+ WERROR status;
} REG_R_CREATE_VALUE;
-/* REG_Q_ENUM_VALUE */
-typedef struct q_reg_query_value_info
-{
- POLICY_HND pol; /* policy handle */
-
- uint32 val_index; /* index */
-
- UNIHDR hdr_name; /* name of value */
- UNISTR2 uni_name;
-
- uint32 ptr_type; /* pointer */
- uint32 type; /* 1 = UNISTR, 3 = BYTES, 4 = DWORD, 7 = MULTI_UNISTR */
-
- uint32 ptr_value; /* pointer */
- BUFFER2 buf_value; /* value, in byte buffer */
-
- uint32 ptr1; /* pointer */
- uint32 len_value1; /* */
-
- uint32 ptr2; /* pointer */
- uint32 len_value2; /* */
-
+/***********************************************/
+typedef struct {
+ POLICY_HND pol;
+ uint32 val_index;
+ UNISTR4 name;
+ uint32 *type;
+ REGVAL_BUFFER *value; /* value, in byte buffer */
+ uint32 *len_value1;
+ uint32 *len_value2;
} REG_Q_ENUM_VALUE;
-/* REG_R_ENUM_VALUE */
-typedef struct r_reg_enum_value_info
-{
- UNIHDR hdr_name; /* name of value */
- UNISTR2 uni_name;
-
- uint32 ptr_type; /* pointer */
- uint32 type; /* 1 = UNISTR, 3 = BYTES, 4 = DWORD, 7 = MULTI_UNISTR */
-
- uint32 ptr_value; /* pointer */
- BUFFER2 buf_value; /* value, in byte buffer */
-
- uint32 ptr1; /* pointer */
- uint32 len_value1; /* */
-
- uint32 ptr2; /* pointer */
- uint32 len_value2; /* */
-
- WERROR status; /* return status */
-
+typedef struct {
+ UNISTR4 name;
+ uint32 *type;
+ REGVAL_BUFFER *value;
+ uint32 *len_value1;
+ uint32 *len_value2;
+ WERROR status;
} REG_R_ENUM_VALUE;
-/* REG_Q_CREATE_KEY */
-typedef struct q_reg_create_key_info
-{
- POLICY_HND pnt_pol; /* parent key policy handle */
+/***********************************************/
- UNIHDR hdr_name;
- UNISTR2 uni_name;
-
- UNIHDR hdr_class;
- UNISTR2 uni_class;
-
- uint32 reserved; /* 0x0000 0000 */
- SEC_ACCESS sam_access; /* access rights flags, see rpc_secdes.h */
-
- uint32 ptr1;
- uint32 sec_info; /* xxxx_SECURITY_INFORMATION */
-
- uint32 ptr2; /* pointer */
- BUFHDR hdr_sec; /* header for security data */
- uint32 ptr3; /* pointer */
+typedef struct {
+ POLICY_HND pnt_pol;
+ UNISTR4 name;
+ UNISTR4 class;
+ uint32 reserved;
+ uint32 access;
+ uint32 *sec_info;
+ uint32 ptr2;
+ BUFHDR hdr_sec;
+ uint32 ptr3;
SEC_DESC_BUF *data;
-
uint32 unknown_2; /* 0x0000 0000 */
-
} REG_Q_CREATE_KEY;
-/* REG_R_CREATE_KEY */
-typedef struct r_reg_create_key_info
-{
- POLICY_HND key_pol; /* policy handle */
- uint32 unknown; /* 0x0000 0000 */
-
- WERROR status; /* return status */
-
+typedef struct {
+ POLICY_HND key_pol;
+ uint32 unknown;
+ WERROR status;
} REG_R_CREATE_KEY;
-/* REG_Q_DELETE_KEY */
-typedef struct q_reg_delete_key_info
-{
- POLICY_HND pnt_pol; /* parent key policy handle */
+/***********************************************/
- UNIHDR hdr_name;
- UNISTR2 uni_name;
+typedef struct {
+ POLICY_HND pnt_pol;
+ UNISTR4 name;
} REG_Q_DELETE_KEY;
-/* REG_R_DELETE_KEY */
-typedef struct r_reg_delete_key_info
-{
- POLICY_HND key_pol; /* policy handle */
-
- WERROR status; /* return status */
-
+typedef struct {
+ POLICY_HND key_pol;
+ WERROR status;
} REG_R_DELETE_KEY;
-/* REG_Q_DELETE_VALUE */
-typedef struct q_reg_delete_val_info
-{
- POLICY_HND pnt_pol; /* parent key policy handle */
-
- UNIHDR hdr_name;
- UNISTR2 uni_name;
+/***********************************************/
+typedef struct {
+ POLICY_HND pnt_pol;
+ UNISTR4 name;
} REG_Q_DELETE_VALUE;
-/* REG_R_DELETE_VALUE */
-typedef struct r_reg_delete_val_info
-{
- POLICY_HND key_pol; /* policy handle */
-
- WERROR status; /* return status */
-
+typedef struct {
+ POLICY_HND key_pol;
+ WERROR status;
} REG_R_DELETE_VALUE;
-/* REG_Q_QUERY_KEY */
-typedef struct q_reg_query_info
-{
- POLICY_HND pol; /* policy handle */
- UNIHDR hdr_class;
- UNISTR2 uni_class;
+/***********************************************/
+typedef struct {
+ POLICY_HND pol;
+ UNISTR4 class;
} REG_Q_QUERY_KEY;
-/* REG_R_QUERY_KEY */
-typedef struct r_reg_query_key_info
-{
- UNIHDR hdr_class;
- UNISTR2 uni_class;
-
+typedef struct {
+ UNISTR4 class;
uint32 num_subkeys;
uint32 max_subkeylen;
- uint32 reserved; /* 0x0000 0000 - according to MSDN (max_subkeysize?) */
+ uint32 reserved; /* 0x0000 0000 - according to MSDN (max_subkeysize?) */
uint32 num_values;
uint32 max_valnamelen;
uint32 max_valbufsize;
- uint32 sec_desc; /* 0x0000 0078 */
- NTTIME mod_time; /* modified time */
-
- WERROR status; /* return status */
-
+ uint32 sec_desc; /* 0x0000 0078 */
+ NTTIME mod_time; /* modified time */
+ WERROR status;
} REG_R_QUERY_KEY;
-/* REG_Q_UNKNOWN_1A */
-typedef struct q_reg_unk_1a_info
-{
- POLICY_HND pol; /* policy handle */
+/***********************************************/
-} REG_Q_UNKNOWN_1A;
+typedef struct {
+ POLICY_HND pol; /* policy handle */
+} REG_Q_GETVERSION;
-/* REG_R_UNKNOWN_1A */
-typedef struct r_reg_unk_1a_info
-{
+typedef struct {
uint32 unknown; /* 0x0500 0000 */
WERROR status; /* return status */
+} REG_R_GETVERSION;
-} REG_R_UNKNOWN_1A;
+/***********************************************/
-/* REG_Q_UNKNOWN_1A */
-typedef struct q_reg_unknown_14
-{
- POLICY_HND pol; /* policy handle */
-
- UNIHDR hdr_file; /* unicode product type header */
- UNISTR2 uni_file; /* local filename to save key as from regedt32.exe */
- /* e.g. "c:\temp\test.dat" */
-
+typedef struct {
+ POLICY_HND pol;
+ UNISTR4 filename;
uint32 unknown; /* 0x0000 0000 */
-
} REG_Q_SAVE_KEY;
-/* REG_R_UNKNOWN_1A */
-typedef struct r_reg_unknown_14
-{
+typedef struct {
WERROR status; /* return status */
-
} REG_R_SAVE_KEY;
-/* REG_Q_CLOSE */
-typedef struct reg_q_close_info
-{
- POLICY_HND pol; /* policy handle */
+/***********************************************/
+typedef struct {
+ POLICY_HND pol; /* policy handle */
} REG_Q_CLOSE;
-/* REG_R_CLOSE */
-typedef struct reg_r_close_info
-{
- POLICY_HND pol; /* policy handle. should be all zeros. */
-
- WERROR status; /* return code */
-
+typedef struct {
+ POLICY_HND pol;
+ WERROR status;
} REG_R_CLOSE;
-/* REG_Q_ENUM_KEY */
-typedef struct q_reg_enum_value_info
-{
- POLICY_HND pol; /* policy handle */
+/***********************************************/
+typedef struct {
+ POLICY_HND pol;
uint32 key_index;
-
uint16 key_name_len; /* 0x0000 */
uint16 unknown_1; /* 0x0414 */
-
uint32 ptr1; /* pointer */
uint32 unknown_2; /* 0x0000 020A */
uint8 pad1[8]; /* padding - zeros */
-
uint32 ptr2; /* pointer */
uint8 pad2[8]; /* padding - zeros */
-
uint32 ptr3; /* pointer */
NTTIME time; /* current time? */
-
} REG_Q_ENUM_KEY;
-/* REG_R_ENUM_KEY */
-typedef struct r_reg_enum_key_info
-{
+typedef struct {
uint16 key_name_len; /* number of bytes in key name */
uint16 unknown_1; /* 0x0414 - matches with query unknown_1 */
@@ -532,17 +386,14 @@ typedef struct r_reg_enum_key_info
NTTIME time; /* current time? */
WERROR status; /* return status */
-
} REG_R_ENUM_KEY;
-/* REG_Q_INFO */
-typedef struct q_reg_info_info
-{
- POLICY_HND pol; /* policy handle */
+/***********************************************/
- UNIHDR hdr_type; /* unicode product type header */
- UNISTR2 uni_type; /* unicode product type - "ProductType" */
+typedef struct {
+ POLICY_HND pol; /* policy handle */
+ UNISTR4 name;
uint32 ptr_reserved; /* pointer */
@@ -560,83 +411,66 @@ typedef struct q_reg_info_info
} REG_Q_INFO;
-/* REG_R_INFO */
-typedef struct r_reg_info_info
-{
- uint32 ptr_type; /* key type pointer */
- uint32 type; /* key datatype */
-
- uint32 ptr_uni_val; /* key value pointer */
- BUFFER2 uni_val; /* key value */
-
- uint32 ptr_max_len;
- uint32 buf_max_len;
-
- uint32 ptr_len;
- uint32 buf_len;
-
+typedef struct {
+ uint32 *type;
+ REGVAL_BUFFER *value; /* key value */
+ uint32 *buf_max_len;
+ uint32 *buf_len;
WERROR status; /* return status */
-
} REG_R_INFO;
-/* REG_Q_OPEN_ENTRY */
-typedef struct q_reg_open_entry_info
-{
- POLICY_HND pol; /* policy handle */
-
- UNIHDR hdr_name; /* unicode registry string header */
- UNISTR2 uni_name; /* unicode registry string name */
+/***********************************************/
+typedef struct {
+ POLICY_HND pol;
+ UNISTR4 name;
uint32 unknown_0; /* 32 bit unknown - 0x0000 0000 */
- uint32 access_desired;
-
+ uint32 access;
} REG_Q_OPEN_ENTRY;
-
-
-/* REG_R_OPEN_ENTRY */
-typedef struct r_reg_open_entry_info
-{
- POLICY_HND pol; /* policy handle */
- WERROR status; /* return status */
-
+typedef struct {
+ POLICY_HND pol;
+ WERROR status;
} REG_R_OPEN_ENTRY;
-/* REG_Q_SHUTDOWN */
-typedef struct q_reg_shutdown_info
-{
- uint32 ptr_0;
- uint32 ptr_1;
- uint32 ptr_2;
- UNIHDR hdr_msg; /* shutdown message */
- UNISTR2 uni_msg; /* seconds */
- uint32 timeout; /* seconds */
+/***********************************************/
+
+typedef struct {
+ uint16 *server;
+ UNISTR4 *message;
+ uint32 timeout; /* in seconds */
uint8 force; /* boolean: force shutdown */
- uint8 reboot; /* boolean: reboot on shutdown */
-
+ uint8 reboot; /* boolean: reboot on shutdown */
} REG_Q_SHUTDOWN;
-/* REG_R_SHUTDOWN */
-typedef struct r_reg_shutdown_info
-{
+typedef struct {
WERROR status; /* return status */
-
} REG_R_SHUTDOWN;
-/* REG_Q_ABORT_SHUTDOWN */
-typedef struct q_reg_abort_shutdown_info
-{
- uint32 ptr_server;
- uint16 server;
+/***********************************************/
+
+typedef struct {
+ uint16 *server;
+ UNISTR4 *message;
+ uint32 timeout; /* in seconds */
+ uint8 force; /* boolean: force shutdown */
+ uint8 reboot; /* boolean: reboot on shutdown */
+ uint32 reason; /* reason - must be defined code */
+} REG_Q_SHUTDOWN_EX;
-} REG_Q_ABORT_SHUTDOWN;
+typedef struct {
+ WERROR status;
+} REG_R_SHUTDOWN_EX;
+
+/***********************************************/
-/* REG_R_ABORT_SHUTDOWN */
-typedef struct r_reg_abort_shutdown_info
-{
- WERROR status; /* return status */
+typedef struct {
+ uint16 *server;
+} REG_Q_ABORT_SHUTDOWN;
+typedef struct {
+ WERROR status;
} REG_R_ABORT_SHUTDOWN;