1
0
mirror of https://github.com/samba-team/samba.git synced 2025-03-08 04:58:40 +03:00

r19856: Use sptr as basis for full ptr implementation. Will add checks for duplicates later.

(This used to be commit 006ab1d4a449c81680add57e0116a86b8317fbfb)
This commit is contained in:
Jelmer Vernooij 2006-11-23 13:48:01 +00:00 committed by Gerald (Jerry) Carter
parent 6166693a8c
commit 128fe5324b
4 changed files with 13 additions and 22 deletions

View File

@ -248,8 +248,8 @@ interface epmapper
/* Function 0x02 */
error_status_t epm_Lookup(
[in] uint32 inquiry_type,
[in,sptr] GUID *object,
[in,sptr] rpc_if_id_t *interface_id,
[in,ptr] GUID *object,
[in,ptr] rpc_if_id_t *interface_id,
[in] uint32 vers_option,
[in,out] policy_handle *entry_handle,
[in] uint32 max_ents,
@ -266,8 +266,8 @@ interface epmapper
} epm_twr_p_t;
error_status_t epm_Map(
[in,sptr] GUID *object,
[in,sptr] epm_twr_t *map_tower,
[in,ptr] GUID *object,
[in,ptr] epm_twr_t *map_tower,
[in,out] policy_handle *entry_handle,
[in] uint32 max_towers,
[out] uint32 *num_towers,
@ -292,8 +292,8 @@ interface epmapper
/* Function 0x06 */
error_status_t epm_MgmtDelete(
[in] uint32 object_speced,
[in,sptr] GUID *object,
[in,sptr] epm_twr_t *tower
[in,ptr] GUID *object,
[in,ptr] epm_twr_t *tower
);
/**********************/

View File

@ -481,7 +481,7 @@ _PUBLIC_ NTSTATUS ndr_push_unique_ptr(struct ndr_push *ndr, const void *p)
/*
push a 'simple' full non-zero value if a pointer is non-NULL, otherwise 0
*/
_PUBLIC_ NTSTATUS ndr_push_sptr_ptr(struct ndr_push *ndr, const void *p)
_PUBLIC_ NTSTATUS ndr_push_full_ptr(struct ndr_push *ndr, const void *p)
{
uint32_t ptr = 0;
if (p) {

View File

@ -309,7 +309,7 @@ sub pointer_type($)
return undef unless $e->{POINTERS};
return "ref" if (has_property($e, "ref"));
return "ptr" if (has_property($e, "ptr"));
return "full" if (has_property($e, "ptr"));
return "sptr" if (has_property($e, "sptr"));
return "unique" if (has_property($e, "unique"));
return "relative" if (has_property($e, "relative"));
@ -789,7 +789,6 @@ my %property_list = (
# pointer
"ref" => ["ELEMENT"],
"ptr" => ["ELEMENT"],
"sptr" => ["ELEMENT"],
"unique" => ["ELEMENT"],
"ignore" => ["ELEMENT"],
"relative" => ["ELEMENT"],
@ -885,10 +884,6 @@ sub ValidElement($)
ValidProperties($e,"ELEMENT");
if (has_property($e, "ptr")) {
fatal($e, el_name($e) . " : pidl does not support full NDR pointers yet\n");
}
# Check whether switches are used correctly.
if (my $switch = has_property($e, "switch_is")) {
my $e2 = find_sibling($e, $switch);
@ -946,7 +941,6 @@ sub ValidElement($)
if (!$e->{POINTERS} && (
has_property($e, "ptr") or
has_property($e, "sptr") or
has_property($e, "unique") or
has_property($e, "relative") or
has_property($e, "ref"))) {
@ -1055,11 +1049,8 @@ sub ValidInterface($)
ValidProperties($interface,"INTERFACE");
if (has_property($interface, "pointer_default")) {
if ($interface->{PROPERTIES}->{pointer_default} eq "ptr") {
nonfatal $interface, "Full pointers are not supported yet, falling back to sptr";
$interface->{PROPERTIES}->{pointer_default} = "sptr";
} elsif (not grep (/$interface->{PROPERTIES}->{pointer_default}/,
("ref", "unique", "ptr", "sptr"))) {
if (not grep (/$interface->{PROPERTIES}->{pointer_default}/,
("ref", "unique", "ptr"))) {
fatal $interface, "Unknown default pointer type `$interface->{PROPERTIES}->{pointer_default}'";
}
}

View File

@ -669,8 +669,8 @@ sub ParsePtrPush($$$)
pidl "NDR_CHECK(ndr_push_relative_ptr1(ndr, $var_name));";
} elsif ($l->{POINTER_TYPE} eq "unique") {
pidl "NDR_CHECK(ndr_push_unique_ptr(ndr, $var_name));";
} elsif ($l->{POINTER_TYPE} eq "sptr") {
pidl "NDR_CHECK(ndr_push_sptr_ptr(ndr, $var_name));";
} elsif ($l->{POINTER_TYPE} eq "full") {
pidl "NDR_CHECK(ndr_push_full_ptr(ndr, $var_name));";
} else {
die("Unhandled pointer type $l->{POINTER_TYPE}");
}
@ -1085,7 +1085,7 @@ sub ParsePtrPull($$$$)
return;
} elsif (($l->{POINTER_TYPE} eq "unique") or
($l->{POINTER_TYPE} eq "relative") or
($l->{POINTER_TYPE} eq "sptr")) {
($l->{POINTER_TYPE} eq "full")) {
pidl "NDR_CHECK(ndr_pull_generic_ptr($ndr, &_ptr_$e->{NAME}));";
pidl "if (_ptr_$e->{NAME}) {";
indent;