diff options
Diffstat (limited to 'source4')
-rw-r--r-- | source4/build/pidl/eparser.pm | 43 | ||||
-rw-r--r-- | source4/build/pidl/packet-dcerpc-eparser.c | 25 | ||||
-rw-r--r-- | source4/build/pidl/packet-dcerpc-eparser.h | 6 | ||||
-rw-r--r-- | source4/librpc/config.m4 | 1 | ||||
-rw-r--r-- | source4/librpc/idl/browser.idl | 47 | ||||
-rw-r--r-- | source4/librpc/idl/dcom.idl | 443 | ||||
-rw-r--r-- | source4/librpc/idl/epmapper.idl | 30 | ||||
-rw-r--r-- | source4/librpc/idl/keysvc.idl | 2 | ||||
-rw-r--r-- | source4/librpc/idl/policyagent.idl | 11 | ||||
-rw-r--r-- | source4/librpc/idl/protected_storage.idl | 1 | ||||
-rw-r--r-- | source4/librpc/idl/svcctl.idl | 294 | ||||
-rw-r--r-- | source4/librpc/rpc/dcerpc_util.c | 6 | ||||
-rw-r--r-- | source4/rpc_server/epmapper/rpc_epmapper.c | 20 | ||||
-rw-r--r-- | source4/torture/rpc/epmapper.c | 47 | ||||
-rw-r--r-- | source4/torture/rpc/svcctl.c | 10 |
15 files changed, 893 insertions, 93 deletions
diff --git a/source4/build/pidl/eparser.pm b/source4/build/pidl/eparser.pm index d84f17ef29..0711790d23 100644 --- a/source4/build/pidl/eparser.pm +++ b/source4/build/pidl/eparser.pm @@ -297,6 +297,9 @@ sub ParseElementPullSwitch($$$) my $cprefix = util::c_pull_prefix($e); + pidl "\t{\n"; + pidl "\t\tguint16 _level;\n"; + my $utype = $structs{$e->{TYPE}}; if (!defined $utype || !util::has_property($utype->{DATA}, "nodiscriminant")) { @@ -304,6 +307,8 @@ sub ParseElementPullSwitch($$$) pidl "\tif (($ndr_flags) & NDR_SCALARS) {\n"; pidl "\t\tndr_pull_level(ndr, tree, hf_level, &_level);\n"; pidl "\t}\n"; + } else { + pidl "\t_level = $switch_var;\n"; } my $sub_size = util::has_property($e, "subcontext"); @@ -312,8 +317,7 @@ sub ParseElementPullSwitch($$$) } else { pidl "\tndr_pull_$e->{TYPE}(ndr, tree, $ndr_flags, _level);\n"; } - - + pidl "\t}\n"; } ##################################################################### @@ -350,6 +354,13 @@ sub ParseElementPullScalar($$) pidl "\tndr_pull_subcontext_flags_fn(ndr, get_subtree(tree, \"$e->{NAME}\", ndr, ett_$e->{TYPE}), $sub_size, (ndr_pull_flags_fn_t) ndr_pull_$e->{TYPE});\n"; } } elsif (util::is_builtin_type($e->{TYPE})) { + $needed{"hf_$e->{NAME}_$e->{TYPE}"} = { + 'name' => $e->{NAME}, + 'type' => $e->{TYPE}, + 'ft' => type2ft($e->{TYPE}), + 'base' => type2base($e->{TYPE}) + }; + pidl "\tndr_pull_$e->{TYPE}(ndr, tree, hf_$e->{NAME}_$e->{TYPE}, &elt_$e->{NAME});\n"; } else { pidl "\tndr_pull_$e->{TYPE}(ndr, get_subtree(tree, \"$e->{NAME}\", ndr, ett_$e->{TYPE}), $ndr_flags);\n"; @@ -512,6 +523,13 @@ sub ParseUnionPull($) pidl "\tndr_pull_struct_start(ndr);\n"; + foreach my $el (@{$e->{DATA}}) { + my $e2 = $el->{DATA}; + if ($e2->{POINTERS}) { + pidl "\tguint32 ptr_$e2->{NAME};\n"; + } + } + # my $align = union_alignment($e); # pidl "\tndr_pull_align(ndr, $align);\n"; @@ -524,19 +542,16 @@ sub ParseUnionPull($) pidl "\tcase $el->{CASE}: {\n"; } if ($el->{TYPE} eq "UNION_ELEMENT") { - my $e2 = $el->{DATA}; - if ($e2->{POINTERS}) { - pidl "\t\tguint32 ptr_$e2->{NAME};\n"; - } ParseElementPullScalar($el->{DATA}, "NDR_SCALARS"); } pidl "\t\tbreak;\n\t}\n"; } if (! $have_default) { - pidl "\tdefault:\n"; + pidl "\tdefault: {\n"; pidl "\t\tproto_tree_add_text(tree, ndr->tvb, ndr->offset, 0, \"Bad switch value %u\", level);\n"; pidl "\t\tif (check_col(ndr->pinfo->cinfo, COL_INFO))\n"; pidl "\t\t\tcol_append_fstr(ndr->pinfo->cinfo, COL_INFO, \", Bad switch value %u\", level);\n"; + pidl "\t}\n"; } pidl "\t}\n"; pidl "buffers:\n"; @@ -544,12 +559,12 @@ sub ParseUnionPull($) pidl "\tswitch (level) {\n"; foreach my $el (@{$e->{DATA}}) { if ($el->{CASE} eq "default") { - pidl "\tdefault:\n"; + pidl "\tdefault: {\n"; } else { pidl "\tcase $el->{CASE}: {\n"; } if ($el->{TYPE} eq "UNION_ELEMENT") { - ParseElementPullBuffer($el->{DATA}, "NDR_BUFFERS"); + ParseElementPullBuffer($el->{DATA}, "NDR_BUFFERS"); } pidl "\t\tbreak;\n\t}\n"; } @@ -654,22 +669,12 @@ sub ParseFunctionElementPull($$) pidl "\tndr_pull_ptr(ndr, tree, hf_ptr, &ptr_$e->{NAME});\n"; pidl "\tif (ptr_$e->{NAME}) {\n"; pidl "\t\tguint32 " . find_size_var($e, util::array_size($e)) . ";\n"; - } elsif ($inout eq "out" && util::has_property($e, "ref")) { - pidl "\tif (r->$inout.$e->{NAME}) {\n"; } else { pidl "\t{\n"; } ParseArrayPull($e, "NDR_SCALARS|NDR_BUFFERS"); pidl "\t}\n"; } else { - if ($inout eq "out" && util::has_property($e, "ref")) { -# pidl "\tif (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {\n"; -# pidl "\tNDR_ALLOC(ndr, r->out.$e->{NAME});\n"; -# pidl "\t}\n"; - } - if ($inout eq "in" && util::has_property($e, "ref")) { -# pidl "\tNDR_ALLOC(ndr, r->in.$e->{NAME});\n"; - } ParseElementPullScalar($e, "NDR_SCALARS|NDR_BUFFERS"); if ($e->{POINTERS}) { diff --git a/source4/build/pidl/packet-dcerpc-eparser.c b/source4/build/pidl/packet-dcerpc-eparser.c index bef5d82646..bf2b6e7981 100644 --- a/source4/build/pidl/packet-dcerpc-eparser.c +++ b/source4/build/pidl/packet-dcerpc-eparser.c @@ -113,14 +113,33 @@ void ndr_pull_uint64(struct e_ndr_pull *ndr, proto_tree *tree, int hf, void ndr_pull_DATA_BLOB(struct e_ndr_pull *ndr, proto_tree *tree, int hf, gDATA_BLOB *h) { - guint32 len1, ofs, len2; - char *data; + guint32 length; if (!(ndr_flags & NDR_SCALARS)) { return; } - /* FIXME */ + if (ndr->flags & LIBNDR_ALIGN_FLAGS) { + if (ndr->flags & LIBNDR_FLAG_ALIGN2) { + length = NDR_ALIGN(ndr, 2); + } else if (ndr->flags & LIBNDR_FLAG_ALIGN4) { + length = NDR_ALIGN(ndr, 4); + } else if (ndr->flags & LIBNDR_FLAG_ALIGN8) { + length = NDR_ALIGN(ndr, 8); + } + if (ndr->data_size - ndr->offset < length) { + length = ndr->data_size - ndr->offset; + } + } else if (ndr->flags & LIBNDR_FLAG_REMAINING) { + length = ndr->data_size - ndr->offset; + } else { + ndr_pull_uint32(ndr, &length); + } + + h->data = g_malloc(length); + proto_tree_add_bytes(tree, hf_bytes_data, ndr->tvb, ndr->offset, length, h->data); + + ndr->offset += length; } void ndr_pull_string(struct e_ndr_pull *ndr, proto_tree *tree, int ndr_flags) diff --git a/source4/build/pidl/packet-dcerpc-eparser.h b/source4/build/pidl/packet-dcerpc-eparser.h index b4cff95b8e..f48badbdf1 100644 --- a/source4/build/pidl/packet-dcerpc-eparser.h +++ b/source4/build/pidl/packet-dcerpc-eparser.h @@ -60,8 +60,8 @@ typedef guint32 gWERROR; typedef struct { - int foobar; - /* FIXME */ + guint8 *data; + guint32 length; } gDATA_BLOB; #include "packet-dcerpc-proto.h" @@ -92,7 +92,7 @@ void ndr_pull_NTTIME(struct e_ndr_pull *ndr, proto_tree *tree, int hf, gNTTIME * void ndr_pull_HYPER_T(struct e_ndr_pull *ndr, proto_tree *tree, int hf, gHYPER_T *data); void ndr_pull_int64(struct e_ndr_pull *ndr, proto_tree *tree, int hf, gint64 *data); void ndr_pull_uint64(struct e_ndr_pull *ndr, proto_tree *tree, int hf, guint64 *data); -void ndr_pull_DATA_BLOB(struct e_ndr_pull *ndr, proto_tree *tree, int hf, gDATA_BLOB *blob); +void ndr_pull_DATA_BLOB(struct e_ndr_pull *ndr, proto_tree *tree, int hf, gDATA_BLOB *data); void ndr_pull_string(struct e_ndr_pull *ndr, proto_tree *tree, int ndr_flags); void ndr_pull_dom_sid2(struct e_ndr_pull *ndr, proto_tree *tree, int flags); diff --git a/source4/librpc/config.m4 b/source4/librpc/config.m4 index ba46cac36c..2d0bad9cc4 100644 --- a/source4/librpc/config.m4 +++ b/source4/librpc/config.m4 @@ -13,6 +13,7 @@ SMB_SUBSYSTEM(LIBNDR_RAW,[], librpc/gen_ndr/ndr_lsads.o librpc/gen_ndr/ndr_dfs.o librpc/gen_ndr/ndr_drsuapi.o + librpc/gen_ndr/ndr_policyagent.o librpc/gen_ndr/ndr_samr.o librpc/gen_ndr/ndr_spoolss.o librpc/gen_ndr/ndr_wkssvc.o diff --git a/source4/librpc/idl/browser.idl b/source4/librpc/idl/browser.idl index e1441c7857..4d48c9a935 100644 --- a/source4/librpc/idl/browser.idl +++ b/source4/librpc/idl/browser.idl @@ -6,5 +6,50 @@ interface browser { /******************/ /* Function 0x00 */ - NTSTATUS browser_Unknown0(); + NTSTATUS BrowserrServerEnum(); + + /******************/ + /* Function 0x01 */ + NTSTATUS BrowserrDebugCall(); + + /******************/ + /* Function 0x02 */ + NTSTATUS BrowserrQueryOtherDomains(); + + /******************/ + /* Function 0x03 */ + NTSTATUS BrowserrResetNetlogonState(); + + /******************/ + /* Function 0x04 */ + NTSTATUS BrowserrDebugTrace(); + + /******************/ + /* Function 0x05 */ + NTSTATUS BrowserrQueryStatistics(); + + /******************/ + /* Function 0x06 */ + NTSTATUS BrowserResetStatistics(); + + /******************/ + /* Function 0x07 */ + NTSTATUS NetrBrowserStatisticsClear(); + + /******************/ + /* Function 0x08 */ + NTSTATUS NetrBrowserStatisticsGet(); + + /******************/ + /* Function 0x09 */ + NTSTATUS BrowserrSetNetlogonState(); + + /******************/ + /* Function 0x10 */ + NTSTATUS BrowserrQueryEmulatedDomains(); + + /******************/ + /* Function 0x11 */ + NTSTATUS BrowserrServerEnumEx(); + } diff --git a/source4/librpc/idl/dcom.idl b/source4/librpc/idl/dcom.idl index fc432c6aa4..5e7c530023 100644 --- a/source4/librpc/idl/dcom.idl +++ b/source4/librpc/idl/dcom.idl @@ -1,35 +1,429 @@ -/* - this is just a placeholder until we start to support DCOM calls -*/ +#include "idl_types.h" + +#define HRESULT uint32 [ - uuid(99fcfec4-5260-101b-bbcb-00aa0021347a), - version(0.0) + uuid(99fcfe60-5260-101b-bbcb-00aa0021347a), + pointer_default(unique) ] -interface IOXIDResolver +interface ObjectRpcBaseTypes { + WERROR stub(); + + typedef [public] struct { + uint32 upper; + uint32 lower; + } hyper; + + ////////////////////////////////////////////////////////////// + // Identifier Definitions + //////////////////////////////////////////////////////////// + + // Machine Identifier +#define MID hyper + + + // Object Exporter Identifier +#define OXID hyper + + // Object Identifer +#define OID hyper + + // Ping Set Identifier +#define SETID hyper + + // Interface Pointer Identifier +#define IPID GUID + + // Causality Identifier +#define CID GUID + +#define CLSID GUID + +#define IID GUID + + ////////////////////////////////////////////////////////////////// + // ORPC Call Packet Format + ////////////////////////////////////////////////////////////////// + // COM_MINOR_VERSION = 1 (NT4.0, SP1, SP2, DCOM95). + // - Initial Release + // - Must be used when talking to downlevel machines, including + // on Remote Activation calls. + // COM_MINOR_VERSION = 2 (NT4.0 SP3 and beyond). + // - Added ResolveOxid2 to IObjectExporter to retrieve the + // COM version number of the server. Passed to the NDR engine + // to fix fatal endian-ness flaw in the way OLEAUTOMATION marshals + // BSTRS. Previous way used trailing padding, which is not NDR + // compatible. See Bug# 69189. + // COM_MINOR_VERSION = 3 (NT4.0 SP4 and DCOM95 builds 1018 and beyond) + // - OLEAUT32 added two new types to the SAFEARRAY, but SAFEARRAY + // previously included the "default" keyword, which prevented + // downlevel NDR engines from correctly handling any extensions. + // Machines with version >=5.3 don't use "default" and will + // gracefully handle future extensions to SAFEARRAY. + // old constants (for convenience) + const uint16 COM_MINOR_VERSION_1 = 1; + const uint16 COM_MINOR_VERSION_2 = 2; + // current version + const uint16 COM_MAJOR_VERSION = 5; + const uint16 COM_MINOR_VERSION = 3; + // Component Object Model version number + + typedef [public] struct + { + uint16 MajorVersion; // Major version number + uint16 MinorVersion; // Minor version number + } COMVERSION; + + + // enumeration of additional information present in the call packet. + // Should be an enum but DCE IDL does not support sparse enumerators. + const uint32 ORPCF_NULL = 0; // no additional info in packet + const uint32 ORPCF_LOCAL = 1; // call is local to this machine + const uint32 ORPCF_RESERVED1 = 2; // reserved for local use + const uint32 ORPCF_RESERVED2 = 4; // reserved for local use + const uint32 ORPCF_RESERVED3 = 8; // reserved for local use + const uint32 ORPCF_RESERVED4 = 16; // reserved for local use + // Extension to implicit parameters. + typedef [public] struct + { + GUID id; // Extension identifier. + uint32 size; // Extension size. + //FIXME[size_is((size+7)&~7)] uint8 data[]; // Extension data. + [size_is(size)] uint8 data[]; + } ORPC_EXTENT; + + + // Array of extensions. + typedef struct + { + uint32 size; // Num extents. + uint32 reserved; // Must be zero. + //FIXME[size_is((size+1)&~1,), unique] ORPC_EXTENT **extent; // extents + [size_is(size),unique] ORPC_EXTENT extent[]; + } ORPC_EXTENT_ARRAY; + + + // implicit 'this' pointer which is the first [in] parameter on + // every ORPC call. + typedef [public] struct + { + COMVERSION version; // COM version number + uint32 flags; // ORPCF flags for presence of other data + uint32 reserved1; // set to zero + CID cid; // causality id of caller + // Extensions. + [unique] ORPC_EXTENT_ARRAY *extensions; + } ORPCTHIS; + + + // implicit 'that' pointer which is the first [out] parameter on + // every ORPC call. + typedef [public] struct + { + uint32 flags; // ORPCF flags for presence of other data + // Extensions. + [unique] ORPC_EXTENT_ARRAY *extensions; + } ORPCTHAT; + + + ////////////////////////////////////////////////////////////////// + // + // Marshaled COM Interface Wire Format + // + ////////////////////////////////////////////////////////////////// + // DUALSTRINGARRAYS are the return type for arrays of network addresses, + // arrays of endpoints and arrays of both used in many ORPC interfaces + typedef struct + { + uint16 wTowerId; // Cannot be zero. + uint16 aNetworkAddr; // Zero terminated. + } STRINGBINDING; + + + const uint16 COM_C_AUTHZ_NONE = 0xffff; + typedef struct + { + uint16 wAuthnSvc; // Cannot be zero. + uint16 wAuthzSvc; // Must not be zero. + uint16 aPrincName; // Zero terminated. + } SECURITYBINDING; + + + typedef [public] struct + { + uint16 wNumEntries; // Number of entries in array. + uint16 wSecurityOffset; // Offset of security info. + // The array contains two parts, a set of STRINGBINDINGs + // and a set of SECURITYBINDINGs. Each set is terminated by an + // extra zero. The shortest array contains four zeros. + [size_is(wNumEntries)] uint16 aStringArray[]; + } DUALSTRINGARRAY; + + + // signature value for OBJREF (object reference, actually the + // marshaled form of a COM interface). + const uint32 OBJREF_SIGNATURE = 0x574f454d; // 'MEOW' + + // flag values for OBJREF + typedef enum { + OBJREF_STANDARD = 0x1, // standard marshaled objref + OBJREF_HANDLER = 0x2, // handler marshaled objref + OBJREF_CUSTOM = 0x4 // custom marshaled objref + } OBJREF_FLAGS; + + // Flag values for a STDOBJREF (standard part of an OBJREF). + // SORF_OXRES1 - SORF_OXRES8 are reserved for the object exporters + // use only, object importers must ignore them and must not enforce MBZ. + const uint32 SORF_OXRES1 = 0x1; // reserved for exporter + const uint32 SORF_OXRES2 = 0x20; // reserved for exporter + const uint32 SORF_OXRES3 = 0x40; // reserved for exporter + const uint32 SORF_OXRES4 = 0x80; // reserved for exporter + const uint32 SORF_OXRES5 = 0x100;// reserved for exporter + const uint32 SORF_OXRES6 = 0x200;// reserved for exporter + const uint32 SORF_OXRES7 = 0x400;// reserved for exporter + const uint32 SORF_OXRES8 = 0x800;// reserved for exporter + const uint32 SORF_NULL = 0x0; // convenient for initializing SORF + const uint32 SORF_NOPING = 0x1000;// Pinging is not required + // standard object reference + typedef struct + { + uint32 flags; // STDOBJREF flags (see above) + uint32 cPublicRefs; // count of references passed + OXID oxid; // oxid of server with this oid + OID oid; // oid of object with this ipid + IPID ipid; // ipid of Interface + } STDOBJREF; + + + typedef struct + { + STDOBJREF std; // standard objref + DUALSTRINGARRAY saResAddr; // resolver address + } u_standard; + + typedef struct + { + STDOBJREF std; // standard objref + CLSID clsid; // Clsid of handler code + DUALSTRINGARRAY saResAddr; // resolver address + } u_handler; + + typedef struct + { + CLSID clsid; // Clsid of unmarshaling code + uint32 cbExtension; // size of extension data + uint32 size; // size of data that follows + [size_is(size), ref] uint8 *pData; // extension + class specific data + } u_custom; + + + + typedef union + { + [case(OBJREF_STANDARD)] u_standard u_standard; + [case(OBJREF_HANDLER)] u_handler u_handler; + [case(OBJREF_CUSTOM)] u_custom u_custom; + } OBJREF_Types; + + // OBJREF is the format of a marshaled interface pointer. + typedef struct + { + uint32 flags; // OBJREF flags (see above) + GUID iid; // interface identifier + [switch_is(flags), switch_type(uint32)] OBJREF_Types u_objref; + } OBJREF; + // wire representation of a marshalled interface pointer + typedef [public] struct + { + uint32 ulCntData; // size of data + [size_is(ulCntData)] uint8 abData[]; // data (OBJREF) + } MInterfacePointer; - /*****************/ - /* Function 0x00 */ - WERROR ResolveOxid(); } +////////////////////////////////////////////////////////////////// + +// The remote version of Iunknown. This interface exists on every +// OXID (whether an OXID represents either a thread or a process is +// implementation specific). It is used by clients to query for new +// interfaces, get additional references (for marshaling), and release +// outstanding references. +// This interface is passed along during OXID resolution. +// +[ + uuid(00000131-0000-0000-C000-000000000046), + version(0.0) +] +interface IRemUnknown // : IUnknown +{ + typedef struct + { + HRESULT hResult; // result of call + STDOBJREF std; // data for returned interface + } + REMQIRESULT; + + HRESULT RemQueryInterface ( + [in] IPID *ripid, // interface to QI on + [in] uint32 cRefs, // count of AddRefs requested + [in] uint16 cIids, // count of IIDs that follow + [in, size_is(cIids)] + IID* iids // IIDs to QI for + /*FIXME: [out, size_is(,cIids)] + REMQIRESULT** ppQIResults // results returned*/ + ); + typedef struct + { + IPID ipid; // ipid to AddRef/Release + uint32 cPublicRefs; + uint32 cPrivateRefs; + } REMINTERFACEREF; + + HRESULT RemAddRef ( + [in] uint16 cInterfaceRefs, + [in, size_is(cInterfaceRefs)] REMINTERFACEREF InterfaceRefs[], + [out, size_is(cInterfaceRefs)] HRESULT* pResults + ); + HRESULT RemRelease ( + [in] uint16 cInterfaceRefs, + [in, size_is(cInterfaceRefs)] REMINTERFACEREF InterfaceRefs[] + ); +} +// Derived from IRemUnknown, this interface supports Remote Query interface +// for objects that supply additional data beyond the STDOBJREF in their +// marshaled interface packets. [ - uuid(4d9f4ab8-7d1c-11cf-861e-0020af6e7c57), - version(0.0) +uuid(00000143-0000-0000-C000-000000000046), +version(0.0) ] -interface IRemoteActivation + +interface IRemUnknown2 //: IRemUnknown { + HRESULT RemQueryInterface2 ( + [in] IPID *ripid, + [in] uint16 cIids, + [in, size_is(cIids)] IID *iids, + [out, size_is(cIids)] HRESULT *phr + //FIXME [out, size_is(cIids)] MInterfacePointer **ppMIF + ); - /*****************/ - /* Function 0x00 */ - NTSTATUS RemoteActivation(); } +[ uuid(99fcfec4-5260-101b-bbcb-00aa0021347a), + pointer_default(unique) +] +interface IOXIDResolver +{ + // Method to get the protocol sequences, string bindings + // and machine id for an object server given its OXID. + typedef [public] struct { + DUALSTRINGARRAY *ppdsaOxidBindings; + } ppdsaOxidBindingsArray; + + [idempotent] WERROR ResolveOxid ( + [in,ref] policy_handle *hRpc, + [in] OXID *pOxid, + [in] uint16 cRequestedProtseqs, + [in, size_is(cRequestedProtseqs)] uint16 arRequestedProtseqs[], + [out, ref] ppdsaOxidBindingsArray *ppdsaOxidBindings, + [out, ref] IPID *pipidRemUnknown, + [out, ref] uint32 *pAuthnHint + ); + + // Simple ping is used to ping a Set. Client machines use this + // to inform the object exporter that it is still using the + // members of the set. + // Returns S_TRUE if the SetId is known by the object exporter, + // S_FALSE if not. + [idempotent] WERROR SimplePing ( + [in] policy_handle hRpc, + [in] SETID *pSetId // Must not be zero + ); + + // Complex ping is used to create sets of OIDs to ping. The + // whole set can subsequently be pinged using SimplePing, + // thus reducing network traffic. + [idempotent] WERROR ComplexPing ( + [in] policy_handle hRpc, + [in, out] SETID *pSetId, // In of 0 on first call for new set. + [in] uint16 SequenceNum, + [in] uint16 cAddToSet, + [in] uint16 cDelFromSet, + // add these OIDs to the set + [in, unique, size_is(cAddToSet)] OID AddToSet[], + //remove these OIDs from the set + [in, unique, size_is(cDelFromSet)] OID DelFromSet[], + [out] uint16 *pPingBackoffFactor// 2^factor = multipler + ); + // In some cases the client maybe unsure that a particular + // binding will reach the server. (For example, when the oxid + // bindings have more then one TCP/IP binding) This call + // can be used to validate the binding + // from the client. + [idempotent] WERROR ServerAlive ( + [in] policy_handle hRpc + ); + // Method to get the protocol sequences, string bindings, + // RemoteUnknown IPID and COM version for an object server + // given its OXID. Supported by DCOM + // version 5.2 and above. + [idempotent] error_status_t ResolveOxid2 ( + [in] policy_handle hRpc, + [in] OXID *pOxid, + [in] uint16 cRequestedProtseqs, + [in, size_is(cRequestedProtseqs)] + uint16 arRequestedProtseqs[], + [out, ref] ppdsaOxidBindingsArray *ppdsaOxidBindings, + [out, ref] IPID *pipidRemUnknown, + [out, ref] uint32 *pAuthnHint, + [out, ref] COMVERSION *pComVersion + ); + +} [ +uuid(4d9f4ab8-7d1c-11cf-861e-0020af6e7c57), + version(0.0), + pointer_default(unique) +] +interface IRemoteActivation +{ + typedef [public] struct { + MInterfacePointer *ppInterfaceData; + } ppInterfaceDataArray; + + const uint32 MODE_GET_CLASS_OBJECT = 0xffffffff; + HRESULT RemoteActivation ( + [in] policy_handle hRpc, + [in] ORPCTHIS *ORPCthis, + [out] ORPCTHAT *ORPCthat, + [in] GUID *Clsid, + [in, unique] unistr *pwszObjectName, + [in, unique] MInterfacePointer *pObjectStorage, + [in] uint32 ClientImpLevel, + [in] uint32 Mode, + [in] uint32 Interfaces, + [in,unique,size_is(Interfaces)] IID *pIIDs, + [in] uint16 cRequestedProtseqs, + [in, size_is(cRequestedProtseqs)] + uint16 RequestedProtseqs[], + [out] OXID *pOxid, + [out] ppdsaOxidBindingsArray *ppdsaOxidBindings, + [out] IPID *pipidRemUnknown, + [out] uint32 *pAuthnHint, + [out] COMVERSION *pServerVersion, + [out] HRESULT *phr, + [out,size_is(Interfaces)] ppInterfaceDataArray *ppInterfaceData, + [out,size_is(Interfaces)] HRESULT *pResults + ); +} + + +/* The Win2k equivalent of IRemoteActivation */ +[ uuid(000001a0-0000-0000-c000-000000000046), version(0.0) ] @@ -40,4 +434,23 @@ interface ISystemActivator /* Function 0x00 */ NTSTATUS isa_Unknown0(); + /*****************/ + /* Function 0x01 */ + NTSTATUS isa_Unknown1(); + + /*****************/ + /* Function 0x02 */ + NTSTATUS isa_Unknown2(); + + /*****************/ + /* Function 0x03 */ + NTSTATUS isa_Unknown3(); + + + // Binding strings and the OBJREF_SIGNATURE in this call + /*****************/ + /* Function 0x04 */ + NTSTATUS isa_Unknown4(); + + } diff --git a/source4/librpc/idl/epmapper.idl b/source4/librpc/idl/epmapper.idl index 5db65cd7cf..fb6fa4ae7f 100644 --- a/source4/librpc/idl/epmapper.idl +++ b/source4/librpc/idl/epmapper.idl @@ -2,6 +2,10 @@ /* endpoint mapper interface + Related links: + http://www.opengroup.org/onlinepubs/9629399/apdxl.htm : Details on towers +http://www.opengroup.org/onlinepubs/9629399/chap6.htm#tagcjh_11_02_03_01: binding strings + */ [ @@ -36,14 +40,22 @@ interface epmapper } epm_prot_uuid; typedef enum { - EPM_PROTOCOL_TCP = 0x07, - EPM_PROTOCOL_IP = 0x09, - EPM_PROTOCOL_PIPE = 0x10, - EPM_PROTOCOL_NETBIOS = 0x11, - EPM_PROTOCOL_RPC_C = 0x0b, - EPM_PROTOCOL_UUID = 0x0d, - EPM_PROTOCOL_SMB = 0x0f, - EPM_PROTOCOL_HTTP = 0x1f + EPM_PROTOCOL_NCACN_DNET_NSP = 0x04, + EPM_PROTOCOL_NCACN_OSI_TP4 = 0x05, + EPM_PROTOCOL_NCACN_OSI_CLNS = 0x06, + EPM_PROTOCOL_NCACN_TCP = 0x07, + EPM_PROTOCOL_NCADG_UDP = 0x08, + EPM_PROTOCOL_NCACN_IP = 0x09, + EPM_PROTOCOL_NCADG_RPC = 0x0a, /* Connectionless RPC */ + EPM_PROTOCOL_NCACN_RPC_C = 0x0b, + EPM_PROTOCOL_NCACN_SPX = 0x0c, + EPM_PROTOCOL_UUID = 0x0d, + EPM_PROTOCOL_NCADG_IPX = 0x0e, + EPM_PROTOCOL_NCACN_SMB = 0x0f, + EPM_PROTOCOL_NCACN_PIPE = 0x10, + EPM_PROTOCOL_NCACN_NETBIOS = 0x11, + EPM_PROTOCOL_NCACN_NB_NB = 0x12, + EPM_PROTOCOL_NCACN_HTTP = 0x1f } epm_protocols; typedef [nodiscriminant] union { @@ -158,7 +170,7 @@ interface epmapper /**********************/ - /* Function 0x05 */ + /* Function 0x06 */ void epm_MgmtDelete( [in] uint32 object_speced, [in] GUID *object, diff --git a/source4/librpc/idl/keysvc.idl b/source4/librpc/idl/keysvc.idl index 396e0fedaf..fd96b65d2e 100644 --- a/source4/librpc/idl/keysvc.idl +++ b/source4/librpc/idl/keysvc.idl @@ -2,6 +2,8 @@ cryptographic key services interface */ + +/* Also seen as: 0d72a7d4-6148-11d1-b4aa-00c04fb66ea0 */ [ uuid(8d0ffe72-d252-11d0-bf8f-00c04fd9126b), version(1.0) diff --git a/source4/librpc/idl/policyagent.idl b/source4/librpc/idl/policyagent.idl new file mode 100644 index 0000000000..75765243af --- /dev/null +++ b/source4/librpc/idl/policyagent.idl @@ -0,0 +1,11 @@ + +/* IPSec policy agent (Win2k) */ +[ + uuid(d335b8f6-cb31-11d0-b0f9-006097ba4e54), + version(1.5) +] interface policyagent +{ + /*****************/ + /* Function 0x00 */ + WERROR policyagent_Dummy(); +} diff --git a/source4/librpc/idl/protected_storage.idl b/source4/librpc/idl/protected_storage.idl index aaf223bbb2..4391c89081 100644 --- a/source4/librpc/idl/protected_storage.idl +++ b/source4/librpc/idl/protected_storage.idl @@ -2,6 +2,7 @@ /* protected_storage interface definitions + Also seen with UUID: c9378ff1-16f7-11d0-a0b2-00aa0061426a ver 1.0 */ [ uuid(e3514235-4b06-11d1-ab04-00c04fc2dcd2), diff --git a/source4/librpc/idl/svcctl.idl b/source4/librpc/idl/svcctl.idl index 2048fea433..da910b772c 100644 --- a/source4/librpc/idl/svcctl.idl +++ b/source4/librpc/idl/svcctl.idl @@ -47,6 +47,28 @@ SERVICE_STATE_INACTIVE=0x02, SERVICE_STATE_ALL=0x03 } ServiceState; + + typedef enum { + SV_TYPE_WORKSTATION =0x00000001, + SV_TYPE_SERVER =0x00000002, + SV_TYPE_DOMAIN_CTRL =0x00000008, + SV_TYPE_DOMAIN_BAKCTRL =0x00000010, + SV_TYPE_TIME_SOURCE =0x00000020, + SV_TYPE_AFP =0x00000040, + SV_TYPE_DOMAIN_MEMBER =0x00000100, + SV_TYPE_PRINTQ_SERVER =0x00000200, + SV_TYPE_DIALIN_SERVER =0x00000400, + SV_TYPE_XENIX_SERVER =0x00000800, + SV_TYPE_SERVER_UNIX =0x00000800, + SV_TYPE_NT =0x00001000, + SV_TYPE_WFW =0x00002000, + SV_TYPE_POTENTIAL_BROWSER =0x00010000, + SV_TYPE_BACKUP_BROWSER =0x00020000, + SV_TYPE_MASTER_BROWSER =0x00040000, + SV_TYPE_DOMAIN_MASTER =0x00080000, + SV_TYPE_LOCAL_LIST_ONLY =0x40000000, + SV_TYPE_DOMAIN_ENUM =0x80000000 + } SERVICE_BITS; /*****************/ /* Function 0x00 */ @@ -57,11 +79,19 @@ /*****************/ /* Function 0x01 */ - WERROR svcctl_ControlService(); + typedef enum { + FIXME=1 + } SERVICE_CONTROL; + + WERROR svcctl_ControlService( + [in,ref] policy_handle *handle, + [in] uint32 control, + [out] SERVICE_STATUS status + ); /*****************/ /* Function 0x02 */ - WERROR svcctl_DeleteService(); + WERROR svcctl_DeleteService([in,ref] policy_handle *handle); /*****************/ /* Function 0x03 */ @@ -101,23 +131,54 @@ /*****************/ /* Function 0x0a */ - WERROR svcctl_SCSetServiceBits(); + WERROR svcctl_SCSetServiceBitsW( + [in,ref] policy_handle *handle, + [in] uint32 bits, + [in] boolean32 bitson, + [in] boolean32 immediate); /*****************/ /* Function 0x0b */ - WERROR svcctl_ChangeServiceConfig(); + WERROR svcctl_ChangeServiceConfigW([in,ref] policy_handle *handle, + [in] uint32 type, + [in] uint32 start, + [in] uint32 error, + [in] unistr *binary_path, + [in] unistr *load_order_group, + [out] uint32 tag_id, + [in] unistr *dependencies, + [in] unistr *service_start_name, + [in] unistr *password, + [in] unistr *display_name); /*****************/ /* Function 0x0c */ - WERROR svcctl_CreateService(); + WERROR svcctl_CreateServiceW([in,ref] policy_handle *handle, + [in] unistr *ServiceName, + [in] unistr *DisplayName, + [in] uint32 desired_access, + [in] uint32 type, + [in] uint32 start_type, + [in] uint32 error_control, + [in] unistr *binary_path, + [in] unistr *LoadOrderGroupKey, + [out] uint32 *TagId, + [in] unistr *dependencies, + [in] unistr *service_start_name, + [in] unistr *password); /*****************/ /* Function 0x0d */ - WERROR svcctl_EnumDependentServices(); + WERROR svcctl_EnumDependentServicesW([in,ref] policy_handle *service, + [in] uint32 state, + [out] ENUM_SERVICE_STATUS *status, + [in] uint32 buf_size, + [out] uint32 bytes_needed, + [out] uint32 services_returned); /*****************/ /* Function 0x0e */ - WERROR svcctl_EnumServicesStatus( + WERROR svcctl_EnumServicesStatusW( [in,ref] policy_handle *handle, [in] uint32 type, [in] uint32 state, @@ -129,7 +190,7 @@ ); /*****************/ /* Function 0x0f */ - WERROR svcctl_OpenSCManager( + WERROR svcctl_OpenSCManagerW( [in] unistr *MachineName, [in] unistr *DatabaseName, [in] uint32 access_mask, @@ -137,15 +198,21 @@ /*****************/ /* Function 0x10 */ - WERROR svcctl_OpenService(); + WERROR svcctl_OpenServiceW([in,ref] policy_handle *scmanager_handle, + [in] unistr *ServiceName, + [in] uint32 access_mask); /*****************/ /* Function 0x11 */ - WERROR svcctl_QueryServiceConfig(); + WERROR svcctl_QueryServiceConfigW([in,ref] policy_handle *handle, + [out] uint8 query[buf_size], //QUERY_SERVICE_CONFIG + [in] uint32 buf_size, + [out] uint32 bytes_needed + ); /*****************/ /* Function 0x12 */ - WERROR svcctl_QueryServiceLockStatus( + WERROR svcctl_QueryServiceLockStatusW( [in,ref] policy_handle *handle, [in] uint32 buf_size, [out,ref] SERVICE_LOCK_STATUS *status, @@ -154,8 +221,211 @@ /*****************/ /* Function 0x13 */ - WERROR svcctl_StartService( + WERROR svcctl_StartServiceW( + [in,ref] policy_handle *handle, + [in] uint32 NumArgs, + [in,length_of(NumArgs)] unistr *Arguments); + + /*****************/ + /* Function 0x14 */ + WERROR svcctl_GetServiceDisplayNameW([in,ref] policy_handle *handle, + [in] unistr *service_name, + [out] unistr *display_name, + [in,out] uint32 *display_name_length); + /*****************/ + /* Function 0x15 */ + WERROR svcctl_GetServiceKeyNameW([in,ref] policy_handle *handle, + [in] unistr *service_name, + [out] unistr *key_name, + [in,out] uint32 *display_name_length); + /*****************/ + /* Function 0x16 */ + WERROR svcctl_SCSetServiceBitsA( + [in,ref] policy_handle *handle, + [in] uint32 bits, + [in] boolean32 bitson, + [in] boolean32 immediate); + + /*****************/ + /* Function 0x17 */ + WERROR svcctl_ChangeServiceConfigA([in,ref] policy_handle *handle, + [in] uint32 type, + [in] uint32 start, + [in] uint32 error, + [in] unistr *binary_path, + [in] unistr *load_order_group, + [out] uint32 tag_id, + [in] unistr *dependencies, + [in] unistr *service_start_name, + [in] unistr *password, + [in] unistr *display_name); + + /*****************/ + /* Function 0x18 */ + WERROR svcctl_CreateServiceA([in,ref] policy_handle *handle, + [in] unistr *ServiceName, + [in] unistr *DisplayName, + [in] uint32 desired_access, + [in] uint32 type, + [in] uint32 start_type, + [in] uint32 error_control, + [in] unistr *binary_path, + [in] unistr *LoadOrderGroupKey, + [out] uint32 *TagId, + [in] unistr *dependencies, + [in] unistr *service_start_name, + [in] unistr *password); + + /*****************/ + /* Function 0x19 */ + WERROR svcctl_EnumDependentServicesA([in,ref] policy_handle *service, + [in] uint32 state, + [out] ENUM_SERVICE_STATUS *status, + [in] uint32 buf_size, + [out] uint32 bytes_needed, + [out] uint32 services_returned); + + /*****************/ + /* Function 0x1a */ + WERROR svcctl_EnumServicesStatusA( + [in,ref] policy_handle *handle, + [in] uint32 type, + [in] uint32 state, + [in] uint32 buf_size, + [out,size_is(buf_size)] uint8 service[*], + [out] uint32 bytes_needed, + [out] uint32 services_returned, + [in,out] uint32 *resume_handle + ); + + /*****************/ + /* Function 0x1b */ + WERROR svcctl_OpenSCManagerA( + [in] unistr *MachineName, + [in] unistr *DatabaseName, + [in] uint32 access_mask, + [out,ref] policy_handle *handle); + + /*****************/ + /* Function 0x1c */ + WERROR svcctl_OpenServiceA([in,ref] policy_handle *scmanager_handle, + [in] unistr *ServiceName, + [in] uint32 access_mask); + + /*****************/ + /* Function 0x1d */ + WERROR svcctl_QueryServiceConfigA([in,ref] policy_handle *handle, + [out] uint8 query[buf_size], //QUERYU_SERVICE_CONFIG + [in] uint32 buf_size, + [out] uint32 bytes_needed + ); + + /*****************/ + /* Function 0x1e */ + WERROR svcctl_QueryServiceLockStatusA( + [in,ref] policy_handle *handle, + [in] uint32 buf_size, + [out,ref] SERVICE_LOCK_STATUS *status, + [out,ref] uint32 *required_buf_size + ); + + /*****************/ + /* Function 0x1f */ + WERROR svcctl_StartServiceA( [in,ref] policy_handle *handle, [in] uint32 NumArgs, [in,length_of(NumArgs)] unistr *Arguments); + + /*****************/ + /* Function 0x20 */ + WERROR svcctl_GetServiceDisplayNameA([in,ref] policy_handle *handle, + [in] unistr *service_name, + [out] unistr *display_name, + [in,out] uint32 *display_name_length); + /*****************/ + /* Function 0x21 */ + WERROR svcctl_GetServiceKeyNameA([in,ref] policy_handle *handle, + [in] unistr *service_name, + [out] unistr *key_name, + [in,out] uint32 *display_name_length); + + /*****************/ + /* Function 0x22 */ + WERROR svcctl_GetCurrentGroupeStateW(); + + /*****************/ + /* Function 0x23 */ + WERROR svcctl_EnumServiceGroupW(); + + /*****************/ + /* Function 0x24 */ + WERROR svcctl_ChangeServiceConfig2A([in,ref] policy_handle *handle, + [in] uint32 info_level, + [in] uint8 *info + ); + + /*****************/ + /* Function 0x25 */ + WERROR svcctl_ChangeServiceConfig2W([in,ref] policy_handle *handle, + [in] uint32 info_level, + [in] uint8 *info); + + /*****************/ + /* Function 0x26 */ + WERROR svcctl_QueryServiceConfig2A( + [in,ref] policy_handle *handle, + [in] uint32 info_level, + [out] uint8 buffer[buf_size], + [in] uint32 buf_size, + [out] uint32 bytes_needed); + + /*****************/ + /* Function 0x27 */ + WERROR svcctl_QueryServiceConfig2W( + [in,ref] policy_handle *handle, + [in] uint32 info_level, + [out] uint8 buffer[buf_size], + [in] uint32 buf_size, + [out] uint32 bytes_needed); + + /*****************/ + /* Function 0x28 */ + WERROR svcctl_QueryServiceStatusEx( + [in,ref] policy_handle *handle, + [in] uint32 info_level, + [out] uint8 buffer[buf_size], + [in] uint32 buf_size, + [out] uint32 bytes_needed); + + /*****************/ + /* Function 0x29 */ + WERROR EnumServicesStatusExA( + [in,ref] policy_handle *scmanager, + [in] uint32 info_level, + [in] uint32 type, + [in] uint32 state, + [out] uint8 services[buf_size], + [in] uint32 buf_size, + [out] uint32 bytes_needed, + [out] uint32 service_returned, + [in,out] uint32 *resume_handle, + [out] unistr *group_name); + + /*****************/ + /* Function 0x2a */ + WERROR EnumServicesStatusExW( + [in,ref] policy_handle *scmanager, + [in] uint32 info_level, + [in] uint32 type, + [in] uint32 state, + [out] uint8 services[buf_size], + [in] uint32 buf_size, + [out] uint32 bytes_needed, + [out] uint32 service_returned, + [in,out] uint32 *resume_handle, + [out] unistr *group_name); + + /*****************/ + /* Function 0x2b */ + WERROR svcctl_SCSendTSMessage(); } diff --git a/source4/librpc/rpc/dcerpc_util.c b/source4/librpc/rpc/dcerpc_util.c index 7f3d49061a..7068d7b0b5 100644 --- a/source4/librpc/rpc/dcerpc_util.c +++ b/source4/librpc/rpc/dcerpc_util.c @@ -105,17 +105,17 @@ NTSTATUS dcerpc_epm_map_tcp_port(const char *server, twr.towers.floors[1].rhs.rhs_data = data_blob_talloc_zero(p->mem_ctx, 2); /* on an RPC connection ... */ - twr.towers.floors[2].lhs.protocol = EPM_PROTOCOL_RPC_C; + twr.towers.floors[2].lhs.protocol = EPM_PROTOCOL_NCACN_RPC_C; twr.towers.floors[2].lhs.info.lhs_data = data_blob(NULL, 0); twr.towers.floors[2].rhs.rhs_data = data_blob_talloc_zero(p->mem_ctx, 2); /* on a TCP port ... */ - twr.towers.floors[3].lhs.protocol = EPM_PROTOCOL_TCP; + twr.towers.floors[3].lhs.protocol = EPM_PROTOCOL_NCACN_TCP; twr.towers.floors[3].lhs.info.lhs_data = data_blob(NULL, 0); twr.towers.floors[3].rhs.rhs_data = data_blob_talloc_zero(p->mem_ctx, 2); /* on an IP link ... */ - twr.towers.floors[4].lhs.protocol = EPM_PROTOCOL_IP; + twr.towers.floors[4].lhs.protocol = EPM_PROTOCOL_NCACN_IP; twr.towers.floors[4].lhs.info.lhs_data = data_blob(NULL, 0); twr.towers.floors[4].rhs.rhs_data = data_blob_talloc_zero(p->mem_ctx, 4); diff --git a/source4/rpc_server/epmapper/rpc_epmapper.c b/source4/rpc_server/epmapper/rpc_epmapper.c index 968c33d6d3..2573ecad63 100644 --- a/source4/rpc_server/epmapper/rpc_epmapper.c +++ b/source4/rpc_server/epmapper/rpc_epmapper.c @@ -70,21 +70,21 @@ static BOOL fill_protocol_tower(TALLOC_CTX *mem_ctx, struct epm_towers *twr, twr->floors[1].rhs.rhs_data = data_blob_talloc_zero(mem_ctx, 2); /* on an RPC connection ... */ - twr->floors[2].lhs.protocol = EPM_PROTOCOL_RPC_C; + twr->floors[2].lhs.protocol = EPM_PROTOCOL_NCACN_RPC_C; twr->floors[2].lhs.info.lhs_data = data_blob(NULL, 0); twr->floors[2].rhs.rhs_data = data_blob_talloc_zero(mem_ctx, 2); switch (e->ep_description.type) { case ENDPOINT_SMB: /* on a SMB pipe ... */ - twr->floors[3].lhs.protocol = EPM_PROTOCOL_SMB; + twr->floors[3].lhs.protocol = EPM_PROTOCOL_NCACN_SMB; twr->floors[3].lhs.info.lhs_data = data_blob(NULL, 0); twr->floors[3].rhs.rhs_data.data = talloc_asprintf(mem_ctx, "\\PIPE\\%s", e->ep_description.info.smb_pipe); twr->floors[3].rhs.rhs_data.length = strlen(twr->floors[3].rhs.rhs_data.data)+1; /* on an NetBIOS link ... */ - twr->floors[4].lhs.protocol = EPM_PROTOCOL_NETBIOS; + twr->floors[4].lhs.protocol = EPM_PROTOCOL_NCACN_NETBIOS; twr->floors[4].lhs.info.lhs_data = data_blob(NULL, 0); twr->floors[4].rhs.rhs_data.data = talloc_asprintf(mem_ctx, "\\\\%s", lp_netbios_name()); @@ -93,13 +93,13 @@ static BOOL fill_protocol_tower(TALLOC_CTX *mem_ctx, struct epm_towers *twr, case ENDPOINT_TCP: /* on a TCP connection ... */ - twr->floors[3].lhs.protocol = EPM_PROTOCOL_TCP; + twr->floors[3].lhs.protocol = EPM_PROTOCOL_NCACN_TCP; twr->floors[3].lhs.info.lhs_data = data_blob(NULL, 0); twr->floors[3].rhs.rhs_data = data_blob_talloc(mem_ctx, NULL, 2); RSSVAL(twr->floors[3].rhs.rhs_data.data, 0, e->ep_description.info.tcp_port); /* on an IP link ... */ - twr->floors[4].lhs.protocol = EPM_PROTOCOL_IP; + twr->floors[4].lhs.protocol = EPM_PROTOCOL_NCACN_IP; twr->floors[4].lhs.info.lhs_data = data_blob(NULL, 0); twr->floors[4].rhs.rhs_data = data_blob_talloc_zero(mem_ctx, 4); /* TODO: we should fill in our IP address here as a hint to the @@ -272,7 +272,7 @@ static NTSTATUS epm_Map(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, floors[1].lhs.protocol != EPM_PROTOCOL_UUID || guid_cmp(mem_ctx, &floors[1].lhs.info.uuid.uuid, NDR_GUID) != 0 || floors[1].lhs.info.uuid.version != NDR_GUID_VERSION || - floors[2].lhs.protocol != EPM_PROTOCOL_RPC_C) { + floors[2].lhs.protocol != EPM_PROTOCOL_NCACN_RPC_C) { goto failed; } @@ -283,14 +283,14 @@ static NTSTATUS epm_Map(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, } switch (eps[i].ep_description.type) { case ENDPOINT_SMB: - if (floors[3].lhs.protocol != EPM_PROTOCOL_SMB || - floors[4].lhs.protocol != EPM_PROTOCOL_NETBIOS) { + if (floors[3].lhs.protocol != EPM_PROTOCOL_NCACN_SMB || + floors[4].lhs.protocol != EPM_PROTOCOL_NCACN_NETBIOS) { continue; } break; case ENDPOINT_TCP: - if (floors[3].lhs.protocol != EPM_PROTOCOL_TCP || - floors[4].lhs.protocol != EPM_PROTOCOL_IP) { + if (floors[3].lhs.protocol != EPM_PROTOCOL_NCACN_TCP || + floors[4].lhs.protocol != EPM_PROTOCOL_NCACN_IP) { continue; } break; diff --git a/source4/torture/rpc/epmapper.c b/source4/torture/rpc/epmapper.c index 24395e064c..2af4e449b4 100644 --- a/source4/torture/rpc/epmapper.c +++ b/source4/torture/rpc/epmapper.c @@ -34,6 +34,10 @@ static void display_tower(TALLOC_CTX *mem_ctx, struct epm_towers *twr) struct epm_lhs *lhs = &twr->floors[i].lhs; struct epm_rhs *rhs = &twr->floors[i].rhs; switch (lhs->protocol) { + case EPM_PROTOCOL_NCACN_DNET_NSP: + printf(" DNET/NSP"); + break; + case EPM_PROTOCOL_UUID: uuid = GUID_string(mem_ctx, &lhs->info.uuid.uuid); if (strcasecmp(uuid, NDR_GUID) == 0) { @@ -43,11 +47,11 @@ static void display_tower(TALLOC_CTX *mem_ctx, struct epm_towers *twr) } break; - case EPM_PROTOCOL_RPC_C: + case EPM_PROTOCOL_NCACN_RPC_C: printf(" RPC-C"); break; - case EPM_PROTOCOL_IP: + case EPM_PROTOCOL_NCACN_IP: printf(" IP:"); if (rhs->rhs_data.length == 4) { struct in_addr in; @@ -56,30 +60,43 @@ static void display_tower(TALLOC_CTX *mem_ctx, struct epm_towers *twr) } break; - case EPM_PROTOCOL_PIPE: + case EPM_PROTOCOL_NCACN_PIPE: printf(" PIPE:%.*s", rhs->rhs_data.length, rhs->rhs_data.data); break; - case EPM_PROTOCOL_SMB: + case EPM_PROTOCOL_NCACN_SMB: printf(" SMB:%.*s", rhs->rhs_data.length, rhs->rhs_data.data); break; - case EPM_PROTOCOL_NETBIOS: + case EPM_PROTOCOL_NCACN_NETBIOS: printf(" NetBIOS:%.*s", rhs->rhs_data.length, rhs->rhs_data.data); break; + case EPM_PROTOCOL_NCACN_NB_NB: + printf(" NB_NB"); + break; + + case EPM_PROTOCOL_NCACN_SPX: + printf(" SPX"); + break; + + /* + case EPM_PROTOCOL_NCACN_NB_IPX: + printf(" NB_IPX"); + break;*/ + case 0x01: printf(" UNK(1):%.*s", rhs->rhs_data.length, rhs->rhs_data.data); break; - case EPM_PROTOCOL_HTTP: + case EPM_PROTOCOL_NCACN_HTTP: printf(" HTTP:"); if (rhs->rhs_data.length == 2) { printf("%d", RSVAL(rhs->rhs_data.data, 0)); } break; - case EPM_PROTOCOL_TCP: + case EPM_PROTOCOL_NCACN_TCP: /* what is the difference between this and 0x1f? */ printf(" TCP:"); if (rhs->rhs_data.length == 2) { @@ -87,6 +104,10 @@ static void display_tower(TALLOC_CTX *mem_ctx, struct epm_towers *twr) } break; + case EPM_PROTOCOL_NCADG_UDP: + printf(" UDP:"); + break; + default: printf(" UNK(%02x):", lhs->protocol); if (rhs->rhs_data.length == 2) { @@ -128,15 +149,15 @@ static BOOL test_Map(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, printf("epm_Map results for '%s':\n", idl_pipe_name(uuid_str, twr->towers.floors[0].lhs.info.uuid.version)); - twr->towers.floors[2].lhs.protocol = EPM_PROTOCOL_RPC_C; + twr->towers.floors[2].lhs.protocol = EPM_PROTOCOL_NCACN_RPC_C; twr->towers.floors[2].lhs.info.lhs_data = data_blob(NULL, 0); twr->towers.floors[2].rhs.rhs_data = data_blob_talloc_zero(p->mem_ctx, 2); - twr->towers.floors[3].lhs.protocol = EPM_PROTOCOL_TCP; + twr->towers.floors[3].lhs.protocol = EPM_PROTOCOL_NCACN_TCP; twr->towers.floors[3].lhs.info.lhs_data = data_blob(NULL, 0); twr->towers.floors[3].rhs.rhs_data = data_blob_talloc_zero(p->mem_ctx, 2); - twr->towers.floors[4].lhs.protocol = EPM_PROTOCOL_IP; + twr->towers.floors[4].lhs.protocol = EPM_PROTOCOL_NCACN_IP; twr->towers.floors[4].lhs.info.lhs_data = data_blob(NULL, 0); twr->towers.floors[4].rhs.rhs_data = data_blob_talloc_zero(p->mem_ctx, 4); @@ -149,7 +170,7 @@ static BOOL test_Map(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, } } - twr->towers.floors[3].lhs.protocol = EPM_PROTOCOL_HTTP; + twr->towers.floors[3].lhs.protocol = EPM_PROTOCOL_NCACN_HTTP; twr->towers.floors[3].lhs.info.lhs_data = data_blob(NULL, 0); twr->towers.floors[3].rhs.rhs_data = data_blob_talloc_zero(p->mem_ctx, 2); @@ -162,11 +183,11 @@ static BOOL test_Map(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, } } - twr->towers.floors[3].lhs.protocol = EPM_PROTOCOL_SMB; + twr->towers.floors[3].lhs.protocol = EPM_PROTOCOL_NCACN_SMB; twr->towers.floors[3].lhs.info.lhs_data = data_blob(NULL, 0); twr->towers.floors[3].rhs.rhs_data = data_blob_talloc_zero(p->mem_ctx, 2); - twr->towers.floors[4].lhs.protocol = EPM_PROTOCOL_NETBIOS; + twr->towers.floors[4].lhs.protocol = EPM_PROTOCOL_NCACN_NETBIOS; twr->towers.floors[4].lhs.info.lhs_data = data_blob(NULL, 0); twr->towers.floors[4].rhs.rhs_data = data_blob_talloc_zero(p->mem_ctx, 2); diff --git a/source4/torture/rpc/svcctl.c b/source4/torture/rpc/svcctl.c index d33639e3a5..1467aeaad8 100644 --- a/source4/torture/rpc/svcctl.c +++ b/source4/torture/rpc/svcctl.c @@ -23,7 +23,7 @@ static BOOL test_EnumServicesStatus(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, struct policy_handle *h) { - struct svcctl_EnumServicesStatus r; + struct svcctl_EnumServicesStatusW r; int i; NTSTATUS status; uint32 resume_handle = 0; @@ -40,7 +40,7 @@ static BOOL test_EnumServicesStatus(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, r.out.services_returned = 0; r.out.bytes_needed = 0; - status = dcerpc_svcctl_EnumServicesStatus(p, mem_ctx, &r); + status = dcerpc_svcctl_EnumServicesStatusW(p, mem_ctx, &r); if (!NT_STATUS_IS_OK(status)) { printf("ËnumServicesStatus failed!\n"); @@ -51,7 +51,7 @@ static BOOL test_EnumServicesStatus(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, r.in.buf_size = r.out.bytes_needed; r.out.service = talloc(mem_ctx, r.out.bytes_needed); - status = dcerpc_svcctl_EnumServicesStatus(p, mem_ctx, &r); + status = dcerpc_svcctl_EnumServicesStatusW(p, mem_ctx, &r); if (!NT_STATUS_IS_OK(status)) { printf("ËnumServicesStatus failed!\n"); @@ -74,7 +74,7 @@ static BOOL test_EnumServicesStatus(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, static BOOL test_OpenSCManager(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, struct policy_handle *h) { - struct svcctl_OpenSCManager r; + struct svcctl_OpenSCManagerW r; NTSTATUS status; r.in.MachineName = NULL; @@ -82,7 +82,7 @@ static BOOL test_OpenSCManager(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, struc r.in.access_mask = SEC_RIGHTS_MAXIMUM_ALLOWED; r.out.handle = h; - status = dcerpc_svcctl_OpenSCManager(p, mem_ctx, &r); + status = dcerpc_svcctl_OpenSCManagerW(p, mem_ctx, &r); if (!NT_STATUS_IS_OK(status)) { printf("OpenSCManager failed!\n"); return False; |