[PATCH v2 0/1] MR2376: wintypes: Stub RoIsApiContractMajorVersionPresent().
This is one of the stubs required for MS Office 365. -- v2: wintypes: Stub RoIsApiContractMajorVersionPresent(). https://gitlab.winehq.org/wine/wine/-/merge_requests/2376
From: Daniel Tang <danielzgtg.opensource(a)gmail.com> --- dlls/wintypes/main.c | 7 +++++++ dlls/wintypes/wintypes.spec | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/dlls/wintypes/main.c b/dlls/wintypes/main.c index 74eda4af5ce..7065650db58 100644 --- a/dlls/wintypes/main.c +++ b/dlls/wintypes/main.c @@ -355,6 +355,13 @@ HRESULT WINAPI DllGetActivationFactory(HSTRING classid, IActivationFactory **fac return S_OK; } +HRESULT WINAPI RoIsApiContractMajorVersionPresent(const WCHAR *name, UINT16 major, BOOL *result) +{ + /* For some reason MS Office crashes if a logging statement is added here */ + *result = FALSE; + return S_OK; +} + HRESULT WINAPI RoResolveNamespace(HSTRING name, HSTRING windowsMetaDataDir, DWORD packageGraphDirsCount, const HSTRING *packageGraphDirs, DWORD *metaDataFilePathsCount, HSTRING **metaDataFilePaths, diff --git a/dlls/wintypes/wintypes.spec b/dlls/wintypes/wintypes.spec index 305344fef42..086332e0d69 100644 --- a/dlls/wintypes/wintypes.spec +++ b/dlls/wintypes/wintypes.spec @@ -5,7 +5,7 @@ @ stub RoCreatePropertySetSerializer @ stub RoGetBufferMarshaler @ stub RoGetMetaDataFile -@ stub RoIsApiContractMajorVersionPresent +@ stdcall RoIsApiContractMajorVersionPresent(wstr long ptr) @ stub RoIsApiContractPresent @ stub RoParseTypeName @ stdcall RoResolveNamespace(ptr ptr long ptr ptr ptr ptr ptr) -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/2376
On Sat Mar 11 15:23:10 2023 +0000, **** wrote:
Jactry Zeng replied on the mailing list: ``` On Sat, Mar 11, 2023 at 1:26 PM Daniel Tang <wine(a)gitlab.winehq.org> wrote:
From: Daniel Tang <danielzgtg.opensource(a)gmail.com>
+HRESULT WINAPI comments(const WCHAR *name, UINT16 major, BOOL *result) +{ + // For some reason MS Office crashes if a logging statement is added
here This is interesting, but I think it will be better to dig a little bit deeper and figure out its root. Other than that, please use C89 standard comments. Thanks ``` Thank you for teaching me the fact that this style of comment isn't in C89.
-- https://gitlab.winehq.org/wine/wine/-/merge_requests/2376#note_26723
Alex Henrie (@alexhenrie) commented about dlls/wintypes/main.c:
return S_OK; }
+HRESULT WINAPI RoIsApiContractMajorVersionPresent(const WCHAR *name, UINT16 major, BOOL *result) +{ + /* For some reason MS Office crashes if a logging statement is added here */
This may be completely irrelevant, but sometimes adding DECLSPEC_HOTPATCH to a function resolves strange crashes. Ideally we would include DECLSPEC_HOTPATCH in the definition of WINAPI, but GCC doesn't like it being slipped onto function pointers, so we've just been adding it on an as-needed basis. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/2376#note_26747
I have noticed that wintypes.dll is used in a lot of Microsoft software, including dot net framework. Minecraft Windows 10 laucher (The on that can launch bedrock) also require a working wintypes.dll -- https://gitlab.winehq.org/wine/wine/-/merge_requests/2376#note_26763
@Fox2Code Can you be specific about which Minecraft launcher? The official (NOT bedrock?) on at https://launcher.mojang.com/download/MinecraftInstaller.exe gives me the following: ``` 0164:fixme:ntdll:NtQuerySystemInformation info_class SYSTEM_PERFORMANCE_INFORMATION Unhandled Exception: System.IO.FileNotFoundException: Could not load file or assembly 'Windows.Foundation.UniversalApiContract, Version=7.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. File name: 'Windows.Foundation.UniversalApiContract, Version=7.0.0.0, Culture=neutral, PublicKeyToken=null' at MinecraftInstaller.App.Main () [0x0007d] in <752450fc637c4f0fa7ec1cf133b65620>:0 [ERROR] FATAL UNHANDLED EXCEPTION: System.IO.FileNotFoundException: Could not load file or assembly 'Windows.Foundation.UniversalApiContract, Version=7.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. File name: 'Windows.Foundation.UniversalApiContract, Version=7.0.0.0, Culture=neutral, PublicKeyToken=null' ``` The one at https://launcher.mojang.com/download/MinecraftInstaller.msi doesn't crash and appears fine:  I Googled the unofficial one, and it gave me the following: ``` 0138:fixme:netprofm:connection_point_Advise 0412AB90, 04022C18, 05C6FB04 - semi-stub Application could not be started, or no application associated with the specified file. ShellExecuteEx failed: Bad EXE format for Z:\home\home\Downloads\net6.0-windows10.0.17763.0\BedrockLauncher.exe. ```
also require a working wintypes.dll
Neither crash mentions `wintypes.dll`, so they appear to be therefore off-topic for this MR. Please file a new bug at https://bugs.winehq.org/buglist.cgi?quicksearch=minecraft
including dot net framework
I use https://wiki.winehq.org/Mono instead of Microsoft's .Net framework. If .Net isn't working please look at the bug tracker -- https://gitlab.winehq.org/wine/wine/-/merge_requests/2376#note_26803
participants (4)
-
Alex Henrie (@alexhenrie) -
Daniel Tang -
Daniel Tang (@danielzgtg) -
Loïc Rebmeister