Author: jelmer
Date: 2005-03-12 17:12:52 +0000 (Sat, 12 Mar 2005)
New Revision: 5775

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=5775

Log:
Remove some unused functions (unions are no longer as special as they used to 
be)
Add oxid mapping table support in DCOM

Modified:
   branches/SAMBA_4_0/source/build/pidl/ndr.pm
   branches/SAMBA_4_0/source/lib/com/dcom/main.c
   branches/SAMBA_4_0/source/libnet/userinfo.c
   branches/SAMBA_4_0/source/librpc/idl/winreg.idl
   branches/SAMBA_4_0/source/librpc/ndr/libndr.h
   branches/SAMBA_4_0/source/librpc/ndr/ndr.c
   branches/SAMBA_4_0/source/torture/rpc/oxidresolve.c
   branches/SAMBA_4_0/source/torture/rpc/remact.c


Changeset:
Modified: branches/SAMBA_4_0/source/build/pidl/ndr.pm
===================================================================
--- branches/SAMBA_4_0/source/build/pidl/ndr.pm 2005-03-12 15:40:26 UTC (rev 
5774)
+++ branches/SAMBA_4_0/source/build/pidl/ndr.pm 2005-03-12 17:12:52 UTC (rev 
5775)
@@ -549,7 +549,7 @@
        my $size = $length;
 
        if (is_conformant_array($e)) {
-               $size = "ndr_get_array_size($ndr, &$var_prefix$e->{NAME})";
+               $length = $size = "ndr_get_array_size($ndr, 
&$var_prefix$e->{NAME})";
        }
 
        # if this is a conformant array then we use that size to allocate, and 
make sure

Modified: branches/SAMBA_4_0/source/lib/com/dcom/main.c
===================================================================
--- branches/SAMBA_4_0/source/lib/com/dcom/main.c       2005-03-12 15:40:26 UTC 
(rev 5774)
+++ branches/SAMBA_4_0/source/lib/com/dcom/main.c       2005-03-12 17:12:52 UTC 
(rev 5775)
@@ -119,7 +119,14 @@
 
 struct dcom_object_exporter *object_exporter_by_oxid(struct com_context *ctx, 
uint64_t oxid)
 {
-       return NULL; /* FIXME */
+       struct dcom_object_exporter *ox;
+       for (ox = ctx->dcom->object_exporters; ox; ox = ox->next) {
+               if (ox->oxid == oxid) {
+                       return ox;
+               }
+       }
+
+       return NULL; 
 }
 
 struct dcom_object_exporter *object_exporter_by_ip(struct com_context *ctx, 
struct IUnknown *ip)

Modified: branches/SAMBA_4_0/source/libnet/userinfo.c
===================================================================
--- branches/SAMBA_4_0/source/libnet/userinfo.c 2005-03-12 15:40:26 UTC (rev 
5774)
+++ branches/SAMBA_4_0/source/libnet/userinfo.c 2005-03-12 17:12:52 UTC (rev 
5775)
@@ -183,6 +183,7 @@
        
 failure:
        talloc_free(c);
+       return NULL;
 }
 
 

Modified: branches/SAMBA_4_0/source/librpc/idl/winreg.idl
===================================================================
--- branches/SAMBA_4_0/source/librpc/idl/winreg.idl     2005-03-12 15:40:26 UTC 
(rev 5774)
+++ branches/SAMBA_4_0/source/librpc/idl/winreg.idl     2005-03-12 17:12:52 UTC 
(rev 5775)
@@ -4,7 +4,8 @@
   winreg interface definition
 */
 
