Re: [Mingw-w64-public] Using midl/widl with MinGW
-Ursprüngliche Nachricht- Von: Biswapriyo Nath [mailto:nathbap...@gmail.com] Gesendet: Samstag, 2. Mai 2020 10:47 An: mingw-w64-public@lists.sourceforge.net Betreff: Re: [Mingw-w64-public] Using midl/widl with MinGW Looking at the errors, it seems that the code is missing some include headers. For example, IUnknown_QueryInterface_Proxy is in unknwnbase.h and IRpcStubBufferVtbl is in objidlbase.h.Try to add `import "unknwn.idl";` in the IDL file that you want to compile. If you have a simple, minimal, reproducible code example[1] please provide it. It will help to debug the issue quickly. And for msys2, check if you've installed mingw-w64-x86_64-toolchain (i686 for 32bit) group package properly. [1]: https://stackoverflow.com/help/minimal-reproducible-example Hi, although I do not have unknwn.idl directly imported, it is imported through the oaidl.idl. The same (from midl) generated code compiles fine with Embarcaderos compiler, which uses its own headers. They are nearly identical to those from the windows sdk. My minimum example is attached, when I ran the response file with "MIDL Compiler Version 8.01.0622" the initial error is: C:/msys64/mingw32/i686-w64-mingw32/include/_mingw.h(581) : error MIDL2025 : syntax error : expecting a type specification or a storage specifer or a type qualifier near "__inline__" I've attached the patch to fix this. With gcc dlldata.c proxy.c example_i.c I still get 'IUnknown_QueryInterface_Proxy' undeclared here (not in a function) Adding -DWIDL_C_INLINE_WRAPPERS -DCOBJMACROS spams a lot of similar errors: c:/msys64/mingw32/i686-w64-mingw32/include/unknwnbase.h:152:1: error: multiple storage classes in declaration specifiers 152 | static FORCEINLINE HRESULT IUnknown_QueryInterface(IUnknown* This,REFIID riid,void **ppvObject) { Precompiled (also attached) this results to static extern __inline__ __attribute__((__always_inline__,__gnu_inline__)) HRESULT IUnknown_QueryInterface(IUnknown* This,const IID *const riid,void **ppvObject) { Compiling it with g++ results in the same errors I've mentioned in the initial message. When I compile the Code with bcc32c (the Clang based Embarcadero Compiler) it compiles (and runs, because that's what we use right now). I've also attached the command line for bcc32c which is rather long. You may notice -DWIN32 and -DREGISTER_PROXY_DLL, I've also tried to add that to the gcc call which doesn't change anything. With widl the wine headers are obviously still missing. There is no package called "mingw-w64-x86_64-toolchain", so I assume you just meant the toolchain. I've mingw32/mingw-w64-i686-{gcc|gdb|make|tools-git} and many more. The same for 64 Bit, but right now I focused on 32 Bit. Are there any other packages I need? I think my compiler is running fine, because I've already compiled Qt, LLVM, qbs, QtCreator, and some other programs. [1] Precompiled with GCC: https://nopaste.nl/EbYeIl8bvy [2] Precompiled with GCC and -DWIDL_C_INLINE_WRAPPERS -DCOBJMACROS: https://nopaste.nl/4NwyiSWFmu [3] Precompiled with bcc32c: https://nopaste.nl/T1N52sHZP4 --- Mit freundlichen Grüßen With Best Regards Björn Schäpers Entwicklung Systemsoftware Mimot GmbH --- __ MIMOT GmbH, Berner Weg 11, D-79539 Lörrach, Telefon +49-7621-9578-0, Telefax +49-7621-9578-10, www.mimot.com Geschäftsführer: Jürgen Philipp • Amtsgericht Freiburg HRB 705553 • UST-ID-Nr. DE 272524976 ___ Mingw-w64-public mailing list Mingw-w64-public@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
Re: [Mingw-w64-public] import dvdif.idl and wincodecsdk.idl from wine
Pushed to git. Thanks, Jacek ___ Mingw-w64-public mailing list Mingw-w64-public@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
[Mingw-w64-public] [PATCH] headers/ddk: add wdmsec.h file
... From 913cd011290d5f336dd02e11222acb6102c9b6e8 Mon Sep 17 00:00:00 2001 From: Biswapriyo Nath Date: Tue, 5 May 2020 00:55:46 +0530 Subject: [PATCH] headers/ddk: add wdmsec.h file Signed-off-by: Biswapriyo Nath --- mingw-w64-headers/ddk/include/ddk/wdmsec.h | 63 ++ 1 file changed, 63 insertions(+) create mode 100644 mingw-w64-headers/ddk/include/ddk/wdmsec.h diff --git a/mingw-w64-headers/ddk/include/ddk/wdmsec.h b/mingw-w64-headers/ddk/include/ddk/wdmsec.h new file mode 100644 index 000..3e5d011 --- /dev/null +++ b/mingw-w64-headers/ddk/include/ddk/wdmsec.h @@ -0,0 +1,63 @@ +/** + * This file has no copyright assigned and is placed in the Public Domain. + * This file is part of the mingw-w64 runtime package. + * No warranty is given; refer to the file DISCLAIMER.PD within this package. + */ + +#ifndef _WDMSEC_H_ +#define _WDMSEC_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +extern const UNICODE_STRING SDDL_DEVOBJ_KERNEL_ONLY; +#define SDDL_DEVOBJ_INF_SUPPLIED SDDL_DEVOBJ_KERNEL_ONLY + +extern const UNICODE_STRING SDDL_DEVOBJ_SYS_ALL; +extern const UNICODE_STRING SDDL_DEVOBJ_SYS_ALL_ADM_ALL; +extern const UNICODE_STRING SDDL_DEVOBJ_SYS_ALL_ADM_RX; +extern const UNICODE_STRING SDDL_DEVOBJ_SYS_ALL_ADM_RWX_WORLD_R; +extern const UNICODE_STRING SDDL_DEVOBJ_SYS_ALL_ADM_RWX_WORLD_R_RES_R; +extern const UNICODE_STRING SDDL_DEVOBJ_SYS_ALL_ADM_RWX_WORLD_RW_RES_R; +extern const UNICODE_STRING SDDL_DEVOBJ_SYS_ALL_ADM_RWX_WORLD_RWX_RES_RWX; + +#undef IoCreateDeviceSecure +#define IoCreateDeviceSecure WdmlibIoCreateDeviceSecure + +NTSTATUS +WdmlibIoCreateDeviceSecure( + PDRIVER_OBJECT DriverObject, + ULONG DeviceExtensionSize, + PUNICODE_STRING DeviceName, + DEVICE_TYPE DeviceType, + ULONG DeviceCharacteristics, + BOOLEAN Exclusive, + PCUNICODE_STRING DefaultSDDLString, + LPCGUID DeviceClassGuid, + PDEVICE_OBJECT *DeviceObject +); + +#undef RtlInitUnicodeStringEx +#define RtlInitUnicodeStringEx WdmlibRtlInitUnicodeStringEx + +NTSTATUS +WdmlibRtlInitUnicodeStringEx( + PUNICODE_STRING DestinationString, + PCWSTR SourceString +); + +#undef IoValidateDeviceIoControlAccess +#define IoValidateDeviceIoControlAccess WdmlibIoValidateDeviceIoControlAccess + +NTSTATUS +WdmlibIoValidateDeviceIoControlAccess( + PIRP Irp, + ULONG RequiredAccess +); + +#ifdef __cplusplus +} +#endif + +#endif /* _WDMSEC_H_ */ -- 2.26.2 ___ Mingw-w64-public mailing list Mingw-w64-public@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
Re: [Mingw-w64-public] How to compile a module including dwrite.h with C compiler?
On 5/4/20 2:22 PM, Ruslan Garipov wrote: Hello! The IDWriteTextLayout[1] interface inherits from the IDWriteTextFormat[2] one. Both declare, for example, GetFontCollection() members. Therefore, IDWriteTextLayout exploits C++ function overloading, which isn't available in C. And that's where I failed: I need to compile a C code module including dwrite.h header using CC: $ cc -x c dwrite.h -o /dev/null 2>&1 | fgrep GetFontCollection dwrite.h:2006:15: error: duplicate member 'GetFontCollection' 2006 | STDMETHOD(GetFontCollection)(THIS_ Of course, there are other "duplicated member functions" like GetFontFamilyNameLength(), GetFontFamilyName(), etc. How can I compile my C code? Am I doomed to use ITypeInfo and IDispatch for IDWriteTextLayout objects in C code? You can't compile it as C it looks like, as is. For Wine this header is built from dwrite.idl (that does not exist in SDK), and widl was made to handle such cases by renaming vtable field of overloaded method. Second part of this quirk is that inline wrappers like IDWriteTextLayout_GetFontCollection() are only emitted for overloaded variants. It gets worse in newer dwrite headers, when same interface is using overloaded variants in its own methods list. I didn't get the part about ITypeInfo/IDispatch, how are do you plan to apply it for dwrite that doesn't use automation-capable objects? Oh, by the way, revision 75bdd3 misses a parenthesis: diff --git a/mingw-w64-headers/include/dwrite.h b/mingw-w64-headers/include/dwrite.h index 9a0cc02d..943cd738 100644 --- a/mingw-w64-headers/include/dwrite.h +++ b/mingw-w64-headers/include/dwrite.h @@ -1430,7 +1430,7 @@ DECLARE_INTERFACE_(IDWriteLocalFontFileLoader,IDWriteFontFileLoader) STDMETHOD_(ULONG, Release)(THIS) PURE; /* IDWriteFontFileLoader methods */ - STDMETHOD(CreateStreamFromKey(THIS_ const void *fontFileReferenceKey,UINT32 fontFileReferenceKeySize,IDWriteFontFileStream **fileStream) PURE; + STDMETHOD(CreateStreamFromKey)(THIS_ const void *fontFileReferenceKey,UINT32 fontFileReferenceKeySize,IDWriteFontFileStream **fileStream) PURE; #endif /* IDWriteLocalFontFileLoader methods */ Please send a patch for that. ___ Mingw-w64-public mailing list Mingw-w64-public@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mingw-w64-public ___ Mingw-w64-public mailing list Mingw-w64-public@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
Re: [Mingw-w64-public] How to compile a module including dwrite.h with C compiler?
Can you provide the project link which you want to compile? ___ Mingw-w64-public mailing list Mingw-w64-public@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
[Mingw-w64-public] How to compile a module including dwrite.h with C compiler?
Hello! The IDWriteTextLayout[1] interface inherits from the IDWriteTextFormat[2] one. Both declare, for example, GetFontCollection() members. Therefore, IDWriteTextLayout exploits C++ function overloading, which isn't available in C. And that's where I failed: I need to compile a C code module including dwrite.h header using CC: $ cc -x c dwrite.h -o /dev/null 2>&1 | fgrep GetFontCollection dwrite.h:2006:15: error: duplicate member 'GetFontCollection' 2006 | STDMETHOD(GetFontCollection)(THIS_ Of course, there are other "duplicated member functions" like GetFontFamilyNameLength(), GetFontFamilyName(), etc. How can I compile my C code? Am I doomed to use ITypeInfo and IDispatch for IDWriteTextLayout objects in C code? Oh, by the way, revision 75bdd3 misses a parenthesis: diff --git a/mingw-w64-headers/include/dwrite.h b/mingw-w64-headers/include/dwrite.h index 9a0cc02d..943cd738 100644 --- a/mingw-w64-headers/include/dwrite.h +++ b/mingw-w64-headers/include/dwrite.h @@ -1430,7 +1430,7 @@ DECLARE_INTERFACE_(IDWriteLocalFontFileLoader,IDWriteFontFileLoader) STDMETHOD_(ULONG, Release)(THIS) PURE; /* IDWriteFontFileLoader methods */ -STDMETHOD(CreateStreamFromKey(THIS_ const void *fontFileReferenceKey,UINT32 fontFileReferenceKeySize,IDWriteFontFileStream **fileStream) PURE; +STDMETHOD(CreateStreamFromKey)(THIS_ const void *fontFileReferenceKey,UINT32 fontFileReferenceKeySize,IDWriteFontFileStream **fileStream) PURE; #endif /* IDWriteLocalFontFileLoader methods */ [1] https://docs.microsoft.com/en-us/windows/win32/api/dwrite/nn-dwrite-idwritetextlayout [2] https://docs.microsoft.com/en-us/windows/win32/api/dwrite/nn-dwrite-idwritetextformat ___ Mingw-w64-public mailing list Mingw-w64-public@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
[Mingw-w64-public] gcc is failing with "bad address" error
Hello I am using MSYS2 with mingw-w64. I have updated everything gcc version : 9.3.0 Several packages that I am building fail with the error: /mingw64/bin/x86_64-w64-mingw32-gcc: Bad address Does someone know what is happening, here ? thank you Vincent Torri ___ Mingw-w64-public mailing list Mingw-w64-public@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mingw-w64-public