summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2005-03-12 17:12:52 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:11:02 -0500
commite9ca6e48fff41c5f457075156a8c4b2c729c5527 (patch)
treeabfe42de2722644947b586350c20339158188014
parentf58143b0256d470e17f2c0a09a7c1a352855d385 (diff)
downloadsamba-e9ca6e48fff41c5f457075156a8c4b2c729c5527.tar.gz
samba-e9ca6e48fff41c5f457075156a8c4b2c729c5527.tar.xz
samba-e9ca6e48fff41c5f457075156a8c4b2c729c5527.zip
r5775: Remove some unused functions (unions are no longer as special as they used to be)
Add oxid mapping table support in DCOM (This used to be commit e193555f0eec2dda8c8760e9668181200fef0a1e)
-rw-r--r--source4/build/pidl/ndr.pm2
-rw-r--r--source4/lib/com/dcom/main.c9
-rw-r--r--source4/libnet/userinfo.c1
-rw-r--r--source4/librpc/idl/winreg.idl3
-rw-r--r--source4/librpc/ndr/libndr.h3
-rw-r--r--source4/librpc/ndr/ndr.c28
-rw-r--r--source4/torture/rpc/oxidresolve.c14
-rw-r--r--source4/torture/rpc/remact.c2
8 files changed, 29 insertions, 33 deletions
diff --git a/source4/build/pidl/ndr.pm b/source4/build/pidl/ndr.pm
index 1e862f5c231..b4f02048a20 100644
--- a/source4/build/pidl/ndr.pm
+++ b/source4/build/pidl/ndr.pm
@@ -549,7 +549,7 @@ sub ParseArrayPull($$$$)
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
diff --git a/source4/lib/com/dcom/main.c b/source4/lib/com/dcom/main.c
index 8ef2060eb74..4d9c635be84 100644
--- a/source4/lib/com/dcom/main.c
+++ b/source4/lib/com/dcom/main.c
@@ -119,7 +119,14 @@ static NTSTATUS dcom_connect_host(struct com_context *ctx, struct dcerpc_pipe **
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)
diff --git a/source4/libnet/userinfo.c b/source4/libnet/userinfo.c
index 350bc262020..67a1710dc8a 100644
--- a/source4/libnet/userinfo.c
+++ b/source4/libnet/userinfo.c
@@ -183,6 +183,7 @@ struct composite_context* rpc_composite_userinfo_send(struct dcerpc_pipe *p,
failure:
talloc_free(c);
+ return NULL;
}
diff --git a/source4/librpc/idl/winreg.idl b/source4/librpc/idl/winreg.idl
index a58a62f62fc..3d11af790bf 100644
--- a/source4/librpc/idl/winreg.idl
+++ b/source4/librpc/idl/winreg.idl
@@ -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),
diff --git a/source4/librpc/ndr/libndr.h b/source4/librpc/ndr/libndr.h
index 19d43566815..4df3e7f248a 100644
--- a/source4/librpc/ndr/libndr.h
+++ b/source4/librpc/ndr/libndr.h
@@ -137,7 +137,6 @@ struct ndr_print {
/* 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 @@ enum ndr_err_code {
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 *);
diff --git a/source4/librpc/ndr/ndr.c b/source4/librpc/ndr/ndr.c
index f3394d1e442..b96a231a908 100644
--- a/source4/librpc/ndr/ndr.c
+++ b/source4/librpc/ndr/ndr.c
@@ -644,12 +644,12 @@ NTSTATUS ndr_check_array_length(struct ndr_pull *ndr, void *p, uint32_t length)
/*
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 @@ NTSTATUS ndr_pull_set_switch_value(struct ndr_pull *ndr, void *p, uint32_t val)
/*
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,21 +729,6 @@ NTSTATUS ndr_push_relative_ptr2(struct ndr_push *ndr, const void *p)
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
*/
@@ -807,7 +792,7 @@ size_t ndr_size_struct(const void *p, int flags, ndr_push_flags_fn_t push)
/*
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 @@ size_t ndr_size_union(const void *p, int flags, uint32_t level, ndr_push_union_f
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;
}
diff --git a/source4/torture/rpc/oxidresolve.c b/source4/torture/rpc/oxidresolve.c
index 3ff90e3a01f..2caf3512d55 100644
--- a/source4/torture/rpc/oxidresolve.c
+++ b/source4/torture/rpc/oxidresolve.c
@@ -232,24 +232,28 @@ BOOL torture_rpc_oxidresolve(void)
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_ComplexPing(p, mem_ctx, &setid, oid))
+ if(!test_ServerAlive2(p, mem_ctx))
ret = False;
- if(!test_SimplePing(p, mem_ctx, setid))
+ if(!test_RemoteActivation(premact, mem_ctx, &oxid, &oid))
+ return False;
+
+ if(!test_ComplexPing(p, mem_ctx, &setid, oid))
ret = False;
- if(!test_ServerAlive2(p, mem_ctx))
+ if(!test_SimplePing(p, mem_ctx, setid))
ret = False;
if(!test_ResolveOxid(p, mem_ctx, oxid))
diff --git a/source4/torture/rpc/remact.c b/source4/torture/rpc/remact.c
index 83a88117871..a8dff5f50b0 100644
--- a/source4/torture/rpc/remact.c
+++ b/source4/torture/rpc/remact.c
@@ -86,7 +86,7 @@ static int test_RemoteActivation(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx)
}
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;
}