Commit Graph

391 Commits

Author SHA1 Message Date
Rémi Bernon f5b7a76b28 widl: Disallow qualified types in expressions.
MIDL WinRT mode only supports a limited subset of original IDL syntax
anyway, and this will save some conflicts when removing the lexer trick
for namespaces.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-08 20:09:12 +01:00
Rémi Bernon 47a256c648 widl: Use explicit namespace parameter for qualified names.
Instead of buggy lookup namespace stack.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-08 20:09:07 +01:00
Rémi Bernon f76f3d152f widl: Add explicit namespace parameter to find_type_or_error.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-08 20:09:04 +01:00
Rémi Bernon 36597eda3d widl: Fold aIDENTIFIER / aKNOWNTYPE rules together.
Splitting t_ident rule as typename / m_typename rules.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-05 22:53:46 +01:00
Rémi Bernon 6f1308cd62 widl: Factor and cleanup module type declaration and definition.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-05 22:53:46 +01:00
Rémi Bernon 62c58eb8a0 widl: Factor and cleanup apicontract type declaration and definition.
And remove unused check_def helper.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-05 22:53:46 +01:00
Rémi Bernon ce14877436 widl: Factor and cleanup dispinterface type declaration and definition.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-05 22:53:46 +01:00
Rémi Bernon f8684cf953 widl: Factor and cleanup interface type declaration and definition.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-05 22:53:46 +01:00
Rémi Bernon 621b4fa697 widl: Distinguish interface declarations from interface references.
Interface referencing should probably check for a previous type
declaration, but Wine IDLs currently have many places where this is
broken.

This is for instance the case when a coclass use the inner interface
statement to declare an interface without any previous declaration.

And in mimeole.idl, coclass are being declared with the same name as
their interface, to generate the corresponding CLSID.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-04 23:11:22 +01:00
Rémi Bernon 7a01eb2aad widl: Factor and cleanup runtimeclass type declaration and definition.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-04 23:11:22 +01:00
Rémi Bernon 84b7faeb52 widl: Factor and cleanup coclass type declaration and definition.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-04 23:11:22 +01:00
Rémi Bernon 6a1b6a20a3 widl: Remove constant t parameter from find_type_or_error.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-04 23:11:22 +01:00
Rémi Bernon b3f807a142 widl: Remove useless find_type_or_error2 helper.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-04 23:11:22 +01:00
Rémi Bernon 8233b3d537 widl: Support WinRT eventadd/eventremove attributes.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-01 10:50:17 +01:00
Rémi Bernon 1a62712e25 widl: Support WinRT flags attribute parsing.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-01 10:50:12 +01:00
Rémi Bernon f46c077d5e widl: Support WinRT runtimeclass type parsing.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-01-28 09:41:46 +01:00
Rémi Bernon 73e0f5e212 widl: Support WinRT exclusiveto attribute parsing.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-01-26 19:26:22 +01:00
Rémi Bernon 1abdd8c89a widl: Support WinRT mta threading attribute parsing.
As an alias to free-threaded model.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-01-26 19:26:19 +01:00
Rémi Bernon 2129e335f2 widl: Support WinRT marshaling_behavior attribute parsing.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-01-25 21:04:04 +01:00
Jacek Caban 6653a381cb widl: Don't apply call_as methods to async interface.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-12-18 16:25:02 +01:00
Rémi Bernon 54035a2101 widl: Support WinRT contract attribute.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-12-01 19:50:04 +01:00
Rémi Bernon ee490ee26c widl: Support WinRT apicontract type.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-12-01 19:49:52 +01:00
Rémi Bernon 19b5f3e060 widl: Support WinRT contractversion attribute parsing.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-12-01 19:49:49 +01:00
Rémi Bernon 13592f0cdb widl: Add abi_prefix parameter to format_namespace.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-12-01 19:49:47 +01:00
Kevin Puetz 7afd550f34 widl: Parse attribute custom(guid,expr).
Signed-off-by: Kevin Puetz <PuetzKevinA@JohnDeere.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-11-18 22:27:51 +01:00
Rémi Bernon 92eb5ef5a1 widl: Support repetition for some attributes.
Some attributes can be specified multiple times, this is the case for
instance for "custom" attribute, as well as WinRT "static".

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: PuetzKevinA@JohnDeere.com
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-11-16 21:06:18 +01:00
Eric Kohl ba72ef6c22 widl: Add the [allocate] acf attribute.
Signed-off-by: Eric Kohl <eric.kohl@reactos.org>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-10-27 21:04:46 +01:00
Nikolay Sivov d7b166976d widl: Allow [restricted] for coclass-es.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-09-24 15:03:32 +02:00
Nikolay Sivov 0a49202109 widl: Allow [hidden] attribute on enum members.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-09-23 18:42:51 +02:00
Nikolay Sivov 8eb756c699 widl: Enable [hidden] attribute for enums.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-09-23 18:42:31 +02:00
Rémi Bernon 280932536f widl: Support fully qualified names in WinRT mode.
Interfaces are going to reference each other across namespaces, so this
implements a type lookup with the full name.

