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
42b04e2c
Commit
42b04e2c
authored
Dec 20, 2017
by
Nikolay Sivov
Committed by
Alexandre Julliard
Dec 20, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mfplat: Implement MFGetService().
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
6fb250e5
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
153 additions
and
1 deletion
+153
-1
main.c
dlls/mf/main.c
+23
-0
mf.spec
dlls/mf/mf.spec
+1
-1
mf.c
dlls/mf/tests/mf.c
+128
-0
mfidl.idl
include/mfidl.idl
+1
-0
No files found.
dlls/mf/main.c
View file @
42b04e2c
...
...
@@ -20,6 +20,8 @@
#include <stdarg.h>
#define COBJMACROS
#include "windef.h"
#include "winbase.h"
#include "mfidl.h"
...
...
@@ -51,3 +53,24 @@ HRESULT WINAPI MFGetSupportedMimeTypes(PROPVARIANT *array)
return
E_NOTIMPL
;
}
/***********************************************************************
* MFGetService (mf.@)
*/
HRESULT
WINAPI
MFGetService
(
IUnknown
*
object
,
REFGUID
service
,
REFIID
riid
,
void
**
obj
)
{
IMFGetService
*
gs
;
HRESULT
hr
;
TRACE
(
"(%p, %s, %s, %p)
\n
"
,
object
,
debugstr_guid
(
service
),
debugstr_guid
(
riid
),
obj
);
if
(
!
object
)
return
E_POINTER
;
if
(
FAILED
(
hr
=
IUnknown_QueryInterface
(
object
,
&
IID_IMFGetService
,
(
void
**
)
&
gs
)))
return
hr
;
hr
=
IMFGetService_GetService
(
gs
,
service
,
riid
,
obj
);
IMFGetService_Release
(
gs
);
return
hr
;
}
dlls/mf/mf.spec
View file @
42b04e2c
...
...
@@ -72,7 +72,7 @@
@ stub MFCreateWMVEncoderActivate
@ stub MFEnumDeviceSources
@ stub MFGetMultipleServiceProviders
@ st
ub MFGetService
@ st
dcall MFGetService(ptr ptr ptr ptr)
@ stdcall MFGetSupportedMimeTypes(ptr)
@ stub MFGetSupportedSchemes
@ stub MFGetTopoNodeCurrentType
...
...
dlls/mf/tests/mf.c
View file @
42b04e2c
...
...
@@ -26,6 +26,7 @@
#include "windef.h"
#include "winbase.h"
#include "initguid.h"
#include "mfidl.h"
#include "wine/test.h"
...
...
@@ -43,7 +44,134 @@ static void test_topology(void)
IMFTopology_Release
(
topology
);
}
static
HRESULT
WINAPI
test_getservice_QI
(
IMFGetService
*
iface
,
REFIID
riid
,
void
**
obj
)
{
if
(
IsEqualIID
(
riid
,
&
IID_IMFGetService
)
||
IsEqualIID
(
riid
,
&
IID_IUnknown
))
{
*
obj
=
iface
;
return
S_OK
;
}
*
obj
=
NULL
;
return
E_NOINTERFACE
;
}
static
ULONG
WINAPI
test_getservice_AddRef
(
IMFGetService
*
iface
)
{
return
2
;
}
static
ULONG
WINAPI
test_getservice_Release
(
IMFGetService
*
iface
)
{
return
1
;
}
static
HRESULT
WINAPI
test_getservice_GetService
(
IMFGetService
*
iface
,
REFGUID
service
,
REFIID
riid
,
void
**
obj
)
{
*
obj
=
(
void
*
)
0xdeadbeef
;
return
0x83eddead
;
}
static
const
IMFGetServiceVtbl
testmfgetservicevtbl
=
{
test_getservice_QI
,
test_getservice_AddRef
,
test_getservice_Release
,
test_getservice_GetService
,
};
static
IMFGetService
test_getservice
=
{
&
testmfgetservicevtbl
};
static
HRESULT
WINAPI
testservice_QI
(
IUnknown
*
iface
,
REFIID
riid
,
void
**
obj
)
{
if
(
IsEqualIID
(
riid
,
&
IID_IUnknown
))
{
*
obj
=
iface
;
return
S_OK
;
}
*
obj
=
NULL
;
if
(
IsEqualIID
(
riid
,
&
IID_IMFGetService
))
return
0x82eddead
;
return
E_NOINTERFACE
;
}
static
HRESULT
WINAPI
testservice2_QI
(
IUnknown
*
iface
,
REFIID
riid
,
void
**
obj
)
{
if
(
IsEqualIID
(
riid
,
&
IID_IUnknown
))
{
*
obj
=
iface
;
return
S_OK
;
}
if
(
IsEqualIID
(
riid
,
&
IID_IMFGetService
))
{
*
obj
=
&
test_getservice
;
return
S_OK
;
}
*
obj
=
NULL
;
return
E_NOINTERFACE
;
}
static
ULONG
WINAPI
testservice_AddRef
(
IUnknown
*
iface
)
{
return
2
;
}
static
ULONG
WINAPI
testservice_Release
(
IUnknown
*
iface
)
{
return
1
;
}
static
const
IUnknownVtbl
testservicevtbl
=
{
testservice_QI
,
testservice_AddRef
,
testservice_Release
,
};
static
const
IUnknownVtbl
testservice2vtbl
=
{
testservice2_QI
,
testservice_AddRef
,
testservice_Release
,
};
static
IUnknown
testservice
=
{
&
testservicevtbl
};
static
IUnknown
testservice2
=
{
&
testservice2vtbl
};
static
void
test_MFGetService
(
void
)
{
IUnknown
*
unk
;
HRESULT
hr
;
hr
=
MFGetService
(
NULL
,
NULL
,
NULL
,
NULL
);
ok
(
hr
==
E_POINTER
,
"Unexpected return value %#x.
\n
"
,
hr
);
unk
=
(
void
*
)
0xdeadbeef
;
hr
=
MFGetService
(
NULL
,
NULL
,
NULL
,
(
void
**
)
&
unk
);
ok
(
hr
==
E_POINTER
,
"Unexpected return value %#x.
\n
"
,
hr
);
ok
(
unk
==
(
void
*
)
0xdeadbeef
,
"Unexpected out object.
\n
"
);
hr
=
MFGetService
(
&
testservice
,
NULL
,
NULL
,
NULL
);
ok
(
hr
==
0x82eddead
,
"Unexpected return value %#x.
\n
"
,
hr
);
unk
=
(
void
*
)
0xdeadbeef
;
hr
=
MFGetService
(
&
testservice
,
NULL
,
NULL
,
(
void
**
)
&
unk
);
ok
(
hr
==
0x82eddead
,
"Unexpected return value %#x.
\n
"
,
hr
);
ok
(
unk
==
(
void
*
)
0xdeadbeef
,
"Unexpected out object.
\n
"
);
unk
=
NULL
;
hr
=
MFGetService
(
&
testservice2
,
NULL
,
NULL
,
(
void
**
)
&
unk
);
ok
(
hr
==
0x83eddead
,
"Unexpected return value %#x.
\n
"
,
hr
);
ok
(
unk
==
(
void
*
)
0xdeadbeef
,
"Unexpected out object.
\n
"
);
}
START_TEST
(
mf
)
{
test_topology
();
test_MFGetService
();
}
include/mfidl.idl
View file @
42b04e2c
...
...
@@ -256,3 +256,4 @@ cpp_quote("HRESULT WINAPI MFCreateStreamDescriptor(DWORD identifier, DWORD cMedi
cpp_quote
(
" IMFMediaType **types, IMFStreamDescriptor **descriptor);"
)
cpp_quote
(
"HRESULT WINAPI MFCreateTopology(IMFTopology **topology);"
)
cpp_quote
(
"HRESULT WINAPI MFGetSupportedMimeTypes(PROPVARIANT *array);"
)
cpp_quote
(
"HRESULT WINAPI MFGetService(IUnknown *object, REFGUID service, REFIID iid, void **obj);"
)
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