[PATCH 0/6] MR9958: wminet_utils: Add dll.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=59223 This also requires a Wine Mono change to install the dll. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/9958
From: Esme Povirk <esme@codeweavers.com> --- configure.ac | 1 + dlls/wminet_utils/Makefile.in | 3 ++ dlls/wminet_utils/wminet_utils.spec | 65 +++++++++++++++++++++++++++++ loader/wine.inf.in | 2 + 4 files changed, 71 insertions(+) create mode 100644 dlls/wminet_utils/Makefile.in create mode 100644 dlls/wminet_utils/wminet_utils.spec diff --git a/configure.ac b/configure.ac index da4a0af4a60..3b0520b5cb7 100644 --- a/configure.ac +++ b/configure.ac @@ -3412,6 +3412,7 @@ WINE_CONFIG_MAKEFILE(dlls/wmadmod) WINE_CONFIG_MAKEFILE(dlls/wmasf) WINE_CONFIG_MAKEFILE(dlls/wmi) WINE_CONFIG_MAKEFILE(dlls/wmilib.sys) +WINE_CONFIG_MAKEFILE(dlls/wminet_utils) WINE_CONFIG_MAKEFILE(dlls/wmiutils) WINE_CONFIG_MAKEFILE(dlls/wmiutils/tests) WINE_CONFIG_MAKEFILE(dlls/wmp) diff --git a/dlls/wminet_utils/Makefile.in b/dlls/wminet_utils/Makefile.in new file mode 100644 index 00000000000..3157a076dcf --- /dev/null +++ b/dlls/wminet_utils/Makefile.in @@ -0,0 +1,3 @@ +MODULE = wminet_utils.dll + +EXTRADLLFLAGS = -Wb,--prefer-native diff --git a/dlls/wminet_utils/wminet_utils.spec b/dlls/wminet_utils/wminet_utils.spec new file mode 100644 index 00000000000..05ef2970523 --- /dev/null +++ b/dlls/wminet_utils/wminet_utils.spec @@ -0,0 +1,65 @@ +@ stub BeginEnumeration +@ stub BeginMethodEnumeration +@ stub BlessIWbemServices +@ stub BlessIWbemServicesObject +@ stub Clone +@ stub CloneEnumWbemClassObject +@ stub CompareTo +@ stub ConnectServerWmi +@ stub CreateClassEnumWmi +@ stub CreateInstanceEnumWmi +@ stub Delete +@ stub DeleteMethod +@ stub DllCanUnloadNow +@ stub DllGetClassObject +@ stub DllRegisterServer +@ stub DllUnregisterServer +@ stub EndEnumeration +@ stub EndMethodEnumeration +@ stub ExecNotificationQueryWmi +@ stub ExecQueryWmi +@ stub Get +@ stub GetCurrentApartmentType +@ stub GetDemultiplexedStub +@ stub GetErrorInfo +@ stub GetMethod +@ stub GetMethodOrigin +@ stub GetMethodQualifierSet +@ stub GetNames +@ stub GetObjectText +@ stub GetPropertyHandle +@ stub GetPropertyInfoByHandle +@ stub GetPropertyOrigin +@ stub GetPropertyQualifierSet +@ stub GetQualifierSet +@ stub InheritsFrom +@ stub Initialize +@ stub Lock +@ stub Next +@ stub NextMethod +@ stub Put +@ stub PutClassWmi +@ stub PutInstanceWmi +@ stub PutMethod +@ stub QualifierSet_BeginEnumeration +@ stub QualifierSet_Delete +@ stub QualifierSet_EndEnumeration +@ stub QualifierSet_Get +@ stub QualifierSet_GetNames +@ stub QualifierSet_Next +@ stub QualifierSet_Put +@ stub ReadDWORD +@ stub ReadPropertyValue +@ stub ReadQWORD +@ stub ResetSecurity +@ stub SetSecurity +@ stub SpawnDerivedClass +@ stub SpawnInstance +@ stub UFunc +@ stub Unlock +@ stub VerifyClientKey +@ stub WriteDWORD +@ stub WriteDouble +@ stub WritePropertyValue +@ stub WriteQWORD +@ stub WriteSingle diff --git a/loader/wine.inf.in b/loader/wine.inf.in index 80a4a062351..5bdb6455a06 100644 --- a/loader/wine.inf.in +++ b/loader/wine.inf.in @@ -763,6 +763,7 @@ HKLM,SOFTWARE\Microsoft\VisualStudio\14.0\VC\Runtimes\x86,"Version",2,"14.42.344 11,,regasm.exe,- 11,,servicemodelreg.exe,- 11,,presentationfontcache.exe,- +11,,wminet_utils.dll,- ; some programs are 64-bit only 11,,conhost.exe,- 11,,plugplay.exe,- @@ -827,6 +828,7 @@ HKLM,SOFTWARE\Microsoft\VisualStudio\14.0\VC\Runtimes\x86,"Version",2,"14.42.344 11,,regasm.exe,- 11,,servicemodelreg.exe,- 11,,presentationfontcache.exe,- +11,,wminet_utils.dll,- ; registration order matters for these 11,,msxml.dll 11,,msxml2.dll -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/9958
From: Esme Povirk <esme@codeweavers.com> --- dlls/wminet_utils/Makefile.in | 3 +++ dlls/wminet_utils/main.c | 31 +++++++++++++++++++++++++++++ dlls/wminet_utils/wminet_utils.spec | 2 +- 3 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 dlls/wminet_utils/main.c diff --git a/dlls/wminet_utils/Makefile.in b/dlls/wminet_utils/Makefile.in index 3157a076dcf..663265289ae 100644 --- a/dlls/wminet_utils/Makefile.in +++ b/dlls/wminet_utils/Makefile.in @@ -1,3 +1,6 @@ MODULE = wminet_utils.dll EXTRADLLFLAGS = -Wb,--prefer-native + +SOURCES = \ + main.c diff --git a/dlls/wminet_utils/main.c b/dlls/wminet_utils/main.c new file mode 100644 index 00000000000..62a4f04eee7 --- /dev/null +++ b/dlls/wminet_utils/main.c @@ -0,0 +1,31 @@ +/* + * Copyright 2026 Esme Povirk for CodeWeavers + * + * 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 <stdarg.h> + +#include "windef.h" +#include "winbase.h" + +#include "wine/debug.h" + +WINE_DEFAULT_DEBUG_CHANNEL(wminet_utils); + +HRESULT WINAPI Initialize(BOOLEAN bAllowIManagementObjectQI) { + TRACE("%i\n", bAllowIManagementObjectQI); + return S_OK; +} diff --git a/dlls/wminet_utils/wminet_utils.spec b/dlls/wminet_utils/wminet_utils.spec index 05ef2970523..f8ea154c5f1 100644 --- a/dlls/wminet_utils/wminet_utils.spec +++ b/dlls/wminet_utils/wminet_utils.spec @@ -33,7 +33,7 @@ @ stub GetPropertyQualifierSet @ stub GetQualifierSet @ stub InheritsFrom -@ stub Initialize +@ stdcall Initialize(long) @ stub Lock @ stub Next @ stub NextMethod -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/9958
From: Esme Povirk <esme@codeweavers.com> --- dlls/wminet_utils/main.c | 9 +++++++++ dlls/wminet_utils/wminet_utils.spec | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/dlls/wminet_utils/main.c b/dlls/wminet_utils/main.c index 62a4f04eee7..e6a9f36b324 100644 --- a/dlls/wminet_utils/main.c +++ b/dlls/wminet_utils/main.c @@ -21,10 +21,19 @@ #include "windef.h" #include "winbase.h" +#define COBJMACROS + +#include "objidl.h" + #include "wine/debug.h" WINE_DEFAULT_DEBUG_CHANNEL(wminet_utils); +HRESULT WINAPI GetCurrentApartmentType(int vFunc, IComThreadingInfo *ptr, APTTYPE *aptType) { + TRACE("%i %p %p\n", vFunc, ptr, aptType); + return IComThreadingInfo_GetCurrentApartmentType(ptr, aptType); +} + HRESULT WINAPI Initialize(BOOLEAN bAllowIManagementObjectQI) { TRACE("%i\n", bAllowIManagementObjectQI); return S_OK; diff --git a/dlls/wminet_utils/wminet_utils.spec b/dlls/wminet_utils/wminet_utils.spec index f8ea154c5f1..c07713ec37a 100644 --- a/dlls/wminet_utils/wminet_utils.spec +++ b/dlls/wminet_utils/wminet_utils.spec @@ -19,7 +19,7 @@ @ stub ExecNotificationQueryWmi @ stub ExecQueryWmi @ stub Get -@ stub GetCurrentApartmentType +@ stdcall GetCurrentApartmentType(long ptr ptr) @ stub GetDemultiplexedStub @ stub GetErrorInfo @ stub GetMethod -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/9958
From: Esme Povirk <esme@codeweavers.com> --- dlls/wminet_utils/Makefile.in | 1 + dlls/wminet_utils/main.c | 30 +++++++++++++++++++++++++++++ dlls/wminet_utils/wminet_utils.spec | 2 +- 3 files changed, 32 insertions(+), 1 deletion(-) diff --git a/dlls/wminet_utils/Makefile.in b/dlls/wminet_utils/Makefile.in index 663265289ae..2df888adc4f 100644 --- a/dlls/wminet_utils/Makefile.in +++ b/dlls/wminet_utils/Makefile.in @@ -1,4 +1,5 @@ MODULE = wminet_utils.dll +IMPORTS = ole32 EXTRADLLFLAGS = -Wb,--prefer-native diff --git a/dlls/wminet_utils/main.c b/dlls/wminet_utils/main.c index e6a9f36b324..47eed7a9426 100644 --- a/dlls/wminet_utils/main.c +++ b/dlls/wminet_utils/main.c @@ -23,12 +23,42 @@ #define COBJMACROS +#include "initguid.h" #include "objidl.h" +#include "wbemcli.h" #include "wine/debug.h" WINE_DEFAULT_DEBUG_CHANNEL(wminet_utils); +HRESULT WINAPI ConnectServerWmi(BSTR strNetworkResource, BSTR strUser, BSTR strPassword, + BSTR strLocale, long lSecurityFlags, BSTR strAuthority, IWbemContext *pCtx, + IWbemServices** ppNamespace, DWORD impLevel, DWORD authLevel) +{ + HRESULT hr; + IWbemLocator *locator; + + TRACE("%li %li\n", impLevel, authLevel); + + if (!ppNamespace) + return E_POINTER; + + *ppNamespace = NULL; + + hr = CoCreateInstance(&CLSID_WbemLocator, 0, CLSCTX_INPROC_SERVER, &IID_IWbemLocator, + (void**)&locator); + + if (SUCCEEDED(hr)) + { + hr = IWbemLocator_ConnectServer(locator, strNetworkResource, strUser, strPassword, + strLocale, lSecurityFlags, strAuthority, pCtx, ppNamespace); + + IWbemLocator_Release(locator); + } + + return hr; +} + HRESULT WINAPI GetCurrentApartmentType(int vFunc, IComThreadingInfo *ptr, APTTYPE *aptType) { TRACE("%i %p %p\n", vFunc, ptr, aptType); return IComThreadingInfo_GetCurrentApartmentType(ptr, aptType); diff --git a/dlls/wminet_utils/wminet_utils.spec b/dlls/wminet_utils/wminet_utils.spec index c07713ec37a..2a2f35bdead 100644 --- a/dlls/wminet_utils/wminet_utils.spec +++ b/dlls/wminet_utils/wminet_utils.spec @@ -5,7 +5,7 @@ @ stub Clone @ stub CloneEnumWbemClassObject @ stub CompareTo -@ stub ConnectServerWmi +@ stdcall ConnectServerWmi(wstr wstr wstr wstr long wstr ptr ptr long long) @ stub CreateClassEnumWmi @ stub CreateInstanceEnumWmi @ stub Delete -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/9958
From: Esme Povirk <esme@codeweavers.com> --- dlls/wminet_utils/main.c | 14 ++++++++++++++ dlls/wminet_utils/wminet_utils.spec | 2 +- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/dlls/wminet_utils/main.c b/dlls/wminet_utils/main.c index 47eed7a9426..ffea80b28fc 100644 --- a/dlls/wminet_utils/main.c +++ b/dlls/wminet_utils/main.c @@ -59,6 +59,20 @@ HRESULT WINAPI ConnectServerWmi(BSTR strNetworkResource, BSTR strUser, BSTR strP return hr; } +HRESULT WINAPI ExecQueryWmi(BSTR strQueryLanguage, BSTR strQuery, long lFlags, IWbemContext *pCtx, + IEnumWbemClassObject **ppEnum, DWORD authLevel, DWORD impLevel, IWbemServices *pCurrentNamespace, + BSTR strUser, BSTR strPassword, BSTR strAuthority) +{ + TRACE("%s %s %lx\n", debugstr_w(strQueryLanguage), debugstr_w(strQuery), lFlags); + + if (!ppEnum) + return E_POINTER; + + *ppEnum = NULL; + + return IWbemServices_ExecQuery(pCurrentNamespace, strQueryLanguage, strQuery, lFlags, pCtx, ppEnum); +} + HRESULT WINAPI GetCurrentApartmentType(int vFunc, IComThreadingInfo *ptr, APTTYPE *aptType) { TRACE("%i %p %p\n", vFunc, ptr, aptType); return IComThreadingInfo_GetCurrentApartmentType(ptr, aptType); diff --git a/dlls/wminet_utils/wminet_utils.spec b/dlls/wminet_utils/wminet_utils.spec index 2a2f35bdead..ac25b88f77b 100644 --- a/dlls/wminet_utils/wminet_utils.spec +++ b/dlls/wminet_utils/wminet_utils.spec @@ -17,7 +17,7 @@ @ stub EndEnumeration @ stub EndMethodEnumeration @ stub ExecNotificationQueryWmi -@ stub ExecQueryWmi +@ stdcall ExecQueryWmi(wstr wstr long ptr ptr long long ptr wstr wstr wstr) @ stub Get @ stdcall GetCurrentApartmentType(long ptr ptr) @ stub GetDemultiplexedStub -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/9958
From: Esme Povirk <esme@codeweavers.com> Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=59223 --- dlls/wminet_utils/main.c | 14 ++++++++++++++ dlls/wminet_utils/wminet_utils.spec | 2 +- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/dlls/wminet_utils/main.c b/dlls/wminet_utils/main.c index ffea80b28fc..3adfa2d7c0b 100644 --- a/dlls/wminet_utils/main.c +++ b/dlls/wminet_utils/main.c @@ -31,6 +31,20 @@ WINE_DEFAULT_DEBUG_CHANNEL(wminet_utils); +HRESULT WINAPI CloneEnumWbemClassObject(IEnumWbemClassObject **ppEnum, DWORD authLevel, + DWORD impLevel, IEnumWbemClassObject *pCurrentEnumWbemClassObject, BSTR strUser, + BSTR strPassword, BSTR strAuthority) +{ + TRACE("\n"); + + if (!ppEnum) + return E_POINTER; + + *ppEnum = NULL; + + return IEnumWbemClassObject_Clone(pCurrentEnumWbemClassObject, ppEnum); +} + HRESULT WINAPI ConnectServerWmi(BSTR strNetworkResource, BSTR strUser, BSTR strPassword, BSTR strLocale, long lSecurityFlags, BSTR strAuthority, IWbemContext *pCtx, IWbemServices** ppNamespace, DWORD impLevel, DWORD authLevel) diff --git a/dlls/wminet_utils/wminet_utils.spec b/dlls/wminet_utils/wminet_utils.spec index ac25b88f77b..e43f4b43bd2 100644 --- a/dlls/wminet_utils/wminet_utils.spec +++ b/dlls/wminet_utils/wminet_utils.spec @@ -3,7 +3,7 @@ @ stub BlessIWbemServices @ stub BlessIWbemServicesObject @ stub Clone -@ stub CloneEnumWbemClassObject +@ stdcall CloneEnumWbemClassObject(ptr long long ptr wstr wstr wstr) @ stub CompareTo @ stdcall ConnectServerWmi(wstr wstr wstr wstr long wstr ptr ptr long long) @ stub CreateClassEnumWmi -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/9958
The corresponding Wine Mono change: https://gitlab.winehq.org/mono/wine-mono/-/merge_requests/50 -- https://gitlab.winehq.org/wine/wine/-/merge_requests/9958#note_127889
Wouldn't it be cleaner to move the contents of dotnetfakedlls.inf into wine.inf (as a separate section that wine-mono can invoke), instead of having to maintain that list in two separate projects? -- https://gitlab.winehq.org/wine/wine/-/merge_requests/9958#note_127928
On Sat Jan 24 16:44:11 2026 +0000, Alexandre Julliard wrote:
Wouldn't it be cleaner to move the contents of dotnetfakedlls.inf into wine.inf (as a separate section that wine-mono can invoke), instead of having to maintain that list in two separate projects? Possibly. Currently, dotnetfakedlls.inf is coupled with the MSI tables (which I neglected to update) for the uninstall. I suppose if we also put uninstall info in wine.inf, it'd fix that too.
Changing that would mean that Wine Mono 11.x requires a Wine version greater than 11.0, which I try to avoid. I guess I could add a fallback path for this release cycle. Another option I considered was to put this dll in Wine Mono entirely, as we do with PresentationNative (which is part of wpf). I'm not sure which way is better. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/9958#note_127931
On Sat Jan 24 16:44:11 2026 +0000, Esme Povirk wrote:
Possibly. Currently, dotnetfakedlls.inf is coupled with the MSI tables (which I neglected to update) for the uninstall. I suppose if we also put uninstall info in wine.inf, it'd fix that too. Changing that would mean that Wine Mono 11.x requires a Wine version greater than 11.0, which I try to avoid. I guess I could add a fallback path for this release cycle. Another option I considered was to put this dll in Wine Mono entirely, as we do with PresentationNative (which is part of wpf). I'm not sure which way is better. Getting rid of dotnetfakedlls.inf entirely and moving the dll's into Wine Mono would be the easiest option for me, because then they'd just be normal files as far as MSI is concerned. But I feel like there was some reason we needed fusion.dll to be in Wine.
-- https://gitlab.winehq.org/wine/wine/-/merge_requests/9958#note_127932
On Sat Jan 24 16:46:04 2026 +0000, Esme Povirk wrote:
Getting rid of dotnetfakedlls.inf entirely and moving the dll's into Wine Mono would be the easiest option for me, because then they'd just be normal files as far as MSI is concerned. But I feel like there was some reason we needed fusion.dll to be in Wine. I think making wine-mono dlls part of wine-mono makes sense unless the dll might get called in a context where wine-mono isn't loaded.
But putting C only dlls in wine for wine-mono also makes sense since it might reduce developer burden, and ensure the dlls are compatible with the latest version of wine and would allow to use the current wine testing infrastructure. Transferring all wine-mono dlls in wine would greatly reduce maintenance efforts on wine-mono at the cost of portability. Transferring all wine-mono dlls in wine-mono would greatly increase portability at the cost of maintenance. By portability, I mean between wine versions. Everything is a trade-off, I think reducing required maintenance effort is worth it if it gives developers more time to do other stuff! -- https://gitlab.winehq.org/wine/wine/-/merge_requests/9958#note_128127
On Tue Jan 27 09:19:12 2026 +0000, Loïc Rebmeister wrote:
I think making wine-mono dlls part of wine-mono makes sense unless the dll might get called in a context where wine-mono isn't loaded. But putting C only dlls in wine for wine-mono also makes sense since it might reduce developer burden, and ensure the dlls are compatible with the latest version of wine and would allow to use the current wine testing infrastructure. Transferring all wine-mono dlls in wine would greatly reduce maintenance efforts on wine-mono at the cost of portability. Transferring all wine-mono dlls in wine-mono would greatly increase portability at the cost of maintenance. By portability, I mean between wine versions. Everything is a trade-off, I think reducing required maintenance effort is worth it if it gives developers more time to do other stuff! Note: I am not worried about proton as Valve backport any required dlls to their wine version if needed!
-- https://gitlab.winehq.org/wine/wine/-/merge_requests/9958#note_128128
On Tue Jan 27 09:21:18 2026 +0000, Loïc Rebmeister wrote:
Note: I am not worried about proton as Valve backport any required dlls to their wine version if needed! I think that my feeling right now is that the need to add Framework dll's like this is rare enough that the simplification isn't worth the redesign and complex transition across multiple release cycles (which I'm going to need if I want to ensure that all Wine Mono X.* works with all Wine X.*, something I like do to, given that Wine 11.0 has already released without the needed section in wine.inf.in).
Putting the dll in Wine Mono would certainly make things simpler for me, but it would also mean this library gets less review than it would in Wine. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/9958#note_128191
participants (4)
-
Alexandre Julliard (@julliard) -
Esme Povirk -
Esme Povirk (@madewokherd) -
Loïc Rebmeister (@Fox2Code)