Commit 170417f5 authored by Rémi Bernon's avatar Rémi Bernon Committed by Alexandre Julliard

windows.globalization: Implement IGlobalizationPreferencesStatics stubs.

parent 2942261c
......@@ -29,7 +29,13 @@
#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_Globalization
#include "windows.globalization.h"
#define WIDL_using_Windows_System_UserProfile
#include "windows.system.userprofile.h"
WINE_DEFAULT_DEBUG_CHANNEL(locale);
......@@ -45,6 +51,7 @@ static const char *debugstr_hstring(HSTRING hstr)
struct windows_globalization
{
IActivationFactory IActivationFactory_iface;
IGlobalizationPreferencesStatics IGlobalizationPreferencesStatics_iface;
LONG ref;
};
......@@ -53,6 +60,11 @@ static inline struct windows_globalization *impl_from_IActivationFactory(IActiva
return CONTAINING_RECORD(iface, struct windows_globalization, IActivationFactory_iface);
}
static inline struct windows_globalization *impl_from_IGlobalizationPreferencesStatics(IGlobalizationPreferencesStatics *iface)
{
return CONTAINING_RECORD(iface, struct windows_globalization, IGlobalizationPreferencesStatics_iface);
}
static HRESULT STDMETHODCALLTYPE windows_globalization_QueryInterface(
IActivationFactory *iface, REFIID iid, void **out)
{
......@@ -69,6 +81,13 @@ static HRESULT STDMETHODCALLTYPE windows_globalization_QueryInterface(
return S_OK;
}
if (IsEqualGUID(iid, &IID_IGlobalizationPreferencesStatics))
{
IUnknown_AddRef(iface);
*out = &impl->IGlobalizationPreferencesStatics_iface;
return S_OK;
}
FIXME("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(iid));
*out = NULL;
return E_NOINTERFACE;
......@@ -133,9 +152,112 @@ static const struct IActivationFactoryVtbl activation_factory_vtbl =
windows_globalization_ActivateInstance,
};
static HRESULT STDMETHODCALLTYPE globalization_preferences_QueryInterface(
IGlobalizationPreferencesStatics *iface, REFIID iid, void **object)
{
struct windows_globalization *impl = impl_from_IGlobalizationPreferencesStatics(iface);
return windows_globalization_QueryInterface(&impl->IActivationFactory_iface, iid, object);
}
static ULONG STDMETHODCALLTYPE globalization_preferences_AddRef(
IGlobalizationPreferencesStatics *iface)
{
struct windows_globalization *impl = impl_from_IGlobalizationPreferencesStatics(iface);
return windows_globalization_AddRef(&impl->IActivationFactory_iface);
}
static ULONG STDMETHODCALLTYPE globalization_preferences_Release(
IGlobalizationPreferencesStatics *iface)
{
struct windows_globalization *impl = impl_from_IGlobalizationPreferencesStatics(iface);
return windows_globalization_Release(&impl->IActivationFactory_iface);
}
static HRESULT STDMETHODCALLTYPE globalization_preferences_GetIids(
IGlobalizationPreferencesStatics *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 globalization_preferences_GetRuntimeClassName(
IGlobalizationPreferencesStatics *iface, HSTRING *class_name)
{
FIXME("iface %p, class_name %p stub!\n", iface, class_name);
return E_NOTIMPL;
}
static HRESULT STDMETHODCALLTYPE globalization_preferences_GetTrustLevel(
IGlobalizationPreferencesStatics *iface, TrustLevel *trust_level)
{
FIXME("iface %p, trust_level %p stub!\n", iface, trust_level);
return E_NOTIMPL;
}
static HRESULT STDMETHODCALLTYPE globalization_preferences_get_Calendars(
IGlobalizationPreferencesStatics *iface, IVectorView_HSTRING **out)
{
FIXME("iface %p, out %p stub!\n", iface, out);
return E_NOTIMPL;
}
static HRESULT STDMETHODCALLTYPE globalization_preferences_get_Clocks(
IGlobalizationPreferencesStatics *iface, IVectorView_HSTRING **out)
{
FIXME("iface %p, out %p stub!\n", iface, out);
return E_NOTIMPL;
}
static HRESULT STDMETHODCALLTYPE globalization_preferences_get_Currencies(
IGlobalizationPreferencesStatics *iface, IVectorView_HSTRING **out)
{
FIXME("iface %p, out %p stub!\n", iface, out);
return E_NOTIMPL;
}
static HRESULT STDMETHODCALLTYPE globalization_preferences_get_Languages(
IGlobalizationPreferencesStatics *iface, IVectorView_HSTRING **out)
{
FIXME("iface %p, out %p stub!\n", iface, out);
return E_NOTIMPL;
}
static HRESULT STDMETHODCALLTYPE globalization_preferences_get_HomeGeographicRegion(
IGlobalizationPreferencesStatics *iface, HSTRING* out)
{
FIXME("iface %p, out %p stub!\n", iface, out);
return E_NOTIMPL;
}
static HRESULT STDMETHODCALLTYPE globalization_preferences_get_WeekStartsOn(
IGlobalizationPreferencesStatics *iface, enum DayOfWeek* out)
{
FIXME("iface %p, out %p stub!\n", iface, out);
return E_NOTIMPL;
}
static const struct IGlobalizationPreferencesStaticsVtbl globalization_preferences_vtbl =
{
globalization_preferences_QueryInterface,
globalization_preferences_AddRef,
globalization_preferences_Release,
/* IInspectable methods */
globalization_preferences_GetIids,
globalization_preferences_GetRuntimeClassName,
globalization_preferences_GetTrustLevel,
/* IGlobalizationPreferencesStatics methods */
globalization_preferences_get_Calendars,
globalization_preferences_get_Clocks,
globalization_preferences_get_Currencies,
globalization_preferences_get_Languages,
globalization_preferences_get_HomeGeographicRegion,
globalization_preferences_get_WeekStartsOn,
};
static struct windows_globalization windows_globalization =
{
{&activation_factory_vtbl},
{&globalization_preferences_vtbl},
0
};
......
......@@ -88,8 +88,7 @@ static void test_GlobalizationPreferences(void)
ok(hr == S_OK, "IActivationFactory_QueryInterface IID_IAgileObject failed, hr %#x\n", hr);
hr = IActivationFactory_QueryInterface(factory, &IID_IGlobalizationPreferencesStatics, (void **)&preferences_statics);
todo_wine ok(hr == S_OK, "IActivationFactory_QueryInterface IID_IGlobalizationPreferencesStatics failed, hr %#x\n", hr);
if (FAILED(hr)) goto done;
ok(hr == S_OK, "IActivationFactory_QueryInterface IID_IGlobalizationPreferencesStatics failed, hr %#x\n", hr);
hr = IGlobalizationPreferencesStatics_QueryInterface(preferences_statics, &IID_IInspectable, (void **)&tmp_inspectable);
ok(hr == S_OK, "IGlobalizationPreferencesStatics_QueryInterface IID_IInspectable failed, hr %#x\n", hr);
......@@ -102,7 +101,8 @@ static void test_GlobalizationPreferences(void)
IAgileObject_Release(tmp_agile_object);
hr = IGlobalizationPreferencesStatics_get_HomeGeographicRegion(preferences_statics, &tmp_str);
ok(hr == S_OK, "IGlobalizationPreferencesStatics_get_HomeGeographicRegion failed, hr %#x\n", hr);
todo_wine ok(hr == S_OK, "IGlobalizationPreferencesStatics_get_HomeGeographicRegion failed, hr %#x\n", hr);
if (FAILED(hr)) goto done;
buf = pWindowsGetStringRawBuffer(tmp_str, &len);
ok(buf != NULL && len > 0, "WindowsGetStringRawBuffer returned buf %p, len %u\n", buf, len);
......@@ -154,9 +154,9 @@ static void test_GlobalizationPreferences(void)
IVectorView_HSTRING_Release(languages);
done:
IGlobalizationPreferencesStatics_Release(preferences_statics);
done:
IAgileObject_Release(agile_object);
IInspectable_Release(inspectable);
IActivationFactory_Release(factory);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment