Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
091535e4
Commit
091535e4
authored
Jun 28, 2023
by
Fabian Maurer
Committed by
Alexandre Julliard
Jul 06, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
windows.devices.geolocation.geolocator: Add stubs for IGeolocator.
parent
7fb18d59
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
203 additions
and
2 deletions
+203
-2
main.c
dlls/windows.devices.geolocation.geolocator/main.c
+186
-2
geolocator.c
...windows.devices.geolocation.geolocator/tests/geolocator.c
+17
-0
No files found.
dlls/windows.devices.geolocation.geolocator/main.c
View file @
091535e4
...
...
@@ -30,6 +30,175 @@ struct geolocator_statics
LONG
ref
;
};
struct
geolocator
{
IGeolocator
IGeolocator_iface
;
LONG
ref
;
};
static
inline
struct
geolocator
*
impl_from_IGeolocator
(
IGeolocator
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
struct
geolocator
,
IGeolocator_iface
);
}
static
HRESULT
WINAPI
geolocator_QueryInterface
(
IGeolocator
*
iface
,
REFIID
iid
,
void
**
out
)
{
struct
geolocator
*
impl
=
impl_from_IGeolocator
(
iface
);
TRACE
(
"iface %p, iid %s, out %p.
\n
"
,
iface
,
debugstr_guid
(
iid
),
out
);
if
(
IsEqualGUID
(
iid
,
&
IID_IUnknown
)
||
IsEqualGUID
(
iid
,
&
IID_IInspectable
)
||
IsEqualGUID
(
iid
,
&
IID_IAgileObject
)
||
IsEqualGUID
(
iid
,
&
IID_IGeolocator
))
{
*
out
=
&
impl
->
IGeolocator_iface
;
IInspectable_AddRef
(
*
out
);
return
S_OK
;
}
FIXME
(
"%s not implemented, returning E_NOINTERFACE.
\n
"
,
debugstr_guid
(
iid
));
*
out
=
NULL
;
return
E_NOINTERFACE
;
}
static
ULONG
WINAPI
geolocator_AddRef
(
IGeolocator
*
iface
)
{
struct
geolocator
*
impl
=
impl_from_IGeolocator
(
iface
);
ULONG
ref
=
InterlockedIncrement
(
&
impl
->
ref
);
TRACE
(
"iface %p increasing refcount to %lu.
\n
"
,
iface
,
ref
);
return
ref
;
}
static
ULONG
WINAPI
geolocator_Release
(
IGeolocator
*
iface
)
{
struct
geolocator
*
impl
=
impl_from_IGeolocator
(
iface
);
ULONG
ref
=
InterlockedDecrement
(
&
impl
->
ref
);
TRACE
(
"iface %p decreasing refcount to %lu.
\n
"
,
iface
,
ref
);
return
ref
;
}
static
HRESULT
WINAPI
geolocator_GetIids
(
IGeolocator
*
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
WINAPI
geolocator_GetRuntimeClassName
(
IGeolocator
*
iface
,
HSTRING
*
class_name
)
{
FIXME
(
"iface %p, class_name %p stub!
\n
"
,
iface
,
class_name
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
geolocator_GetTrustLevel
(
IGeolocator
*
iface
,
TrustLevel
*
trust_level
)
{
FIXME
(
"iface %p, trust_level %p stub!
\n
"
,
iface
,
trust_level
);
return
E_NOTIMPL
;
}
HRESULT
WINAPI
geolocator_get_DesiredAccuracy
(
IGeolocator
*
iface
,
PositionAccuracy
*
value
)
{
FIXME
(
"iface %p, value %p stub.
\n
"
,
iface
,
value
);
return
E_NOTIMPL
;
}
HRESULT
WINAPI
geolocator_set_DesiredAccuracy
(
IGeolocator
*
iface
,
PositionAccuracy
value
)
{
FIXME
(
"iface %p, value %d stub.
\n
"
,
iface
,
value
);
return
E_NOTIMPL
;
}
HRESULT
WINAPI
geolocator_get_MovementThreshold
(
IGeolocator
*
iface
,
DOUBLE
*
value
)
{
FIXME
(
"iface %p, value %p stub.
\n
"
,
iface
,
value
);
return
E_NOTIMPL
;
}
HRESULT
WINAPI
geolocator_set_MovementThreshold
(
IGeolocator
*
iface
,
DOUBLE
value
)
{
FIXME
(
"iface %p, value %f stub.
\n
"
,
iface
,
value
);
return
E_NOTIMPL
;
}
HRESULT
WINAPI
geolocator_get_ReportInterval
(
IGeolocator
*
iface
,
UINT32
*
value
)
{
FIXME
(
"iface %p, value %p stub.
\n
"
,
iface
,
value
);
return
E_NOTIMPL
;
}
HRESULT
WINAPI
geolocator_set_ReportInterval
(
IGeolocator
*
iface
,
UINT32
value
)
{
FIXME
(
"iface %p, value %u stub.
\n
"
,
iface
,
value
);
return
E_NOTIMPL
;
}
HRESULT
WINAPI
geolocator_LocationStatus
(
IGeolocator
*
iface
,
PositionStatus
*
value
)
{
FIXME
(
"iface %p, value %p stub.
\n
"
,
iface
,
value
);
return
E_NOTIMPL
;
}
HRESULT
WINAPI
geolocator_GetGeopositionAsync
(
IGeolocator
*
iface
,
IAsyncOperation_Geoposition
**
value
)
{
FIXME
(
"iface %p, value %p stub.
\n
"
,
iface
,
value
);
return
E_NOTIMPL
;
}
HRESULT
WINAPI
geolocator_GetGeopositionAsyncWithAgeAndTimeout
(
IGeolocator
*
iface
,
TimeSpan
maximum_age
,
TimeSpan
timeout
,
IAsyncOperation_Geoposition
**
value
)
{
FIXME
(
"iface %p, maximum_age %#I64x, timeout %#I64x, value %p stub.
\n
"
,
iface
,
maximum_age
.
Duration
,
timeout
.
Duration
,
value
);
return
E_NOTIMPL
;
}
HRESULT
WINAPI
geolocator_add_PositionChanged
(
IGeolocator
*
iface
,
ITypedEventHandler_Geolocator_PositionChangedEventArgs
*
handler
,
EventRegistrationToken
*
token
)
{
FIXME
(
"iface %p, handler %p, token %p stub.
\n
"
,
iface
,
handler
,
token
);
return
E_NOTIMPL
;
}
HRESULT
WINAPI
geolocator_remove_PositionChanged
(
IGeolocator
*
iface
,
EventRegistrationToken
token
)
{
FIXME
(
"iface %p, token %#I64x stub.
\n
"
,
iface
,
token
.
value
);
return
E_NOTIMPL
;
}
HRESULT
WINAPI
geolocator_add_StatusChanged
(
IGeolocator
*
iface
,
ITypedEventHandler_Geolocator_StatusChangedEventArgs
*
handler
,
EventRegistrationToken
*
token
)
{
FIXME
(
"iface %p, handler %p, token %p stub.
\n
"
,
iface
,
handler
,
token
);
return
E_NOTIMPL
;
}
HRESULT
WINAPI
geolocator_remove_StatusChanged
(
IGeolocator
*
iface
,
EventRegistrationToken
token
)
{
FIXME
(
"iface %p, token %#I64x stub.
\n
"
,
iface
,
token
.
value
);
return
E_NOTIMPL
;
}
static
const
struct
IGeolocatorVtbl
geolocator_vtbl
=
{
geolocator_QueryInterface
,
geolocator_AddRef
,
geolocator_Release
,
/* IInspectable methods */
geolocator_GetIids
,
geolocator_GetRuntimeClassName
,
geolocator_GetTrustLevel
,
/* IGeolocator methods */
geolocator_get_DesiredAccuracy
,
geolocator_set_DesiredAccuracy
,
geolocator_get_MovementThreshold
,
geolocator_set_MovementThreshold
,
geolocator_get_ReportInterval
,
geolocator_set_ReportInterval
,
geolocator_LocationStatus
,
geolocator_GetGeopositionAsync
,
geolocator_GetGeopositionAsyncWithAgeAndTimeout
,
geolocator_add_PositionChanged
,
geolocator_remove_PositionChanged
,
geolocator_add_StatusChanged
,
geolocator_remove_StatusChanged
,
};
static
inline
struct
geolocator_statics
*
impl_from_IActivationFactory
(
IActivationFactory
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
struct
geolocator_statics
,
IActivationFactory_iface
);
...
...
@@ -90,10 +259,25 @@ static HRESULT WINAPI factory_GetTrustLevel(IActivationFactory *iface, TrustLeve
return
E_NOTIMPL
;
}
static
const
struct
IActivationFactoryVtbl
factory_vtbl
;
static
HRESULT
WINAPI
factory_ActivateInstance
(
IActivationFactory
*
iface
,
IInspectable
**
instance
)
{
FIXME
(
"iface %p, instance %p stub!
\n
"
,
iface
,
instance
);
return
E_NOTIMPL
;
struct
geolocator
*
impl
;
TRACE
(
"iface %p, instance %p.
\n
"
,
iface
,
instance
);
if
(
!
(
impl
=
calloc
(
1
,
sizeof
(
*
impl
))))
{
*
instance
=
NULL
;
return
E_OUTOFMEMORY
;
}
impl
->
IGeolocator_iface
.
lpVtbl
=
&
geolocator_vtbl
;
impl
->
ref
=
1
;
*
instance
=
(
IInspectable
*
)
&
impl
->
IGeolocator_iface
;
return
S_OK
;
}
static
const
struct
IActivationFactoryVtbl
factory_vtbl
=
...
...
dlls/windows.devices.geolocation.geolocator/tests/geolocator.c
View file @
091535e4
...
...
@@ -51,6 +51,8 @@ void test_basic(void)
{
static
const
WCHAR
*
geolocator_name
=
L"Windows.Devices.Geolocation.Geolocator"
;
IActivationFactory
*
factory
;
IInspectable
*
inspectable
;
IGeolocator
*
geolocator
;
HSTRING
str
;
HRESULT
hr
;
...
...
@@ -71,6 +73,21 @@ void test_basic(void)
check_interface
(
factory
,
&
IID_IInspectable
);
check_interface
(
factory
,
&
IID_IActivationFactory
);
hr
=
IActivationFactory_ActivateInstance
(
factory
,
&
inspectable
);
ok
(
hr
==
S_OK
&&
inspectable
,
"got hr %#lx.
\n
"
,
hr
);
check_interface
(
inspectable
,
&
IID_IUnknown
);
check_interface
(
inspectable
,
&
IID_IInspectable
);
check_interface
(
inspectable
,
&
IID_IAgileObject
);
hr
=
IInspectable_QueryInterface
(
inspectable
,
&
IID_IGeolocator
,
(
void
**
)
&
geolocator
);
ok
(
hr
==
S_OK
&&
geolocator
,
"got hr %#lx.
\n
"
,
hr
);
ok
((
void
*
)
inspectable
==
(
void
*
)
geolocator
,
"Interfaces are not the same
\n
"
);
IInspectable_Release
(
inspectable
);
inspectable
=
0
;
IGeolocator_Release
(
geolocator
);
IActivationFactory_Release
(
factory
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment