r15776: Don't generate ref pointers in Samba4-generated code. There is no point
authorJelmer Vernooij <jelmer@samba.org>
Sun, 21 May 2006 12:58:39 +0000 (12:58 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 19:08:18 +0000 (14:08 -0500)
in having pointers for outgoing data when you can already modify the top-level
element.

This can be overridden (temporarily) by specifying the new "keepref"
attribute. Once we've removed keepref from all IDL files, I'll remove this
attribute as well.
(This used to be commit bdc6dd37503ced8322a671d225122ccffbb8bfec)

30 files changed:
source4/lib/registry/reg_backend_rpc.c
source4/librpc/idl/atsvc.idl
source4/librpc/idl/dcom.idl
source4/librpc/idl/dfs.idl
source4/librpc/idl/drsuapi.idl
source4/librpc/idl/echo.idl
source4/librpc/idl/efs.idl
source4/librpc/idl/epmapper.idl
source4/librpc/idl/eventlog.idl
source4/librpc/idl/initshutdown.idl
source4/librpc/idl/irpc.idl
source4/librpc/idl/lsa.idl
source4/librpc/idl/netlogon.idl
source4/librpc/idl/orpc.idl
source4/librpc/idl/oxidresolver.idl
source4/librpc/idl/remact.idl
source4/librpc/idl/rot.idl
source4/librpc/idl/samr.idl
source4/librpc/idl/spoolss.idl
source4/librpc/idl/srvsvc.idl
source4/librpc/idl/svcctl.idl
source4/librpc/idl/unixinfo.idl
source4/librpc/idl/winreg.idl
source4/librpc/idl/wkssvc.idl
source4/librpc/ndr/ndr_basic.c
source4/pidl/lib/Parse/Pidl/NDR.pm
source4/pidl/lib/Parse/Pidl/Samba4/Header.pm
source4/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm
source4/pidl/lib/Parse/Pidl/Typelist.pm
source4/torture/rpc/winreg.c

index 79adad13569e1073bac3fcfbc27ca0ad74970372..8e709987785c979bf3a4b4f3176967302d09bac2 100644 (file)
@@ -280,7 +280,7 @@ static WERROR rpc_query_key(const struct registry_key *k)
     struct rpc_key_data *mykeydata = k->backend_data;
        TALLOC_CTX *mem_ctx = talloc_init("query_key");
 
-    init_winreg_String(&r.in.class, NULL);
+    init_winreg_String(&r.in.class_in, NULL);
     r.in.handle = &mykeydata->pol;
        
     status = dcerpc_winreg_QueryInfoKey((struct dcerpc_pipe *)(k->hive->backend_data), mem_ctx, &r);
index d58a71965191fa5310848d1cf4ff8e7dc0c1e218..3dd5cb6805fb1d991bc4a41584a2b3d1b089a520 100644 (file)
@@ -6,7 +6,8 @@
   version(1.0),
   pointer_default(unique),
   helpstring("Microsoft AT-Scheduler Service"),
-  endpoint("ncacn_np:[\\pipe\\atsvc]", "ncalrpc:")
+  endpoint("ncacn_np:[\\pipe\\atsvc]", "ncalrpc:"),
+  keepref
 ] interface atsvc
 {
        typedef [bitmap32bit] bitmap {
@@ -73,7 +74,7 @@
        /* Function: 0x00 */
        NTSTATUS atsvc_JobAdd(
                [in,unique,string,charset(UTF16)] uint16 *servername,
-               [in] atsvc_JobInfo *job_info,
+               [in,keepref] atsvc_JobInfo *job_info,
                [out]    uint32 job_id
        );
 
index ce10c98c0ae48a0d58d0410346c032e071183255..2a2b9ad8b1324875f45dcb6a429342826a71de78 100644 (file)
@@ -18,7 +18,8 @@
        object,
        uuid("00000000-0000-0000-C000-000000000046"),
        pointer_default(unique),
-       helpstring("Base interface for all COM interfaces")
+       helpstring("Base interface for all COM interfaces"),
+       keepref
 ]
 interface IUnknown
 {
@@ -42,7 +43,8 @@ interface IUnknown
 [
        object,
        uuid("00000001-0000-0000-C000-000000000046"),
-       pointer_default(unique)
+       pointer_default(unique),
+       keepref
 ] interface IClassFactory : IUnknown
 {
        [local] WERROR CreateInstance([in,unique] MInterfacePointer *pUnknown, 
@@ -69,7 +71,8 @@ interface IUnknown
        uuid("00000131-0000-0000-C000-000000000046"),
        object,
        pointer_default(unique),
-       helpstring("Remote version of IUnknown")
+       helpstring("Remote version of IUnknown"),
+       keepref
 ]
 interface IRemUnknown : IUnknown
 {
@@ -169,7 +172,8 @@ interface IRemUnknown : IUnknown
 [
        object,
        pointer_default(unique),
-       uuid("00000143-0000-0000-C000-000000000046")
+       uuid("00000143-0000-0000-C000-000000000046"),
+       keepref
 ]
 
 interface IRemUnknown2 : IRemUnknown
@@ -186,8 +190,9 @@ interface IRemUnknown2 : IRemUnknown
 [
        object,
        pointer_default(unique),
-       uuid("00020400-0000-0000-C000-000000000046")
-       ] interface IDispatch : IUnknown
+       uuid("00020400-0000-0000-C000-000000000046"),
+       keepref
+] interface IDispatch : IUnknown
 {
        /*****************/
        /* Function 0x03 */
@@ -254,7 +259,8 @@ interface IRemUnknown2 : IRemUnknown
        uuid(DA23F6DB-6F45-466C-9EED-0B65286F2D78),
        helpstring("ICoffeeMachine Interface"),
        pointer_default(unique),
-       object
+       object,
+       keepref
 ] interface ICoffeeMachine : IUnknown
 {
        WERROR MakeCoffee([in,string,charset(UTF16)] uint16 *flavor);
@@ -272,7 +278,8 @@ interface IRemUnknown2 : IRemUnknown
        object,
        pointer_default(unique),
        uuid("0000000C-0000-0000-C000-000000000046"),
-       helpstring("Stream")
+       helpstring("Stream"),
+       keepref
 ]
 interface IStream : IUnknown
 {
index ef3d2ca604e70c92459f324f212084c0e75f0913..a39bfe6aa0ff36c4387f7f44d815b7bc79764320 100644 (file)
@@ -5,7 +5,8 @@
 [ uuid("4fc742e0-4a10-11cf-8273-00aa004ae673"),
   version(3.0),
   pointer_default(unique),
-  helpstring("Settings for Microsoft Distributed File System")
+  helpstring("Settings for Microsoft Distributed File System"),
+  keepref
 ] interface netdfs
 {
        /******************/
index 3668ddab7eaf184fbfb40c382f07e26979aff2d6..f106c4ce3a2c07b773b12bc3409e2f81172491d5 100644 (file)
@@ -7,7 +7,8 @@
   authservice("ldap"),
   helpstring("Active Directory Replication"),
   pointer_default(unique),
-  depends(security,misc)
+  depends(security,misc),
+  keepref
 ] 
 interface drsuapi
 {
index 7b80e3e29692b57404167694a9e63d80750c4174..cda29685a1823f7004168fe90d3c5c90183700b8 100644 (file)
@@ -4,7 +4,8 @@
   endpoint("ncacn_np:[\\pipe\\rpcecho]", "ncacn_ip_tcp:", "ncalrpc:"),
   pointer_default(unique),
   version(1.0),
-  helpstring("Simple echo pipe")
+  helpstring("Simple echo pipe"),
+  keepref
 ]
 interface rpcecho
 {
index 75d997a0184caa545fd7b2c807d4206580140ab6..83c6cad19f4e0968070457bb0ac1ce7164591250 100644 (file)
@@ -7,7 +7,8 @@
   uuid("c681d488-d850-11d0-8c52-00c04fd90f7e"),
   version(1.0),
   depends(security),
-  pointer_default(unique)
+  pointer_default(unique),
+  keepref
 ] interface efs
 {
 
index 223883c366128af712c8b7623a82e3deae8be1d8..e913209cf1c81c8714a22212aedb77d8475e4a2a 100644 (file)
@@ -15,7 +15,8 @@ http://www.opengroup.org/onlinepubs/9629399/chap6.htm#tagcjh_11_02_03_01: bindin
                  "ncalrpc:[EPMAPPER]"),
  helpstring("EndPoint Mapper"),
  pointer_default_top(sptr),
- pointer_default(sptr)
+ pointer_default(sptr),
+ keepref
 ]
 interface epmapper
 {
index 38f4a88e281f9ad5b042f6b1a4bd3186af7cfea6..c8a146b272f5054c50608809846572d1251f734b 100644 (file)
@@ -7,7 +7,8 @@
   version(0.0),
   depends(lsa,security),
   pointer_default(unique),
-  helpstring("Event Logger")
+  helpstring("Event Logger"),
+  keepref
 ] interface eventlog
 {
        typedef bitmap {
index 50d49637c2e65d87234c022b902fe6888afbcbef..8555ed0c5cd33a57f292bdd237e1074b7b436d6e 100644 (file)
@@ -9,7 +9,8 @@
   version(1.0),
   endpoint("ncacn_np:[\\pipe\\InitShutdown]"),
   pointer_default(unique),
-  helpstring("Init shutdown service")
+  helpstring("Init shutdown service"),
+  keepref
 ] interface initshutdown
 {
        typedef struct {
index 5614608bd75f78f7fad6e51f65485114d57339b6..a566a99bfc9c4013f4642cb520212222acf3b56d 100644 (file)
@@ -6,7 +6,8 @@
 [ uuid("e770c620-0b06-4b5e-8d87-a26e20f28340"),
   version(1.0),
   pointer_default(unique),
-  depends(security,nbt)
+  depends(security,nbt),
+  keepref
 ] interface irpc
 {
        typedef bitmap {
index 454f73afebf7f3503c63eb0ea9ba722815d79c24..0953c6d02547ffa6b47ae902a432b784b99db94c 100644 (file)
@@ -9,7 +9,8 @@
   endpoint("ncacn_np:[\\pipe\\lsarpc]","ncacn_np:[\\pipe\\lsass]", "ncacn_ip_tcp:", "ncalrpc:"),
   pointer_default(unique),
   helpstring("Local Security Authority"),
-  depends(security)
+  depends(security),
+  keepref
 ] interface lsarpc
 {
        declare bitmap security_secinfo;
index c4a0f976137387f17b0d14ae9d3eeb1e849a1a84..95289b7ea9c07b74da33db0d09be0c69d6a907b5 100644 (file)
@@ -12,7 +12,8 @@
   endpoint("ncacn_np:[\\pipe\\netlogon]","ncacn_ip_tcp:","ncalrpc:"),
   pointer_default(unique),
   pointer_default_top(unique),
-  depends(lsa,samr,security)
+  depends(lsa,samr,security),
+  keepref
 ]
 
 interface netlogon
index c1faefd3b1777c5c5bf0b0e0e4d5f9504e312858..c59cc9d3cb4c4573d160a360f6bacf3b8928c1f9 100644 (file)
@@ -6,7 +6,8 @@
  */
 
 [
-       pointer_default(unique)
+       pointer_default(unique),
+       keepref
 ]
 interface ObjectRpcBaseTypes
 {
index d3f3078a0d0192d4d97b7fbac2bde7272505e403..835b848a4522ba90ca1f8bed7fd1de70dbceb378 100644 (file)
@@ -16,7 +16,8 @@
        endpoint("ncacn_np:[\\pipe\\epmapper]", "ncacn_ip_tcp:[135]", "ncalrpc:"),
        pointer_default(unique),
        pointer_default_top(unique),
-       depends(dcom, orpc)
+       depends(dcom, orpc),
+       keepref
 ]
 interface IOXIDResolver
 {
index a54ca7781dec136d4e577e6da9a6ee266f1ca40b..2f8baf926ae0961d18fffea24b78850975231d88 100644 (file)
@@ -8,7 +8,8 @@
        pointer_default(unique),
        pointer_default_top(unique),
        endpoint("ncalrpc:", "ncacn_ip_tcp:[135]", "ncacn_np:[\\pipe\\epmapper]"),
-       depends(dcom,orpc)
+       depends(dcom,orpc),
+       keepref
 ]
 interface IRemoteActivation
 {
index 5851466c79ae423625a478e04513fc2ae76bc254..27c78366356d96f669a53d86df7ee7e1ae374a6e 100644 (file)
@@ -5,7 +5,8 @@
        pointer_default_top(unique),
        depends(orpc),
        endpoint("ncacn_np:[\\pipe\\epmapper]", "ncacn_ip_tcp:[135]", 
-                 "ncalrpc:[EPMAPPER]")
+                 "ncalrpc:[EPMAPPER]"),
+       keepref
 ] interface rot
 {
        WERROR rot_add (
index c9d21dba0899cea33a127c8e131cfb0b41b3a1e2..370eb728bdb51921d4383e9fdb60578322e6b188 100644 (file)
@@ -13,7 +13,8 @@
   endpoint("ncacn_np:[\\pipe\\samr]","ncacn_ip_tcp:", "ncalrpc:"),
   pointer_default(unique),
   pointer_default_top(unique),
-  depends(misc,lsa,security)
+  depends(misc,lsa,security),
+  keepref
 ] interface samr
 {
        declare bitmap security_secinfo;
index 93ce3c3f36515b26c2da9184bcfa23910847a6ba..b09690b2786d358df07faa6a8109f016435646e8 100644 (file)
@@ -11,7 +11,8 @@
   pointer_default_top(unique),
   helpstring("Spooler SubSystem"),
   depends(security),
-  helper("librpc/ndr/ndr_spoolss_buf.h")
+  helper("librpc/ndr/ndr_spoolss_buf.h"),
+  keepref
 ] interface spoolss
 {
        typedef struct {
index 6405736c9f6a3d142108c3977d770c8e60e56d1f..845969a0276ca4be07373e3a57247a8c32d490b3 100644 (file)
@@ -10,7 +10,8 @@
   pointer_default(unique),
   pointer_default_top(unique),
   helpstring("Server Service"),
-  depends(security,svcctl)
+  depends(security,svcctl),
+  keepref
 ] interface srvsvc
 {
        declare bitmap svcctl_ServerType;
index 27172f85df01ce813ade23dcb04b8f5b4c388174..f77e4d42761e83cbcd459299ec20f90fa2d44773 100644 (file)
@@ -9,7 +9,8 @@
   pointer_default(unique),
   pointer_default_top(unique),
   endpoint("ncacn_np:[\\pipe\\svcctl]", "ncalrpc:"),
-  helpstring("Service Control")
+  helpstring("Service Control"),
+  keepref
 ] interface svcctl
 {
        typedef struct {
index 078862f444a2e0003d173b173f917ee681268525..2b5b60908f75292a1e0a8e401cbbe7770b086dc6 100644 (file)
@@ -7,7 +7,8 @@
   endpoint("ncacn_np:[\\pipe\\unixinfo]", "ncacn_ip_tcp:", "ncalrpc:"),
   pointer_default(unique),
   helpstring("Unixinfo specific stuff"),
-  depends(security)
+  depends(security),
+  keepref
 ] interface unixinfo
 {
        /******************/
index 1ecb98d3b0c28d037f46f92294ee30d965de4c1d..93c3c12db5235a8dbebe4000c7150264efc94265 100644 (file)
@@ -9,7 +9,8 @@
   pointer_default(unique),
   pointer_default_top(unique),
   helpstring("Remote Registry Service"),
-  depends(lsa,initshutdown,security)
+  depends(lsa,initshutdown,security),
+  keepref
 ] interface winreg
 {
        declare bitmap security_secinfo;
        /* Function: 0x10 */
        WERROR winreg_QueryInfoKey(
                [in,ref] policy_handle *handle,
-               [in] winreg_String class,
-               [out] winreg_String class,
+               [in] winreg_String class_in,
+               [out] winreg_String *class_out,
                [out] uint32 num_subkeys,
                [out] uint32 max_subkeylen,
                [out] uint32 max_subkeysize,
index d658091c4769a3099ae86eab429068ec1864e041..a085265a41481dd8bd5415494a78065a12c24361 100644 (file)
@@ -7,7 +7,8 @@
   pointer_default(unique),
   pointer_default_top(unique),
   helpstring("Workstation Service"),
-  depends(srvsvc)
+  depends(srvsvc),
+  keepref
 ] interface wkssvc
 {
        declare [v1_enum] enum srvsvc_PlatformId;
index 197fd4489588b63ec438e789a4e129382f1d90de..f4ba7868652629b0e5a1432b3f2ebdd69f853d6a 100644 (file)
@@ -494,11 +494,8 @@ _PUBLIC_ NTSTATUS ndr_push_sptr_ptr(struct ndr_push *ndr, const void *p)
 /*
   push always a 0, if a pointer is NULL it's a fatal error
 */
-_PUBLIC_ NTSTATUS ndr_push_ref_ptr(struct ndr_push *ndr, const void *p)
+_PUBLIC_ NTSTATUS ndr_push_ref_ptr(struct ndr_push *ndr)
 {
-       if (p == NULL) {
-               return NT_STATUS_INVALID_PARAMETER_MIX;
-       }
        return ndr_push_uint32(ndr, NDR_SCALARS, 0xAEF1AEF1);
 }
 
index 5839b042d356e4a4cb312e2b771de8069a9ab12a..21875a12972e379251e9ce7d2c2e0524b1578345 100644 (file)
@@ -571,8 +571,7 @@ sub ParseFunction($$$)
 
 sub CheckPointerTypes($$)
 {
-       my $s = shift;
-       my $default = shift;
+       my ($s,$default) = @_;
 
        foreach my $e (@{$s->{ELEMENTS}}) {
                if ($e->{POINTERS} and not defined(pointer_type($e))) {
@@ -581,6 +580,23 @@ sub CheckPointerTypes($$)
        }
 }
 
+#FIXME: Remove when ref handling in Samba4 is fixed
+sub AddKeepRef($)
+{
+       my $d = shift;
+
+       if ($d->{TYPE} eq "FUNCTION") {
+               foreach (@{$d->{ELEMENTS}}) {
+                       $_->{PROPERTIES}->{keepref} = 1;
+               }
+       } elsif ($d->{TYPE} eq "TYPEDEF" and ($d->{DATA}->{TYPE} eq "STRUCT"
+                       or $d->{DATA}->{TYPE} eq "UNION")) {
+               foreach (@{$d->{DATA}->{ELEMENTS}}) {
+                       $_->{PROPERTIES}->{keepref} = 1;
+               }
+       }
+}
+
 sub ParseInterface($)
 {
        my $idl = shift;
@@ -606,10 +622,12 @@ sub ParseInterface($)
                if ($d->{TYPE} eq "DECLARE") {
                        push (@declares, $d);
                } elsif ($d->{TYPE} eq "FUNCTION") {
+                       AddKeepRef($d) if (has_property($idl, "keepref"));
                        push (@functions, ParseFunction($idl, $d, \$opnum));
                } elsif ($d->{TYPE} eq "CONST") {
                        push (@consts, ParseConst($idl, $d));
                } else {
+                       AddKeepRef($d) if (has_property($idl, "keepref"));
                        push (@types, ParseType($idl, $d));
                }
        }
@@ -831,6 +849,10 @@ my %property_list = (
        "noheader"              => ["ELEMENT"],
        "charset"               => ["ELEMENT"],
        "length_is"             => ["ELEMENT"],
+
+       # temporary (should be removed once we've migrated away from 
+       # relying on ref pointers being there in Samba4's code)
+       "keepref"               => ["ELEMENT","INTERFACE"],
 );
 
 #####################################################################
index 6fb3ee2eecb826ee65a9df590fc263c8e24ec269..c9487115f5aec8bc8b8350500225783c0bc6b904 100644 (file)
@@ -60,7 +60,11 @@ sub HeaderElement($)
        } else {
                HeaderType($element, $element->{TYPE}, "");
                pidl " ";
-               my $numstar = $element->{POINTERS};
+               my $numstar = 0;
+               if (!has_property($element, "ref") or 
+                       has_property($element, "keepref")) {
+                       $numstar += $element->{POINTERS};
+               }
                if ($numstar >= 1) {
                        $numstar-- if Parse::Pidl::Typelist::scalar_is_reference($element->{TYPE});
                }
index b7ae526e68b914bf7f268de128e6f2d1b0ea8567..5a8ef53e1471fb80ca5e4ac69b2787b74ad8a080 100644 (file)
@@ -582,7 +582,9 @@ sub ParseElementPushLevel
                                pidl "NDR_CHECK(ndr_push_relative_ptr2(ndr, $var_name));";
                        }
                }
-               $var_name = get_value_of($var_name);
+               if ($l->{POINTER_TYPE} ne "ref" or has_property($e, "keepref")) {
+                       $var_name = get_value_of($var_name);
+               }
                ParseElementPushLevel($e, GetNextLevel($e, $l), $ndr, $var_name, $env, 1, 1);
 
                if ($l->{POINTER_TYPE} ne "ref") {
@@ -662,11 +664,12 @@ sub ParsePtrPush($$$)
        my ($e,$l,$var_name) = @_;
 
        if ($l->{POINTER_TYPE} eq "ref") {
-               if ($l->{LEVEL} eq "EMBEDDED") {
-                       pidl "NDR_CHECK(ndr_push_ref_ptr(ndr, $var_name));";
-               } else {
+               if (has_property($e, "keepref")) {
                        check_null_pointer(get_value_of($var_name));
                }
+               if ($l->{LEVEL} eq "EMBEDDED") {
+                       pidl "NDR_CHECK(ndr_push_ref_ptr(ndr));";
+               }
        } elsif ($l->{POINTER_TYPE} eq "relative") {
                pidl "NDR_CHECK(ndr_push_relative_ptr1(ndr, $var_name));";
        } elsif ($l->{POINTER_TYPE} eq "unique") {
@@ -872,7 +875,7 @@ sub ParseMemCtxPullStart($$$)
                my $next_is_array = ($nl->{TYPE} eq "ARRAY");
                my $next_is_string = (($nl->{TYPE} eq "DATA") and 
                                        ($nl->{DATA_TYPE} eq "string"));
-               if ($next_is_array or $next_is_string) {
+               if ($next_is_array or $next_is_string or not has_property($e, "keepref")) {
                        return;
                } else {
                        $mem_c_flags = "LIBNDR_FLAG_REF_ALLOC";
@@ -898,7 +901,7 @@ sub ParseMemCtxPullEnd($$)
                my $next_is_array = ($nl->{TYPE} eq "ARRAY");
                my $next_is_string = (($nl->{TYPE} eq "DATA") and 
                                        ($nl->{DATA_TYPE} eq "string"));
-               if ($next_is_array or $next_is_string) {
+               if ($next_is_array or $next_is_string or not has_property($e, "keepref")) {
                        return;
                } else {
                        $mem_r_flags = "LIBNDR_FLAG_REF_ALLOC";
@@ -975,7 +978,9 @@ sub ParseElementPullLevel
 
                ParseMemCtxPullStart($e,$l, $var_name);
 
-               $var_name = get_value_of($var_name);
+               if ($l->{POINTER_TYPE} ne "ref" or has_property($e, "keepref")) {
+                       $var_name = get_value_of($var_name);
+               }
                ParseElementPullLevel($e,GetNextLevel($e,$l), $ndr, $var_name, $env, 1, 1);
 
                ParseMemCtxPullEnd($e,$l);
@@ -1075,11 +1080,12 @@ sub ParsePtrPull($$$$)
                                                 ($nl->{DATA_TYPE} eq "string"));
 
        if ($l->{POINTER_TYPE} eq "ref") {
-               unless ($l->{LEVEL} eq "TOP") {
+               if ($l->{LEVEL} eq "EMBEDDED") {
                        pidl "NDR_CHECK(ndr_pull_ref_ptr($ndr, &_ptr_$e->{NAME}));";
                }
 
-               unless ($next_is_array or $next_is_string) {
+               if (!$next_is_array and !$next_is_string and 
+                       has_property($e, "keepref")) {
                        pidl "if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {";
                        pidl "\tNDR_PULL_ALLOC($ndr, $var_name);"; 
                        pidl "}";
@@ -1413,8 +1419,7 @@ sub DeclareArrayVariables($)
 
 sub need_decl_mem_ctx($$)
 {
-       my $e = shift;
-       my $l = shift;
+       my ($e,$l) = @_;
 
        return 0 if has_fast_array($e,$l);
        return 0 if is_charset_array($e,$l);
@@ -1425,7 +1430,7 @@ sub need_decl_mem_ctx($$)
                my $next_is_array = ($nl->{TYPE} eq "ARRAY");
                my $next_is_string = (($nl->{TYPE} eq "DATA") and 
                                        ($nl->{DATA_TYPE} eq "string"));
-               return 0 if ($next_is_array or $next_is_string);
+               return 0 if ($next_is_array or $next_is_string or not has_property($e, "keepref"));
        }
        return 1 if ($l->{TYPE} eq "POINTER");
 
@@ -2091,6 +2096,7 @@ sub ParseFunctionPull($)
                next unless (grep(/out/, @{$e->{DIRECTION}}));
                next unless ($e->{LEVELS}[0]->{TYPE} eq "POINTER" and 
                             $e->{LEVELS}[0]->{POINTER_TYPE} eq "ref");
+               next unless has_property($e, "keepref");
                next if (($e->{LEVELS}[1]->{TYPE} eq "DATA") and 
                                 ($e->{LEVELS}[1]->{DATA_TYPE} eq "string"));
                next if (($e->{LEVELS}[1]->{TYPE} eq "ARRAY") 
index 10a1e8136f56ff34399420f7b4a2417383f14356..66d5e59e7c36bf8db02b891ab721af7b0689792a 100644 (file)
@@ -23,50 +23,29 @@ my @reference_scalars = (
 
 # a list of known scalar types
 my %scalars = (
-       # 0 byte types
        "void"          => "void",
-
-       # 1 byte types
        "char"          => "char",
        "int8"          => "int8_t",
        "uint8"         => "uint8_t",
-
-       # 2 byte types
        "int16"         => "int16_t",
        "uint16"        => "uint16_t",
-
-       # 4 byte types
        "int32"         => "int32_t",
        "uint32"        => "uint32_t",
-
-       # 8 byte types
        "hyper"         => "uint64_t",
        "dlong"         => "int64_t",
        "udlong"        => "uint64_t",
        "udlongr"       => "uint64_t",
-
-       # assume its a 8 byte type, but cope with either
        "pointer"       => "void*",
-
-       # DATA_BLOB types
        "DATA_BLOB"     => "DATA_BLOB",
-
-       # string types
        "string"        => "const char *",
        "string_array"  => "const char **",
-
-       # time types
        "time_t"        => "time_t",
        "NTTIME"        => "NTTIME",
        "NTTIME_1sec"   => "NTTIME",
        "NTTIME_hyper"  => "NTTIME",
-
-       # error code types
        "WERROR"        => "WERROR",
        "NTSTATUS"      => "NTSTATUS",
        "COMRESULT" => "COMRESULT",
-
-       # special types
        "nbt_string"    => "const char *",
        "wrepl_nbt_name"=> "struct nbt_name *",
        "ipv4address"   => "const char *",
index a03da8002a5bbeef1df17047ade32635c06eb68f..35f9b201819c1efa4b152cfa73e12f651dcc0b71 100644 (file)
@@ -376,7 +376,7 @@ static BOOL test_QueryInfoKey(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
        printf("\ntesting QueryInfoKey\n");
 
        r.in.handle = handle;
-       init_winreg_String(&r.in.class, class);
+       init_winreg_String(&r.in.class_in, class);
        
        status = dcerpc_winreg_QueryInfoKey(p, mem_ctx, &r);