diff options
Diffstat (limited to 'source4/librpc')
-rw-r--r-- | source4/librpc/config.mk | 12 | ||||
-rw-r--r-- | source4/librpc/idl/dcerpc.idl | 40 | ||||
-rw-r--r-- | source4/librpc/idl/lsa.idl | 25 | ||||
-rw-r--r-- | source4/librpc/idl/srvsvc.idl | 10 | ||||
-rw-r--r-- | source4/librpc/idl/winreg.cnf | 52 | ||||
-rw-r--r-- | source4/librpc/idl/winreg.idl | 401 | ||||
-rw-r--r-- | source4/librpc/ndr/ndr_orpc.c | 173 | ||||
-rw-r--r-- | source4/librpc/ndr/ndr_table.c | 134 | ||||
-rw-r--r-- | source4/librpc/ndr/ndr_wmi.c | 90 | ||||
-rw-r--r-- | source4/librpc/ndr/ndr_wmi.h | 3 | ||||
-rw-r--r-- | source4/librpc/tables.pl | 89 |
11 files changed, 41 insertions, 988 deletions
diff --git a/source4/librpc/config.mk b/source4/librpc/config.mk index 819b79f91f..a988dcf420 100644 --- a/source4/librpc/config.mk +++ b/source4/librpc/config.mk @@ -10,8 +10,6 @@ PUBLIC_DEPENDENCIES = LIBSAMBA-ERRORS LIBTALLOC LIBSAMBA-UTIL CHARSET \ LIBNDR_OBJ_FILES = $(addprefix $(ndrsrcdir)/, ndr_string.o) ../librpc/ndr/ndr_basic.o ../librpc/ndr/uuid.o ../librpc/ndr/ndr.o -$(eval $(call proto_header_template,$(ndrsrcdir)/libndr_proto.h,$(LIBNDR_OBJ_FILES:.o=.c))) - PC_FILES += ../librpc/ndr.pc LIBNDR_VERSION = 0.0.1 LIBNDR_SOVERSION = 0 @@ -90,7 +88,7 @@ NDR_DCOM_OBJ_FILES = $(gen_ndrsrcdir)/ndr_dcom.o [SUBSYSTEM::NDR_WMI] PUBLIC_DEPENDENCIES = LIBNDR NDR_SECURITY NDR_DCOM -NDR_WMI_OBJ_FILES = $(gen_ndrsrcdir)/ndr_wmi.o $(ndrsrcdir)/ndr_wmi.o +NDR_WMI_OBJ_FILES = $(gen_ndrsrcdir)/ndr_wmi.o ../librpc/ndr/ndr_wmi.o [SUBSYSTEM::NDR_DSBACKUP] PUBLIC_DEPENDENCIES = LIBNDR @@ -261,7 +259,7 @@ NDR_PROTECTED_STORAGE_OBJ_FILES = $(gen_ndrsrcdir)/ndr_protected_storage.o [SUBSYSTEM::NDR_ORPC] PUBLIC_DEPENDENCIES = LIBNDR -NDR_ORPC_OBJ_FILES = $(gen_ndrsrcdir)/ndr_orpc.o $(ndrsrcdir)/ndr_orpc.o +NDR_ORPC_OBJ_FILES = $(gen_ndrsrcdir)/ndr_orpc.o ../librpc/ndr/ndr_orpc.o [SUBSYSTEM::NDR_OXIDRESOLVER] PUBLIC_DEPENDENCIES = LIBNDR NDR_ORPC NDR_MISC @@ -373,7 +371,7 @@ clean:: $(gen_ndrsrcdir)/tables.c: $(IDL_NDR_PARSE_H_FILES) @echo Generating $@ - @$(PERL) $(librpcsrcdir)/tables.pl --output=$@ $^ > $(gen_ndrsrcdir)/tables.x + @$(PERL) ../librpc/tables.pl --output=$@ $^ > $(gen_ndrsrcdir)/tables.x @mv $(gen_ndrsrcdir)/tables.x $@ [SUBSYSTEM::NDR_TABLE] @@ -390,9 +388,7 @@ PUBLIC_DEPENDENCIES = \ NDR_SASL_HELPERS NDR_NOTIFY NDR_WINBIND NDR_FRSRPC NDR_FRSAPI NDR_NFS4ACL NDR_NTP_SIGND \ NDR_DCOM NDR_WMI -NDR_TABLE_OBJ_FILES = $(ndrsrcdir)/ndr_table.o $(gen_ndrsrcdir)/tables.o - -$(eval $(call proto_header_template,$(ndrsrcdir)/ndr_table.h,$(NDR_TABLE_OBJ_FILES:.o=.c))) +NDR_TABLE_OBJ_FILES = ../librpc/ndr/ndr_table.o $(gen_ndrsrcdir)/tables.o [SUBSYSTEM::RPC_NDR_ROT] PUBLIC_DEPENDENCIES = NDR_ROT dcerpc diff --git a/source4/librpc/idl/dcerpc.idl b/source4/librpc/idl/dcerpc.idl index a78329d990..7c0abe6ab8 100644 --- a/source4/librpc/idl/dcerpc.idl +++ b/source4/librpc/idl/dcerpc.idl @@ -205,26 +205,26 @@ interface dcerpc } dcerpc_working; typedef [enum8bit] enum { - DCERPC_PKT_REQUEST = 0, - DCERPC_PKT_PING = 1, - DCERPC_PKT_RESPONSE = 2, - DCERPC_PKT_FAULT = 3, - DCERPC_PKT_WORKING = 4, - DCERPC_PKT_NOCALL = 5, - DCERPC_PKT_REJECT = 6, - DCERPC_PKT_ACK = 7, - DCERPC_PKT_CL_CANCEL = 8, - DCERPC_PKT_FACK = 9, - DCERPC_PKT_CANCEL_ACK = 10, - DCERPC_PKT_BIND = 11, - DCERPC_PKT_BIND_ACK = 12, - DCERPC_PKT_BIND_NAK = 13, - DCERPC_PKT_ALTER = 14, - DCERPC_PKT_ALTER_RESP = 15, - DCERPC_PKT_AUTH3 = 16, - DCERPC_PKT_SHUTDOWN = 17, - DCERPC_PKT_CO_CANCEL = 18, - DCERPC_PKT_ORPHANED = 19 + DCERPC_PKT_REQUEST = 0, /* Ordinary request. */ + DCERPC_PKT_PING = 1, /* Connectionless is server alive ? */ + DCERPC_PKT_RESPONSE = 2, /* Ordinary reply. */ + DCERPC_PKT_FAULT = 3, /* Fault in processing of call. */ + DCERPC_PKT_WORKING = 4, /* Connectionless reply to a ping when server busy. */ + DCERPC_PKT_NOCALL = 5, /* Connectionless reply to a ping when server has lost part of clients call. */ + DCERPC_PKT_REJECT = 6, /* Refuse a request with a code. */ + DCERPC_PKT_ACK = 7, /* Connectionless client to server code. */ + DCERPC_PKT_CL_CANCEL = 8, /* Connectionless cancel. */ + DCERPC_PKT_FACK = 9, /* Connectionless fragment ack. Both client and server send. */ + DCERPC_PKT_CANCEL_ACK = 10, /* Server ACK to client cancel request. */ + DCERPC_PKT_BIND = 11, /* Bind to interface. */ + DCERPC_PKT_BIND_ACK = 12, /* Server ack of bind. */ + DCERPC_PKT_BIND_NAK = 13, /* Server nack of bind. */ + DCERPC_PKT_ALTER = 14, /* Alter auth. */ + DCERPC_PKT_ALTER_RESP = 15, /* Reply to alter auth. */ + DCERPC_PKT_AUTH3 = 16, /* not the real name! this is undocumented! */ + DCERPC_PKT_SHUTDOWN = 17, /* Server to client request to shutdown. */ + DCERPC_PKT_CO_CANCEL = 18, /* Connection-oriented cancel request. */ + DCERPC_PKT_ORPHANED = 19 /* Client telling server it's aborting a partially sent request or telling server to stop sending replies. */ } dcerpc_pkt_type; typedef [nodiscriminant] union { diff --git a/source4/librpc/idl/lsa.idl b/source4/librpc/idl/lsa.idl index 8745385a10..4a7a42b4dc 100644 --- a/source4/librpc/idl/lsa.idl +++ b/source4/librpc/idl/lsa.idl @@ -288,7 +288,7 @@ import "misc.idl", "security.idl"; [case(LSA_POLICY_INFO_L_ACCOUNT_DOMAIN)] lsa_DomainInfo l_account_domain; } lsa_PolicyInformation; - NTSTATUS lsa_QueryInfoPolicy ( + NTSTATUS lsa_QueryInfoPolicy( [in] policy_handle *handle, [in] lsa_PolicyInfo level, [out,unique,switch_is(level)] lsa_PolicyInformation *info @@ -718,14 +718,14 @@ import "misc.idl", "security.idl"; /* Function: 0x1a */ NTSTATUS lsa_QueryTrustedDomainInfo( [in] policy_handle *trustdom_handle, - [in] lsa_TrustDomInfoEnum level, + [in] lsa_TrustDomInfoEnum level, [out,switch_is(level),unique] lsa_TrustedDomainInfo *info ); /* Function: 0x1b */ NTSTATUS lsa_SetInformationTrustedDomain( [in] policy_handle *trustdom_handle, - [in] lsa_TrustDomInfoEnum level, + [in] lsa_TrustDomInfoEnum level, [in,switch_is(level)] lsa_TrustedDomainInfo *info ); @@ -792,8 +792,6 @@ import "misc.idl", "security.idl"; [in,out] policy_handle *handle ); - - /*******************/ /* Function: 0x23 */ NTSTATUS lsa_EnumAccountsWithUserRight ( @@ -840,7 +838,7 @@ import "misc.idl", "security.idl"; NTSTATUS lsa_QueryTrustedDomainInfoBySid( [in] policy_handle *handle, [in] dom_sid2 *dom_sid, - [in] lsa_TrustDomInfoEnum level, + [in] lsa_TrustDomInfoEnum level, [out,switch_is(level),unique] lsa_TrustedDomainInfo *info ); @@ -848,9 +846,10 @@ import "misc.idl", "security.idl"; NTSTATUS lsa_SetTrustedDomainInfo( [in] policy_handle *handle, [in] dom_sid2 *dom_sid, - [in] lsa_TrustDomInfoEnum level, + [in] lsa_TrustDomInfoEnum level, [in,switch_is(level)] lsa_TrustedDomainInfo *info ); + /* Function: 0x29 */ NTSTATUS lsa_DeleteTrustedDomain( [in] policy_handle *handle, @@ -888,8 +887,8 @@ import "misc.idl", "security.idl"; /* Function: 0x2e */ NTSTATUS lsa_QueryInfoPolicy2( - [in] policy_handle *handle, - [in] lsa_PolicyInfo level, + [in] policy_handle *handle, + [in] lsa_PolicyInfo level, [out,unique,switch_is(level)] lsa_PolicyInformation *info ); @@ -903,9 +902,9 @@ import "misc.idl", "security.idl"; /**********************/ /* Function 0x30 */ NTSTATUS lsa_QueryTrustedDomainInfoByName( - [in] policy_handle *handle, + [in] policy_handle *handle, [in] lsa_String trusted_domain, - [in] lsa_TrustDomInfoEnum level, + [in] lsa_TrustDomInfoEnum level, [out,unique,switch_is(level)] lsa_TrustedDomainInfo *info ); @@ -914,7 +913,7 @@ import "misc.idl", "security.idl"; NTSTATUS lsa_SetTrustedDomainInfoByName( [in] policy_handle *handle, [in] lsa_String trusted_domain, - [in] lsa_TrustDomInfoEnum level, + [in] lsa_TrustDomInfoEnum level, [in,unique,switch_is(level)] lsa_TrustedDomainInfo *info ); @@ -980,7 +979,7 @@ import "misc.idl", "security.idl"; NTSTATUS lsa_QueryDomainInformationPolicy( [in] policy_handle *handle, - [in] uint16 level, + [in] uint16 level, [out,unique,switch_is(level)] lsa_DomainInformationPolicy *info ); diff --git a/source4/librpc/idl/srvsvc.idl b/source4/librpc/idl/srvsvc.idl index 703f3281cf..10807cd6af 100644 --- a/source4/librpc/idl/srvsvc.idl +++ b/source4/librpc/idl/srvsvc.idl @@ -65,7 +65,7 @@ import "security.idl", "svcctl.idl"; /******************/ /* Function: 0x01 */ WERROR srvsvc_NetCharDevGetInfo( - [in,unique] [string,charset(UTF16)] uint16 *server_unc, + [in,unique] [string,charset(UTF16)] uint16 *server_unc, [in] [string,charset(UTF16)] uint16 device_name[], [in] uint32 level, [out,switch_is(level)] srvsvc_NetCharDevInfo info @@ -74,7 +74,7 @@ import "security.idl", "svcctl.idl"; /******************/ /* Function: 0x02 */ WERROR srvsvc_NetCharDevControl( - [in,unique] [string,charset(UTF16)] uint16 *server_unc, + [in,unique] [string,charset(UTF16)] uint16 *server_unc, [in] [string,charset(UTF16)] uint16 device_name[], [in] uint32 opcode ); @@ -131,7 +131,7 @@ import "security.idl", "svcctl.idl"; /******************/ /* Function: 0x04 */ WERROR srvsvc_NetCharDevQGetInfo( - [in,unique] [string,charset(UTF16)] uint16 *server_unc, + [in,unique] [string,charset(UTF16)] uint16 *server_unc, [in] [string,charset(UTF16)] uint16 queue_name[], [in] [string,charset(UTF16)] uint16 user[], [in] uint32 level, @@ -151,14 +151,14 @@ import "security.idl", "svcctl.idl"; /******************/ /* Function: 0x06 */ WERROR srvsvc_NetCharDevQPurge( - [in,unique] [string,charset(UTF16)] uint16 *server_unc, + [in,unique] [string,charset(UTF16)] uint16 *server_unc, [in] [string,charset(UTF16)] uint16 queue_name[] ); /******************/ /* Function: 0x07 */ WERROR srvsvc_NetCharDevQPurgeSelf( - [in,unique] [string,charset(UTF16)] uint16 *server_unc, + [in,unique] [string,charset(UTF16)] uint16 *server_unc, [in] [string,charset(UTF16)] uint16 queue_name[], [in] [string,charset(UTF16)] uint16 computer_name[] ); diff --git a/source4/librpc/idl/winreg.cnf b/source4/librpc/idl/winreg.cnf deleted file mode 100644 index e5a146cd5d..0000000000 --- a/source4/librpc/idl/winreg.cnf +++ /dev/null @@ -1,52 +0,0 @@ -IMPORT security_secinfo offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep, hf_winreg_winreg_GetKeySecurity_sec_info, NULL); - -HF_FIELD hf_winreg_access_required "Access Required" "winreg.access_required" FT_UINT32 BASE_HEX NULL 0 "" "" "" - -HF_RENAME hf_winreg_winreg_OpenHKCR_access_required hf_winreg_access_required -HF_RENAME hf_winreg_winreg_OpenHKLM_access_required hf_winreg_access_required -HF_RENAME hf_winreg_winreg_OpenHKU_access_required hf_winreg_access_required -HF_RENAME hf_winreg_winreg_CreateKey_access_required hf_winreg_access_required -HF_RENAME hf_winreg_winreg_OpenHKCC_access_required hf_winreg_access_required -HF_RENAME hf_winreg_winreg_OpenHKDD_access_required hf_winreg_access_required -HF_RENAME hf_winreg_winreg_OpenHKPT_access_required hf_winreg_access_required -HF_RENAME hf_winreg_winreg_OpenHKPN_access_required hf_winreg_access_required - -HF_FIELD hf_winreg_system_name "System Name" "winreg.system_name" FT_UINT16 BASE_DEC NULL 0 "" "" "" - -HF_RENAME hf_winreg_winreg_OpenHKCR_system_name hf_winreg_system_name -HF_RENAME hf_winreg_winreg_OpenHKCU_system_name hf_winreg_system_name -HF_RENAME hf_winreg_winreg_OpenHKLM_system_name hf_winreg_system_name -HF_RENAME hf_winreg_winreg_OpenHKPD_system_name hf_winreg_system_name -HF_RENAME hf_winreg_winreg_OpenHKU_system_name hf_winreg_system_name -HF_RENAME hf_winreg_winreg_OpenHKCC_system_name hf_winreg_system_name -HF_RENAME hf_winreg_winreg_OpenHKDD_system_name hf_winreg_system_name -HF_RENAME hf_winreg_winreg_OpenHKPT_system_name hf_winreg_system_name -HF_RENAME hf_winreg_winreg_OpenHKPN_system_name hf_winreg_system_name - -HF_FIELD hf_winreg_handle "Handle" "winreg.handle" FT_BYTES BASE_NONE NULL 0 "" "" "" - -HF_RENAME hf_winreg_winreg_OpenHKCR_handle hf_winreg_handle -HF_RENAME hf_winreg_winreg_OpenHKCU_handle hf_winreg_handle -HF_RENAME hf_winreg_winreg_OpenHKLM_handle hf_winreg_handle -HF_RENAME hf_winreg_winreg_OpenHKPD_handle hf_winreg_handle -HF_RENAME hf_winreg_winreg_OpenHKU_handle hf_winreg_handle -HF_RENAME hf_winreg_winreg_CloseKey_handle hf_winreg_handle -HF_RENAME hf_winreg_winreg_CreateKey_handle hf_winreg_handle -HF_RENAME hf_winreg_winreg_DeleteKey_handle hf_winreg_handle -HF_RENAME hf_winreg_winreg_DeleteValue_handle hf_winreg_handle -HF_RENAME hf_winreg_winreg_EnumKey_handle hf_winreg_handle -HF_RENAME hf_winreg_winreg_EnumValue_handle hf_winreg_handle -HF_RENAME hf_winreg_winreg_FlushKey_handle hf_winreg_handle -HF_RENAME hf_winreg_winreg_GetKeySecurity_handle hf_winreg_handle -HF_RENAME hf_winreg_winreg_LoadKey_handle hf_winreg_handle -HF_RENAME hf_winreg_winreg_NotifyChangeKeyValue_handle hf_winreg_handle -HF_RENAME hf_winreg_winreg_OpenKey_handle hf_winreg_handle -HF_RENAME hf_winreg_winreg_QueryInfoKey_handle hf_winreg_handle -HF_RENAME hf_winreg_winreg_QueryValue_handle hf_winreg_handle -HF_RENAME hf_winreg_winreg_SetKeySecurity_handle hf_winreg_handle -HF_RENAME hf_winreg_winreg_SetValue_handle hf_winreg_handle -HF_RENAME hf_winreg_winreg_GetVersion_handle hf_winreg_handle -HF_RENAME hf_winreg_winreg_OpenHKCC_handle hf_winreg_handle -HF_RENAME hf_winreg_winreg_OpenHKDD_handle hf_winreg_handle -HF_RENAME hf_winreg_winreg_OpenHKPT_handle hf_winreg_handle -HF_RENAME hf_winreg_winreg_OpenHKPN_handle hf_winreg_handle diff --git a/source4/librpc/idl/winreg.idl b/source4/librpc/idl/winreg.idl deleted file mode 100644 index 643dc9e458..0000000000 --- a/source4/librpc/idl/winreg.idl +++ /dev/null @@ -1,401 +0,0 @@ -/* - winreg interface definition -*/ - -import "lsa.idl", "security.idl"; - -[ - uuid("338cd001-2244-31f1-aaaa-900038001003"), - version(1.0), - endpoint("ncacn_np:[\\pipe\\winreg]","ncacn_ip_tcp:","ncalrpc:"), - pointer_default(unique), - helpstring("Remote Registry Service") -] interface winreg -{ - typedef bitmap security_secinfo security_secinfo; - - typedef [bitmap32bit] bitmap { - KEY_QUERY_VALUE = 0x00001, - KEY_SET_VALUE = 0x00002, - KEY_CREATE_SUB_KEY = 0x00004, - KEY_ENUMERATE_SUB_KEYS = 0x00008, - KEY_NOTIFY = 0x00010, - KEY_CREATE_LINK = 0x00020, - KEY_WOW64_64KEY = 0x00100, - KEY_WOW64_32KEY = 0x00200 - } winreg_AccessMask; - - typedef [public,v1_enum] enum { - REG_NONE = 0, - REG_SZ = 1, - REG_EXPAND_SZ = 2, - REG_BINARY = 3, - REG_DWORD = 4, - REG_DWORD_BIG_ENDIAN = 5, - REG_LINK = 6, - REG_MULTI_SZ = 7, - REG_RESOURCE_LIST = 8, - REG_FULL_RESOURCE_DESCRIPTOR = 9, - REG_RESOURCE_REQUIREMENTS_LIST = 10, - REG_QWORD = 11 - } winreg_Type; - - typedef [public,noejs] struct { - [value(strlen_m_term(name)*2)] uint16 name_len; - [value(strlen_m_term(name)*2)] uint16 name_size; - [string,charset(UTF16)] uint16 *name; - } winreg_String; - - /******************/ - /* Function: 0x00 */ - WERROR winreg_OpenHKCR( - [in,unique] uint16 *system_name, - [in] winreg_AccessMask access_mask, - [out,ref] policy_handle *handle - ); - - /******************/ - /* Function: 0x01 */ - WERROR winreg_OpenHKCU( - [in,unique] uint16 *system_name, - [in] winreg_AccessMask access_mask, - [out,ref] policy_handle *handle - ); - - /******************/ - /* Function: 0x02 */ - [public] WERROR winreg_OpenHKLM( - [in,unique] uint16 *system_name, - [in] winreg_AccessMask access_mask, - [out,ref] policy_handle *handle - ); - - /******************/ - /* Function: 0x03 */ - WERROR winreg_OpenHKPD( - [in,unique] uint16 *system_name, - [in] winreg_AccessMask access_mask, - [out,ref] policy_handle *handle - ); - - /******************/ - /* Function: 0x04 */ - WERROR winreg_OpenHKU( - [in,unique] uint16 *system_name, - [in] winreg_AccessMask access_mask, - [out,ref] policy_handle *handle - ); - - /******************/ - /* Function: 0x05 */ - [public] WERROR winreg_CloseKey( - [in,out,ref] policy_handle *handle - ); - - /******************/ - /* Function: 0x06 */ - - typedef struct { - [size_is(size),length_is(len)] uint8 *data; - uint32 size; - uint32 len; - } KeySecurityData; - - typedef struct { - uint32 length; - KeySecurityData sd; - boolean8 inherit; - } winreg_SecBuf; - - typedef [v1_enum] enum { - REG_ACTION_NONE = 0, /* used by caller */ - REG_CREATED_NEW_KEY = 1, - REG_OPENED_EXISTING_KEY = 2 - } winreg_CreateAction; - - [public] WERROR winreg_CreateKey( - [in,ref] policy_handle *handle, - [in] winreg_String name, - [in] winreg_String keyclass, - [in] uint32 options, - [in] winreg_AccessMask access_mask, - [in,unique] winreg_SecBuf *secdesc, - [out,ref] policy_handle *new_handle, - [in,out,unique] winreg_CreateAction *action_taken - ); - - /******************/ - /* Function: 0x07 */ - [public] WERROR winreg_DeleteKey( - [in,ref] policy_handle *handle, - [in] winreg_String key - ); - - /******************/ - /* Function: 0x08 */ - WERROR winreg_DeleteValue( - [in,ref] policy_handle *handle, - [in] winreg_String value - ); - - typedef struct { - [value(strlen_m_term(name)*2)] uint16 length; - /* size cannot be auto-set by value() as it is the - amount of space the server is allowed to use for this - string in the reply, not its current size */ - uint16 size; - [size_is(size/2),length_is(length/2),charset(UTF16)] uint16 *name; - } winreg_StringBuf; - - /******************/ - /* Function: 0x09 */ - [public] WERROR winreg_EnumKey( - [in,ref] policy_handle *handle, - [in] uint32 enum_index, - [in,out,ref] winreg_StringBuf *name, - [in,out,unique] winreg_StringBuf *keyclass, - [in,out,unique] NTTIME *last_changed_time - ); - - /******************/ - /* Function: 0x0a */ - - [public] WERROR winreg_EnumValue( - [in,ref] policy_handle *handle, - [in] uint32 enum_index, - [in,out,ref] winreg_StringBuf *name, - [in,out,unique] winreg_Type *type, - [in,out,unique,size_is(*size),length_is(*length)] uint8 *value, - [in,out,unique] uint32 *size, - [in,out,unique] uint32 *length - ); - - /******************/ - /* Function: 0x0b */ - [public] WERROR winreg_FlushKey( - [in,ref] policy_handle *handle - ); - - /******************/ - /* Function: 0x0c */ - [public] WERROR winreg_GetKeySecurity( - [in,ref] policy_handle *handle, - [in] security_secinfo sec_info, - [in,out,ref] KeySecurityData *sd - ); - - /******************/ - /* Function: 0x0d */ - WERROR winreg_LoadKey( - [in,ref] policy_handle *handle, - [in,unique] winreg_String *keyname, - [in,unique] winreg_String *filename - ); - - /******************/ - /* Function: 0x0e */ - typedef [public,bitmap32bit] bitmap { - REG_NOTIFY_CHANGE_NAME = 0x00000001, - REG_NOTIFY_CHANGE_ATTRIBUTES = 0x00000002, - REG_NOTIFY_CHANGE_LAST_SET = 0x00000004, - REG_NOTIFY_CHANGE_SECURITY = 0x00000008 - } winreg_NotifyChangeType; - - [public] WERROR winreg_NotifyChangeKeyValue( - [in,ref] policy_handle *handle, - [in] boolean8 watch_subtree, - [in] winreg_NotifyChangeType notify_filter, - [in] uint32 unknown, - [in] winreg_String string1, - [in] winreg_String string2, - [in] uint32 unknown2 - ); - - /******************/ - /* Function: 0x0f */ - [public] WERROR winreg_OpenKey( - [in,ref] policy_handle *parent_handle, - [in] winreg_String keyname, - [in] uint32 unknown, - [in] winreg_AccessMask access_mask, - [out,ref] policy_handle *handle - ); - - /******************/ - /* Function: 0x10 */ - [public] WERROR winreg_QueryInfoKey( - [in,ref] policy_handle *handle, - [in,out,ref] winreg_String *classname, - [out,ref] uint32 *num_subkeys, - [out,ref] uint32 *max_subkeylen, - [out,ref] uint32 *max_subkeysize, - [out,ref] uint32 *num_values, - [out,ref] uint32 *max_valnamelen, - [out,ref] uint32 *max_valbufsize, - [out,ref] uint32 *secdescsize, - [out,ref] NTTIME *last_changed_time - ); - - /******************/ - /* Function: 0x11 */ - [public] WERROR winreg_QueryValue( - [in,ref] policy_handle *handle, - [in,ref] winreg_String *value_name, - [in,out,unique] winreg_Type *type, - [in,out,unique,size_is(*data_size),length_is(*data_length)] uint8 *data, - [in,out,unique] uint32 *data_size, - [in,out,unique] uint32 *data_length - ); - - /******************/ - /* Function: 0x12 */ - [todo] WERROR winreg_ReplaceKey( - ); - - /******************/ - /* Function: 0x13 */ - WERROR winreg_RestoreKey( - [in,ref] policy_handle *handle, - [in,ref] winreg_String *filename, - [in] uint32 flags - ); - - /******************/ - /* Function: 0x14 */ - - typedef struct { - uint32 data_size; - KeySecurityData sec_data; - uint8 inherit; - } KeySecurityAttribute; - - WERROR winreg_SaveKey( - [in,ref] policy_handle *handle, - [in,ref] winreg_String *filename, - [in,unique] KeySecurityAttribute *sec_attrib - ); - - /******************/ - /* Function: 0x15 */ - WERROR winreg_SetKeySecurity( - [in,ref] policy_handle *handle, - [in] security_secinfo sec_info, - [in,ref] KeySecurityData *sd - ); - - /******************/ - /* Function: 0x16 */ - WERROR winreg_SetValue( - [in,ref] policy_handle *handle, - [in] winreg_String name, - [in] winreg_Type type, - [in,size_is(size),ref] uint8 *data, - [in] uint32 size - ); - - /******************/ - /* Function: 0x17 */ - [todo] WERROR winreg_UnLoadKey( - ); - - /******************/ - /* Function: 0x18 */ - WERROR winreg_InitiateSystemShutdown( - [in,unique] uint16 *hostname, - /* - * Note: lsa_String and winreg_String both result - * in WERR_INVALID_PARAM - */ - [in,unique] lsa_StringLarge *message, - [in] uint32 timeout, - [in] uint8 force_apps, - [in] uint8 do_reboot - ); - - /******************/ - /* Function: 0x19 */ - WERROR winreg_AbortSystemShutdown( - [in,unique] uint16 *server - ); - - /******************/ - /* Function: 0x1a */ - [public] WERROR winreg_GetVersion( - [in,ref] policy_handle *handle, - [out,ref] uint32 *version - ); - - /******************/ - /* Function: 0x1b */ - WERROR winreg_OpenHKCC( - [in,unique] uint16 *system_name, - [in] winreg_AccessMask access_mask, - [out,ref] policy_handle *handle - ); - - /******************/ - /* Function: 0x1c */ - WERROR winreg_OpenHKDD( - [in,unique] uint16 *system_name, - [in] winreg_AccessMask access_mask, - [out,ref] policy_handle *handle - ); - - typedef struct { - winreg_String *name; - winreg_Type type; - uint32 offset; - uint32 length; - } QueryMultipleValue; - - /******************/ - /* Function: 0x1d */ - [public] WERROR winreg_QueryMultipleValues( - [in,ref] policy_handle *key_handle, - [in,out,ref,size_is(num_values),length_is(num_values)] QueryMultipleValue *values, - [in] uint32 num_values, - [in,out,unique,size_is(*buffer_size),length_is(*buffer_size)] uint8 *buffer, - [in,out,ref] uint32 *buffer_size - ); - - /******************/ - /* Function: 0x1e */ - WERROR winreg_InitiateSystemShutdownEx( - [in,unique] uint16 *hostname, - /* - * Note: lsa_String and winreg_String both result - * in WERR_INVALID_PARAM - */ - [in,unique] lsa_StringLarge *message, - [in] uint32 timeout, - [in] uint8 force_apps, - [in] uint8 do_reboot, - [in] uint32 reason - ); - - /******************/ - /* Function: 0x1f */ - [todo] WERROR winreg_SaveKeyEx( - ); - - /******************/ - /* Function: 0x20 */ - WERROR winreg_OpenHKPT( - [in,unique] uint16 *system_name, - [in] winreg_AccessMask access_mask, - [out,ref] policy_handle *handle - ); - - /******************/ - /* Function: 0x21 */ - WERROR winreg_OpenHKPN( - [in,unique] uint16 *system_name, - [in] winreg_AccessMask access_mask, - [out,ref] policy_handle *handle - ); - - /******************/ - /* Function: 0x22 */ - [todo] WERROR winreg_QueryMultipleValues2( - ); -} diff --git a/source4/librpc/ndr/ndr_orpc.c b/source4/librpc/ndr/ndr_orpc.c deleted file mode 100644 index 6a55048e43..0000000000 --- a/source4/librpc/ndr/ndr_orpc.c +++ /dev/null @@ -1,173 +0,0 @@ -/* - Unix SMB/CIFS implementation. - - routines for marshalling/unmarshalling DCOM string arrays - - Copyright (C) Jelmer Vernooij 2004 - - 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 3 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, see <http://www.gnu.org/licenses/>. -*/ - - -#include "includes.h" -#include "librpc/gen_ndr/ndr_orpc.h" - -enum ndr_err_code ndr_pull_DUALSTRINGARRAY(struct ndr_pull *ndr, int ndr_flags, struct DUALSTRINGARRAY *ar) -{ - uint16_t num_entries, security_offset; - uint16_t towerid; - uint32_t towernum = 0, conformant_size; - - if (!(ndr_flags & NDR_SCALARS)) { - return NDR_ERR_SUCCESS; - } - - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &conformant_size)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &num_entries)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &security_offset)); - - ar->stringbindings = talloc_array(ndr, struct STRINGBINDING *, num_entries); - ar->stringbindings[0] = NULL; - - do { - /* 'Peek' */ - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &towerid)); - - if (towerid > 0) { - ndr->offset -= 2; - ar->stringbindings = talloc_realloc(ndr, ar->stringbindings, struct STRINGBINDING *, towernum+2); - ar->stringbindings[towernum] = talloc(ndr, struct STRINGBINDING); - NDR_CHECK(ndr_pull_STRINGBINDING(ndr, ndr_flags, ar->stringbindings[towernum])); - towernum++; - } - } while (towerid != 0); - - ar->stringbindings[towernum] = NULL; - towernum = 0; - - ar->securitybindings = talloc_array(ndr, struct SECURITYBINDING *, num_entries); - ar->securitybindings[0] = NULL; - - do { - /* 'Peek' */ - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &towerid)); - - if (towerid > 0) { - ndr->offset -= 2; - ar->securitybindings = talloc_realloc(ndr, ar->securitybindings, struct SECURITYBINDING *, towernum+2); - ar->securitybindings[towernum] = talloc(ndr, struct SECURITYBINDING); - NDR_CHECK(ndr_pull_SECURITYBINDING(ndr, ndr_flags, ar->securitybindings[towernum])); - towernum++; - } - } while (towerid != 0); - - ar->securitybindings[towernum] = NULL; - - return NDR_ERR_SUCCESS; -} - -enum ndr_err_code ndr_push_DUALSTRINGARRAY(struct ndr_push *ndr, int ndr_flags, const struct DUALSTRINGARRAY *ar) -{ - return ndr_push_error(ndr, NDR_ERR_STRING, "ndr_push_DUALSTRINGARRAY not implemented"); -} - -/* - print a dom_sid -*/ -void ndr_print_DUALSTRINGARRAY(struct ndr_print *ndr, const char *name, const struct DUALSTRINGARRAY *ar) -{ - int i; - ndr->print(ndr, "%-25s: DUALSTRINGARRAY", name); - ndr->depth++; - ndr->print(ndr, "STRING BINDINGS"); - ndr->depth++; - for (i=0;ar->stringbindings[i];i++) { - char *idx = NULL; - asprintf(&idx, "[%d]", i); - if (idx) { - ndr_print_STRINGBINDING(ndr, idx, ar->stringbindings[i]); - free(idx); - } - } - ndr->depth--; - ndr->print(ndr, "SECURITY BINDINGS"); - ndr->depth++; - for (i=0;ar->securitybindings[i];i++) { - char *idx = NULL; - asprintf(&idx, "[%d]", i); - if (idx) { - ndr_print_SECURITYBINDING(ndr, idx, ar->securitybindings[i]); - free(idx); - } - } - ndr->depth--; -} - -enum ndr_err_code ndr_pull_STRINGARRAY(struct ndr_pull *ndr, int ndr_flags, struct STRINGARRAY *ar) -{ - uint16_t towerid; - uint32_t towernum = 0; - uint16_t num_entries; - - if (!(ndr_flags & NDR_SCALARS)) { - return NDR_ERR_SUCCESS; - } - - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &num_entries)); - - ar->stringbindings = talloc_array(ndr, struct STRINGBINDING *, 1); - ar->stringbindings[0] = NULL; - - do { - /* 'Peek' */ - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &towerid)); - - if (towerid > 0) { - ndr->offset -= 2; - ar->stringbindings = talloc_realloc(ndr, ar->stringbindings, struct STRINGBINDING *, towernum+2); - ar->stringbindings[towernum] = talloc(ndr, struct STRINGBINDING); - NDR_CHECK(ndr_pull_STRINGBINDING(ndr, ndr_flags, ar->stringbindings[towernum])); - towernum++; - } - } while (towerid != 0); - - ar->stringbindings[towernum] = NULL; - towernum = 0; - - return NDR_ERR_SUCCESS; -} - -enum ndr_err_code ndr_push_STRINGARRAY(struct ndr_push *ndr, int ndr_flags, const struct STRINGARRAY *ar) -{ - return ndr_push_error(ndr, NDR_ERR_STRING, "ndr_push_STRINGARRAY not implemented"); -} - -/* - print a dom_sid -*/ -void ndr_print_STRINGARRAY(struct ndr_print *ndr, const char *name, const struct STRINGARRAY *ar) -{ - int i; - ndr->print(ndr, "%-25s: STRINGARRAY", name); - ndr->depth++; - for (i=0;ar->stringbindings[i];i++) { - char *idx = NULL; - asprintf(&idx, "[%d]", i); - if (idx) { - ndr_print_STRINGBINDING(ndr, idx, ar->stringbindings[i]); - free(idx); - } - } - ndr->depth--; -} diff --git a/source4/librpc/ndr/ndr_table.c b/source4/librpc/ndr/ndr_table.c deleted file mode 100644 index 6308ba20dd..0000000000 --- a/source4/librpc/ndr/ndr_table.c +++ /dev/null @@ -1,134 +0,0 @@ -/* - Unix SMB/CIFS implementation. - - dcerpc utility functions - - Copyright (C) Andrew Tridgell 2003 - Copyright (C) Jelmer Vernooij 2004 - - 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 3 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, see <http://www.gnu.org/licenses/>. -*/ - -#include "includes.h" -#include "../lib/util/dlinklist.h" -#include "librpc/ndr/libndr.h" -#include "librpc/ndr/ndr_table.h" - -static struct ndr_interface_list *ndr_interfaces; - -/* - register a ndr interface table -*/ -NTSTATUS ndr_table_register(const struct ndr_interface_table *table) -{ - struct ndr_interface_list *l; - - for (l = ndr_interfaces; l; l = l->next) { - if (GUID_equal(&table->syntax_id.uuid, &l->table->syntax_id.uuid)) { - DEBUG(0, ("Attempt to register interface %s which has the " - "same UUID as already registered interface %s\n", - table->name, l->table->name)); - return NT_STATUS_OBJECT_NAME_COLLISION; - } - } - - l = talloc(talloc_autofree_context(), struct ndr_interface_list); - l->table = table; - - DLIST_ADD(ndr_interfaces, l); - - return NT_STATUS_OK; -} - -/* - find the pipe name for a local IDL interface -*/ -const char *ndr_interface_name(const struct GUID *uuid, uint32_t if_version) -{ - const struct ndr_interface_list *l; - for (l=ndr_table_list();l;l=l->next) { - if (GUID_equal(&l->table->syntax_id.uuid, uuid) && - l->table->syntax_id.if_version == if_version) { - return l->table->name; - } - } - return "UNKNOWN"; -} - -/* - find the number of calls defined by local IDL -*/ -int ndr_interface_num_calls(const struct GUID *uuid, uint32_t if_version) -{ - const struct ndr_interface_list *l; - for (l=ndr_interfaces;l;l=l->next){ - if (GUID_equal(&l->table->syntax_id.uuid, uuid) && - l->table->syntax_id.if_version == if_version) { - return l->table->num_calls; - } - } - return -1; -} - - -/* - find a dcerpc interface by name -*/ -const struct ndr_interface_table *ndr_table_by_name(const char *name) -{ - const struct ndr_interface_list *l; - for (l=ndr_interfaces;l;l=l->next) { - if (strcasecmp(l->table->name, name) == 0) { - return l->table; - } - } - return NULL; -} - -/* - find a dcerpc interface by uuid -*/ -const struct ndr_interface_table *ndr_table_by_uuid(const struct GUID *uuid) -{ - const struct ndr_interface_list *l; - for (l=ndr_interfaces;l;l=l->next) { - if (GUID_equal(&l->table->syntax_id.uuid, uuid)) { - return l->table; - } - } - return NULL; -} - -/* - return the list of registered dcerpc_pipes -*/ -const struct ndr_interface_list *ndr_table_list(void) -{ - return ndr_interfaces; -} - - -NTSTATUS ndr_table_register_builtin_tables(void); - -NTSTATUS ndr_table_init(void) -{ - static bool initialized = false; - - if (initialized) return NT_STATUS_OK; - initialized = true; - - ndr_table_register_builtin_tables(); - - return NT_STATUS_OK; -} diff --git a/source4/librpc/ndr/ndr_wmi.c b/source4/librpc/ndr/ndr_wmi.c deleted file mode 100644 index 6cf42471f8..0000000000 --- a/source4/librpc/ndr/ndr_wmi.c +++ /dev/null @@ -1,90 +0,0 @@ -/* - Unix SMB/CIFS implementation. - - routines for marshalling/unmarshalling DCOM string arrays - - Copyright (C) Jelmer Vernooij 2004 - - 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. -*/ -//#define NDR_CHECK_DEBUG -#include "includes.h" -#include "librpc/gen_ndr/ndr_dcom.h" -#include "librpc/gen_ndr/ndr_wmi.h" -#include "librpc/ndr/ndr_wmi.h" - -// Just for debugging -int NDR_CHECK_depth = 0; -int NDR_CHECK_shift = 0x18; - -int get_CIMTYPE_size(int t) -{ - if (t & CIM_FLAG_ARRAY) return 4; - t &= 0x1FF; - switch (t) { - case CIM_SINT8: - case CIM_UINT8: - return 1; - case CIM_SINT16: - case CIM_UINT16: - case CIM_BOOLEAN: - return 2; - case CIM_SINT32: - case CIM_UINT32: - case CIM_REAL32: - case CIM_STRING: - case CIM_DATETIME: - case CIM_REFERENCE: - case CIM_OBJECT: - return 4; - case CIM_SINT64: - case CIM_UINT64: - case CIM_REAL64: - return 8; - default: - DEBUG(0, ("Unknown CIMTYPE size for %04X", t)); - return 4; - } -} - -enum ndr_err_code ndr_push_BSTR(struct ndr_push *ndr, int ndr_flags, const struct BSTR *r) -{ - uint32_t len; - uint32_t flags; - enum ndr_err_code status; - len = strlen(r->data); - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0x72657355)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, len)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 2*len)); - flags = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NOTERM | LIBNDR_FLAG_STR_SIZE4); - status = ndr_push_string(ndr, NDR_SCALARS, r->data); - ndr->flags = flags; - return status; - } - return NDR_ERR_SUCCESS; -} - -enum ndr_err_code ndr_pull_BSTR(struct ndr_pull *ndr, int ndr_flags, struct BSTR *r) -{ - return NDR_ERR_BAD_SWITCH; -} - -void ndr_print_BSTR(struct ndr_print *ndr, const char *name, const struct BSTR *r) -{ - ndr->print(ndr, "%-25s: BSTR(\"%s\")", name, r->data); -} diff --git a/source4/librpc/ndr/ndr_wmi.h b/source4/librpc/ndr/ndr_wmi.h deleted file mode 100644 index 539b9e882b..0000000000 --- a/source4/librpc/ndr/ndr_wmi.h +++ /dev/null @@ -1,3 +0,0 @@ -typedef const char *CIMSTRING; -enum ndr_err_code ndr_pull_CIMSTRING(struct ndr_pull *ndr, int ndr_flags, CIMSTRING *r); -enum ndr_err_code ndr_push_CIMSTRING(struct ndr_push *ndr, int ndr_flags, const CIMSTRING *r); diff --git a/source4/librpc/tables.pl b/source4/librpc/tables.pl deleted file mode 100644 index 04764f5fa0..0000000000 --- a/source4/librpc/tables.pl +++ /dev/null @@ -1,89 +0,0 @@ -#!/usr/bin/perl -w - -################################################### -# package to produce a table of all idl parsers -# Copyright tridge@samba.org 2003 -# Copyright jelmer@samba.org 2005 -# released under the GNU GPL - -use strict; - -use Getopt::Long; -use File::Basename; - -my $opt_output = 'librpc/gen_ndr/tables.c'; -my $opt_help = 0; - - -######################################### -# display help text -sub ShowHelp() -{ - print " - perl NDR interface table generator - Copyright (C) tridge\@samba.org - - Usage: tables.pl [options] <idlfile> - - \n"; - exit(0); -} - -# main program -GetOptions ( - 'help|h|?' => \$opt_help, - 'output=s' => \$opt_output, - ); - -if ($opt_help) { - ShowHelp(); - exit(0); -} - -my $init_fns = ""; - -################################### -# extract table entries from 1 file -sub process_file($) -{ - my $filename = shift; - open(FILE, $filename) || die "unable to open $filename\n"; - my $found = 0; - - while (my $line = <FILE>) { - if ($line =~ /extern const struct ndr_interface_table (\w+);/) { - $found = 1; - $init_fns.="\tstatus = ndr_table_register(&$1);\n"; - $init_fns.="\tif (NT_STATUS_IS_ERR(status)) return status;\n\n"; - } - } - - if ($found) { - print "#include \"$filename\"\n"; - } - - close(FILE); -} - -print <<EOF; - -/* Automatically generated by tables.pl. DO NOT EDIT */ - -#include "includes.h" -#include "librpc/ndr/libndr.h" -#include "librpc/ndr/ndr_table.h" -EOF - -process_file($_) foreach (@ARGV); - -print <<EOF; - -NTSTATUS ndr_table_register_builtin_tables(void) -{ - NTSTATUS status; - -$init_fns - - return NT_STATUS_OK; -} -EOF |