Needed by Photoshop 2024.
-- v2: coremessaging: Add CreateDispatcherQueueController() stub. include: Add dispatcherqueue.idl file. widl: Use mangled namespace names in typedef pointer types. coremessaging: Add stub DLL.
From: Mohamad Al-Jaf mohamadaljaf@gmail.com
Needed by Photoshop 2024. --- configure.ac | 1 + dlls/coremessaging/Makefile.in | 1 + dlls/coremessaging/coremessaging.spec | 31 +++++++++++++++++++++++++++ 3 files changed, 33 insertions(+) create mode 100644 dlls/coremessaging/Makefile.in create mode 100644 dlls/coremessaging/coremessaging.spec
diff --git a/configure.ac b/configure.ac index 3f54230b46b..231ec7f17d6 100644 --- a/configure.ac +++ b/configure.ac @@ -2494,6 +2494,7 @@ WINE_CONFIG_MAKEFILE(dlls/comsvcs/tests) WINE_CONFIG_MAKEFILE(dlls/concrt140) WINE_CONFIG_MAKEFILE(dlls/concrt140/tests) WINE_CONFIG_MAKEFILE(dlls/connect) +WINE_CONFIG_MAKEFILE(dlls/coremessaging) WINE_CONFIG_MAKEFILE(dlls/credui) WINE_CONFIG_MAKEFILE(dlls/credui/tests) WINE_CONFIG_MAKEFILE(dlls/crtdll) diff --git a/dlls/coremessaging/Makefile.in b/dlls/coremessaging/Makefile.in new file mode 100644 index 00000000000..2d43a9077cd --- /dev/null +++ b/dlls/coremessaging/Makefile.in @@ -0,0 +1 @@ +MODULE = coremessaging.dll diff --git a/dlls/coremessaging/coremessaging.spec b/dlls/coremessaging/coremessaging.spec new file mode 100644 index 00000000000..f8c31e6fbdb --- /dev/null +++ b/dlls/coremessaging/coremessaging.spec @@ -0,0 +1,31 @@ +@ stub CoreUICallComputeMaximumMessageSize +@ stub CoreUICallCreateConversationHost +@ stub CoreUICallCreateEndpointHost +@ stub CoreUICallCreateEndpointHostWithSendPriority +@ stub CoreUICallGetAddressOfParameterInBuffer +@ stub CoreUICallReceive +@ stub CoreUICallSend +@ stub CoreUICallSendVaList +@ stub CoreUIConfigureTestHost +@ stub CoreUIConfigureUserIntegration +@ stub CoreUICreate +@ stub CoreUICreateAnonymousStream +@ stub CoreUICreateEx +@ stub CoreUIInitializeTestService +@ stub CoreUIOpenExisting +@ stub CoreUIRouteToTestRegistrar +@ stub CoreUIUninitializeTestService +@ stub CreateDispatcherQueueController +@ stub CreateDispatcherQueueForCurrentThread +@ stdcall -private DllCanUnloadNow() +@ stub DllGetActivationFactory +@ stub DllGetClassObject +@ stub GetDispatcherQueueForCurrentThread +@ stub MsgBlobCreateShared +@ stub MsgBlobCreateStack +@ stub MsgBufferShare +@ stub MsgRelease +@ stub MsgStringCreateShared +@ stub MsgStringCreateStack +@ stub ServiceMain +@ stub SvchostPushServiceGlobals
From: Rémi Bernon rbernon@codeweavers.com
--- tools/widl/header.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/tools/widl/header.c b/tools/widl/header.c index 624d38094f9..fd02fb1c291 100644 --- a/tools/widl/header.c +++ b/tools/widl/header.c @@ -819,8 +819,8 @@ static void write_generic_handle_routines(FILE *header)
static void write_typedef(FILE *header, type_t *type, int declonly) { - type_t *t = type_alias_get_aliasee_type(type); - if (winrt_mode && t->namespace && !is_global_namespace(t->namespace)) + type_t *t = type_alias_get_aliasee_type(type), *root = type_pointer_get_root_type(t); + if (winrt_mode && root->namespace && !is_global_namespace(root->namespace)) { fprintf(header, "#ifndef __cplusplus\n"); fprintf(header, "typedef "); @@ -829,12 +829,12 @@ static void write_typedef(FILE *header, type_t *type, int declonly) if (type_get_type_detect_alias(t) != TYPE_ENUM) { fprintf(header, "#else /* __cplusplus */\n"); - write_namespace_start(header, t->namespace); + if (t->namespace && !is_global_namespace(t->namespace)) write_namespace_start(header, t->namespace); indent(header, 0); fprintf(header, "typedef "); write_type_v(header, type_alias_get_aliasee(type), FALSE, TRUE, type->name, NAME_DEFAULT); fprintf(header, ";\n"); - write_namespace_end(header, t->namespace); + if (t->namespace && !is_global_namespace(t->namespace)) write_namespace_end(header, t->namespace); } fprintf(header, "#endif /* __cplusplus */\n\n"); }
From: Mohamad Al-Jaf mohamadaljaf@gmail.com
--- include/Makefile.in | 1 + include/dispatcherqueue.idl | 48 +++++++++++++++++++++++++++++++++++++ 2 files changed, 49 insertions(+) create mode 100644 include/dispatcherqueue.idl
diff --git a/include/Makefile.in b/include/Makefile.in index fa8c096eabd..81ff6cfa634 100644 --- a/include/Makefile.in +++ b/include/Makefile.in @@ -239,6 +239,7 @@ SOURCES = \ dinput.h \ dinputd.h \ directmanipulation.idl \ + dispatcherqueue.idl \ dispdib.h \ dispex.idl \ dlgs.h \ diff --git a/include/dispatcherqueue.idl b/include/dispatcherqueue.idl new file mode 100644 index 00000000000..7a4be6ede0e --- /dev/null +++ b/include/dispatcherqueue.idl @@ -0,0 +1,48 @@ +/* + * Copyright (C) 2024 Mohamad Al-Jaf + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#ifdef __WIDL__ +#pragma winrt ns_prefix +#endif + +import "windows.system.idl"; + +typedef Windows.System.IDispatcherQueue *PDISPATCHERQUEUE; +typedef Windows.System.IDispatcherQueueController *PDISPATCHERQUEUECONTROLLER; + +typedef enum DISPATCHERQUEUE_THREAD_APARTMENTTYPE +{ + DQTAT_COM_NONE = 0, + DQTAT_COM_ASTA = 1, + DQTAT_COM_STA = 2, +} DISPATCHERQUEUE_THREAD_APARTMENTTYPE; + +typedef enum DISPATCHERQUEUE_THREAD_TYPE +{ + DQTYPE_THREAD_DEDICATED = 1, + DQTYPE_THREAD_CURRENT = 2, +} DISPATCHERQUEUE_THREAD_TYPE; + +typedef struct DispatcherQueueOptions +{ + DWORD dwSize; + DISPATCHERQUEUE_THREAD_TYPE threadType; + DISPATCHERQUEUE_THREAD_APARTMENTTYPE apartmentType; +} DispatcherQueueOptions; + +[local] HRESULT __stdcall CreateDispatcherQueueController(DispatcherQueueOptions options, PDISPATCHERQUEUECONTROLLER *queue_controller);
From: Mohamad Al-Jaf mohamadaljaf@gmail.com
Needed by Photoshop 2024. --- dlls/coremessaging/Makefile.in | 3 +++ dlls/coremessaging/coremessaging.spec | 2 +- dlls/coremessaging/main.c | 30 +++++++++++++++++++++++++++ 3 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 dlls/coremessaging/main.c
diff --git a/dlls/coremessaging/Makefile.in b/dlls/coremessaging/Makefile.in index 2d43a9077cd..0aa0fc43a9b 100644 --- a/dlls/coremessaging/Makefile.in +++ b/dlls/coremessaging/Makefile.in @@ -1 +1,4 @@ MODULE = coremessaging.dll + +SOURCES = \ + main.c diff --git a/dlls/coremessaging/coremessaging.spec b/dlls/coremessaging/coremessaging.spec index f8c31e6fbdb..58f2be2dc8e 100644 --- a/dlls/coremessaging/coremessaging.spec +++ b/dlls/coremessaging/coremessaging.spec @@ -15,7 +15,7 @@ @ stub CoreUIOpenExisting @ stub CoreUIRouteToTestRegistrar @ stub CoreUIUninitializeTestService -@ stub CreateDispatcherQueueController +@ stdcall CreateDispatcherQueueController(long long long ptr) @ stub CreateDispatcherQueueForCurrentThread @ stdcall -private DllCanUnloadNow() @ stub DllGetActivationFactory diff --git a/dlls/coremessaging/main.c b/dlls/coremessaging/main.c new file mode 100644 index 00000000000..4944f28a49a --- /dev/null +++ b/dlls/coremessaging/main.c @@ -0,0 +1,30 @@ +/* WinRT CoreMessaging Implementation + * + * Copyright (C) 2024 Mohamad Al-Jaf + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include "dispatcherqueue.h" +#include "wine/debug.h" + +WINE_DEFAULT_DEBUG_CHANNEL(messaging); + +HRESULT WINAPI CreateDispatcherQueueController( DispatcherQueueOptions options, PDISPATCHERQUEUECONTROLLER *queue_controller ) +{ + FIXME( "options.dwSize = %lu, options.threadType = %d, options.apartmentType = %d, queue_controller %p stub!\n", + options.dwSize, options.threadType, options.apartmentType, queue_controller ); + return E_NOTIMPL; +}
On Fri May 31 06:06:37 2024 +0000, Rémi Bernon wrote:
I don't think this will work, the C typedefs are not written with the namespace-mangled interface but a different forward declared interface. With this widl fix https://gitlab.winehq.org/rbernon/wine/-/commit/73d264e61081c4e81bce43dde4e8... you should then instead be able to do this, which will be correct:
typedef Windows.System.IDispatcherQueue *PDISPATCHERQUEUE; typedef Windows.System.IDispatcherQueueController *PDISPATCHERQUEUECONTROLLER;
You're right, I missed that. Thanks, your fix works perfectly and generates the right typedefs.
On Fri May 31 06:07:43 2024 +0000, Aida Jonikienė wrote:
Looking at my Windows 10 installation I can see CoreMessaging.dll is present in both System32 and SysWOW64 (so not building it doesn't match Windows behavior) :frog:
Thanks for looking into it, I wasn't aware it fails to build on i386. I only tested it on x86_64 because since 2020, Photoshop only supports 64-bit. So we could stub it for 32 bit, but that doesn't seem to be correct to split them up like that. AFAIK, only legacy modules and mangled exports like those found in MSVC are assigned a specific architecture. Also, the module is present in WOW64.
On Fri May 31 06:08:09 2024 +0000, Alexandre Julliard wrote:
You can use `long long long ptr`. It won't display the right thing in +relay on 64-bit but that shouldn't matter.
Thanks, this works.
This merge request was approved by Mohamad Al-Jaf.
This merge request was approved by Rémi Bernon.