[PATCHES] remact, dcom and oxidresolver patches

Guenther Deschner gd at samba.org
Fri Jul 24 13:07:13 UTC 2015


Hi,

attached are some cleanups and crashbug fixes for some dcom related
protocols, encountered while working on implementing the clusapi interface.

Please review and push.

Thanks,
Guenther
-- 
Günther Deschner                    GPG-ID: 8EE11688
Red Hat                         gdeschner at redhat.com
Samba Team                              gd at samba.org
-------------- next part --------------
From 17d7bbc789e92126740c6f81cbb818f50cd7a3fb Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?G=C3=BCnther=20Deschner?= <gd at samba.org>
Date: Tue, 21 Jul 2015 20:39:15 +0200
Subject: [PATCH 01/24] dcom: remove trailing whitespace from dcom.idl
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Guenther

Signed-off-by: Günther Deschner <gd at samba.org>
---
 librpc/idl/dcom.idl | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/librpc/idl/dcom.idl b/librpc/idl/dcom.idl
index 30d6d43..124ef0d 100644
--- a/librpc/idl/dcom.idl
+++ b/librpc/idl/dcom.idl
@@ -26,7 +26,7 @@ interface IUnknown
 {
 	/*****************/
 	/* Function 0x00 */
-	/* Returns the interface with the specified IID 
+	/* Returns the interface with the specified IID
 	   if implemented by this object */
 	[local] WERROR QueryInterface([in,unique] GUID *iid,
 	   [out,iid_is(riid)] IUnknown **data);
@@ -47,7 +47,7 @@ interface IUnknown
 	pointer_default(unique)
 ] interface IClassFactory : IUnknown
 {
-	[local] WERROR CreateInstance([in,unique] MInterfacePointer *pUnknown, 
+	[local] WERROR CreateInstance([in,unique] MInterfacePointer *pUnknown,
 			       [in,unique] GUID *iid,
 			       [out, iid_is(riid),unique] MInterfacePointer *ppv);
 
@@ -75,7 +75,7 @@ interface IUnknown
 ]
 interface IRemUnknown : IUnknown
 {
-	typedef [public] struct 
+	typedef [public] struct
 	{
 		WERROR hResult; /* result of call */
 		STDOBJREF std; /* data for returned interface */
@@ -90,7 +90,7 @@ interface IRemUnknown : IUnknown
 		[out, size_is(cIids), unique] MInterfacePointer *ip
 		);
 
-	typedef struct 
+	typedef struct
 	{
 		GUID ipid; /* ipid to AddRef/Release */
 		uint32 cPublicRefs;
@@ -114,7 +114,7 @@ interface IRemUnknown : IUnknown
 	object
 ] interface IClassActivator : IUnknown
 {
-	void GetClassObject([in] GUID clsid, 
+	void GetClassObject([in] GUID clsid,
 		                [in] uint32 context,
 						[in] uint32 locale,
 						[in] GUID iid,
@@ -133,7 +133,7 @@ interface IRemUnknown : IUnknown
 [
 	pointer_default(unique),
 	uuid("c6f3ee72-ce7e-11d1-b71e-00c04fc3111a")
-] interface IMachineLocalActivator 
+] interface IMachineLocalActivator
 {
 	WERROR IMachineLocalActivator_foo();
 }
@@ -146,7 +146,7 @@ interface IRemUnknown : IUnknown
 	WERROR ILocalObjectExporter_Foo();
 }
 
-/* Looks like this is the equivalent of .NET's 
+/* Looks like this is the equivalent of .NET's
    System.Activator class */
 [
 	uuid("000001a0-0000-0000-c000-000000000046"),
@@ -157,7 +157,7 @@ interface IRemUnknown : IUnknown
 	WERROR ISystemActivatorRemoteCreateInstance([in] hyper unknown1,  /* OXID ? */
 											  [in] MInterfacePointer iface1,
 											  [in] hyper unknown2,
-											  [out] uint32 *unknown3, 
+											  [out] uint32 *unknown3,
 											  [out] MInterfacePointer *iface2);
 }
 
@@ -277,7 +277,7 @@ interface IStream : IUnknown
 {
 	WERROR Read(
 				[out, size_is(num_requested), length_is(*num_read)] uint8 pv[],
-				[in] uint32 num_requested, 
+				[in] uint32 num_requested,
 				[in, unique] uint32 *num_readx,
 				[out] uint32 *num_read
 				);
@@ -293,7 +293,7 @@ interface IStream : IUnknown
 	progid("Samba.Simple"),
 	helpstring("simple class"),
 	internal
-] coclass simple 
+] coclass simple
 {
 	interface IStream;
 }
-- 
2.4.3


From 24e533584865b05f0c71c5bb4259be9ee08fdb37 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?G=C3=BCnther=20Deschner?= <gd at samba.org>
Date: Tue, 21 Jul 2015 20:39:40 +0200
Subject: [PATCH 02/24] orpc: remove trailing whitespace from orpc.idl
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Guenther

Signed-off-by: Günther Deschner <gd at samba.org>
---
 librpc/idl/orpc.idl | 36 ++++++++++++++++++------------------
 1 file changed, 18 insertions(+), 18 deletions(-)

diff --git a/librpc/idl/orpc.idl b/librpc/idl/orpc.idl
index d023865..34a35e2 100644
--- a/librpc/idl/orpc.idl
+++ b/librpc/idl/orpc.idl
@@ -41,7 +41,7 @@ interface ObjectRpcBaseTypes
 	/* Component Object Model version number */
 
 
-	typedef [public] struct 
+	typedef [public] struct
 	{
 		uint16 MajorVersion; /* Major version number */
 		uint16 MinorVersion; /* Minor version number */
@@ -58,8 +58,8 @@ interface ObjectRpcBaseTypes
 	} ORPC_FLAGS;
 
 	/* Extension to implicit parameters. */
-	typedef [public] struct 
-	{ 	
+	typedef [public] struct
+	{
 		GUID id; /* Extension identifier. */
 		uint32 size; /* Extension size. */
 		[size_is(((size+7)&~7))] uint8 data[]; /* Extension data. */
@@ -67,7 +67,7 @@ interface ObjectRpcBaseTypes
 
 
 	/* Array of extensions. */
-	typedef struct 
+	typedef struct
 	{
 		uint32 size; /* Num extents. */
 		uint32 reserved; /* Must be zero. */
@@ -77,7 +77,7 @@ interface ObjectRpcBaseTypes
 
 	/* implicit 'this' pointer which is the first [in] parameter on */
 	/* every ORPC call. */
-	typedef [public] struct 
+	typedef [public] struct
 	{
 		COMVERSION version; /* COM version number */
 		uint32 flags; /* ORPCF flags for presence of other data */
@@ -90,7 +90,7 @@ interface ObjectRpcBaseTypes
 
 	/* implicit 'that' pointer which is the first [out] parameter on */
 	/* every ORPC call. */
-	typedef [public] struct 
+	typedef [public] struct
 	{
 		uint32 flags; /* ORPCF flags for presence of other data */
 		/* Extensions. */
@@ -100,33 +100,33 @@ interface ObjectRpcBaseTypes
 
 	/* DUALSTRINGARRAYS are the return type for arrays of network addresses, */
 	/* arrays of endpoints and arrays of both used in many ORPC interfaces */
-	typedef [public,flag(NDR_NOALIGN)] struct 
+	typedef [public,flag(NDR_NOALIGN)] struct
 	{
 		uint16 wTowerId; /* Cannot be zero. */
-		nstring NetworkAddr; 
+		nstring NetworkAddr;
 	} 	STRINGBINDING;
 
-	typedef [public,nopush,nopull,noprint] struct 
+	typedef [public,nopush,nopull,noprint] struct
 	{
 		STRINGBINDING **stringbindings;
 	} STRINGARRAY;
 
-	typedef [public,nopush,nopull,noprint] struct 
+	typedef [public,nopush,nopull,noprint] struct
 	{
 		STRINGBINDING **stringbindings;
 		SECURITYBINDING **securitybindings;
 	} DUALSTRINGARRAY;
 
 	const uint16 COM_C_AUTHZ_NONE = 0xffff;
-	typedef [public,flag(NDR_NOALIGN)] struct 
+	typedef [public,flag(NDR_NOALIGN)] struct
 	{
 		uint16 wAuthnSvc; /* Cannot be zero. */
 		uint16 wAuthzSvc;
-		nstring PrincName; 
+		nstring PrincName;
 	} 	SECURITYBINDING;
 
 	/* signature value for OBJREF (object reference, actually the */
-	/* marshaled form of a COM interface). 
+	/* marshaled form of a COM interface).
 	 * MEOW apparently stands for "Microsoft Extended Object Wireformat"
 	 */
 	const uint32 OBJREF_SIGNATURE = 0x574f454d; /* 'MEOW' */
@@ -156,7 +156,7 @@ interface ObjectRpcBaseTypes
 	} STDOBJREF_FLAGS;
 
 	/* standard object reference */
-	typedef [public] struct 
+	typedef [public] struct
 	{
 		uint32 flags; /* STDOBJREF flags (see above) */
 		uint32 cPublicRefs; /* count of references passed */
@@ -190,7 +190,7 @@ interface ObjectRpcBaseTypes
 	{
 	} u_null;
 
-	typedef [nodiscriminant] union 
+	typedef [nodiscriminant] union
 	{
 		[case(OBJREF_NULL)] u_null u_null;
 		[case(OBJREF_STANDARD)] u_standard u_standard;
@@ -199,7 +199,7 @@ interface ObjectRpcBaseTypes
 	} OBJREF_Types;
 
 	/* OBJREF is the format of a marshaled interface pointer. */
-	typedef [public,flag(NDR_LITTLE_ENDIAN)] struct 
+	typedef [public,flag(NDR_LITTLE_ENDIAN)] struct
 	{
 		uint32 signature;
 		uint32 flags; /* OBJREF flags (see above) */
@@ -208,13 +208,13 @@ interface ObjectRpcBaseTypes
 	} OBJREF;
 
 	/* wire representation of a marshalled interface pointer */
-	typedef [public] struct 
+	typedef [public] struct
 	{
 		uint32 size;
 		[subcontext(4)] OBJREF obj;
 	} MInterfacePointer;
 
-	typedef [v1_enum,public] enum 
+	typedef [v1_enum,public] enum
 	{
 		COM_OK 				= 0x00000000,
 		COM_OUTOFMEMORY 	= 0x80000002,
-- 
2.4.3


From 3887fa9ee99dda9b9e5e3e06d761100b025f09ab Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?G=C3=BCnther=20Deschner?= <gd at samba.org>
Date: Tue, 21 Jul 2015 20:40:07 +0200
Subject: [PATCH 03/24] oxidresolver: remove trailing whitespace from
 oxidresolver.idl
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Guenther

Signed-off-by: Günther Deschner <gd at samba.org>
---
 librpc/idl/oxidresolver.idl | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/librpc/idl/oxidresolver.idl b/librpc/idl/oxidresolver.idl
index 67cb430..905702a 100644
--- a/librpc/idl/oxidresolver.idl
+++ b/librpc/idl/oxidresolver.idl
@@ -3,8 +3,8 @@
   http://www.grimes.demon.co.uk/DCOM/DCOMSpec.htm
  */
 
-/* 
- The OXID Resolver can turn a OXID (Object Exporter ID) into a 
+/*
+ The OXID Resolver can turn a OXID (Object Exporter ID) into a
  RPC binding string that can be used to contact an object
 
  (used by DCOM)
@@ -12,7 +12,7 @@
 
 import "misc.idl", "orpc.idl";
 
-[ 
+[
 	uuid("99fcfec4-5260-101b-bbcb-00aa0021347a"),
 	helpstring("Object Exporter ID Resolver"),
 	endpoint("ncacn_np:[\\pipe\\epmapper]", "ncacn_ip_tcp:[135]", "ncalrpc:"),
@@ -45,7 +45,7 @@ interface IOXIDResolver
 	[idempotent] WERROR SimplePing (
 		[in] SETID *SetId /* 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. */
@@ -71,7 +71,7 @@ interface IOXIDResolver
 	/* 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. Looks like that means 
+	/* version 5.2 and above. Looks like that means
 	 * Windows 2003/XP and above */
 	[idempotent] WERROR ResolveOxid2 (
 											  [in] OXID pOxid,
-- 
2.4.3


From 670c245a8e1a16d57aa8cd4d0ea617247bb0f95d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?G=C3=BCnther=20Deschner?= <gd at samba.org>
Date: Tue, 21 Jul 2015 20:40:30 +0200
Subject: [PATCH 04/24] remact: remove trailing whitespace from remact.idl
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Guenther

Signed-off-by: Günther Deschner <gd at samba.org>
---
 librpc/idl/remact.idl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/librpc/idl/remact.idl b/librpc/idl/remact.idl
index 14fd6ce..b4c4032 100644
--- a/librpc/idl/remact.idl
+++ b/librpc/idl/remact.idl
@@ -12,7 +12,7 @@ import "misc.idl", "orpc.idl";
 ]
 interface IRemoteActivation
 {
-	typedef enum 
+	typedef enum
 	{
 		RPC_C_IMP_LEVEL_DEFAULT = 0,
 		RPC_C_IMP_LEVEL_ANONYMOUS = 1,
-- 
2.4.3


From eb6cf90fffca487585bc9aab659fcaf99554c232 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?G=C3=BCnther=20Deschner?= <gd at samba.org>
Date: Tue, 21 Jul 2015 20:41:12 +0200
Subject: [PATCH 05/24] s4-torture: remove trailing whitespace from oxidresolve
 test.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Guenther

Signed-off-by: Günther Deschner <gd at samba.org>
---
 source4/torture/rpc/oxidresolve.c | 38 +++++++++++++++++++-------------------
 1 file changed, 19 insertions(+), 19 deletions(-)

diff --git a/source4/torture/rpc/oxidresolve.c b/source4/torture/rpc/oxidresolve.c
index 33865d7..34e5b72 100644
--- a/source4/torture/rpc/oxidresolve.c
+++ b/source4/torture/rpc/oxidresolve.c
@@ -1,19 +1,19 @@
-/* 
+/*
    Unix SMB/CIFS implementation.
    test suite for oxidresolve operations
 
    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/>.
 */
@@ -30,7 +30,7 @@ const struct GUID IUnknown_uuid = {
 	0x00000000,0x0000,0x0000,{0xc0,0x00},{0x00,0x00,0x00,0x00,0x00,0x46}
 };
 
-static bool test_RemoteActivation(struct torture_context *tctx, 
+static bool test_RemoteActivation(struct torture_context *tctx,
 				 uint64_t *oxid, struct GUID *oid)
 {
 	struct RemoteActivation r;
@@ -40,9 +40,9 @@ static bool test_RemoteActivation(struct torture_context *tctx,
 	struct dcerpc_pipe *p;
 	struct dcerpc_binding_handle *b;
 
-	status = torture_rpc_connection(tctx, &p, 
+	status = torture_rpc_connection(tctx, &p,
 					&ndr_table_IRemoteActivation);
-			
+
 	if (!NT_STATUS_IS_OK(status)) {
 		return false;
 	}
@@ -86,7 +86,7 @@ static bool test_RemoteActivation(struct torture_context *tctx,
 	return true;
 }
 
-static bool test_SimplePing(struct torture_context *tctx, 
+static bool test_SimplePing(struct torture_context *tctx,
 			   struct dcerpc_pipe *p)
 {
 	struct SimplePing r;
@@ -103,7 +103,7 @@ static bool test_SimplePing(struct torture_context *tctx,
 	return true;
 }
 
-static bool test_ComplexPing(struct torture_context *tctx, 
+static bool test_ComplexPing(struct torture_context *tctx,
 			     struct dcerpc_pipe *p)
 {
 	struct ComplexPing r;
@@ -135,12 +135,12 @@ static bool test_ComplexPing(struct torture_context *tctx,
 		return 0;
 	}
 
-	
+
 
 	return 1;
 }
 
-static bool test_ServerAlive(struct torture_context *tctx, 
+static bool test_ServerAlive(struct torture_context *tctx,
 			    struct dcerpc_pipe *p)
 {
 	struct ServerAlive r;
@@ -154,12 +154,12 @@ static bool test_ServerAlive(struct torture_context *tctx,
 	return true;
 }
 
-static bool test_ResolveOxid(struct torture_context *tctx, 
+static bool test_ResolveOxid(struct torture_context *tctx,
 			     struct dcerpc_pipe *p)
 {
 	struct ResolveOxid r;
 	NTSTATUS status;
-	uint16_t protseq[2] = { EPM_PROTOCOL_TCP, EPM_PROTOCOL_SMB };	
+	uint16_t protseq[2] = { EPM_PROTOCOL_TCP, EPM_PROTOCOL_SMB };
 	uint64_t oxid;
 	struct GUID oid;
 	struct dcerpc_binding_handle *b = p->binding_handle;
@@ -178,12 +178,12 @@ static bool test_ResolveOxid(struct torture_context *tctx,
 	return true;
 }
 
-static bool test_ResolveOxid2(struct torture_context *tctx, 
+static bool test_ResolveOxid2(struct torture_context *tctx,
 			      struct dcerpc_pipe *p)
 {
 	struct ResolveOxid2 r;
 	NTSTATUS status;
-	uint16_t protseq[2] = { EPM_PROTOCOL_TCP, EPM_PROTOCOL_SMB };	
+	uint16_t protseq[2] = { EPM_PROTOCOL_TCP, EPM_PROTOCOL_SMB };
 	uint64_t oxid;
 	struct GUID oid;
 	struct dcerpc_binding_handle *b = p->binding_handle;
@@ -199,13 +199,13 @@ static bool test_ResolveOxid2(struct torture_context *tctx,
 	torture_assert_ntstatus_ok(tctx, status, "ResolveOxid2");
 
 	torture_assert_werr_ok(tctx, r.out.result, "ResolveOxid2");
-	
+
 	torture_comment(tctx, "Remote server versions: %d, %d\n", r.out.ComVersion->MajorVersion, r.out.ComVersion->MinorVersion);
 
 	return true;
 }
 
-static bool test_ServerAlive2(struct torture_context *tctx, 
+static bool test_ServerAlive2(struct torture_context *tctx,
 			     struct dcerpc_pipe *p)
 {
 	struct ServerAlive2 r;
@@ -224,7 +224,7 @@ struct torture_suite *torture_rpc_oxidresolve(TALLOC_CTX *mem_ctx)
 	struct torture_suite *suite = torture_suite_create(mem_ctx, "oxidresolve");
 	struct torture_rpc_tcase *tcase;
 
-	tcase = torture_suite_add_rpc_iface_tcase(suite, "oxidresolver", 
+	tcase = torture_suite_add_rpc_iface_tcase(suite, "oxidresolver",
 					  &ndr_table_IOXIDResolver);
 
 	torture_rpc_tcase_add_test(tcase, "ServerAlive", test_ServerAlive);
@@ -234,7 +234,7 @@ struct torture_suite *torture_rpc_oxidresolve(TALLOC_CTX *mem_ctx)
 	torture_rpc_tcase_add_test(tcase, "ComplexPing", test_ComplexPing);
 
 	torture_rpc_tcase_add_test(tcase, "SimplePing", test_SimplePing);
-	
+
 	torture_rpc_tcase_add_test(tcase, "ResolveOxid", test_ResolveOxid);
 
 	torture_rpc_tcase_add_test(tcase, "ResolveOxid2", test_ResolveOxid2);
-- 
2.4.3


From 016d3776c3bf6ab612ee94886aa3d696f0d480e8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?G=C3=BCnther=20Deschner?= <gd at samba.org>
Date: Tue, 21 Jul 2015 20:41:34 +0200
Subject: [PATCH 06/24] s4-torture: remove trailing whitespace from remact
 test.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Guenther

Signed-off-by: Günther Deschner <gd at samba.org>
---
 source4/torture/rpc/remact.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/source4/torture/rpc/remact.c b/source4/torture/rpc/remact.c
index c14adb8..e39045c 100644
--- a/source4/torture/rpc/remact.c
+++ b/source4/torture/rpc/remact.c
@@ -1,19 +1,19 @@
-/* 
+/*
    Unix SMB/CIFS implementation.
    test suite for remoteactivation operations
 
    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/>.
 */
@@ -27,7 +27,7 @@
 #define DCERPC_IUNKNOWN_UUID "00000000-0000-0000-c000-000000000046"
 #define DCERPC_ICLASSFACTORY_UUID "00000001-0000-0000-c000-000000000046"
 
-static bool test_RemoteActivation(struct torture_context *tctx, 
+static bool test_RemoteActivation(struct torture_context *tctx,
 								 struct dcerpc_pipe *p)
 {
 	struct RemoteActivation r;
@@ -62,15 +62,15 @@ static bool test_RemoteActivation(struct torture_context *tctx,
 	r.in.Mode = MODE_GET_CLASS_OBJECT;
 
 	status = dcerpc_RemoteActivation_r(b, tctx, &r);
-	torture_assert_ntstatus_ok(tctx, status, 
+	torture_assert_ntstatus_ok(tctx, status,
 							   "RemoteActivation(GetClassObject)");
 
-	torture_assert_werr_ok(tctx, r.out.result, 
+	torture_assert_werr_ok(tctx, r.out.result,
 						   "RemoteActivation(GetClassObject)");
 
 	torture_assert_werr_ok(tctx, *r.out.hr, "RemoteActivation(GetClassObject)");
 
-	torture_assert_werr_ok(tctx, r.out.results[0], 
+	torture_assert_werr_ok(tctx, r.out.results[0],
 						   "RemoteActivation(GetClassObject)");
 
 	return true;
-- 
2.4.3


From c422262d37a891e51fde5e270e3c91a2c5854616 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?G=C3=BCnther=20Deschner?= <gd at samba.org>
Date: Tue, 21 Jul 2015 20:34:40 +0200
Subject: [PATCH 07/24] oxidresolver: fix indent of ResolveOxid2 in IDL.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Guenther

Signed-off-by: Günther Deschner <gd at samba.org>
---
 librpc/idl/oxidresolver.idl | 17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)

diff --git a/librpc/idl/oxidresolver.idl b/librpc/idl/oxidresolver.idl
index 905702a..5ed2a7b 100644
--- a/librpc/idl/oxidresolver.idl
+++ b/librpc/idl/oxidresolver.idl
@@ -74,14 +74,15 @@ interface IOXIDResolver
 	/* version 5.2 and above. Looks like that means
 	 * Windows 2003/XP and above */
 	[idempotent] WERROR ResolveOxid2 (
-											  [in] OXID pOxid,
-											  [in] uint16 cRequestedProtseqs,
-											  [in, size_is(cRequestedProtseqs)] uint16 arRequestedProtseqs[],
-											  [out] DUALSTRINGARRAY **pdsaOxidBindings,
-											  [out,ref] IPID *ipidRemUnknown,
-											  [out,ref] uint32 *AuthnHint,
-											  [out,ref] COMVERSION *ComVersion
-											 );
+		[in] OXID pOxid,
+		[in] uint16 cRequestedProtseqs,
+		[in, size_is(cRequestedProtseqs)] uint16 arRequestedProtseqs[],
+		[out] DUALSTRINGARRAY **pdsaOxidBindings,
+		[out,ref] IPID *ipidRemUnknown,
+		[out,ref] uint32 *AuthnHint,
+		[out,ref] COMVERSION *ComVersion
+	);
+
 	typedef struct {
 		COMVERSION version;
 	  	uint32 unknown1;
-- 
2.4.3


From b1e543d05f98021080311d195d8993cfe4aa03e8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?G=C3=BCnther=20Deschner?= <gd at samba.org>
Date: Tue, 21 Jul 2015 20:49:22 +0200
Subject: [PATCH 08/24] dcom: fix ident in dcom.idl.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Guenther

Signed-off-by: Günther Deschner <gd at samba.org>
---
 librpc/idl/dcom.idl | 117 +++++++++++++++++++++++++++++-----------------------
 1 file changed, 66 insertions(+), 51 deletions(-)

diff --git a/librpc/idl/dcom.idl b/librpc/idl/dcom.idl
index 124ef0d..ff44722 100644
--- a/librpc/idl/dcom.idl
+++ b/librpc/idl/dcom.idl
@@ -28,8 +28,10 @@ interface IUnknown
 	/* Function 0x00 */
 	/* Returns the interface with the specified IID
 	   if implemented by this object */
-	[local] WERROR QueryInterface([in,unique] GUID *iid,
-	   [out,iid_is(riid)] IUnknown **data);
+	[local] WERROR QueryInterface(
+		[in,unique] GUID *iid,
+		[out,iid_is(riid)] IUnknown **data
+		);
 
 	/*****************/
 	/* Function 0x01 */
@@ -47,15 +49,19 @@ interface IUnknown
 	pointer_default(unique)
 ] interface IClassFactory : IUnknown
 {
-	[local] WERROR CreateInstance([in,unique] MInterfacePointer *pUnknown,
-			       [in,unique] GUID *iid,
-			       [out, iid_is(riid),unique] MInterfacePointer *ppv);
+	[local] WERROR CreateInstance(
+		[in,unique] MInterfacePointer *pUnknown,
+		[in,unique] GUID *iid,
+		[out, iid_is(riid),unique] MInterfacePointer *ppv
+		);
 
 	[call_as(CreateInstance)] WERROR RemoteCreateInstance();
 
 	/* Set lock to TRUE when you want to do a lock
 	and set it to FALSE when you want to unlock */
-	[local] WERROR LockServer([in] uint8 lock);
+	[local] WERROR LockServer(
+		[in] uint8 lock
+		);
 
 	[call_as(LockServer)] WERROR RemoteLockServer();
 }
@@ -98,14 +104,14 @@ interface IRemUnknown : IUnknown
 	} REMINTERFACEREF;
 
 	[call_as(AddRef)] WERROR RemAddRef (
-		 [in] uint16 cInterfaceRefs,
-		 [in, size_is(cInterfaceRefs)] REMINTERFACEREF InterfaceRefs[],
-		 [out, size_is(cInterfaceRefs), unique] WERROR *pResults
+		[in] uint16 cInterfaceRefs,
+		[in, size_is(cInterfaceRefs)] REMINTERFACEREF InterfaceRefs[],
+		[out, size_is(cInterfaceRefs), unique] WERROR *pResults
 		);
 
 	[call_as(Release)] WERROR RemRelease (
-		 [in] uint16 cInterfaceRefs,
-		 [in, size_is(cInterfaceRefs)] REMINTERFACEREF InterfaceRefs[]
+		[in] uint16 cInterfaceRefs,
+		[in, size_is(cInterfaceRefs)] REMINTERFACEREF InterfaceRefs[]
 		);
 }
 
@@ -114,11 +120,13 @@ interface IRemUnknown : IUnknown
 	object
 ] interface IClassActivator : IUnknown
 {
-	void GetClassObject([in] GUID clsid,
-		                [in] uint32 context,
-						[in] uint32 locale,
-						[in] GUID iid,
-						[out, iid_is(iid)] MInterfacePointer *data);
+	void GetClassObject(
+		[in] GUID clsid,
+		[in] uint32 context,
+		[in] uint32 locale,
+		[in] GUID iid,
+		[out, iid_is(iid)] MInterfacePointer *data
+		);
 }
 
 [
@@ -154,11 +162,13 @@ interface IRemUnknown : IUnknown
 ]
 	interface ISystemActivator : IClassActivator
 {
-	WERROR ISystemActivatorRemoteCreateInstance([in] hyper unknown1,  /* OXID ? */
-											  [in] MInterfacePointer iface1,
-											  [in] hyper unknown2,
-											  [out] uint32 *unknown3,
-											  [out] MInterfacePointer *iface2);
+	WERROR ISystemActivatorRemoteCreateInstance(
+		[in] hyper unknown1,  /* OXID ? */
+		[in] MInterfacePointer iface1,
+		[in] hyper unknown2,
+		[out] uint32 *unknown3,
+		[out] MInterfacePointer *iface2
+		);
 }
 
 
@@ -175,11 +185,11 @@ interface IRemUnknown : IUnknown
 interface IRemUnknown2 : IRemUnknown
 {
 	[call_as(QueryInterface2)] WERROR RemQueryInterface2 (
-		 [in, unique] GUID *ripid,
-		 [in] uint16 cIids,
-		 [in, size_is(cIids), unique] GUID *iids,
-		 [out, size_is(cIids), unique] WERROR *phr,
-		 [out, size_is(cIids), unique] MInterfacePointer *ppMIF
+		[in, unique] GUID *ripid,
+		[in] uint16 cIids,
+		[in, size_is(cIids), unique] GUID *iids,
+		[out, size_is(cIids), unique] WERROR *phr,
+		[out, size_is(cIids), unique] MInterfacePointer *ppMIF
 		);
 }
 
@@ -192,7 +202,8 @@ interface IRemUnknown2 : IRemUnknown
 	/*****************/
 	/* Function 0x03 */
 	WERROR GetTypeInfoCount(
-			[out, unique] uint16 *pctinfo);
+		[out, unique] uint16 *pctinfo
+		);
 
 	typedef struct {
 	} REF_ITypeInfo;
@@ -200,18 +211,20 @@ interface IRemUnknown2 : IRemUnknown
 	/*****************/
 	/* Function 0x04 */
 	WERROR GetTypeInfo (
-			[in] uint16 iTInfo,
-			[in] uint32 lcid,
-			[out, unique] REF_ITypeInfo *ppTInfo);
+		[in] uint16 iTInfo,
+		[in] uint32 lcid,
+		[out, unique] REF_ITypeInfo *ppTInfo
+		);
 
 	/*****************/
 	/* Function 0x05 */
 	WERROR GetIDsOfNames(
-			[in, unique] GUID *riid,
-			/*FIXME[in,size_is(cNames)] OLESTR *rgszNames[], */
-			[in] uint16 cNames,
-			[in] uint32 lcid,
-			[out,size_is(cNames), unique] uint32 *rgDispId);
+		[in, unique] GUID *riid,
+		/*FIXME[in,size_is(cNames)] OLESTR *rgszNames[], */
+		[in] uint16 cNames,
+		[in] uint32 lcid,
+		[out,size_is(cNames), unique] uint32 *rgDispId
+		);
 
 	typedef struct {
 		uint16 vartype;
@@ -230,14 +243,15 @@ interface IRemUnknown2 : IRemUnknown
 	/*****************/
 	/* Function 0x06 */
 	WERROR Invoke(
-			[in] uint32 dispIdMember,
-			[in, unique] GUID *riid,
-			[in] uint32 lcid,
-			[in] uint16 wFlags,
-			[out,in, unique] DISPPARAMS *pDispParams,
-			[out, unique] VARIANT *pVarResult,
-			[out, unique] EXCEPINFO *pExcepInfo,
-			[out, unique] uint16 *puArgErr);
+		[in] uint32 dispIdMember,
+		[in, unique] GUID *riid,
+		[in] uint32 lcid,
+		[in] uint16 wFlags,
+		[out,in, unique] DISPPARAMS *pDispParams,
+		[out, unique] VARIANT *pVarResult,
+		[out, unique] EXCEPINFO *pExcepInfo,
+		[out, unique] uint16 *puArgErr
+		);
 }
 
 [
@@ -276,16 +290,17 @@ interface IRemUnknown2 : IRemUnknown
 interface IStream : IUnknown
 {
 	WERROR Read(
-				[out, size_is(num_requested), length_is(*num_read)] uint8 pv[],
-				[in] uint32 num_requested,
-				[in, unique] uint32 *num_readx,
-				[out] uint32 *num_read
-				);
+		[out, size_is(num_requested), length_is(*num_read)] uint8 pv[],
+		[in] uint32 num_requested,
+		[in, unique] uint32 *num_readx,
+		[out] uint32 *num_read
+		);
 
 	WERROR Write(
-				[in,size_is(num_requested),unique] uint8 *data,
-				 [in] uint32 num_requested,
-				 [out] uint32 *num_written);
+		[in,size_is(num_requested),unique] uint8 *data,
+		[in] uint32 num_requested,
+		[out] uint32 *num_written
+		 );
 }
 
 [
-- 
2.4.3


From 85b4757f10ac5284c90ec91cebfe9b64690263ba Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?G=C3=BCnther=20Deschner?= <gd at samba.org>
Date: Tue, 21 Jul 2015 20:53:24 +0200
Subject: [PATCH 09/24] oxidresolver: fix indent in oxidresolver.idl
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Guenther

Signed-off-by: Günther Deschner <gd at samba.org>
---
 librpc/idl/oxidresolver.idl | 29 +++++++++++++++--------------
 1 file changed, 15 insertions(+), 14 deletions(-)

diff --git a/librpc/idl/oxidresolver.idl b/librpc/idl/oxidresolver.idl
index 5ed2a7b..570b112 100644
--- a/librpc/idl/oxidresolver.idl
+++ b/librpc/idl/oxidresolver.idl
@@ -29,13 +29,13 @@ interface IOXIDResolver
 	/* and machine id for an object server given its OXID. */
 
 	[idempotent] WERROR ResolveOxid (
-		 [in] OXID pOxid,
-		 [in] uint16 cRequestedProtseqs,
-		 [in, size_is(cRequestedProtseqs)] uint16 arRequestedProtseqs[],
-		 [out] DUALSTRINGARRAY **ppdsaOxidBindings,
-		 [out,ref] IPID *pipidRemUnknown,
-		 [out,ref] uint32 *pAuthnHint
-			 );
+		[in] OXID pOxid,
+		[in] uint16 cRequestedProtseqs,
+		[in, size_is(cRequestedProtseqs)] uint16 arRequestedProtseqs[],
+		[out] DUALSTRINGARRAY **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 */
@@ -59,7 +59,7 @@ interface IOXIDResolver
 		/*remove these OIDs from the set */
 		[in, size_is(cDelFromSet)] OID DelFromSet[],
 		[out,ref] uint16 *PingBackoffFactor/* 2^factor = multipler */
-			 );
+		 );
 
 	/* In some cases the client maybe unsure that a particular */
 	/* binding will reach the server. (For example, when the oxid */
@@ -81,7 +81,7 @@ interface IOXIDResolver
 		[out,ref] IPID *ipidRemUnknown,
 		[out,ref] uint32 *AuthnHint,
 		[out,ref] COMVERSION *ComVersion
-	);
+		);
 
 	typedef struct {
 		COMVERSION version;
@@ -89,9 +89,10 @@ interface IOXIDResolver
 	} COMINFO;
 
 	[idempotent] WERROR ServerAlive2 (
-	  [out,ref] COMINFO *info,
-	  [out,ref] DUALSTRINGARRAY *dualstring,
-	  [out,ref] uint8 *unknown2,
-	  [out,ref] uint8 *unknown3,
-	  [out,ref] uint8 *unknown4);
+		[out,ref] COMINFO *info,
+		[out,ref] DUALSTRINGARRAY *dualstring,
+		[out,ref] uint8 *unknown2,
+		[out,ref] uint8 *unknown3,
+		[out,ref] uint8 *unknown4
+		);
 }
-- 
2.4.3


From 428208f2e277e3cf3d58161ee9541a96804735d9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?G=C3=BCnther=20Deschner?= <gd at samba.org>
Date: Tue, 21 Jul 2015 20:54:17 +0200
Subject: [PATCH 10/24] remact: fix indent of remact.idl
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Guenther

Signed-off-by: Günther Deschner <gd at samba.org>
---
 librpc/idl/remact.idl | 41 +++++++++++++++++++++--------------------
 1 file changed, 21 insertions(+), 20 deletions(-)

diff --git a/librpc/idl/remact.idl b/librpc/idl/remact.idl
index b4c4032..04f7fd8 100644
--- a/librpc/idl/remact.idl
+++ b/librpc/idl/remact.idl
@@ -22,25 +22,26 @@ interface IRemoteActivation
 	} imp_levels;
 
 	const uint32 MODE_GET_CLASS_OBJECT = 0xffffffff;
+
 	WERROR RemoteActivation (
-			[in] ORPCTHIS this_object,
-			[out,ref] ORPCTHAT *that,
-			[in] GUID Clsid,
-			[in] [string,charset(UTF16)] uint16 *pwszObjectName,
-			[in] MInterfacePointer *pObjectStorage,
-			[in] uint32 ClientImpLevel,
-			[in] uint32 Mode,
-			[in,range(1,32768)] uint32 Interfaces,
-			[in,size_is(Interfaces)] GUID *pIIDs,
-			[in] uint16 num_protseqs,
-			[in, size_is(num_protseqs)] uint16 protseq[*],
-			[out,ref] hyper *pOxid,
-			[out,ref] DUALSTRINGARRAY *pdsaOxidBindings,
-			[out,ref] GUID *ipidRemUnknown,
-			[out,ref] uint32 *AuthnHint,
-			[out,ref] COMVERSION *ServerVersion,
-			[out,ref] WERROR *hr,
-			[out,size_is(Interfaces)] MInterfacePointer *ifaces[],
-			[out,size_is(Interfaces)] WERROR results[]
-			);
+		[in] ORPCTHIS this_object,
+		[out,ref] ORPCTHAT *that,
+		[in] GUID Clsid,
+		[in] [string,charset(UTF16)] uint16 *pwszObjectName,
+		[in] MInterfacePointer *pObjectStorage,
+		[in] uint32 ClientImpLevel,
+		[in] uint32 Mode,
+		[in,range(1,32768)] uint32 Interfaces,
+		[in,size_is(Interfaces)] GUID *pIIDs,
+		[in] uint16 num_protseqs,
+		[in, size_is(num_protseqs)] uint16 protseq[*],
+		[out,ref] hyper *pOxid,
+		[out,ref] DUALSTRINGARRAY *pdsaOxidBindings,
+		[out,ref] GUID *ipidRemUnknown,
+		[out,ref] uint32 *AuthnHint,
+		[out,ref] COMVERSION *ServerVersion,
+		[out,ref] WERROR *hr,
+		[out,size_is(Interfaces)] MInterfacePointer *ifaces[],
+		[out,size_is(Interfaces)] WERROR results[]
+		);
 }
-- 
2.4.3


From ce491428dbb367be3bd85db075bae5ae6bc558d9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?G=C3=BCnther=20Deschner?= <gd at samba.org>
Date: Tue, 21 Jul 2015 21:07:25 +0200
Subject: [PATCH 11/24] s4-torture: fix indent of remact test.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Guenther

Signed-off-by: Günther Deschner <gd at samba.org>
---
 source4/torture/rpc/remact.c | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/source4/torture/rpc/remact.c b/source4/torture/rpc/remact.c
index e39045c..aff89a1 100644
--- a/source4/torture/rpc/remact.c
+++ b/source4/torture/rpc/remact.c
@@ -28,7 +28,7 @@
 #define DCERPC_ICLASSFACTORY_UUID "00000001-0000-0000-c000-000000000046"
 
 static bool test_RemoteActivation(struct torture_context *tctx,
-								 struct dcerpc_pipe *p)
+				  struct dcerpc_pipe *p)
 {
 	struct RemoteActivation r;
 	NTSTATUS status;
@@ -62,16 +62,13 @@ static bool test_RemoteActivation(struct torture_context *tctx,
 	r.in.Mode = MODE_GET_CLASS_OBJECT;
 
 	status = dcerpc_RemoteActivation_r(b, tctx, &r);
-	torture_assert_ntstatus_ok(tctx, status,
-							   "RemoteActivation(GetClassObject)");
+	torture_assert_ntstatus_ok(tctx, status, "RemoteActivation(GetClassObject)");
 
-	torture_assert_werr_ok(tctx, r.out.result,
-						   "RemoteActivation(GetClassObject)");
+	torture_assert_werr_ok(tctx, r.out.result, "RemoteActivation(GetClassObject)");
 
 	torture_assert_werr_ok(tctx, *r.out.hr, "RemoteActivation(GetClassObject)");
 
-	torture_assert_werr_ok(tctx, r.out.results[0],
-						   "RemoteActivation(GetClassObject)");
+	torture_assert_werr_ok(tctx, r.out.results[0], "RemoteActivation(GetClassObject)");
 
 	return true;
 }
-- 
2.4.3


From 3dddea1128aafcc2783acd96d7c7d2f0db050056 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?G=C3=BCnther=20Deschner?= <gd at samba.org>
Date: Wed, 22 Jul 2015 00:06:00 +0200
Subject: [PATCH 12/24] rot: remove trailing whitespace from rot.idl
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Guenther

Signed-off-by: Günther Deschner <gd at samba.org>
---
 librpc/idl/rot.idl | 28 ++++++++++++++--------------
 1 file changed, 14 insertions(+), 14 deletions(-)

diff --git a/librpc/idl/rot.idl b/librpc/idl/rot.idl
index 78eee48..8b6dd9e 100644
--- a/librpc/idl/rot.idl
+++ b/librpc/idl/rot.idl
@@ -3,41 +3,41 @@ import "orpc.idl";
 [
 	uuid("b9e79e60-3d52-11ce-aaa1-00006901293f"),
 	version(0.2),
-    	pointer_default(unique),
- 	endpoint("ncacn_np:[\\pipe\\epmapper]", "ncacn_ip_tcp:[135]", 
-		  "ncalrpc:[EPMAPPER]")
+	pointer_default(unique),
+	endpoint("ncacn_np:[\\pipe\\epmapper]", "ncacn_ip_tcp:[135]",
+		 "ncalrpc:[EPMAPPER]")
 ] interface rot
 {
 	WERROR rot_add (
-					[in] uint32 flags, 
-					[in] MInterfacePointer *unk, 
-					[in] MInterfacePointer *moniker, 
+					[in] uint32 flags,
+					[in] MInterfacePointer *unk,
+					[in] MInterfacePointer *moniker,
 					[out] uint32 *rotid
 					);
-	
+
 	WERROR rot_remove (
 				  [in] uint32 rotid
 				  );
-	
+
 	WERROR rot_is_listed (
 					 [in] MInterfacePointer *moniker
 					 );
-	
+
 	WERROR rot_get_interface_pointer (
-					 [in] MInterfacePointer *moniker, 
+					 [in] MInterfacePointer *moniker,
 					 [out] MInterfacePointer *ip
 					 );
-	
+
 	WERROR rot_set_modification_time (
-						  [in] uint32 rotid, 
+						  [in] uint32 rotid,
 						  [in] NTTIME *t
 						  );
-	
+
 	WERROR rot_get_modification_time (
 							   [in] MInterfacePointer *moniker,
 							   [out] NTTIME *t
 							   );
-	
+
 	WERROR rot_enum (
 					   [out] MInterfacePointer *EnumMoniker
 					   );
-- 
2.4.3


From 987427f94c2689735e38a15b634006e30ef0bf14 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?G=C3=BCnther=20Deschner?= <gd at samba.org>
Date: Wed, 22 Jul 2015 00:07:22 +0200
Subject: [PATCH 13/24] rot: fix indent in rot.idl
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Guenther

Signed-off-by: Günther Deschner <gd at samba.org>
---
 librpc/idl/rot.idl | 40 ++++++++++++++++++++--------------------
 1 file changed, 20 insertions(+), 20 deletions(-)

diff --git a/librpc/idl/rot.idl b/librpc/idl/rot.idl
index 8b6dd9e..7239111 100644
--- a/librpc/idl/rot.idl
+++ b/librpc/idl/rot.idl
@@ -9,36 +9,36 @@ import "orpc.idl";
 ] interface rot
 {
 	WERROR rot_add (
-					[in] uint32 flags,
-					[in] MInterfacePointer *unk,
-					[in] MInterfacePointer *moniker,
-					[out] uint32 *rotid
-					);
+		[in] uint32 flags,
+		[in] MInterfacePointer *unk,
+		[in] MInterfacePointer *moniker,
+		[out] uint32 *rotid
+		);
 
 	WERROR rot_remove (
-				  [in] uint32 rotid
-				  );
+		[in] uint32 rotid
+		);
 
 	WERROR rot_is_listed (
-					 [in] MInterfacePointer *moniker
-					 );
+		[in] MInterfacePointer *moniker
+		);
 
 	WERROR rot_get_interface_pointer (
-					 [in] MInterfacePointer *moniker,
-					 [out] MInterfacePointer *ip
-					 );
+		[in] MInterfacePointer *moniker,
+		[out] MInterfacePointer *ip
+		);
 
 	WERROR rot_set_modification_time (
-						  [in] uint32 rotid,
-						  [in] NTTIME *t
-						  );
+		[in] uint32 rotid,
+		[in] NTTIME *t
+		);
 
 	WERROR rot_get_modification_time (
-							   [in] MInterfacePointer *moniker,
-							   [out] NTTIME *t
-							   );
+		[in] MInterfacePointer *moniker,
+		[out] NTTIME *t
+		);
 
 	WERROR rot_enum (
-					   [out] MInterfacePointer *EnumMoniker
-					   );
+		[out] MInterfacePointer *EnumMoniker
+		);
 }
-- 
2.4.3


From 5e5ac81b9d03bc33e206c6f36f582e13f8d393dd Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?G=C3=BCnther=20Deschner?= <gd at samba.org>
Date: Tue, 21 Jul 2015 20:23:11 +0200
Subject: [PATCH 14/24] oxidresolver: fix ServerAlive2 IDL and test.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Guenther

Signed-off-by: Günther Deschner <gd at samba.org>
---
 librpc/idl/oxidresolver.idl       | 6 ++----
 source4/torture/rpc/oxidresolve.c | 7 +++++++
 2 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/librpc/idl/oxidresolver.idl b/librpc/idl/oxidresolver.idl
index 570b112..07700d5 100644
--- a/librpc/idl/oxidresolver.idl
+++ b/librpc/idl/oxidresolver.idl
@@ -90,9 +90,7 @@ interface IOXIDResolver
 
 	[idempotent] WERROR ServerAlive2 (
 		[out,ref] COMINFO *info,
-		[out,ref] DUALSTRINGARRAY *dualstring,
-		[out,ref] uint8 *unknown2,
-		[out,ref] uint8 *unknown3,
-		[out,ref] uint8 *unknown4
+		[out,ref] DUALSTRINGARRAY **dualstring,
+		[out,ref] uint8 *pReserved
 		);
 }
diff --git a/source4/torture/rpc/oxidresolve.c b/source4/torture/rpc/oxidresolve.c
index 34e5b72..9c67988 100644
--- a/source4/torture/rpc/oxidresolve.c
+++ b/source4/torture/rpc/oxidresolve.c
@@ -211,6 +211,13 @@ static bool test_ServerAlive2(struct torture_context *tctx,
 	struct ServerAlive2 r;
 	NTSTATUS status;
 	struct dcerpc_binding_handle *b = p->binding_handle;
+	struct COMINFO info;
+	struct DUALSTRINGARRAY *dualstring;
+	uint8_t pReserved;
+
+	r.out.info = &info;
+	r.out.dualstring = &dualstring;
+	r.out.pReserved = &pReserved;
 
 	status = dcerpc_ServerAlive2_r(b, tctx, &r);
 	torture_assert_ntstatus_ok(tctx, status, "ServerAlive2");
-- 
2.4.3


From 3ba80dded036b0343adaf2eddf322befc4d67451 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?G=C3=BCnther=20Deschner?= <gd at samba.org>
Date: Tue, 21 Jul 2015 20:35:14 +0200
Subject: [PATCH 15/24] s4-torture: use torture_assert macros for
 RemoteActivation test.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Guenther

Signed-off-by: Günther Deschner <gd at samba.org>
---
 source4/torture/rpc/oxidresolve.c | 23 ++++-------------------
 1 file changed, 4 insertions(+), 19 deletions(-)

diff --git a/source4/torture/rpc/oxidresolve.c b/source4/torture/rpc/oxidresolve.c
index 9c67988..e3fa80b 100644
--- a/source4/torture/rpc/oxidresolve.c
+++ b/source4/torture/rpc/oxidresolve.c
@@ -63,25 +63,10 @@ static bool test_RemoteActivation(struct torture_context *tctx,
 	r.out.ipidRemUnknown = oid;
 
 	status = dcerpc_RemoteActivation_r(b, tctx, &r);
-	if(NT_STATUS_IS_ERR(status)) {
-		fprintf(stderr, "RemoteActivation: %s\n", nt_errstr(status));
-		return false;
-	}
-
-	if(!W_ERROR_IS_OK(r.out.result)) {
-		fprintf(stderr, "RemoteActivation: %s\n", win_errstr(r.out.result));
-		return false;
-	}
-
-	if(!W_ERROR_IS_OK(*r.out.hr)) {
-		fprintf(stderr, "RemoteActivation: %s\n", win_errstr(*r.out.hr));
-		return false;
-	}
-
-	if(!W_ERROR_IS_OK(r.out.results[0])) {
-		fprintf(stderr, "RemoteActivation: %s\n", win_errstr(r.out.results[0]));
-		return false;
-	}
+	torture_assert_ntstatus_ok(tctx, status, "RemoteActivation failed");
+	torture_assert_werr_ok(tctx, r.out.result, "RemoteActivation failed");
+	torture_assert_werr_ok(tctx, *r.out.hr, "RemoteActivation failed");
+	torture_assert_werr_ok(tctx, r.out.results[0], "RemoteActivation failed");
 
 	return true;
 }
-- 
2.4.3


From 916d8190b0bf69a314d2198fee23011b1a7ef453 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?G=C3=BCnther=20Deschner?= <gd at samba.org>
Date: Tue, 21 Jul 2015 22:37:34 +0200
Subject: [PATCH 16/24] remact: fix IDL for RemoteActivation.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Guenther

Signed-off-by: Günther Deschner <gd at samba.org>
---
 librpc/idl/remact.idl | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/librpc/idl/remact.idl b/librpc/idl/remact.idl
index 04f7fd8..ebcaddf 100644
--- a/librpc/idl/remact.idl
+++ b/librpc/idl/remact.idl
@@ -27,21 +27,21 @@ interface IRemoteActivation
 		[in] ORPCTHIS this_object,
 		[out,ref] ORPCTHAT *that,
 		[in] GUID Clsid,
-		[in] [string,charset(UTF16)] uint16 *pwszObjectName,
-		[in] MInterfacePointer *pObjectStorage,
+		[in] [unique,string,charset(UTF16)] uint16 *pwszObjectName,
+		[in] [unique] MInterfacePointer *pObjectStorage,
 		[in] uint32 ClientImpLevel,
 		[in] uint32 Mode,
 		[in,range(1,32768)] uint32 Interfaces,
-		[in,size_is(Interfaces)] GUID *pIIDs,
+		[in,unique,size_is(Interfaces)] GUID *pIIDs,
 		[in] uint16 num_protseqs,
 		[in, size_is(num_protseqs)] uint16 protseq[*],
 		[out,ref] hyper *pOxid,
-		[out,ref] DUALSTRINGARRAY *pdsaOxidBindings,
+		[out,ref] DUALSTRINGARRAY **pdsaOxidBindings,
 		[out,ref] GUID *ipidRemUnknown,
 		[out,ref] uint32 *AuthnHint,
 		[out,ref] COMVERSION *ServerVersion,
 		[out,ref] WERROR *hr,
-		[out,size_is(Interfaces)] MInterfacePointer *ifaces[],
+		[out,size_is(Interfaces)] MInterfacePointer **ifaces,
 		[out,size_is(Interfaces)] WERROR results[]
 		);
 }
-- 
2.4.3


From 816d21bd2d98567100439897622a3de953b4fc22 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?G=C3=BCnther=20Deschner?= <gd at samba.org>
Date: Tue, 21 Jul 2015 22:38:25 +0200
Subject: [PATCH 17/24] s4-torture: fix test for RemoteActivation.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Guenther

Signed-off-by: Günther Deschner <gd at samba.org>
---
 source4/torture/rpc/oxidresolve.c | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)

diff --git a/source4/torture/rpc/oxidresolve.c b/source4/torture/rpc/oxidresolve.c
index e3fa80b..fa21177 100644
--- a/source4/torture/rpc/oxidresolve.c
+++ b/source4/torture/rpc/oxidresolve.c
@@ -39,6 +39,12 @@ static bool test_RemoteActivation(struct torture_context *tctx,
 	uint16_t protseq[3] = { EPM_PROTOCOL_TCP, EPM_PROTOCOL_NCALRPC, EPM_PROTOCOL_UUID };
 	struct dcerpc_pipe *p;
 	struct dcerpc_binding_handle *b;
+	struct ORPCTHAT that;
+	struct DUALSTRINGARRAY *pdsaOxidBindings;
+	uint32_t AuthnHint;
+	struct COMVERSION ServerVersion;
+	WERROR hr;
+	struct MInterfacePointer *ifaces;
 
 	status = torture_rpc_connection(tctx, &p,
 					&ndr_table_IRemoteActivation);
@@ -48,7 +54,8 @@ static bool test_RemoteActivation(struct torture_context *tctx,
 	}
 	b = p->binding_handle;
 
-	ZERO_STRUCT(r.in);
+	ZERO_STRUCT(r);
+
 	r.in.this_object.version.MajorVersion = 5;
 	r.in.this_object.version.MinorVersion = 1;
 	r.in.this_object.cid = GUID_random();
@@ -59,8 +66,15 @@ static bool test_RemoteActivation(struct torture_context *tctx,
 	r.in.Interfaces = 1;
 	iids[0] = IUnknown_uuid;
 	r.in.pIIDs = iids;
+
+	r.out.that = &that;
 	r.out.pOxid = oxid;
+	r.out.pdsaOxidBindings = &pdsaOxidBindings;
 	r.out.ipidRemUnknown = oid;
+	r.out.AuthnHint = &AuthnHint;
+	r.out.ServerVersion = &ServerVersion;
+	r.out.hr = &hr;
+	r.out.ifaces = &ifaces;
 
 	status = dcerpc_RemoteActivation_r(b, tctx, &r);
 	torture_assert_ntstatus_ok(tctx, status, "RemoteActivation failed");
-- 
2.4.3


From 6cb0d08b95e0ee49f8b83923a7314d518fe5c158 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?G=C3=BCnther=20Deschner?= <gd at samba.org>
Date: Tue, 21 Jul 2015 21:32:53 +0200
Subject: [PATCH 18/24] s4-torture: fix remact test from crashing.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

RemoteActivation was missing all out,ref pointers.

Guenther

Signed-off-by: Günther Deschner <gd at samba.org>
---
 source4/torture/rpc/remact.c | 20 +++++++++++++++++++-
 1 file changed, 19 insertions(+), 1 deletion(-)

diff --git a/source4/torture/rpc/remact.c b/source4/torture/rpc/remact.c
index aff89a1..627b8dc 100644
--- a/source4/torture/rpc/remact.c
+++ b/source4/torture/rpc/remact.c
@@ -35,8 +35,17 @@ static bool test_RemoteActivation(struct torture_context *tctx,
 	struct GUID iids[1];
 	uint16_t protseq[3] = { EPM_PROTOCOL_TCP, EPM_PROTOCOL_NCALRPC, EPM_PROTOCOL_UUID };
 	struct dcerpc_binding_handle *b = p->binding_handle;
+	struct ORPCTHAT that;
+	uint64_t pOxid;
+	struct DUALSTRINGARRAY *pdsaOxidBindings;
+	struct GUID ipidRemUnknown;
+	uint32_t AuthnHint;
+	struct COMVERSION ServerVersion;
+	WERROR hr;
+	struct MInterfacePointer *ifaces;
+
+	ZERO_STRUCT(r);
 
-	ZERO_STRUCT(r.in);
 	r.in.this_object.version.MajorVersion = 5;
 	r.in.this_object.version.MinorVersion = 1;
 	r.in.this_object.cid = GUID_random();
@@ -48,6 +57,15 @@ static bool test_RemoteActivation(struct torture_context *tctx,
 	GUID_from_string(DCERPC_IUNKNOWN_UUID, &iids[0]);
 	r.in.pIIDs = iids;
 
+	r.out.that = &that;
+	r.out.pOxid = &pOxid;
+	r.out.pdsaOxidBindings = &pdsaOxidBindings;
+	r.out.ipidRemUnknown = &ipidRemUnknown;
+	r.out.AuthnHint = &AuthnHint;
+	r.out.ServerVersion = &ServerVersion;
+	r.out.hr = &hr;
+	r.out.ifaces = &ifaces;
+
 	status = dcerpc_RemoteActivation_r(b, tctx, &r);
 	torture_assert_ntstatus_ok(tctx, status, "RemoteActivation");
 
-- 
2.4.3


From 580ebccb1554a923e627135af30a4bc695160da7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?G=C3=BCnther=20Deschner?= <gd at samba.org>
Date: Tue, 21 Jul 2015 22:21:46 +0200
Subject: [PATCH 19/24] lib/torture: add torture_assert_hresult_{equal,ok}
 macros.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Guenther

Signed-off-by: Günther Deschner <gd at samba.org>
---
 lib/torture/torture.h | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/lib/torture/torture.h b/lib/torture/torture.h
index 2d99e65..356922a 100644
--- a/lib/torture/torture.h
+++ b/lib/torture/torture.h
@@ -293,6 +293,14 @@ void torture_result(struct torture_context *test,
 	}\
 	} while(0)
 
+#define torture_assert_hresult_equal(torture_ctx, got, expected, cmt) \
+	do { HRESULT __got = got, __expected = expected; \
+	if (!HRES_IS_EQUAL(__got, __expected)) { \
+		torture_result(torture_ctx, TORTURE_FAIL, __location__": "#got" was %s, expected %s: %s", hresult_errstr(__got), hresult_errstr(__expected), cmt); \
+		return false; \
+	} \
+	} while (0)
+
 #define torture_assert_casestr_equal(torture_ctx,got,expected,cmt) \
 	do { const char *__got = (got), *__expected = (expected); \
 	if (!strequal(__got, __expected)) { \
@@ -563,6 +571,9 @@ void torture_result(struct torture_context *test,
 #define torture_assert_ndr_success(torture_ctx,expr,cmt) \
 		torture_assert_ndr_err_equal(torture_ctx,expr,NDR_ERR_SUCCESS,cmt)
 
+#define torture_assert_hresult_ok(torture_ctx,expr,cmt) \
+		torture_assert_hresult_equal(torture_ctx,expr,HRES_ERROR(0), cmt)
+
 /* Getting settings */
 const char *torture_setting_string(struct torture_context *test, \
 								   const char *name, 
-- 
2.4.3


From a56c9b975fafe2961bf7dcbb9fd843d46055435b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?G=C3=BCnther=20Deschner?= <gd at samba.org>
Date: Tue, 21 Jul 2015 22:23:22 +0200
Subject: [PATCH 20/24] remact: use HRESULT in RemoteActivation IDL and tests.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Guenther

Signed-off-by: Günther Deschner <gd at samba.org>
---
 librpc/idl/remact.idl             |  4 ++--
 source4/torture/rpc/oxidresolve.c |  6 +++---
 source4/torture/rpc/remact.c      | 10 +++++-----
 3 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/librpc/idl/remact.idl b/librpc/idl/remact.idl
index ebcaddf..dcf9955 100644
--- a/librpc/idl/remact.idl
+++ b/librpc/idl/remact.idl
@@ -40,8 +40,8 @@ interface IRemoteActivation
 		[out,ref] GUID *ipidRemUnknown,
 		[out,ref] uint32 *AuthnHint,
 		[out,ref] COMVERSION *ServerVersion,
-		[out,ref] WERROR *hr,
+		[out,ref] HRESULT *hr,
 		[out,size_is(Interfaces)] MInterfacePointer **ifaces,
-		[out,size_is(Interfaces)] WERROR results[]
+		[out,size_is(Interfaces)] HRESULT results[]
 		);
 }
diff --git a/source4/torture/rpc/oxidresolve.c b/source4/torture/rpc/oxidresolve.c
index fa21177..3ddb049 100644
--- a/source4/torture/rpc/oxidresolve.c
+++ b/source4/torture/rpc/oxidresolve.c
@@ -43,7 +43,7 @@ static bool test_RemoteActivation(struct torture_context *tctx,
 	struct DUALSTRINGARRAY *pdsaOxidBindings;
 	uint32_t AuthnHint;
 	struct COMVERSION ServerVersion;
-	WERROR hr;
+	HRESULT hr;
 	struct MInterfacePointer *ifaces;
 
 	status = torture_rpc_connection(tctx, &p,
@@ -79,8 +79,8 @@ static bool test_RemoteActivation(struct torture_context *tctx,
 	status = dcerpc_RemoteActivation_r(b, tctx, &r);
 	torture_assert_ntstatus_ok(tctx, status, "RemoteActivation failed");
 	torture_assert_werr_ok(tctx, r.out.result, "RemoteActivation failed");
-	torture_assert_werr_ok(tctx, *r.out.hr, "RemoteActivation failed");
-	torture_assert_werr_ok(tctx, r.out.results[0], "RemoteActivation failed");
+	torture_assert_hresult_ok(tctx, *r.out.hr, "RemoteActivation failed");
+	torture_assert_hresult_ok(tctx, r.out.results[0], "RemoteActivation failed");
 
 	return true;
 }
diff --git a/source4/torture/rpc/remact.c b/source4/torture/rpc/remact.c
index 627b8dc..9e9642e 100644
--- a/source4/torture/rpc/remact.c
+++ b/source4/torture/rpc/remact.c
@@ -41,7 +41,7 @@ static bool test_RemoteActivation(struct torture_context *tctx,
 	struct GUID ipidRemUnknown;
 	uint32_t AuthnHint;
 	struct COMVERSION ServerVersion;
-	WERROR hr;
+	HRESULT hr;
 	struct MInterfacePointer *ifaces;
 
 	ZERO_STRUCT(r);
@@ -71,9 +71,9 @@ static bool test_RemoteActivation(struct torture_context *tctx,
 
 	torture_assert_werr_ok(tctx, r.out.result, "RemoteActivation");
 
-	torture_assert_werr_ok(tctx, *r.out.hr, "RemoteActivation");
+	torture_assert_hresult_ok(tctx, *r.out.hr, "RemoteActivation");
 
-	torture_assert_werr_ok(tctx, r.out.results[0], "RemoteActivation");
+	torture_assert_hresult_ok(tctx, r.out.results[0], "RemoteActivation");
 
 	GUID_from_string(DCERPC_ICLASSFACTORY_UUID, &iids[0]);
 	r.in.Interfaces = 1;
@@ -84,9 +84,9 @@ static bool test_RemoteActivation(struct torture_context *tctx,
 
 	torture_assert_werr_ok(tctx, r.out.result, "RemoteActivation(GetClassObject)");
 
-	torture_assert_werr_ok(tctx, *r.out.hr, "RemoteActivation(GetClassObject)");
+	torture_assert_hresult_ok(tctx, *r.out.hr, "RemoteActivation(GetClassObject)");
 
-	torture_assert_werr_ok(tctx, r.out.results[0], "RemoteActivation(GetClassObject)");
+	torture_assert_hresult_ok(tctx, r.out.results[0], "RemoteActivation(GetClassObject)");
 
 	return true;
 }
-- 
2.4.3


From f1fae0f7ab77eac2f04885fdbe7f46affd0c9dba Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?G=C3=BCnther=20Deschner?= <gd at samba.org>
Date: Tue, 21 Jul 2015 22:28:32 +0200
Subject: [PATCH 21/24] remact: use imp_levels enum in RemoteActivation IDL.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Guenther

Signed-off-by: Günther Deschner <gd at samba.org>
---
 librpc/idl/remact.idl | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/librpc/idl/remact.idl b/librpc/idl/remact.idl
index dcf9955..77134e7 100644
--- a/librpc/idl/remact.idl
+++ b/librpc/idl/remact.idl
@@ -12,8 +12,7 @@ import "misc.idl", "orpc.idl";
 ]
 interface IRemoteActivation
 {
-	typedef enum
-	{
+	typedef [v1_enum] enum {
 		RPC_C_IMP_LEVEL_DEFAULT = 0,
 		RPC_C_IMP_LEVEL_ANONYMOUS = 1,
 		RPC_C_IMP_LEVEL_IDENTIFY = 2,
@@ -29,7 +28,7 @@ interface IRemoteActivation
 		[in] GUID Clsid,
 		[in] [unique,string,charset(UTF16)] uint16 *pwszObjectName,
 		[in] [unique] MInterfacePointer *pObjectStorage,
-		[in] uint32 ClientImpLevel,
+		[in] imp_levels ClientImpLevel,
 		[in] uint32 Mode,
 		[in,range(1,32768)] uint32 Interfaces,
 		[in,unique,size_is(Interfaces)] GUID *pIIDs,
-- 
2.4.3


From 1e9686cc7619fa0d91871fc850c216697e765667 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?G=C3=BCnther=20Deschner?= <gd at samba.org>
Date: Tue, 21 Jul 2015 23:36:26 +0200
Subject: [PATCH 22/24] s4-torture: fix ResolveOxid test, filling in missing
 ref,out pointers.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Guenther

Signed-off-by: Günther Deschner <gd at samba.org>
---
 source4/torture/rpc/oxidresolve.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/source4/torture/rpc/oxidresolve.c b/source4/torture/rpc/oxidresolve.c
index 3ddb049..c9a8d1c 100644
--- a/source4/torture/rpc/oxidresolve.c
+++ b/source4/torture/rpc/oxidresolve.c
@@ -162,6 +162,9 @@ static bool test_ResolveOxid(struct torture_context *tctx,
 	uint64_t oxid;
 	struct GUID oid;
 	struct dcerpc_binding_handle *b = p->binding_handle;
+	struct DUALSTRINGARRAY *ppdsaOxidBindings;
+	struct GUID pipidRemUnknown;
+	uint32_t pAuthnHint;
 
 	if (!test_RemoteActivation(tctx, &oxid, &oid))
 		return false;
@@ -169,6 +172,9 @@ static bool test_ResolveOxid(struct torture_context *tctx,
 	r.in.pOxid = oxid;
 	r.in.cRequestedProtseqs = 2;
 	r.in.arRequestedProtseqs = protseq;
+	r.out.ppdsaOxidBindings = &ppdsaOxidBindings;
+	r.out.pipidRemUnknown = &pipidRemUnknown;
+	r.out.pAuthnHint = &pAuthnHint;
 
 	status = dcerpc_ResolveOxid_r(b, tctx, &r);
 	torture_assert_ntstatus_ok(tctx, status, "ResolveOxid");
-- 
2.4.3


From 02cf2bf7904d56082864af5971597bad25df67bc Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?G=C3=BCnther=20Deschner?= <gd at samba.org>
Date: Tue, 21 Jul 2015 23:37:07 +0200
Subject: [PATCH 23/24] s4-torture: fix ResolveOxid2 test, filling in missing
 ref,out pointers.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Guenther

Signed-off-by: Günther Deschner <gd at samba.org>
---
 source4/torture/rpc/oxidresolve.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/source4/torture/rpc/oxidresolve.c b/source4/torture/rpc/oxidresolve.c
index c9a8d1c..11cd8fe 100644
--- a/source4/torture/rpc/oxidresolve.c
+++ b/source4/torture/rpc/oxidresolve.c
@@ -192,6 +192,10 @@ static bool test_ResolveOxid2(struct torture_context *tctx,
 	uint64_t oxid;
 	struct GUID oid;
 	struct dcerpc_binding_handle *b = p->binding_handle;
+	struct DUALSTRINGARRAY *pdsaOxidBindings;
+	struct GUID ipidRemUnknown;
+	uint32_t AuthnHint;
+	struct COMVERSION ComVersion;
 
 	if (!test_RemoteActivation(tctx, &oxid, &oid))
 		return false;
@@ -199,6 +203,10 @@ static bool test_ResolveOxid2(struct torture_context *tctx,
 	r.in.pOxid = oxid;
 	r.in.cRequestedProtseqs = 2;
 	r.in.arRequestedProtseqs = protseq;
+	r.out.pdsaOxidBindings = &pdsaOxidBindings;
+	r.out.ipidRemUnknown = &ipidRemUnknown;
+	r.out.AuthnHint = &AuthnHint;
+	r.out.ComVersion = &ComVersion;
 
 	status = dcerpc_ResolveOxid2_r(b, tctx, &r);
 	torture_assert_ntstatus_ok(tctx, status, "ResolveOxid2");
-- 
2.4.3


From 014b27304e44f2116f2c1519d3ef83fa3edf11df Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?G=C3=BCnther=20Deschner?= <gd at samba.org>
Date: Wed, 22 Jul 2015 00:17:51 +0200
Subject: [PATCH 24/24] lib/dcom: use HRESULT in dcom_create_object.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Guenther

Signed-off-by: Günther Deschner <gd at samba.org>
---
 source4/lib/com/dcom/dcom.h  | 2 +-
 source4/lib/com/dcom/main.c  | 8 ++++----
 source4/lib/wmi/tools/wmis.c | 3 ++-
 source4/lib/wmi/wmicore.c    | 3 ++-
 4 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/source4/lib/com/dcom/dcom.h b/source4/lib/com/dcom/dcom.h
index 56d6eac..cb549b1 100644
--- a/source4/lib/com/dcom/dcom.h
+++ b/source4/lib/com/dcom/dcom.h
@@ -50,7 +50,7 @@ typedef enum ndr_err_code (*unmarshal_fn)(TALLOC_CTX *mem_ctx, struct OBJREF *o,
 struct dcom_client_context *dcom_client_init(struct com_context *ctx, struct cli_credentials *credentials);
 struct dcom_object_exporter *object_exporter_by_oxid(struct com_context *ctx, uint64_t oxid);
 struct dcom_object_exporter *object_exporter_by_ip(struct com_context *ctx, struct IUnknown *ip);
-WERROR dcom_create_object(struct com_context *ctx, struct GUID *clsid, const char *server, int num_ifaces, struct GUID *iid, struct IUnknown ***ip, WERROR *results);
+WERROR dcom_create_object(struct com_context *ctx, struct GUID *clsid, const char *server, int num_ifaces, struct GUID *iid, struct IUnknown ***ip, HRESULT *results);
 WERROR dcom_get_class_object(struct com_context *ctx, struct GUID *clsid, const char *server, struct GUID *iid, struct IUnknown **ip);
 NTSTATUS dcom_get_pipe(struct IUnknown *iface, struct dcerpc_pipe **pp);
 NTSTATUS dcom_OBJREF_from_IUnknown(struct OBJREF *o, struct IUnknown *p);
diff --git a/source4/lib/com/dcom/main.c b/source4/lib/com/dcom/main.c
index ea1e4f8..a652678 100644
--- a/source4/lib/com/dcom/main.c
+++ b/source4/lib/com/dcom/main.c
@@ -240,7 +240,7 @@ struct dcom_object_exporter *object_exporter_by_ip(struct com_context *ctx, stru
 	return object_exporter_by_oxid(ctx, ip->obj.u_objref.u_standard.std.oxid);
 }
 
-WERROR dcom_create_object(struct com_context *ctx, struct GUID *clsid, const char *server, int num_ifaces, struct GUID *iid, struct IUnknown ***ip, WERROR *results)
+WERROR dcom_create_object(struct com_context *ctx, struct GUID *clsid, const char *server, int num_ifaces, struct GUID *iid, struct IUnknown ***ip, HRESULT *results)
 {
 	uint16_t protseq[] = DCOM_NEGOTIATED_PROTOCOLS;
 	struct dcerpc_pipe *p;
@@ -249,7 +249,7 @@ WERROR dcom_create_object(struct com_context *ctx, struct GUID *clsid, const cha
 	struct RemoteActivation r;
 	struct DUALSTRINGARRAY *pds;
 	int i;
-	WERROR hr;
+	HRESULT hr;
 	uint64_t oxid;
 	struct GUID ipidRemUnknown;
 	struct IUnknown *ru_template;
@@ -301,8 +301,8 @@ WERROR dcom_create_object(struct com_context *ctx, struct GUID *clsid, const cha
 		hr = r.out.result;
 		goto end;
 	}
-	
-	if(!W_ERROR_IS_OK(hr)) {
+
+	if(!HRES_IS_OK(hr)) {
 		goto end;
 	}
 
diff --git a/source4/lib/wmi/tools/wmis.c b/source4/lib/wmi/tools/wmis.c
index 314fdd1..c4c8ed9 100644
--- a/source4/lib/wmi/tools/wmis.c
+++ b/source4/lib/wmi/tools/wmis.c
@@ -102,7 +102,8 @@ WERROR WBEM_ConnectServer(struct com_context *ctx, const char *server, const cha
 {
 	struct GUID clsid;
 	struct GUID iid;
-	WERROR result, coresult;
+	WERROR result;
+	HRESULT coresult;
 	struct IUnknown **mqi;
 	struct IWbemLevel1Login *pL;
 
diff --git a/source4/lib/wmi/wmicore.c b/source4/lib/wmi/wmicore.c
index 7624946..dc9fee4 100644
--- a/source4/lib/wmi/wmicore.c
+++ b/source4/lib/wmi/wmicore.c
@@ -57,7 +57,8 @@ WERROR WBEM_ConnectServer(struct com_context *ctx, const char *server, const uin
 {
         struct GUID clsid;
         struct GUID iid;
-        WERROR result, coresult;
+        WERROR result;
+	HRESULT coresult;
         struct IUnknown **mqi;
         struct IWbemLevel1Login *pL;
 
-- 
2.4.3



More information about the samba-technical mailing list