-[ uuid("338cd001-2244-31f1-aaaa-900038001003"),
+[ 
+  uuid("338cd001-2244-31f1-aaaa-900038001003"),
   version(1.0),
   endpoint("ncacn_np:[\\pipe\\winreg]","ncacn_ip_tcp:","ncalrpc:"),
   pointer_default(unique),

Modified: branches/SAMBA_4_0/source/librpc/ndr/libndr.h
===================================================================
--- branches/SAMBA_4_0/source/librpc/ndr/libndr.h       2005-03-12 15:40:26 UTC 
(rev 5774)
+++ branches/SAMBA_4_0/source/librpc/ndr/libndr.h       2005-03-12 17:12:52 UTC 
(rev 5775)
@@ -137,7 +137,6 @@
 
 /* useful macro for debugging */
 #define NDR_PRINT_DEBUG(type, p) ndr_print_debug((ndr_print_fn_t)ndr_print_ 
##type, #p, p)
-#define NDR_PRINT_UNION_DEBUG(type, level, p) 
ndr_print_union_debug((ndr_print_union_fn_t)ndr_print_ ##type, #p, level, p)
 #define NDR_PRINT_FUNCTION_DEBUG(type, flags, p) 
ndr_print_function_debug((ndr_print_function_t)ndr_print_ ##type, #type, flags, 
p)
 #define NDR_PRINT_BOTH_DEBUG(type, p) NDR_PRINT_FUNCTION_DEBUG(type, NDR_BOTH, 
p)
 #define NDR_PRINT_OUT_DEBUG(type, p) NDR_PRINT_FUNCTION_DEBUG(type, NDR_OUT, p)
@@ -242,8 +241,6 @@
 typedef NTSTATUS (*ndr_push_flags_fn_t)(struct ndr_push *, int ndr_flags, void 
*);
 typedef NTSTATUS (*ndr_push_const_fn_t)(struct ndr_push *, int ndr_flags, 
const void *);
 typedef NTSTATUS (*ndr_pull_flags_fn_t)(struct ndr_pull *, int ndr_flags, void 
*);
-typedef NTSTATUS (*ndr_push_union_fn_t)(struct ndr_push *, int ndr_flags, 
uint32_t, void *);
-typedef NTSTATUS (*ndr_pull_union_fn_t)(struct ndr_pull *, int ndr_flags, 
uint32_t, void *);
 typedef void (*ndr_print_fn_t)(struct ndr_print *, const char *, void *);
 typedef void (*ndr_print_function_t)(struct ndr_print *, const char *, int, 
void *);
 typedef void (*ndr_print_union_fn_t)(struct ndr_print *, const char *, 
uint32_t, void *);

Modified: branches/SAMBA_4_0/source/librpc/ndr/ndr.c
===================================================================
--- branches/SAMBA_4_0/source/librpc/ndr/ndr.c  2005-03-12 15:40:26 UTC (rev 
5774)
+++ branches/SAMBA_4_0/source/librpc/ndr/ndr.c  2005-03-12 17:12:52 UTC (rev 
5775)
@@ -644,12 +644,12 @@
 /*
   store a switch value
  */
-NTSTATUS ndr_push_set_switch_value(struct ndr_push *ndr, void *p, uint32_t val)
+NTSTATUS ndr_push_set_switch_value(struct ndr_push *ndr, const void *p, 
uint32_t val)
 {
        return ndr_token_store(ndr, &ndr->switch_list, p, val);
 }
 
-NTSTATUS ndr_pull_set_switch_value(struct ndr_pull *ndr, void *p, uint32_t val)
+NTSTATUS ndr_pull_set_switch_value(struct ndr_pull *ndr, const void *p, 
uint32_t val)
 {
        return ndr_token_store(ndr, &ndr->switch_list, p, val);
 }
@@ -657,12 +657,12 @@
 /*
   retrieve a switch value
  */
-uint32_t ndr_push_get_switch_value(struct ndr_push *ndr, void *p)
+uint32_t ndr_push_get_switch_value(struct ndr_push *ndr, const void *p)
 {
        return ndr_token_peek(&ndr->switch_list, p);
 }
 
-uint32_t ndr_pull_get_switch_value(struct ndr_pull *ndr, void *p)
+uint32_t ndr_pull_get_switch_value(struct ndr_pull *ndr, const void *p)
 {
        return ndr_token_peek(&ndr->switch_list, p);
 }
@@ -729,22 +729,7 @@
        return NT_STATUS_OK;
 }
 
-
 /*
-  pull a union from a blob using NDR
-*/
-NTSTATUS ndr_pull_union_blob(DATA_BLOB *blob, TALLOC_CTX *mem_ctx, uint32_t 
level, void *p,
-                            ndr_pull_union_fn_t fn)
-{
-       struct ndr_pull *ndr;
-       ndr = ndr_pull_init_blob(blob, mem_ctx);
-       if (!ndr) {
-               return NT_STATUS_NO_MEMORY;
-       }
-       return fn(ndr, NDR_SCALARS|NDR_BUFFERS, level, p);
-}
-
-/*
   pull a struct from a blob using NDR
 */
 NTSTATUS ndr_pull_struct_blob(const DATA_BLOB *blob, TALLOC_CTX *mem_ctx, void 
*p,
@@ -807,7 +792,7 @@
 /*
   generic ndr_size_*() handler for unions
 */
-size_t ndr_size_union(const void *p, int flags, uint32_t level, 
ndr_push_union_fn_t push)
+size_t ndr_size_union(const void *p, int flags, uint32_t level, 
ndr_push_flags_fn_t push)
 {
        struct ndr_push *ndr;
        NTSTATUS status;
@@ -819,7 +804,8 @@
        ndr = ndr_push_init_ctx(NULL);
        if (!ndr) return 0;
        ndr->flags |= flags | LIBNDR_FLAG_NO_NDR_SIZE;
-       status = push(ndr, NDR_SCALARS|NDR_BUFFERS, level, discard_const(p));
+       ndr_push_set_switch_value(ndr, p, level);
+       status = push(ndr, NDR_SCALARS|NDR_BUFFERS, discard_const(p));
        if (!NT_STATUS_IS_OK(status)) {
                return 0;
        }

Modified: branches/SAMBA_4_0/source/torture/rpc/oxidresolve.c
===================================================================
--- branches/SAMBA_4_0/source/torture/rpc/oxidresolve.c 2005-03-12 15:40:26 UTC 
(rev 5774)
+++ branches/SAMBA_4_0/source/torture/rpc/oxidresolve.c 2005-03-12 17:12:52 UTC 
(rev 5775)
@@ -232,26 +232,30 @@
                return False;
        }
 
-       status = dcerpc_secondary_connection(premact, &p, 
+       status = torture_rpc_connection(&p, 
                                        DCERPC_IOXIDRESOLVER_NAME, 
                                        DCERPC_IOXIDRESOLVER_UUID, 
                                        DCERPC_IOXIDRESOLVER_VERSION);
 
-       if(!test_RemoteActivation(premact, mem_ctx, &oxid, &oid))
+       if (!NT_STATUS_IS_OK(status)) {
                return False;
+       }
 
        if(!test_ServerAlive(p, mem_ctx))
                ret = False;
 
+       if(!test_ServerAlive2(p, mem_ctx))
+               ret = False;
+
+       if(!test_RemoteActivation(premact, mem_ctx, &oxid, &oid))
+               return False;
+
        if(!test_ComplexPing(p, mem_ctx, &setid, oid))
                ret = False;
 
        if(!test_SimplePing(p, mem_ctx, setid))
                ret = False;
 
-       if(!test_ServerAlive2(p, mem_ctx))
-               ret = False;
-
        if(!test_ResolveOxid(p, mem_ctx, oxid))
                ret = False;
 

Modified: branches/SAMBA_4_0/source/torture/rpc/remact.c
===================================================================
--- branches/SAMBA_4_0/source/torture/rpc/remact.c      2005-03-12 15:40:26 UTC 
(rev 5774)
+++ branches/SAMBA_4_0/source/torture/rpc/remact.c      2005-03-12 17:12:52 UTC 
(rev 5775)
@@ -86,7 +86,7 @@
        }
 
        if(!W_ERROR_IS_OK(r.out.results[0])) {
-               printf("RemoteActivation: %s\n", win_errstr(r.out.results[0]));
+               printf("RemoteActivation(GetClassObject): %s\n", 
win_errstr(r.out.results[0]));
                return 0;
        }
 

Reply via email to