It supports the following idl syntax in WinRT mode:

    #ifdef __WIDL__
    #pragma winrt ns_prefix
    #endif

    import "wtypes.idl";

    namespace Windows {
        namespace Foo {
            [object]
            interface IFoo {}
        }
        namespace Bar {
            [object]
            interface IBar { HRESULT DoBar([in] Windows.Foo.IFoo *foo); }
        }
    }

That was previously failing to parse the Windows.Foo.IFoo part and to
lookup the corresponding type.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-09-07 21:07:00 +02:00
Rémi Bernon f4f612a077 widl: Search for known types in current namespace.
Fixes the following error with this sample idl:

    #ifdef __WIDL__
    #pragma winrt ns_prefix
    #endif

    import "wtypes.idl";

    namespace Windows {
        [object]
        interface IFoo {}

        [object]
        interface IBar { HRESULT DoBar([in] IFoo *foo); }
    }

$ widl -o windows.foo.h windows.foo.idl
windows.foo.idl:13: error: type 'IFoo' not found

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-09-07 21:07:00 +02:00
Jacek Caban 26ad9a7ba3 widl: Check dispinterfaces for duplicated methods.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-02-04 21:30:27 +01:00
Zebediah Figura 56995dd322 widl: Output a registry script for all interfaces written into the typelib.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=46005
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-01-30 16:22:33 +01:00
Alexandre Julliard 264d8884d5 widl: Add strmake() helper.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-11-02 13:55:16 +01:00
Richard Pospesel 4b1dfa6037 widl: Add the typedef to the type library if the aliasee is an anonymous UDT.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=47050
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-08-21 20:04:05 +02:00
Zebediah Figura 732f67ed38 widl: Generate a name for the encapsulated union type.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-08-21 20:03:52 +02:00
Richard Pospesel 181cafcd52 widl: Fail compilation if an incomplete union or enum is used in a remoted field.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-08-21 09:33:57 +02:00
Zebediah Figura 833639bd09 widl: Create exactly one type_t object per named union type.
Based on a patch by Richard Pospesel.

Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-08-20 09:08:54 +02:00
Zebediah Figura 42321d7a11 widl: Create exactly one type_t object per named structure type.
Regardless of whether we are writing a typelib.

Based on a patch by Richard Pospesel.

Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-08-20 09:08:51 +02:00
Zebediah Figura 55234f65a8 widl: Track whether the type has been defined yet in the statement_t and var_t structures.
Based on a patch by Richard Pospesel.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=47149
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-08-20 09:08:48 +02:00
Zebediah Figura 60d668631f widl: Don't store the default pointer type in the type_t structure.
This fixes type format string generation for the following IDL:

typedef int *intp;
[pointer_default(ref)] interface IRef {
    void a(intp *a);
}
[pointer_default(unique)] interface IUnique {
    void b(intp *a);
}

Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-08-19 11:29:28 +02:00
Zebediah Figura 5cc3548299 widl: Store the "inline" function specifier inside the decl_spec_t structure.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-08-19 11:29:28 +02:00
Richard Pospesel 7e4da76689 widl: Store the "const" type qualifier inside the decl_spec_t structure.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-08-19 11:29:28 +02:00
Zebediah Figura df948ccc05 widl: Fix nesting of functions, pointers, and arrays.
This is actually broken in MIDL, even as recent as the version shipped with
the Windows 10 SDK, but it makes our code simpler, so there's no reason not
to do it right.

Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-08-19 11:29:28 +02:00
Richard Pospesel f131795b30 widl: Pass a decl_spec_t to type_new_alias().
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-08-16 10:09:33 +02:00
Richard Pospesel d4dfbb630f widl: Pass a decl_spec_t to type_new_array().
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-08-16 10:09:29 +02:00
Richard Pospesel e63df7f7bf widl: Store the aliasee as a decl_spec_t structure.
Signed-off-by: Richard Pospesel <richard@torproject.org>
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-08-15 10:22:40 +02:00
Zebediah Figura c5ab9d01be widl: Use type_iface_get_inherit() in check_async_uuid().
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-08-15 10:22:19 +02:00
Zebediah Figura b4fe4ccc96 widl: Introduce type_iface_get_async_iface().
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-08-15 10:22:14 +02:00