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
99fdedb4
Commit
99fdedb4
authored
Sep 28, 2023
by
Mohamad Al-Jaf
Committed by
Alexandre Julliard
Oct 05, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
windows.media.mediacontrol: Add ISystemMediaTransportControlsInterop stub interface.
parent
8b34decc
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
77 additions
and
0 deletions
+77
-0
classes.idl
dlls/windows.media.mediacontrol/classes.idl
+1
-0
main.c
dlls/windows.media.mediacontrol/main.c
+30
-0
private.h
dlls/windows.media.mediacontrol/private.h
+39
-0
mediacontrol.c
dlls/windows.media.mediacontrol/tests/mediacontrol.c
+7
-0
No files found.
dlls/windows.media.mediacontrol/classes.idl
View file @
99fdedb4
...
...
@@ -20,4 +20,5 @@
#
pragma
makedep
register
#
include
"systemmediatransportcontrolsinterop.idl"
#
include
"windows.media.idl"
dlls/windows.media.mediacontrol/main.c
View file @
99fdedb4
...
...
@@ -27,6 +27,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(mediacontrol);
struct
media_control_statics
{
IActivationFactory
IActivationFactory_iface
;
ISystemMediaTransportControlsInterop
ISystemMediaTransportControlsInterop_iface
;
LONG
ref
;
};
...
...
@@ -51,6 +52,13 @@ static HRESULT WINAPI factory_QueryInterface( IActivationFactory *iface, REFIID
return
S_OK
;
}
if
(
IsEqualGUID
(
iid
,
&
IID_ISystemMediaTransportControlsInterop
))
{
*
out
=
&
impl
->
ISystemMediaTransportControlsInterop_iface
;
IInspectable_AddRef
(
*
out
);
return
S_OK
;
}
FIXME
(
"%s not implemented, returning E_NOINTERFACE.
\n
"
,
debugstr_guid
(
iid
)
);
*
out
=
NULL
;
return
E_NOINTERFACE
;
...
...
@@ -109,9 +117,31 @@ static const struct IActivationFactoryVtbl factory_vtbl =
factory_ActivateInstance
,
};
DEFINE_IINSPECTABLE
(
media_control_statics
,
ISystemMediaTransportControlsInterop
,
struct
media_control_statics
,
IActivationFactory_iface
)
static
HRESULT
WINAPI
media_control_statics_GetForWindow
(
ISystemMediaTransportControlsInterop
*
iface
,
HWND
window
,
REFIID
riid
,
void
**
control
)
{
FIXME
(
"iface %p, window %p, riid %s, control %p stub!
\n
"
,
iface
,
window
,
debugstr_guid
(
riid
),
control
);
return
E_NOTIMPL
;
}
static
const
struct
ISystemMediaTransportControlsInteropVtbl
media_control_statics_vtbl
=
{
media_control_statics_QueryInterface
,
media_control_statics_AddRef
,
media_control_statics_Release
,
/* IInspectable methods */
media_control_statics_GetIids
,
media_control_statics_GetRuntimeClassName
,
media_control_statics_GetTrustLevel
,
/* ISystemMediaTransportControlsInterop methods */
media_control_statics_GetForWindow
,
};
static
struct
media_control_statics
media_control_statics
=
{
{
&
factory_vtbl
},
{
&
media_control_statics_vtbl
},
1
,
};
...
...
dlls/windows.media.mediacontrol/private.h
View file @
99fdedb4
...
...
@@ -34,5 +34,44 @@
#include "windows.foundation.h"
#define WIDL_using_Windows_Media
#include "windows.media.h"
#include "systemmediatransportcontrolsinterop.h"
#define DEFINE_IINSPECTABLE_( pfx, iface_type, impl_type, impl_from, iface_mem, expr ) \
static inline impl_type *impl_from( iface_type *iface ) \
{ \
return CONTAINING_RECORD( iface, impl_type, iface_mem ); \
} \
static HRESULT WINAPI pfx##_QueryInterface( iface_type *iface, REFIID iid, void **out ) \
{ \
impl_type *impl = impl_from( iface ); \
return IInspectable_QueryInterface( (IInspectable *)(expr), iid, out ); \
} \
static ULONG WINAPI pfx##_AddRef( iface_type *iface ) \
{ \
impl_type *impl = impl_from( iface ); \
return IInspectable_AddRef( (IInspectable *)(expr) ); \
} \
static ULONG WINAPI pfx##_Release( iface_type *iface ) \
{ \
impl_type *impl = impl_from( iface ); \
return IInspectable_Release( (IInspectable *)(expr) ); \
} \
static HRESULT WINAPI pfx##_GetIids( iface_type *iface, ULONG *iid_count, IID **iids ) \
{ \
impl_type *impl = impl_from( iface ); \
return IInspectable_GetIids( (IInspectable *)(expr), iid_count, iids ); \
} \
static HRESULT WINAPI pfx##_GetRuntimeClassName( iface_type *iface, HSTRING *class_name ) \
{ \
impl_type *impl = impl_from( iface ); \
return IInspectable_GetRuntimeClassName( (IInspectable *)(expr), class_name ); \
} \
static HRESULT WINAPI pfx##_GetTrustLevel( iface_type *iface, TrustLevel *trust_level ) \
{ \
impl_type *impl = impl_from( iface ); \
return IInspectable_GetTrustLevel( (IInspectable *)(expr), trust_level ); \
}
#define DEFINE_IINSPECTABLE( pfx, iface_type, impl_type, base_iface ) \
DEFINE_IINSPECTABLE_( pfx, iface_type, impl_type, impl_from_##iface_type, iface_type##_iface, &impl->base_iface )
#endif
dlls/windows.media.mediacontrol/tests/mediacontrol.c
View file @
99fdedb4
...
...
@@ -30,6 +30,7 @@
#include "windows.foundation.h"
#define WIDL_using_Windows_Media
#include "windows.media.h"
#include "systemmediatransportcontrolsinterop.h"
#include "wine/test.h"
...
...
@@ -48,6 +49,7 @@ static void check_interface_( unsigned int line, void *obj, const IID *iid )
static
void
test_MediaControlStatics
(
void
)
{
static
const
WCHAR
*
media_control_statics_name
=
L"Windows.Media.SystemMediaTransportControls"
;
ISystemMediaTransportControlsInterop
*
media_control_interop_statics
;
IActivationFactory
*
factory
;
HSTRING
str
;
HRESULT
hr
;
...
...
@@ -69,6 +71,11 @@ static void test_MediaControlStatics(void)
check_interface
(
factory
,
&
IID_IInspectable
);
check_interface
(
factory
,
&
IID_IAgileObject
);
hr
=
IActivationFactory_QueryInterface
(
factory
,
&
IID_ISystemMediaTransportControlsInterop
,
(
void
**
)
&
media_control_interop_statics
);
ok
(
hr
==
S_OK
,
"got hr %#lx.
\n
"
,
hr
);
ref
=
ISystemMediaTransportControlsInterop_Release
(
media_control_interop_statics
);
ok
(
ref
==
2
,
"got ref %ld.
\n
"
,
ref
);
ref
=
IActivationFactory_Release
(
factory
);
ok
(
ref
==
1
,
"got ref %ld.
\n
"
,
ref
);
}
...
...
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