mirror of
https://github.com/samba-team/samba.git
synced 2025-02-28 01:58:17 +03:00
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)
This commit is contained in:
parent
f58143b025
commit
e9ca6e48ff
@ -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
|
||||
|
@ -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)
|
||||
|
@ -183,6 +183,7 @@ struct composite_context* rpc_composite_userinfo_send(struct dcerpc_pipe *p,
|
||||
|
||||
failure:
|
||||
talloc_free(c);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
|
@ -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),
|
||||
|
@ -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 *);
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -232,26 +232,30 @@ 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_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;
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user