From: Fabian Maurer dark.shadow4@web.de
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=55126 --- .../main.c | 50 +++++++++++++++++++ .../private.h | 1 + 2 files changed, 51 insertions(+)
diff --git a/dlls/windows.devices.geolocation.geolocator/main.c b/dlls/windows.devices.geolocation.geolocator/main.c index 0f78990ae3b..0d51c70ebea 100644 --- a/dlls/windows.devices.geolocation.geolocator/main.c +++ b/dlls/windows.devices.geolocation.geolocator/main.c @@ -37,6 +37,7 @@ struct geolocator { IActivationFactory IActivationFactory_iface; IGeolocator IGeolocator_iface; + IWeakReferenceSource IWeakReferenceSource_iface; LONG ref; };
@@ -84,6 +85,7 @@ HRESULT WINAPI geolocator_ReportInterval_set(IGeolocator *iface, UINT32 value) HRESULT WINAPI geolocator_LocationStatus(IGeolocator *iface, PositionStatus *value) { FIXME("iface %p, value %p stub.\n", iface, value); + *value = 0; return E_NOTIMPL; }
@@ -148,6 +150,45 @@ static const struct IGeolocatorVtbl geolocator_vtbl = geolocator_StatusChanged_remove, };
+static inline struct geolocator *impl_from_IWeakReferenceSource(IWeakReferenceSource *iface) +{ + return CONTAINING_RECORD(iface, struct geolocator, IWeakReferenceSource_iface); +} + +static HRESULT WINAPI weakreferencesource_QueryInterface(IWeakReferenceSource *iface, REFIID iid, void **out) +{ + struct geolocator *impl = impl_from_IWeakReferenceSource(iface); + return geolocator_QueryInterface(&impl->IGeolocator_iface, iid, out); +} + +static ULONG WINAPI weakreferencesource_AddRef(IWeakReferenceSource *iface) +{ + struct geolocator *impl = impl_from_IWeakReferenceSource(iface); + return geolocator_AddRef(&impl->IGeolocator_iface); +} + +static ULONG WINAPI weakreferencesource_Release(IWeakReferenceSource *iface) +{ + struct geolocator *impl = impl_from_IWeakReferenceSource(iface); + return geolocator_Release(&impl->IGeolocator_iface); +} + +static HRESULT WINAPI weakreferencesource_GetWeakReference(IWeakReferenceSource *iface , IWeakReference **ref) +{ + FIXME("iface %p, ref %p stub.\n", iface, ref); + *ref = 0; + return E_NOTIMPL; +} + +static const struct IWeakReferenceSourceVtbl weakreferencesource_vtbl = +{ + weakreferencesource_QueryInterface, + weakreferencesource_AddRef, + weakreferencesource_Release, + /* IWeakReferenceSource methods */ + weakreferencesource_GetWeakReference, +}; + static inline struct geolocator *impl_from_IActivationFactory(IActivationFactory *iface) { return CONTAINING_RECORD(iface, struct geolocator, IActivationFactory_iface); @@ -176,6 +217,13 @@ static HRESULT WINAPI factory_QueryInterface(IActivationFactory *iface, REFIID i return S_OK; }
+ if (IsEqualGUID(iid, &IID_IWeakReferenceSource)) + { + *out = &impl->IWeakReferenceSource_iface; + IInspectable_AddRef(*out); + return S_OK; + } + FIXME("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(iid)); *out = NULL; return E_NOINTERFACE; @@ -231,6 +279,7 @@ static HRESULT WINAPI factory_ActivateInstance(IActivationFactory *iface, IInspe
impl->IActivationFactory_iface.lpVtbl = &factory_vtbl; impl->IGeolocator_iface.lpVtbl = &geolocator_vtbl; + impl->IWeakReferenceSource_iface.lpVtbl = &weakreferencesource_vtbl; impl->ref = 1;
*instance = (IInspectable *)&impl->IGeolocator_iface; @@ -254,6 +303,7 @@ static struct geolocator geolocator = { {&factory_vtbl}, {&geolocator_vtbl}, + {&weakreferencesource_vtbl}, 1, };
diff --git a/dlls/windows.devices.geolocation.geolocator/private.h b/dlls/windows.devices.geolocation.geolocator/private.h index 15e6720f73c..74b09b877e2 100644 --- a/dlls/windows.devices.geolocation.geolocator/private.h +++ b/dlls/windows.devices.geolocation.geolocator/private.h @@ -28,6 +28,7 @@ #include "winstring.h"
#include "activation.h" +#include "weakreference.h"
#define WIDL_using_Windows_Foundation #define WIDL_using_Windows_Foundation_Collections