diff options
author | Gerald Carter <jerry@samba.org> | 2005-03-23 23:26:33 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 10:56:15 -0500 |
commit | 5d1cb8e79edea9e8581d3c2c9dd297310cd9a98c (patch) | |
tree | 12142ce30c28b602882cb6c3492dfc5811a7eace /source3/include | |
parent | 920745f0df024741f28e8557c52187a8db01c5d1 (diff) | |
download | samba-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')
-rw-r--r-- | source3/include/doserr.h | 1 | ||||
-rw-r--r-- | source3/include/ntdomain.h | 2 | ||||
-rw-r--r-- | source3/include/rpc_eventlog.h | 193 | ||||
-rw-r--r-- | source3/include/rpc_lsa.h | 2 | ||||
-rw-r--r-- | source3/include/rpc_misc.h | 38 | ||||
-rw-r--r-- | source3/include/rpc_reg.h | 540 | ||||
-rw-r--r-- | source3/include/rpc_shutdown.h | 65 | ||||
-rwxr-xr-x | source3/include/rpc_spoolss.h | 66 | ||||
-rw-r--r-- | source3/include/rpc_svcctl.h | 243 | ||||
-rw-r--r-- | source3/include/smb.h | 7 | ||||
-rw-r--r-- | source3/include/smb_macros.h | 3 |
11 files changed, 722 insertions, 438 deletions
diff --git a/source3/include/doserr.h b/source3/include/doserr.h index c6d6b1fac9..259eafc45f 100644 --- a/source3/include/doserr.h +++ b/source3/include/doserr.h @@ -185,6 +185,7 @@ #define WERR_INVALID_OWNER W_ERROR(1307) #define WERR_IO_PENDING W_ERROR(997) #define WERR_CAN_NOT_COMPLETE W_ERROR(1003) +#define WERR_NO_SUCH_SERVICE W_ERROR(1060) #define WERR_INVALID_SECURITY_DESCRIPTOR W_ERROR(1338) #define WERR_SERVER_UNAVAILABLE W_ERROR(1722) #define WERR_INVALID_FORM_NAME W_ERROR(1902) diff --git a/source3/include/ntdomain.h b/source3/include/ntdomain.h index 9f0cbe6160..87fac492db 100644 --- a/source3/include/ntdomain.h +++ b/source3/include/ntdomain.h @@ -398,7 +398,9 @@ typedef struct { #include "rpc_samr.h" #include "rpc_srvsvc.h" #include "rpc_wkssvc.h" +#include "rpc_svcctl.h" #include "rpc_spoolss.h" +#include "rpc_eventlog.h" #include "rpc_dfs.h" #include "rpc_ds.h" #include "rpc_echo.h" diff --git a/source3/include/rpc_eventlog.h b/source3/include/rpc_eventlog.h new file mode 100644 index 0000000000..b692a76225 --- /dev/null +++ b/source3/include/rpc_eventlog.h @@ -0,0 +1,193 @@ +/* + * Unix SMB/CIFS implementation. + * RPC Pipe client / server routines + * Copyright (C) Marcin Krzysztof Porwit 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 + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#ifndef _RPC_EVENTLOG_H /* _RPC_EVENTLOG_H */ +#define _RPC_EVENTLOG_H + +/* opcodes */ + +#define EVENTLOG_CLEAREVENTLOG 0x00 +#define EVENTLOG_CLOSEEVENTLOG 0x02 +#define EVENTLOG_GETNUMRECORDS 0x04 +#define EVENTLOG_GETOLDESTENTRY 0x05 +#define EVENTLOG_OPENEVENTLOG 0x07 +#define EVENTLOG_READEVENTLOG 0x0a + +/* Eventlog read flags */ + +#define EVENTLOG_SEQUENTIAL_READ 0x0001 +#define EVENTLOG_SEEK_READ 0x0002 +#define EVENTLOG_FORWARDS_READ 0x0004 +#define EVENTLOG_BACKWARDS_READ 0x0008 + +/* Event types */ + +#define EVENTLOG_SUCCESS 0x0000 +#define EVENTLOG_ERROR_TYPE 0x0001 +#define EVENTLOG_WARNING_TYPE 0x0002 +#define EVENTLOG_INFORMATION_TYPE 0x0004 +#define EVENTLOG_AUDIT_SUCCESS 0x0008 +#define EVENTLOG_AUDIT_FAILURE 0x0010 + + +typedef struct eventlog_q_open_eventlog +{ + uint32 unknown1; + uint16 unknown2; + uint16 unknown3; + uint16 sourcename_length; + uint16 sourcename_size; + uint32 sourcename_ptr; + UNISTR2 sourcename; + uint32 servername_ptr; + UNISTR2 servername; +} +EVENTLOG_Q_OPEN_EVENTLOG; + +typedef struct eventlog_r_open_eventlog +{ + POLICY_HND handle; + WERROR status; +} +EVENTLOG_R_OPEN_EVENTLOG; + +typedef struct eventlog_q_close_eventlog +{ + POLICY_HND handle; +} +EVENTLOG_Q_CLOSE_EVENTLOG; + +typedef struct eventlog_r_close_eventlog +{ + POLICY_HND handle; + WERROR status; +} +EVENTLOG_R_CLOSE_EVENTLOG; + +typedef struct eventlog_q_get_num_records +{ + POLICY_HND handle; +} +EVENTLOG_Q_GET_NUM_RECORDS; + +typedef struct eventlog_r_get_num_records +{ + uint32 num_records; + WERROR status; +} +EVENTLOG_R_GET_NUM_RECORDS; + +typedef struct eventlog_q_get_oldest_entry +{ + POLICY_HND handle; +} +EVENTLOG_Q_GET_OLDEST_ENTRY; + +typedef struct eventlog_r_get_oldest_entry +{ + uint32 oldest_entry; + WERROR status; +} +EVENTLOG_R_GET_OLDEST_ENTRY; + +typedef struct eventlog_q_read_eventlog +{ + POLICY_HND handle; + uint32 flags; + uint32 offset; + uint32 max_read_size; +} +EVENTLOG_Q_READ_EVENTLOG; + +typedef struct eventlog_record +{ + uint32 length; + uint32 reserved1; + uint32 record_number; + uint32 time_generated; + uint32 time_written; + uint32 event_id; + uint16 event_type; + uint16 num_strings; + uint16 event_category; + uint16 reserved2; + uint32 closing_record_number; + uint32 string_offset; + uint32 user_sid_length; + uint32 user_sid_offset; + uint32 data_length; + uint32 data_offset; +} Eventlog_record; + +typedef struct eventlog_data_record +{ + uint32 source_name_len; + wpstring source_name; + uint32 computer_name_len; + wpstring computer_name; + uint32 sid_padding; + wpstring sid; + uint32 strings_len; + wpstring strings; + uint32 user_data_len; + pstring user_data; + uint32 data_padding; +} Eventlog_data_record; + +typedef struct eventlog_entry +{ + Eventlog_record record; + Eventlog_data_record data_record; + uint8 *data; + uint8 *end_of_data_padding; + struct eventlog_entry *next; +} Eventlog_entry; + +typedef struct eventlog_r_read_eventlog +{ + uint32 num_bytes_in_resp; + uint32 bytes_in_next_record; + uint32 num_records; + Eventlog_entry *entry; + uint8 *end_of_entries_padding; + uint32 sent_size; + uint32 real_size; + WERROR status; +} +EVENTLOG_R_READ_EVENTLOG; + +typedef struct eventlog_q_clear_eventlog +{ + POLICY_HND handle; + uint32 unknown1; + uint16 backup_file_length; + uint16 backup_file_size; + uint32 backup_file_ptr; + UNISTR2 backup_file; +} +EVENTLOG_Q_CLEAR_EVENTLOG; + +typedef struct eventlog_r_clear_eventlog +{ + WERROR status; +} +EVENTLOG_R_CLEAR_EVENTLOG; + +#endif /* _RPC_EVENTLOG_H */ diff --git a/source3/include/rpc_lsa.h b/source3/include/rpc_lsa.h index a0d78280c2..507161109f 100644 --- a/source3/include/rpc_lsa.h +++ b/source3/include/rpc_lsa.h @@ -423,7 +423,7 @@ typedef struct lsa_q_lookup_sids POLICY_HND pol; /* policy handle */ LSA_SID_ENUM sids; LSA_TRANS_NAME_ENUM names; - LOOKUP_LEVEL level; + uint16 level; uint32 mapped_count; } LSA_Q_LOOKUP_SIDS; diff --git a/source3/include/rpc_misc.h b/source3/include/rpc_misc.h index 6abc85a4ca..16611fe955 100644 --- a/source3/include/rpc_misc.h +++ b/source3/include/rpc_misc.h @@ -1,6 +1,6 @@ /* Unix SMB/CIFS implementation. - SMB parameters and setup + Copyright (C) Andrew Tridgell 1992-1997 Copyright (C) Luke Kenneth Casson Leighton 1996-1997 Copyright (C) Paul Ashton 1997 @@ -28,6 +28,9 @@ #define SMB_RPC_INTERFACE_VERSION 1 +#define PRS_POINTER_CAST BOOL (*)(const char*, prs_struct*, int, void*) + + /* well-known RIDs - Relative IDs */ /* RIDs - Well-known users ... */ @@ -88,12 +91,6 @@ typedef struct enum_hnd_info uint32 handle; /* enumeration handle */ } ENUM_HND; -/* LOOKUP_LEVEL - switch value */ -typedef struct lookup_level_info -{ - uint16 value; -} LOOKUP_LEVEL; - /* DOM_SID2 - security id */ typedef struct sid_info_2 { @@ -138,17 +135,25 @@ typedef struct bufhdr_info uint32 buf_len; } BUFHDR; -/* BUFFER2 - unicode string, size (in uint8 ascii chars) and buffer */ -/* pathetic. some stupid team of \PIPE\winreg writers got the concept */ -/* of a unicode string different from the other \PIPE\ writers */ -typedef struct buffer2_info -{ +/* + OLD COMMENT: + BUFFER2 - unicode string, size (in uint8 ascii chars) and buffer + pathetic. some stupid team of \PIPE\winreg writers got the concept + of a unicode string different from the other \PIPE\ writers + + NEW COMMENT: + buffer used by \winreg\ calls to fill in arbitrary REG_XXX values. + It *may* look like a UNISTR2 but it is *not*. This is not a goof + by the winreg developers. It is a generic buffer +*/ + +typedef struct { uint32 buf_max_len; uint32 offset; uint32 buf_len; /* unicode characters. ***MUST*** be little-endian. **NOT** necessarily null-terminated */ uint16 *buffer; -} BUFFER2; +} REGVAL_BUFFER; /* BUFFER3 */ typedef struct buffer3_info @@ -177,6 +182,13 @@ typedef struct unistr2_info uint16 *buffer; } UNISTR2; +/* UNIHDR + UNISTR2* */ +typedef struct { + uint16 length; /* number of bytes not counting NULL terminatation */ + uint16 size; /* number of bytes including NULL terminatation */ + UNISTR2 *string; +} UNISTR4; + /* STRING2 - string size (in uint8 chars) and buffer */ typedef struct string2_info { 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; diff --git a/source3/include/rpc_shutdown.h b/source3/include/rpc_shutdown.h index b8e50b835f..a9d86aec26 100644 --- a/source3/include/rpc_shutdown.h +++ b/source3/include/rpc_shutdown.h @@ -1,7 +1,8 @@ /* Unix SMB/CIFS implementation. - SMB parameters and setup + Copyright (C) Jim McDonough (jmcd@us.ibm.com) 2003. + Copyright (C) Gerald (Jerry) Carter 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 @@ -22,49 +23,53 @@ #define _RPC_SHUTDOWN_H -/* Implemented */ +/* opnums */ + #define SHUTDOWN_INIT 0x00 #define SHUTDOWN_ABORT 0x01 -/* NOT IMPLEMENTED #define SHUTDOWN_INIT_EX 0x02 -*/ -/* SHUTDOWN_Q_INIT */ -typedef struct q_shutodwn_init_info -{ - uint32 ptr_server; - uint16 server; - uint32 ptr_msg; - 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 */ } SHUTDOWN_Q_INIT; -/* SHUTDOWN_R_INIT */ -typedef struct r_shutdown_init_info -{ - NTSTATUS status; /* return status */ - +typedef struct { + WERROR status; /* return status */ } SHUTDOWN_R_INIT; -/* SHUTDOWN_Q_ABORT */ -typedef struct q_shutdown_abort_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 */ +} SHUTDOWN_Q_INIT_EX; -} SHUTDOWN_Q_ABORT; +typedef struct { + WERROR status; +} SHUTDOWN_R_INIT_EX; -/* SHUTDOWN_R_ABORT */ -typedef struct r_shutdown_abort_info -{ - NTSTATUS status; /* return status */ +/***********************************************/ +typedef struct { + uint16 *server; +} SHUTDOWN_Q_ABORT; + +typedef struct { + WERROR status; } SHUTDOWN_R_ABORT; + #endif /* _RPC_SHUTDOWN_H */ diff --git a/source3/include/rpc_spoolss.h b/source3/include/rpc_spoolss.h index 5d74a30fbd..ededc5035e 100755 --- a/source3/include/rpc_spoolss.h +++ b/source3/include/rpc_spoolss.h @@ -426,27 +426,22 @@ PRINTER_MESSAGE_INFO; /* this struct is undocumented */ /* thanks to the ddk ... */ -typedef struct spool_user_1 -{ +typedef struct { uint32 size; /* length of user_name & client_name + 2? */ - uint32 client_name_ptr; - uint32 user_name_ptr; + UNISTR2 *client_name; + UNISTR2 *user_name; uint32 build; uint32 major; uint32 minor; uint32 processor; - UNISTR2 client_name; - UNISTR2 user_name; -} -SPOOL_USER_1; +} SPOOL_USER_1; -typedef struct spool_user_ctr_info -{ +typedef struct { uint32 level; - uint32 ptr; - SPOOL_USER_1 user1; -} -SPOOL_USER_CTR; + union { + SPOOL_USER_1 *user1; + } user; +} SPOOL_USER_CTR; /* * various bits in the DEVICEMODE.fields member @@ -543,41 +538,33 @@ typedef struct _printer_default } PRINTER_DEFAULT; -/* SPOOL_Q_OPEN_PRINTER request to open a printer */ -typedef struct spool_q_open_printer -{ - uint32 printername_ptr; - UNISTR2 printername; +/********************************************/ + +typedef struct { + UNISTR2 *printername; PRINTER_DEFAULT printer_default; -} -SPOOL_Q_OPEN_PRINTER; +} SPOOL_Q_OPEN_PRINTER; -/* SPOOL_R_OPEN_PRINTER reply to an open printer */ -typedef struct spool_r_open_printer -{ +typedef struct { POLICY_HND handle; /* handle used along all transactions (20*uint8) */ WERROR status; -} -SPOOL_R_OPEN_PRINTER; +} SPOOL_R_OPEN_PRINTER; -/* SPOOL_Q_OPEN_PRINTER_EX request to open a printer */ -typedef struct spool_q_open_printer_ex -{ - uint32 printername_ptr; - UNISTR2 printername; +/********************************************/ + +typedef struct { + UNISTR2 *printername; PRINTER_DEFAULT printer_default; uint32 user_switch; SPOOL_USER_CTR user_ctr; -} -SPOOL_Q_OPEN_PRINTER_EX; +} SPOOL_Q_OPEN_PRINTER_EX; -/* SPOOL_R_OPEN_PRINTER_EX reply to an open printer */ -typedef struct spool_r_open_printer_ex -{ +typedef struct { POLICY_HND handle; /* handle used along all transactions (20*uint8) */ WERROR status; -} -SPOOL_R_OPEN_PRINTER_EX; +} SPOOL_R_OPEN_PRINTER_EX; + +/********************************************/ typedef struct spool_notify_option_type { @@ -1678,8 +1665,7 @@ SPOOL_R_ABORTPRINTER; typedef struct spool_q_addprinterex { - uint32 server_name_ptr; - UNISTR2 server_name; + UNISTR2 *server_name; uint32 level; SPOOL_PRINTER_INFO_LEVEL info; DEVMODE_CTR devmode_ctr; diff --git a/source3/include/rpc_svcctl.h b/source3/include/rpc_svcctl.h new file mode 100644 index 0000000000..8006ea0091 --- /dev/null +++ b/source3/include/rpc_svcctl.h @@ -0,0 +1,243 @@ +/* + Unix SMB/CIFS implementation. + SMB parameters and setup + Copyright (C) Andrew Tridgell 1992-1997, + Copyright (C) Gerald (Jerry) Carter 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 + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ + +#ifndef _RPC_SVCCTL_H /* _RPC_SVCCTL_H */ +#define _RPC_SVCCTL_H + + +/* svcctl pipe */ + +#define SVCCTL_CLOSE_SERVICE 0x00 +#define SVCCTL_CONTROL_SERVICE 0x01 +#define SVCCTL_QUERY_STATUS 0x06 +#define SVCCTL_ENUM_DEPENDENT_SERVICES_W 0x0d +#define SVCCTL_ENUM_SERVICES_STATUS_W 0x0e +#define SVCCTL_OPEN_SCMANAGER_W 0x0f +#define SVCCTL_OPEN_SERVICE_W 0x10 +#define SVCCTL_QUERY_SERVICE_CONFIG_W 0x11 +#define SVCCTL_START_SERVICE_W 0x13 +#define SVCCTL_GET_DISPLAY_NAME 0x14 +#define SVCCTL_QUERY_SERVICE_CONFIG2_W 0x27 + +/* ANSI versions not implemented currently +#define SVCCTL_ENUM_SERVICES_STATUS_A 0x0e +#define SVCCTL_OPEN_SCMANAGER_A 0x1b +*/ + +/* SERVER_STATUS - type */ + +#define SVCCTL_TYPE_WIN32 0x00000030 +#define SVCCTL_TYPE_DRIVER 0x0000000f + +/* SERVER_STATUS - state */ +#define SVCCTL_STATE_ACTIVE 0x00000001 +#define SVCCTL_STATE_INACTIVE 0x00000002 +#define SVCCTL_STATE_ALL ( SVC_STATE_ACTIVE | SVC_STATE_INACTIVE ) + +/* SERVER_STATUS - CurrentState */ + +#define SVCCTL_STOPPED 0x00000001 +#define SVCCTL_START_PENDING 0x00000002 +#define SVCCTL_STOP_PENDING 0x00000003 +#define SVCCTL_RUNNING 0x00000004 +#define SVCCTL_CONTINUE_PENDING 0x00000005 +#define SVCCTL_PAUSE_PENDING 0x00000006 +#define SVCCTL_PAUSED 0x00000007 + +/* SERVER_STATUS - ControlAccepted */ + +#define SVCCTL_ACCEPT_STOP 0x00000001 +#define SVCCTL_ACCEPT_PAUSE_CONTINUE 0x00000002 +#define SVCCTL_ACCEPT_SHUTDOWN 0x00000004 +#define SVCCTL_ACCEPT_PARAMCHANGE 0x00000008 +#define SVCCTL_ACCEPT_NETBINDCHANGE 0x00000010 +#define SVCCTL_ACCEPT_HARDWAREPROFILECHANGE 0x00000020 +#define SVCCTL_ACCEPT_POWEREVENT 0x00000040 + + +/* utility structures for RPCs */ + +typedef struct { + uint32 type; + uint32 state; + uint32 controls_accepted; + uint32 win32_exit_code; + uint32 service_exit_code; + uint32 check_point; + uint32 wait_hint; +} SERVICE_STATUS; + +typedef struct { + UNISTR servicename; + UNISTR displayname; + SERVICE_STATUS status; +} ENUM_SERVICES_STATUS; + +typedef struct { + uint32 service_type; + uint32 start_type; + uint32 error_control; + UNISTR2 *executablepath; + UNISTR2 *loadordergroup; + uint32 tag_id; + UNISTR2 *dependencies; + UNISTR2 *startname; + UNISTR2 *displayname; +} SERVICE_CONFIG; + + +/* rpc structures */ + +/**************************/ + +typedef struct { + POLICY_HND handle; +} SVCCTL_Q_CLOSE_SERVICE; + +typedef struct { + WERROR status; +} SVCCTL_R_CLOSE_SERVICE; + +/**************************/ + +typedef struct { + uint32 ptr_srv; + UNISTR2 servername; + uint32 ptr_db; + UNISTR2 database; + uint32 access_mask; +} SVCCTL_Q_OPEN_SCMANAGER; + +typedef struct { + POLICY_HND handle; + WERROR status; +} SVCCTL_R_OPEN_SCMANAGER; + +/**************************/ + +typedef struct { + POLICY_HND handle; + UNISTR2 servicename; + uint32 display_name_len; +} SVCCTL_Q_GET_DISPLAY_NAME; + +typedef struct { + UNISTR2 displayname; + uint32 display_name_len; + WERROR status; +} SVCCTL_R_GET_DISPLAY_NAME; + +/**************************/ + +typedef struct { + POLICY_HND handle; + UNISTR2 servicename; + uint32 access_mask; +} SVCCTL_Q_OPEN_SERVICE; + +typedef struct { + POLICY_HND handle; + WERROR status; +} SVCCTL_R_OPEN_SERVICE; + +/**************************/ + +typedef struct { + POLICY_HND handle; + uint32 parmcount; + UNISTR2_ARRAY parameters; +} SVCCTL_Q_START_SERVICE; + +typedef struct { + WERROR status; +} SVCCTL_R_START_SERVICE; + +/**************************/ + +typedef struct { + POLICY_HND handle; + uint32 control; +} SVCCTL_Q_CONTROL_SERVICE; + +typedef struct { + SERVICE_STATUS svc_status; + WERROR status; +} SVCCTL_R_CONTROL_SERVICE; + +/**************************/ + +typedef struct { + POLICY_HND handle; +} SVCCTL_Q_QUERY_STATUS; + +typedef struct { + SERVICE_STATUS svc_status; + WERROR status; +} SVCCTL_R_QUERY_STATUS; + +/**************************/ + +typedef struct { + POLICY_HND handle; + uint32 type; + uint32 state; + uint32 buffer_size; + uint32 *resume; +} SVCCTL_Q_ENUM_SERVICES_STATUS; + +typedef struct { + RPC_BUFFER buffer; + uint32 needed; + uint32 returned; + uint32 *resume; + WERROR status; +} SVCCTL_R_ENUM_SERVICES_STATUS; + +/**************************/ + +typedef struct { + POLICY_HND handle; + uint32 state; + uint32 buffer_size; +} SVCCTL_Q_ENUM_DEPENDENT_SERVICES; + +typedef struct { + RPC_BUFFER buffer; + uint32 needed; + uint32 returned; + WERROR status; +} SVCCTL_R_ENUM_DEPENDENT_SERVICES; + +/**************************/ + +typedef struct { + POLICY_HND handle; + uint32 buffer_size; +} SVCCTL_Q_QUERY_SERVICE_CONFIG; + +typedef struct { + SERVICE_CONFIG config; + uint32 needed; + WERROR status; +} SVCCTL_R_QUERY_SERVICE_CONFIG; + +#endif /* _RPC_SVCCTL_H */ + diff --git a/source3/include/smb.h b/source3/include/smb.h index 5b557b5926..dc0f5cf83a 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -193,6 +193,9 @@ typedef smb_ucs2_t wfstring[FSTRING_LEN]; #define PIPE_NETDFS "\\PIPE\\netdfs" #define PIPE_ECHO "\\PIPE\\rpcecho" #define PIPE_SHUTDOWN "\\PIPE\\initshutdown" +#define PIPE_EPM "\\PIPE\\epmapper" +#define PIPE_SVCCTL "\\PIPE\\svcctl" +#define PIPE_EVENTLOG "\\PIPE\\eventlog" #define PIPE_NETLOGON_PLAIN "\\NETLOGON" @@ -207,7 +210,9 @@ typedef smb_ucs2_t wfstring[FSTRING_LEN]; #define PI_NETDFS 8 #define PI_ECHO 9 #define PI_SHUTDOWN 10 -#define PI_MAX_PIPES 11 +#define PI_SVCCTL 11 +#define PI_EVENTLOG 12 +#define PI_MAX_PIPES 13 /* 64 bit time (100usec) since ????? - cifs6.txt, section 3.5, page 30 */ typedef struct nttime_info diff --git a/source3/include/smb_macros.h b/source3/include/smb_macros.h index 4fa9ffa5ac..68a80ec402 100644 --- a/source3/include/smb_macros.h +++ b/source3/include/smb_macros.h @@ -290,6 +290,8 @@ copy an IP address from one buffer to another #define TALLOC_REALLOC_ARRAY(ctx, ptr, type, count) (type *)talloc_realloc_array_((ctx),(ptr),sizeof(type),(count)) #define PRS_ALLOC_MEM(ps, type, count) (type *)prs_alloc_mem_((ps),sizeof(type),(count)) +#define PRS_ALLOC_MEM_VOID(ps, size) prs_alloc_mem_((ps),(size),1) + /* Get medieval on our ass about malloc.... */ @@ -338,6 +340,7 @@ copy an IP address from one buffer to another #define TALLOC_REALLOC_ARRAY(ctx, ptr, type, count) (type *)talloc_realloc_array((ctx),(ptr),sizeof(type),(count)) #define PRS_ALLOC_MEM(ps, type, count) (type *)prs_alloc_mem((ps),sizeof(type),(count)) +#define PRS_ALLOC_MEM_VOID(ps, size) prs_alloc_mem((ps),(size),1) /* Regular malloc code. */ |