From: Fabian Maurer Subject: [PATCH 2/4] windows.foundation.metadata: Add stubs for IApiInformationStatics Message-Id: <20220130172355.19624-2-dark.shadow4@web.de> Date: Sun, 30 Jan 2022 18:23:53 +0100 In-Reply-To: <20220130172355.19624-1-dark.shadow4@web.de> References: <20220130172355.19624-1-dark.shadow4@web.de> Signed-off-by: Fabian Maurer --- 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