Wine-Devel
By thread
wine-devel@list.winehq.org
By month
Messages by month
- ----- 2026 -----
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2005 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2004 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2003 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2002 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2001 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
January 2022
- 86 participants
- 2418 messages
Re: [PATCH] WIP/krnl386: When freeing task, also reset internal variable
by Eric Pouech
Le 30/01/2022 à 18:33, Fabian Maurer a écrit :
> Any news on this?
> After a bit more thinking this doesn't seem too correct anymore to me,
> but I still don't know how to do it properly.
> We somehow must prevent the thunks from being freed as long as we still use
> them.
I thought
https://source.winehq.org/git/wine.git/?a=commit;h=879ccd33572170e9bcb00d5a…
was suppose to fix it, didn't it?
A+
Jan. 30, 2022
Re: [PATCH] WIP/krnl386: When freeing task, also reset internal variable
by Fabian Maurer
Any news on this?
After a bit more thinking this doesn't seem too correct anymore to me,
but I still don't know how to do it properly.
We somehow must prevent the thunks from being freed as long as we still use
them.
Regards,
Fabian Maurer
On Montag, 17. Januar 2022 22:26:33 CET you wrote:
> This is a WIP patch fixing crashes in the win16 program Nota Bene.
> The crash is caused by alloc_win16_thunk calling GlobalAlloc16,
> GlobalLock16 and keeping the pinned address as "thunk_array".
>
> Later we have the following chain:
> TASK_DeleteTask -> GlobalFreeAll16 -> GlobalFree16
> This deletes the buffer behind "thunk_array", but since it's not NULL
> wine will continue to use it, causing funny heap corruption issues.
>
> This patch fixes the issue and seems logically correct to me,
> though it's very ugly architecturally.
> Any hints on how we should handle this case properly?
>
> Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=12732
> ---
> dlls/krnl386.exe16/krnl386.exe16.spec | 2 ++
> dlls/krnl386.exe16/task.c | 9 +++++++++
> dlls/user.exe16/message.c | 6 ++++++
> include/wine/winbase16.h | 3 +++
> 4 files changed, 20 insertions(+)
>
> diff --git a/dlls/krnl386.exe16/krnl386.exe16.spec
> b/dlls/krnl386.exe16/krnl386.exe16.spec index d98e136c77e..a1e7db46c0f
> 100644
> --- a/dlls/krnl386.exe16/krnl386.exe16.spec
> +++ b/dlls/krnl386.exe16/krnl386.exe16.spec
> @@ -751,3 +751,5 @@
> # Snoop support
> 2001 pascal -register __wine_snoop_entry()
> 2002 pascal -register __wine_snoop_return()
> +
> +@ cdecl -arch=win32 __wine_set_taskkill_func(ptr)
> diff --git a/dlls/krnl386.exe16/task.c b/dlls/krnl386.exe16/task.c
> index 30a40328c86..140b9190666 100644
> --- a/dlls/krnl386.exe16/task.c
> +++ b/dlls/krnl386.exe16/task.c
> @@ -351,6 +351,12 @@ static TDB *TASK_Create( NE_MODULE *pModule, UINT16
> cmdShow, LPCSTR cmdline, BYT return pTask;
> }
>
> +static wine_taskkill_func taskkill;
> +
> +void __wine_set_taskkill_func(wine_taskkill_func func)
> +{
> + taskkill = func;
> +}
>
> /***********************************************************************
> * TASK_DeleteTask
> @@ -382,6 +388,9 @@ static void TASK_DeleteTask( HTASK16 hTask )
> /* the environment block and the thunk segments). */
>
> GlobalFreeAll16( hPDB );
> +
> + if (taskkill)
> + taskkill();
> }
>
>
> diff --git a/dlls/user.exe16/message.c b/dlls/user.exe16/message.c
> index b79b0cb7751..f5cadc5e387 100644
> --- a/dlls/user.exe16/message.c
> +++ b/dlls/user.exe16/message.c
> @@ -144,6 +144,11 @@ static int winproc_to_index( WNDPROC16 handle )
> return index;
> }
>
> +static void taskkill(void)
> +{
> + thunk_array = 0;
> +}
> +
> /* allocate a 16-bit thunk for an existing window proc */
> static WNDPROC16 alloc_win16_thunk( WNDPROC handle )
> {
> @@ -156,6 +161,7 @@ static WNDPROC16 alloc_win16_thunk( WNDPROC handle )
>
> if (!thunk_array) /* allocate the array and its selector */
> {
> + __wine_set_taskkill_func(taskkill);
> assert( MAX_WINPROCS16 * sizeof(WINPROC_THUNK) <= 0x10000 );
>
> if (!(thunk_selector = GlobalAlloc16( GMEM_FIXED | GMEM_ZEROINIT,
> diff --git a/include/wine/winbase16.h b/include/wine/winbase16.h
> index 1d052130e33..338a2af4e9e 100644
> --- a/include/wine/winbase16.h
> +++ b/include/wine/winbase16.h
> @@ -567,4 +567,7 @@ BOOL16 WINAPI WriteProfileSection16(LPCSTR,LPCSTR);
> #define CURRENT_SP (((WORD *)NtCurrentTeb()->SystemReserved1)[0])
> #define CURRENT_SS (((WORD *)NtCurrentTeb()->SystemReserved1)[1])
>
> +typedef void (*wine_taskkill_func)(void);
> +extern void __wine_set_taskkill_func(wine_taskkill_func func);
> +
> #endif /* __WINE_WINE_WINBASE16_H */
> --
> 2.34.1
Jan. 30, 2022
[PATCH 4/4] windows.foundation.metadata: Fake success for IsPropertyPresent
by Fabian Maurer
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=52484
Signed-off-by: Fabian Maurer <dark.shadow4(a)web.de>
---
dlls/windows.foundation.metadata/main.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/dlls/windows.foundation.metadata/main.c b/dlls/windows.foundation.metadata/main.c
index e4c34e426fc..0f4799e3646 100644
--- a/dlls/windows.foundation.metadata/main.c
+++ b/dlls/windows.foundation.metadata/main.c
@@ -224,8 +224,9 @@ static HRESULT STDMETHODCALLTYPE api_information_statics_IsEventPresent(
static HRESULT STDMETHODCALLTYPE api_information_statics_IsPropertyPresent(
IApiInformationStatics *iface, HSTRING type_name, HSTRING property_name, boolean* result)
{
- FIXME("iface %p, tyoe_name %p, property_name %d, result %p stub!\n", iface, type_name, property_name, result);
- return E_NOTIMPL;
+ FIXME("iface %p, type_name %p, property_name %d, result %p stub!\n", iface, type_name, property_name, result);
+ *result = 0;
+ return S_OK;
}
static HRESULT STDMETHODCALLTYPE api_information_statics_IsReadOnlyPropertyPresent(
--
2.35.1
Jan. 30, 2022
[PATCH 3/4] windows.foundation.metadata: Fake success for IsApiContractPresentByMajor
by Fabian Maurer
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=52484
Signed-off-by: Fabian Maurer <dark.shadow4(a)web.de>
---
dlls/windows.foundation.metadata/main.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/dlls/windows.foundation.metadata/main.c b/dlls/windows.foundation.metadata/main.c
index 54f4de0ad74..e4c34e426fc 100644
--- a/dlls/windows.foundation.metadata/main.c
+++ b/dlls/windows.foundation.metadata/main.c
@@ -253,7 +253,8 @@ static HRESULT STDMETHODCALLTYPE api_information_statics_IsApiContractPresentByM
IApiInformationStatics *iface, HSTRING contract_name, UINT16 version_major, boolean* result)
{
FIXME("iface %p, contract_name %p, version_major %u, result %p stub!\n", iface, contract_name, version_major, result);
- return E_NOTIMPL;
+ *result = 1;
+ return S_OK;
}
static HRESULT STDMETHODCALLTYPE api_information_statics_IsApiContractPresentByMajorAndMinor(
--
2.35.1
Jan. 30, 2022
[PATCH 2/4] windows.foundation.metadata: Add stubs for IApiInformationStatics
by Fabian Maurer
Signed-off-by: Fabian Maurer <dark.shadow4(a)web.de>
---
dlls/windows.foundation.metadata/main.c | 152 +++++++++++++++++++++++-
include/windows.foundation.metadata.idl | 17 +++
2 files changed, 168 insertions(+), 1 deletion(-)
diff --git a/dlls/windows.foundation.metadata/main.c b/dlls/windows.foundation.metadata/main.c
index 18a19ad1bca..54f4de0ad74 100644
--- a/dlls/windows.foundation.metadata/main.c
+++ b/dlls/windows.foundation.metadata/main.c
@@ -49,6 +49,7 @@ static const char *debugstr_hstring(HSTRING hstr)
struct windows_foundation_metadata
{
IActivationFactory IActivationFactory_iface;
+ IApiInformationStatics IApiInformationStatics_iface;
LONG ref;
};
@@ -60,7 +61,9 @@ static inline struct windows_foundation_metadata *impl_from_IActivationFactory(I
static HRESULT STDMETHODCALLTYPE windows_foundation_metadata_QueryInterface(
IActivationFactory *iface, REFIID iid, void **out)
{
- TRACE("iface %p, iid %s, out %p stub!\n", iface, debugstr_guid(iid), out);
+ struct windows_foundation_metadata *impl = impl_from_IActivationFactory(iface);
+
+ TRACE("iface %p, iid %s, out %p\n", iface, debugstr_guid(iid), out);
if (IsEqualGUID(iid, &IID_IUnknown) ||
IsEqualGUID(iid, &IID_IInspectable) ||
@@ -72,6 +75,13 @@ static HRESULT STDMETHODCALLTYPE windows_foundation_metadata_QueryInterface(
return S_OK;
}
+ if (IsEqualGUID(iid, &IID_IApiInformationStatics))
+ {
+ IUnknown_AddRef(iface);
+ *out = &impl->IApiInformationStatics_iface;
+ return S_OK;
+ }
+
FIXME("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(iid));
*out = NULL;
return E_NOINTERFACE;
@@ -136,9 +146,149 @@ static const struct IActivationFactoryVtbl activation_factory_vtbl =
windows_foundation_metadata_ActivateInstance,
};
+static inline struct windows_foundation_metadata *impl_from_IApiInformationStatics(IApiInformationStatics *iface)
+{
+ return CONTAINING_RECORD(iface, struct windows_foundation_metadata, IApiInformationStatics_iface);
+}
+
+static HRESULT STDMETHODCALLTYPE api_information_statics_QueryInterface(
+ IApiInformationStatics *iface, REFIID iid, void **out)
+{
+ struct windows_foundation_metadata *impl = impl_from_IApiInformationStatics(iface);
+ return windows_foundation_metadata_QueryInterface(&impl->IActivationFactory_iface, iid, out);
+}
+
+static ULONG STDMETHODCALLTYPE api_information_statics_AddRef(
+ IApiInformationStatics *iface)
+{
+ struct windows_foundation_metadata *impl = impl_from_IApiInformationStatics(iface);
+ return windows_foundation_metadata_AddRef(&impl->IActivationFactory_iface);
+}
+
+static ULONG STDMETHODCALLTYPE api_information_statics_Release(
+ IApiInformationStatics *iface)
+{
+ struct windows_foundation_metadata *impl = impl_from_IApiInformationStatics(iface);
+ return windows_foundation_metadata_Release(&impl->IActivationFactory_iface);
+}
+
+static HRESULT STDMETHODCALLTYPE api_information_statics_GetIids(
+ IApiInformationStatics *iface, ULONG *iid_count, IID **iids)
+{
+ FIXME("iface %p, iid_count %p, iids %p stub!\n", iface, iid_count, iids);
+ return E_NOTIMPL;
+}
+
+static HRESULT STDMETHODCALLTYPE api_information_statics_GetRuntimeClassName(
+ IApiInformationStatics *iface, HSTRING *class_name)
+{
+ FIXME("iface %p, class_name %p stub!\n", iface, class_name);
+ return E_NOTIMPL;
+}
+
+static HRESULT STDMETHODCALLTYPE api_information_statics_GetTrustLevel(
+ IApiInformationStatics *iface, TrustLevel *trust_level)
+{
+ FIXME("iface %p, trust_level %p stub!\n", iface, trust_level);
+ return E_NOTIMPL;
+}
+
+static HRESULT STDMETHODCALLTYPE api_information_statics_IsTypePresent(
+ IApiInformationStatics *iface, HSTRING type_name, boolean* result)
+{
+ FIXME("iface %p, type_name %p, result %p stub!\n", iface, type_name, result);
+ return E_NOTIMPL;
+}
+
+static HRESULT STDMETHODCALLTYPE api_information_statics_IsMethodPresent(
+ IApiInformationStatics *iface, HSTRING type_name, HSTRING method_name, boolean* result)
+{
+ FIXME("iface %p, type_name %p, method_name %p, result %p stub!\n", iface, type_name, method_name, result);
+ return E_NOTIMPL;
+}
+
+static HRESULT STDMETHODCALLTYPE api_information_statics_IsMethodPresentWithArity(
+ IApiInformationStatics *iface, HSTRING type_name, HSTRING method_name, UINT32 input_param_count, boolean* result)
+{
+ FIXME("iface %p, type_name %p, method_name, input_param_count %u, result %p stub!\n", iface, type_name, method_name, input_param_count, result);
+ return E_NOTIMPL;
+}
+
+static HRESULT STDMETHODCALLTYPE api_information_statics_IsEventPresent(
+ IApiInformationStatics *iface, HSTRING type_name, HSTRING event_name, boolean* result)
+{
+ FIXME("iface %p, type_name %p, event_name %p, result %p stub!\n", iface, type_name, event_name, result);
+ return E_NOTIMPL;
+}
+
+static HRESULT STDMETHODCALLTYPE api_information_statics_IsPropertyPresent(
+ IApiInformationStatics *iface, HSTRING type_name, HSTRING property_name, boolean* result)
+{
+ FIXME("iface %p, tyoe_name %p, property_name %d, result %p stub!\n", iface, type_name, property_name, result);
+ return E_NOTIMPL;
+}
+
+static HRESULT STDMETHODCALLTYPE api_information_statics_IsReadOnlyPropertyPresent(
+ IApiInformationStatics *iface, HSTRING type_name, HSTRING property_name, boolean* result)
+{
+ FIXME("iface %p, type_name %p, property_name %p, result %p stub!\n", iface, type_name, property_name, result);
+ return E_NOTIMPL;
+}
+
+static HRESULT STDMETHODCALLTYPE api_information_statics_IsWriteablePropertyPresent(
+ IApiInformationStatics *iface, HSTRING type_name, HSTRING property_name, boolean* result)
+{
+ FIXME("iface %p, type_name %p, property_name %p, result %p stub!\n", iface, type_name, property_name, result);
+ return E_NOTIMPL;
+}
+
+static HRESULT STDMETHODCALLTYPE api_information_statics_IsEnumNamedValuePresent(
+ IApiInformationStatics *iface, HSTRING enum_name, HSTRING value_name, boolean* result)
+{
+ FIXME("iface %p, enum_name %p, value_name %p, result %p stub!\n", iface, enum_name, value_name, result);
+ return E_NOTIMPL;
+}
+
+static HRESULT STDMETHODCALLTYPE api_information_statics_IsApiContractPresentByMajor(
+ IApiInformationStatics *iface, HSTRING contract_name, UINT16 version_major, boolean* result)
+{
+ FIXME("iface %p, contract_name %p, version_major %u, result %p stub!\n", iface, contract_name, version_major, result);
+ return E_NOTIMPL;
+}
+
+static HRESULT STDMETHODCALLTYPE api_information_statics_IsApiContractPresentByMajorAndMinor(
+ IApiInformationStatics *iface, HSTRING contract_name, UINT16 version_major, UINT16 version_minor, boolean* result)
+{
+ FIXME("iface %p, contract_name %p, version_major %u, version_minor %u, result %p stub!\n", iface, contract_name, version_major, version_minor, result);
+ return E_NOTIMPL;
+}
+
+static const struct IApiInformationStaticsVtbl api_information_statics_vtbl =
+{
+ api_information_statics_QueryInterface,
+ api_information_statics_AddRef,
+ api_information_statics_Release,
+ /* IInspectable methods */
+ api_information_statics_GetIids,
+ api_information_statics_GetRuntimeClassName,
+ api_information_statics_GetTrustLevel,
+ /* IApiInformationStaticsVtbl methods */
+ api_information_statics_IsTypePresent,
+ api_information_statics_IsMethodPresent,
+ api_information_statics_IsMethodPresentWithArity,
+ api_information_statics_IsEventPresent,
+ api_information_statics_IsPropertyPresent,
+ api_information_statics_IsReadOnlyPropertyPresent,
+ api_information_statics_IsWriteablePropertyPresent,
+ api_information_statics_IsEnumNamedValuePresent,
+ api_information_statics_IsApiContractPresentByMajor,
+ api_information_statics_IsApiContractPresentByMajorAndMinor,
+};
+
static struct windows_foundation_metadata windows_foundation_metadata =
{
{&activation_factory_vtbl},
+ {&api_information_statics_vtbl},
1
};
diff --git a/include/windows.foundation.metadata.idl b/include/windows.foundation.metadata.idl
index 7673777e658..93945de79aa 100644
--- a/include/windows.foundation.metadata.idl
+++ b/include/windows.foundation.metadata.idl
@@ -38,6 +38,23 @@ namespace Windows {
namespace Windows {
namespace Foundation {
namespace Metadata {
+ [contract(Windows.Foundation.FoundationContract, 1.0)]
+ [exclusiveto(Windows.Foundation.Metadata.ApiInformation)]
+ [uuid(997439fe-f681-4a11-b416-c13A47e8ba36)]
+ interface IApiInformationStatics : IInspectable
+ {
+ HRESULT IsTypePresent([in] HSTRING type_name, [out, retval] boolean* result);
+ [overload("IsMethodPresent")] HRESULT IsMethodPresent([in] HSTRING type_name, [in] HSTRING method_name, [out, retval] boolean* result);
+ [overload("IsMethodPresent")] HRESULT IsMethodPresentWithArity([in] HSTRING type_name, [in] HSTRING method_name, [in] UINT32 input_param_count, [out, retval] boolean* result);
+ HRESULT IsEventPresent([in] HSTRING type_name, [in] HSTRING event_name, [out, retval] boolean* result);
+ HRESULT IsPropertyPresent([in] HSTRING type_name, [in] HSTRING property_name, [out, retval] boolean* result);
+ HRESULT IsReadOnlyPropertyPresent([in] HSTRING type_name, [in] HSTRING property_name, [out, retval] boolean* result);
+ HRESULT IsWriteablePropertyPresent([in] HSTRING type_name, [in] HSTRING property_name, [out, retval] boolean* result);
+ HRESULT IsEnumNamedValuePresent([in] HSTRING enum_name, [in] HSTRING value_name, [out, retval] boolean* result);
+ [overload("IsApiContractPresent")] HRESULT IsApiContractPresentByMajor([in] HSTRING contract_name, [in] UINT16 version_major, [out, retval] boolean* result);
+ [overload("IsApiContractPresent")] HRESULT IsApiContractPresentByMajorAndMinor([in] HSTRING contract_name, [in] UINT16 version_major, [in] UINT16 version_minor, [out, retval] boolean* result);
+ }
+
[
contract(Windows.Foundation.UniversalApiContract, 1.0),
marshaling_behavior(agile),
--
2.35.1
Jan. 30, 2022
[PATCH 1/4] windows.foundation.metadata: Add stub dll
by Fabian Maurer
Signed-off-by: Fabian Maurer <dark.shadow4(a)web.de>
---
configure | 2 +
configure.ac | 1 +
dlls/windows.foundation.metadata/Makefile.in | 8 +
dlls/windows.foundation.metadata/classes.idl | 23 +++
dlls/windows.foundation.metadata/main.c | 157 ++++++++++++++++++
.../windows.foundation.metadata.spec | 3 +
include/Makefile.in | 1 +
include/windows.foundation.metadata.idl | 52 ++++++
8 files changed, 247 insertions(+)
create mode 100644 dlls/windows.foundation.metadata/Makefile.in
create mode 100644 dlls/windows.foundation.metadata/classes.idl
create mode 100644 dlls/windows.foundation.metadata/main.c
create mode 100644 dlls/windows.foundation.metadata/windows.foundation.metadata.spec
create mode 100644 include/windows.foundation.metadata.idl
diff --git a/configure b/configure
index 425d267ec50..f7f8cb581ef 100755
--- a/configure
+++ b/configure
@@ -1704,6 +1704,7 @@ enable_wiaservc
enable_wimgapi
enable_win32u
enable_windows_devices_enumeration
+enable_windows_foundation_metadata
enable_windows_gaming_input
enable_windows_globalization
enable_windows_media_devices
@@ -22470,6 +22471,7 @@ wine_fn_config_makefile dlls/win87em.dll16 enable_win16
wine_fn_config_makefile dlls/winaspi.dll16 enable_win16
wine_fn_config_makefile dlls/windebug.dll16 enable_win16
wine_fn_config_makefile dlls/windows.devices.enumeration enable_windows_devices_enumeration
+wine_fn_config_makefile dlls/windows.foundation.metadata enable_windows_foundation_metadata
wine_fn_config_makefile dlls/windows.gaming.input enable_windows_gaming_input
wine_fn_config_makefile dlls/windows.gaming.input/tests enable_tests
wine_fn_config_makefile dlls/windows.globalization enable_windows_globalization
diff --git a/configure.ac b/configure.ac
index fed12f61036..c66c6fd462f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3366,6 +3366,7 @@ WINE_CONFIG_MAKEFILE(dlls/win87em.dll16,enable_win16)
WINE_CONFIG_MAKEFILE(dlls/winaspi.dll16,enable_win16)
WINE_CONFIG_MAKEFILE(dlls/windebug.dll16,enable_win16)
WINE_CONFIG_MAKEFILE(dlls/windows.devices.enumeration)
+WINE_CONFIG_MAKEFILE(dlls/windows.foundation.metadata)
WINE_CONFIG_MAKEFILE(dlls/windows.gaming.input)
WINE_CONFIG_MAKEFILE(dlls/windows.gaming.input/tests)
WINE_CONFIG_MAKEFILE(dlls/windows.globalization)
diff --git a/dlls/windows.foundation.metadata/Makefile.in b/dlls/windows.foundation.metadata/Makefile.in
new file mode 100644
index 00000000000..311cfb0a845
--- /dev/null
+++ b/dlls/windows.foundation.metadata/Makefile.in
@@ -0,0 +1,8 @@
+EXTRADEFS = -DWINE_NO_LONG_TYPES
+MODULE = windows.foundation.metadata.dll
+IMPORTS = combase uuid
+
+C_SRCS = \
+ main.c
+
+IDL_SRCS = classes.idl
diff --git a/dlls/windows.foundation.metadata/classes.idl b/dlls/windows.foundation.metadata/classes.idl
new file mode 100644
index 00000000000..405fa9f1133
--- /dev/null
+++ b/dlls/windows.foundation.metadata/classes.idl
@@ -0,0 +1,23 @@
+/*
+ * Runtime Classes for windows.foundation.metadata.dll
+ *
+ * Copyright 2022 Fabian Maurer
+ *
+ * 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
+ */
+
+#pragma makedep register
+
+#include "windows.foundation.metadata.idl"
diff --git a/dlls/windows.foundation.metadata/main.c b/dlls/windows.foundation.metadata/main.c
new file mode 100644
index 00000000000..18a19ad1bca
--- /dev/null
+++ b/dlls/windows.foundation.metadata/main.c
@@ -0,0 +1,157 @@
+/* WinRT Windows.Foundation.Metadata implementation
+ *
+ * Copyright 2022 Fabian Maurer
+ *
+ * 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>
+
+#define COBJMACROS
+#include "windef.h"
+#include "winbase.h"
+#include "winstring.h"
+#include "wine/debug.h"
+#include "objbase.h"
+
+#include "initguid.h"
+#include "activation.h"
+
+#define WIDL_using_Windows_Foundation
+#define WIDL_using_Windows_Foundation_Collections
+#include "windows.foundation.h"
+#define WIDL_using_Windows_Foundation_Metadata
+#include "windows.foundation.metadata.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(metadata);
+
+static const char *debugstr_hstring(HSTRING hstr)
+{
+ const WCHAR *str;
+ UINT32 len;
+ if (hstr && !((ULONG_PTR)hstr >> 16)) return "(invalid)";
+ str = WindowsGetStringRawBuffer(hstr, &len);
+ return wine_dbgstr_wn(str, len);
+}
+
+struct windows_foundation_metadata
+{
+ IActivationFactory IActivationFactory_iface;
+ LONG ref;
+};
+
+static inline struct windows_foundation_metadata *impl_from_IActivationFactory(IActivationFactory *iface)
+{
+ return CONTAINING_RECORD(iface, struct windows_foundation_metadata, IActivationFactory_iface);
+}
+
+static HRESULT STDMETHODCALLTYPE windows_foundation_metadata_QueryInterface(
+ IActivationFactory *iface, REFIID iid, void **out)
+{
+ TRACE("iface %p, iid %s, out %p stub!\n", iface, debugstr_guid(iid), out);
+
+ if (IsEqualGUID(iid, &IID_IUnknown) ||
+ IsEqualGUID(iid, &IID_IInspectable) ||
+ IsEqualGUID(iid, &IID_IAgileObject) ||
+ IsEqualGUID(iid, &IID_IActivationFactory))
+ {
+ IUnknown_AddRef(iface);
+ *out = iface;
+ return S_OK;
+ }
+
+ FIXME("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(iid));
+ *out = NULL;
+ return E_NOINTERFACE;
+}
+
+static ULONG STDMETHODCALLTYPE windows_foundation_metadata_AddRef(
+ IActivationFactory *iface)
+{
+ struct windows_foundation_metadata *impl = impl_from_IActivationFactory(iface);
+ ULONG ref = InterlockedIncrement(&impl->ref);
+ TRACE("iface %p, ref %u.\n", iface, ref);
+ return ref;
+}
+
+static ULONG STDMETHODCALLTYPE windows_foundation_metadata_Release(
+ IActivationFactory *iface)
+{
+ struct windows_foundation_metadata *impl = impl_from_IActivationFactory(iface);
+ ULONG ref = InterlockedDecrement(&impl->ref);
+ TRACE("iface %p, ref %u.\n", iface, ref);
+ return ref;
+}
+
+static HRESULT STDMETHODCALLTYPE windows_foundation_metadata_GetIids(
+ IActivationFactory *iface, ULONG *iid_count, IID **iids)
+{
+ FIXME("iface %p, iid_count %p, iids %p stub!\n", iface, iid_count, iids);
+ return E_NOTIMPL;
+}
+
+static HRESULT STDMETHODCALLTYPE windows_foundation_metadata_GetRuntimeClassName(
+ IActivationFactory *iface, HSTRING *class_name)
+{
+ FIXME("iface %p, class_name %p stub!\n", iface, class_name);
+ return E_NOTIMPL;
+}
+
+static HRESULT STDMETHODCALLTYPE windows_foundation_metadata_GetTrustLevel(
+ IActivationFactory *iface, TrustLevel *trust_level)
+{
+ FIXME("iface %p, trust_level %p stub!\n", iface, trust_level);
+ return E_NOTIMPL;
+}
+
+static HRESULT STDMETHODCALLTYPE windows_foundation_metadata_ActivateInstance(
+ IActivationFactory *iface, IInspectable **instance)
+{
+ FIXME("iface %p, instance %p stub!\n", iface, instance);
+ return E_NOTIMPL;
+}
+
+static const struct IActivationFactoryVtbl activation_factory_vtbl =
+{
+ windows_foundation_metadata_QueryInterface,
+ windows_foundation_metadata_AddRef,
+ windows_foundation_metadata_Release,
+ /* IInspectable methods */
+ windows_foundation_metadata_GetIids,
+ windows_foundation_metadata_GetRuntimeClassName,
+ windows_foundation_metadata_GetTrustLevel,
+ /* IActivationFactory methods */
+ windows_foundation_metadata_ActivateInstance,
+};
+
+static struct windows_foundation_metadata windows_foundation_metadata =
+{
+ {&activation_factory_vtbl},
+ 1
+};
+
+HRESULT WINAPI DllGetClassObject(REFCLSID clsid, REFIID riid, void **out)
+{
+ FIXME("clsid %s, riid %s, out %p stub!\n", debugstr_guid(clsid), debugstr_guid(riid), out);
+ return CLASS_E_CLASSNOTAVAILABLE;
+}
+
+HRESULT WINAPI DllGetActivationFactory(HSTRING classid, IActivationFactory **factory)
+{
+ TRACE("classid %s, factory %p.\n", debugstr_hstring(classid), factory);
+ *factory = &windows_foundation_metadata.IActivationFactory_iface;
+ IUnknown_AddRef(*factory);
+ return S_OK;
+}
diff --git a/dlls/windows.foundation.metadata/windows.foundation.metadata.spec b/dlls/windows.foundation.metadata/windows.foundation.metadata.spec
new file mode 100644
index 00000000000..20a8bfa98ea
--- /dev/null
+++ b/dlls/windows.foundation.metadata/windows.foundation.metadata.spec
@@ -0,0 +1,3 @@
+@ stdcall -private DllCanUnloadNow()
+@ stdcall -private DllGetActivationFactory(ptr ptr)
+@ stdcall -private DllGetClassObject(ptr ptr ptr)
diff --git a/include/Makefile.in b/include/Makefile.in
index 7fcf5f0ba7b..24c2b3fb448 100644
--- a/include/Makefile.in
+++ b/include/Makefile.in
@@ -777,6 +777,7 @@ SOURCES = \
windows.devices.enumeration.idl \
windows.foundation.collections.idl \
windows.foundation.idl \
+ windows.foundation.metadata.idl \
windows.gaming.input.forcefeedback.idl \
windows.gaming.input.idl \
windows.globalization.idl \
diff --git a/include/windows.foundation.metadata.idl b/include/windows.foundation.metadata.idl
new file mode 100644
index 00000000000..7673777e658
--- /dev/null
+++ b/include/windows.foundation.metadata.idl
@@ -0,0 +1,52 @@
+/*
+ * Copyright 2022 Fabian Maurer
+ *
+ * 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 "inspectable.idl";
+import "asyncinfo.idl";
+import "eventtoken.idl";
+import "windowscontracts.idl";
+import "windows.foundation.idl";
+
+namespace Windows {
+ namespace Foundation {
+ namespace Metadata {
+ interface IApiInformationStatics;
+ runtimeclass ApiInformation;
+ }
+ }
+}
+
+namespace Windows {
+ namespace Foundation {
+ namespace Metadata {
+ [
+ contract(Windows.Foundation.UniversalApiContract, 1.0),
+ marshaling_behavior(agile),
+ static(Windows.Foundation.Metadata.IApiInformationStatics, Windows.Foundation.UniversalApiContract, 1.0),
+ threading(both)
+ ]
+ runtimeclass ApiInformation
+ {
+ }
+ }
+ }
+}
--
2.35.1
Jan. 30, 2022
Re: [PATCH 18/22] windowscodecs/tests: Avoid "misleading indentation" warnings.
by Esme Povirk (she/they)
Signed-off-by: Esme Povirk <esme(a)codeweavers.com>
Jan. 30, 2022
[PATCH v2 3/3] kernelbase: Use ntdll ctype functions.
by Zebediah Figura
These were open-coded in 5933c2a6901218bc6ef7b6e808b0571fa96b542e, but there's
no reason not to use the ASCII versions from ntdll.
Signed-off-by: Zebediah Figura <zfigura(a)codeweavers.com>
---
dlls/kernelbase/path.c | 18 ++++--------------
dlls/kernelbase/string.c | 4 ----
2 files changed, 4 insertions(+), 18 deletions(-)
diff --git a/dlls/kernelbase/path.c b/dlls/kernelbase/path.c
index 3503286a82a..5f983895576 100644
--- a/dlls/kernelbase/path.c
+++ b/dlls/kernelbase/path.c
@@ -36,13 +36,6 @@
WINE_DEFAULT_DEBUG_CHANNEL(path);
-#define isalnum(ch) (((ch) >= '0' && (ch) <= '9') || \
- ((ch) >= 'A' && (ch) <= 'Z') || \
- ((ch) >= 'a' && (ch) <= 'z'))
-#define isxdigit(ch) (((ch) >= '0' && (ch) <= '9') || \
- ((ch) >= 'A' && (ch) <= 'F') || \
- ((ch) >= 'a' && (ch) <= 'f'))
-
static const char hexDigits[] = "0123456789ABCDEF";
static const unsigned char hashdata_lookup[256] =
@@ -107,13 +100,12 @@ static WCHAR *heap_strdupAtoW(const char *str)
static BOOL is_drive_spec( const WCHAR *str )
{
- return ((str[0] >= 'A' && str[0] <= 'Z') || (str[0] >= 'a' && str[0] <= 'z')) && str[1] == ':';
+ return isalpha( str[0] ) && str[1] == ':';
}
static BOOL is_escaped_drive_spec( const WCHAR *str )
{
- return ((str[0] >= 'A' && str[0] <= 'Z') || (str[0] >= 'a' && str[0] <= 'z')) &&
- (str[1] == ':' || str[1] == '|');
+ return isalpha( str[0] ) && (str[1] == ':' || str[1] == '|');
}
static BOOL is_prefixed_unc(const WCHAR *string)
@@ -2794,8 +2786,7 @@ HRESULT WINAPI ParseURLA(const char *url, PARSEDURLA *result)
if (result->cbSize != sizeof(*result))
return E_INVALIDARG;
- while (*ptr && ((*ptr >= 'a' && *ptr <= 'z') || (*ptr >= 'A' && *ptr <= 'Z') ||
- (*ptr >= '0' && *ptr <= '9') || *ptr == '-' || *ptr == '+' || *ptr == '.'))
+ while (*ptr && (isalnum( *ptr ) || *ptr == '-' || *ptr == '+' || *ptr == '.'))
ptr++;
if (*ptr != ':' || ptr <= url + 1)
@@ -4177,8 +4168,7 @@ static const WCHAR * scan_url(const WCHAR *start, DWORD *size, enum url_scan_typ
switch (type)
{
case SCHEME:
- while ((*start >= 'a' && *start <= 'z') || (*start >= '0' && *start <= '9') ||
- *start == '+' || *start == '-' || *start == '.')
+ while ((isalnum( *start ) && !isupper( *start )) || *start == '+' || *start == '-' || *start == '.')
{
start++;
(*size)++;
diff --git a/dlls/kernelbase/string.c b/dlls/kernelbase/string.c
index 29cc158202f..f5d4468ae6c 100644
--- a/dlls/kernelbase/string.c
+++ b/dlls/kernelbase/string.c
@@ -30,10 +30,6 @@
WINE_DEFAULT_DEBUG_CHANNEL(string);
-#define isxdigit(ch) (((ch) >= '0' && (ch) <= '9') || \
- ((ch) >= 'A' && (ch) <= 'F') || \
- ((ch) >= 'a' && (ch) <= 'f'))
-
static BOOL char_compare(WORD ch1, WORD ch2, DWORD flags)
{
char str1[3], str2[3];
--
2.34.1
Jan. 30, 2022
[PATCH v2 2/3] kernelbase: Use wcsnlen().
by Zebediah Figura
Signed-off-by: Zebediah Figura <zfigura(a)codeweavers.com>
---
dlls/kernelbase/path.c | 13 ++-----------
1 file changed, 2 insertions(+), 11 deletions(-)
diff --git a/dlls/kernelbase/path.c b/dlls/kernelbase/path.c
index b4b31410a3a..3503286a82a 100644
--- a/dlls/kernelbase/path.c
+++ b/dlls/kernelbase/path.c
@@ -105,15 +105,6 @@ static WCHAR *heap_strdupAtoW(const char *str)
return ret;
}
-static SIZE_T strnlenW(const WCHAR *string, SIZE_T maxlen)
-{
- SIZE_T i;
-
- for (i = 0; i < maxlen; i++)
- if (!string[i]) break;
- return i;
-}
-
static BOOL is_drive_spec( const WCHAR *str )
{
return ((str[0] >= 'A' && str[0] <= 'Z') || (str[0] >= 'a' && str[0] <= 'z')) && str[1] == ':';
@@ -517,7 +508,7 @@ HRESULT WINAPI PathCchAddExtension(WCHAR *path, SIZE_T size, const WCHAR *extens
if (FAILED(hr)) return hr;
if (*existing_extension) return S_FALSE;
- path_length = strnlenW(path, size);
+ path_length = wcsnlen(path, size);
dot_length = has_dot ? 0 : 1;
extension_length = lstrlenW(extension);
@@ -752,7 +743,7 @@ HRESULT WINAPI PathCchRemoveBackslashEx(WCHAR *path, SIZE_T path_size, WCHAR **p
return E_INVALIDARG;
}
- path_length = strnlenW(path, path_size);
+ path_length = wcsnlen(path, path_size);
if (path_length == path_size && !path[path_length]) return E_INVALIDARG;
root_end = get_root_end(path);
--
2.34.1
Jan. 30, 2022
[PATCH v2 1/3] ntdll: Implement wcsnlen().
by Zebediah Figura
Signed-off-by: Zebediah Figura <zfigura(a)codeweavers.com>
---
dlls/ntdll/ntdll.spec | 1 +
dlls/ntdll/wcstring.c | 11 +++++++++++
2 files changed, 12 insertions(+)
diff --git a/dlls/ntdll/ntdll.spec b/dlls/ntdll/ntdll.spec
index bd8e1f5efe6..afb945d4665 100644
--- a/dlls/ntdll/ntdll.spec
+++ b/dlls/ntdll/ntdll.spec
@@ -1609,6 +1609,7 @@
@ cdecl wcsncat(wstr wstr long)
@ cdecl wcsncmp(wstr wstr long)
@ cdecl wcsncpy(ptr wstr long)
+@ cdecl wcsnlen(ptr long)
@ cdecl wcspbrk(wstr wstr)
@ cdecl wcsrchr(wstr long)
@ cdecl wcsspn(wstr wstr)
diff --git a/dlls/ntdll/wcstring.c b/dlls/ntdll/wcstring.c
index a727e4defac..9422e4f676c 100644
--- a/dlls/ntdll/wcstring.c
+++ b/dlls/ntdll/wcstring.c
@@ -251,6 +251,17 @@ LPWSTR __cdecl wcsncpy( LPWSTR s1, LPCWSTR s2, size_t n )
}
+/*********************************************************************
+ * wcsnlen (NTDLL.@)
+ */
+size_t __cdecl wcsnlen( const WCHAR *str, size_t len )
+{
+ const WCHAR *s = str;
+ for (s = str; len && *s; s++, len--) ;
+ return s - str;
+}
+
+
/*********************************************************************
* wcspbrk (NTDLL.@)
*/
--
2.34.1
Jan. 30, 2022