is assumed to be "ptr" if not specified (just like midl).
The validator will warn when "ptr" is used at the moment, because
pidl only supports unique, ref and relative at the moment.
return 0;
}
+sub pointer_type($)
+{
+ my $e = shift;
+
+ return undef unless $e->{POINTERS};
+
+ return "ref" if (util::has_property($e, "ref"));
+ return "ptr" if (util::has_property($e, "ptr"));
+ return "unique" if (util::has_property($e, "unique"));
+ return "relative" if (util::has_property($e, "relative"));
+
+ return undef;
+}
+
# determine if an element needs a reference pointer on the wire
# in its NDR representation
sub need_wire_pointer($)
{
my $e = shift;
- if ($e->{POINTERS} &&
- !util::has_property($e, "ref")) {
- return $e->{POINTERS};
+ my $pt;
+
+ return 0 unless ($pt = pointer_type($e));
+
+ if ($pt ne "ref") {
+ return 1;
+ } else {
+ return 0;
}
- return undef;
}
# determine if an element is a pure scalar. pure scalars do not
my($interface) = shift;
my($data) = $interface->{DATA};
- foreach my $d (@{$data}) {
- if ($d->{TYPE} eq "DECLARE") {
- $typedefs{$d->{NAME}} = $d;
- }
- if ($d->{TYPE} eq "TYPEDEF") {
- $typedefs{$d->{NAME}} = $d;
- }
- }
-
# Push functions
foreach my $d (@{$data}) {
($d->{TYPE} eq "TYPEDEF") &&
pidl "}\n\n";
}
+sub CheckPointerTypes($$)
+{
+ my $s = shift;
+ my $default = shift;
+
+ foreach my $e (@{$s->{ELEMENTS}}) {
+ if ($e->{POINTERS}) {
+ if (not defined(pointer_type($e))) {
+ $e->{PROPERTIES}->{$default} = 1;
+ }
+
+ if (pointer_type($e) eq "ptr") {
+ print "Warning: ptr is not supported by pidl yet\n";
+ }
+ }
+ }
+}
+
+sub LoadInterface($)
+{
+ my $x = shift;
+
+ if (not util::has_property($x, "pointer_default")) {
+ $x->{PROPERTIES}->{pointer_default} = "ptr";
+ }
+
+ foreach my $d (@{$x->{DATA}}) {
+ if ($d->{TYPE} eq "DECLARE" or $d->{TYPE} eq "TYPEDEF") {
+ $typedefs{$d->{NAME}} = $d;
+ if ($d->{DATA}->{TYPE} eq "STRUCT" or $d->{DATA}->{TYPE} eq "UNION") {
+ CheckPointerTypes($d->{DATA}, $x->{PROPERTIES}->{pointer_default});
+ }
+ }
+ if ($d->{TYPE} eq "FUNCTION") {
+ CheckPointerTypes($d, $x->{PROPERTIES}->{pointer_default});
+ }
+ }
+}
+
+sub Load($)
+{
+ my $idl = shift;
+
+ foreach my $x (@{$idl}) {
+ LoadInterface($x);
+ }
+}
+
#####################################################################
# parse a parsed IDL structure back into an IDL file
sub Parse($$)
my $h_filename = $filename;
$res = "";
+ Load($idl);
+
if ($h_filename =~ /(.*)\.c/) {
$h_filename = "$1.h";
}
if (!$e->{POINTERS} && (
util::has_property($e, "ptr") or
util::has_property($e, "unique") or
+ util::has_property($e, "relative") or
util::has_property($e, "ref"))) {
fatal(el_name($e) . " : pointer properties on non-pointer element\n");
}
my($interface) = shift;
my($data) = $interface->{DATA};
+ if (util::has_property($interface, "pointer_default") &&
+ $interface->{PROPERTIES}->{pointer_default} eq "ptr") {
+ fatal "Full pointers are not supported yet\n";
+ }
+
if (util::has_property($interface, "object")) {
if(util::has_property($interface, "version") &&
$interface->{PROPERTIES}->{version} != 0) {
[
uuid("0a74ef1c-41a4-4e06-83ae-dc74fb1cdd53"),
version(1.0),
+ pointer_default(unique),
helpstring("Audio Server")
] interface audiosrv
{
uuid("6bffd098-a112-3610-9833-012892020162"),
version(0.0),
helpstring("Browsing"),
+ pointer_default(unique),
endpoint("ncacn_np:[\\pipe\\browser]", "ncacn_ip_tcp:", "ncalrpc:")
]
interface browser
[
uuid("1d55b526-c137-46c5-ab79-638f2a68e869"),
version(1.0),
+ pointer_default(unique),
helpstring("Remote IDL debugger")
] interface dbgidl
{
see http://www.opengroup.org/onlinepubs/9629399/chap12.htm for packet
layouts
*/
+[
+pointer_default(unique)
+]
interface dcerpc
{
typedef [public] struct {
[
uuid("18f70770-8e64-11cf-9af1-0020af6e72f4"),
+ pointer_default(unique),
version(0.0)
] interface dcom_Unknown
{
void UpdateResolverBindings();
}
+[
+ pointer_default(unique)
+]
interface ObjectRpcBaseTypes
{
/* COM_MINOR_VERSION = 1 (NT4.0, SP1, SP2, DCOM95). */
[
object,
uuid("00000000-0000-0000-C000-000000000046"),
+ pointer_default(unique),
helpstring("Base interface for all COM interfaces")
]
interface IUnknown
[
uuid("00000131-0000-0000-C000-000000000046"),
object,
+ pointer_default(unique),
helpstring("Remote version of IUnknown")
]
interface IRemUnknown : IUnknown
[
uuid("00000140-0000-0000-c000-000000000046"),
+ pointer_default(unique),
object
] interface IClassActivator : IUnknown
{
[
uuid("00000136-0000-0000-c000-000000000046"),
+ pointer_default(unique),
object
] interface ISCMLocalActivator : IClassActivator
{
}
[
+ pointer_default(unique),
uuid("c6f3ee72-ce7e-11d1-b71e-00c04fc3111a")
] interface IMachineLocalActivator
{
}
[
+ pointer_default(unique),
uuid("e60c73e6-88f9-11cf-9af1-0020af6e72f4")
] interface ILocalObjectExporter
{
System.Activator class */
[
uuid("000001a0-0000-0000-c000-000000000046"),
+ pointer_default(unique),
object
]
interface ISystemActivator : IClassActivator
/* marshaled interface packets. */
[
object,
+ pointer_default(unique),
uuid("00000143-0000-0000-C000-000000000046")
]
[
object,
+ pointer_default(unique),
uuid("00000136-0000-0000-C000-000000000046")
] interface ISCMActivator : IClassActivator
{
[
object,
+ pointer_default(unique),
uuid("00020400-0000-0000-C000-000000000046")
] interface IDispatch : IUnknown
{
[
object,
+ pointer_default(unique),
uuid("0000000C-0000-0000-C000-000000000046"),
helpstring("Stream")
]
[
uuid("38578646-4566-4564-2244-275796345667"),
version(0.0),
+ pointer_default(unique),
helpstring("Active Directory Replication LDAP Blobs")
]
interface drsblobs {
[
uuid("ecec0d70-a603-11d0-96b1-00a0c91ece30"),
version(1.0),
+ pointer_default(unique),
helpstring("Backup support for Active Directory")
] interface ad_backup
{
[
uuid("16e0cf3a-a604-11d0-96b1-00a0c91ece30"),
version(1.0),
+ pointer_default(unique),
helpstring("Restoring Active Directory backups")
] interface ad_restore
{
[
uuid("60a15ec5-4de8-11d7-a637-005056a20182"),
endpoint("ncacn_np:[\\pipe\\rpcecho]", "ncacn_ip_tcp:", "ncalrpc:"),
+ pointer_default(unique),
version(1.0),
helpstring("Simple echo pipe")
]
[
uuid("c681d488-d850-11d0-8c52-00c04fd90f7e"),
version(1.0),
+ pointer_default(unique),
helpstring("Encrypted File System")
] interface efs
{
[
uuid("99e64010-b032-11d0-97a4-00c04fd6551d"),
+ pointer_default(unique),
version(3.0)
] interface exchange_store_admin3
{
[
uuid("89742ace-a9ed-11cf-9c0c-08002be7ae86"),
+ pointer_default(unique),
version(2.0)
] interface exchange_store_admin2
{
[
uuid("a4f1db00-ca47-1067-b31e-00dd010662da"),
+ pointer_default(unique),
version(1.0)
] interface exchange_store_admin1
{
[
uuid("1544f5e0-613c-11d1-93df-00c04fd7bd09"),
+ pointer_default(unique),
version(1.0),
helpstring("Exchange 2003 Directory Request For Response")
] interface exchange_ds_rfr
[
uuid("f930c514-1215-11d3-99a5-00a0c9b61b04"),
helpstring("System Attendant Cluster Interface"),
+ pointer_default(unique),
version(1.0)
] interface exchange_sysatt_cluster
{
[
uuid("469d6ec0-0d87-11ce-b13f-00aa003bac6c"),
+ pointer_default(unique),
helpstring("Exchange 5.5 System Attendant Request for Response")
] interface exchange_system_attendant
{
[
uuid("9e8ee830-4559-11ce-979b-00aa005ffebe"),
+ pointer_default(unique),
version(2.0),
helpstring("Exchange 5.5 MTA")
] interface exchange_mta
[
uuid("f5cc59b4-4264-101a-8c59-08002b2f8426"),
+ pointer_default(unique),
version(21.0),
helpstring("Exchange 5.5 DRS")
] interface exchange_drs
[
uuid("f5cc5a7c-4264-101a-8c59-08002b2f8426"),
version(21.0),
+ pointer_default(unique),
helpstring("Exchange 5.5 XDS")
] interface exchange_xds
{
[
uuid("38a94e72-a9bc-11d2-8faf-00c04fa378ff"),
+ pointer_default(unique),
version(1.0)
] interface exchange_mta_qadmin
{
[
uuid("0e4a0156-dd5d-11d2-8c2f-00c04fb6bcde"),
+ pointer_default(unique),
version(1.0)
] interface exchange_store_information
{
[
uuid("f5cc5a18-4264-101a-8c59-08002b2f8426"),
+ pointer_default(unique),
version(56.0),
helpstring("Exchange 5.5 Name Service Provider")
] interface exchange_nsp
[
uuid("a4f1db00-ca47-1067-b31f-00dd010662da"),
+ pointer_default(unique),
version(0.81),
helpstring("Exchange 5.5 EMSMDB")
] interface exchange_emsmdb
[
uuid("c840a7dc-42c0-1a10-b4b9-08002b2fe182"),
+ pointer_default(unique),
helpstring("Unknown")
] interface exchange_unknown
{
/* Also seen as: 0d72a7d4-6148-11d1-b4aa-00c04fb66ea0 */
[
uuid("8d0ffe72-d252-11d0-bf8f-00c04fd9126b"),
+ pointer_default(unique),
version(1.0),
helpstring("Cryptographic Key Services")
]
[
uuid("afa8bd80-7d8a-11c9-bef4-08002b102989"),
version(1.0),
+ pointer_default(unique),
endpoint("ncalrpc:[EPMAPPER]", "ncacn_ip_tcp:[135]", "ncacn_np:[\\pipe\\epmapper]"),
helpstring("DCE/RPC Remote Management")
]
miscellaneous IDL structures
*/
+
+[
+ pointer_default(unique)
+]
interface misc
{
typedef [public,noprint,gensize] struct {
[
uuid("17fdd703-1827-4e34-79d4-24a55c53bb37"),
version(1.0),
+ pointer_default(unique),
helpstring("Messaging Service")
] interface msgsvc
{
[
uuid("d335b8f6-cb31-11d0-b0f9-006097ba4e54"),
version(1.5),
+ pointer_default(unique),
helpstring("IPSec Policy Agent")
] interface policyagent
{
[
uuid("b9e79e60-3d52-11ce-aaa1-00006901293f"),
version(0.2),
+ pointer_default(unique),
endpoint("ncacn_np:[\\pipe\\epmapper]", "ncacn_ip_tcp:[135]",
"ncalrpc:[EPMAPPER]", "ncacn_unix_stream:[/tmp/epmapper]")
] interface rot
[
uuid("93149ca2-973b-11d1-8c39-00c04fb984f9"),
version(0.0),
+ pointer_default(unique),
helpstring("Security Configuration Editor")
]
interface scerpc
security IDL structures
*/
+[
+ pointer_default(unique)
+]
interface security
{
/*
[
uuid("300f3532-38cc-11d0-a3f0-0020af6b0add"),
version(1.2),
+ pointer_default(unique),
helpstring("Distributed Key Tracking Service")
]
interface trkwks
uuid("8fb6d884-2388-11d0-8c35-00c04fda2795"),
endpoint("ncacn_np:[\\pipe\\srvsvc]","ncacn_np:[\\pipe\\atsvc]","ncacn_np:[\\pipe\\browser]","ncacn_np:[\\pipe\\keysvc]","ncacn_np:[\\pipe\\wkssvc]"),
version(4.1),
+ pointer_default(unique),
helpstring("Win32 Time Server")
]
interface w32time
*/
[
- depends(security)
+ depends(security),
+ pointer_default(unique)
]
interface xattr
{