This repository has been archived by the owner on Oct 1, 2020. It is now read-only.
/
0002-dmusic-Add-IKsControl-stub-subinterface-for-SynthPor.patch
144 lines (136 loc) · 5.67 KB
/
0002-dmusic-Add-IKsControl-stub-subinterface-for-SynthPor.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
From 8b845b6348b898f79e7fd401b045a46f9501e1e0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Fri, 29 Apr 2016 16:41:04 +0200
Subject: dmusic: Add IKsControl stub subinterface for SynthPort.
---
dlls/dmusic/dmusic_private.h | 2 ++
dlls/dmusic/port.c | 79 ++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 81 insertions(+)
diff --git a/dlls/dmusic/dmusic_private.h b/dlls/dmusic/dmusic_private.h
index 44d5d57..110788c 100644
--- a/dlls/dmusic/dmusic_private.h
+++ b/dlls/dmusic/dmusic_private.h
@@ -41,6 +41,7 @@
#include "dmusici.h"
#include "dmusicf.h"
#include "dmusics.h"
+#include "dmksctrl.h"
/*****************************************************************************
* Interfaces
@@ -167,6 +168,7 @@ struct SynthPortImpl {
IDirectMusicPort IDirectMusicPort_iface;
IDirectMusicPortDownload IDirectMusicPortDownload_iface;
IDirectMusicThru IDirectMusicThru_iface;
+ IKsControl IKsControl_iface;
LONG ref;
/* IDirectMusicPort fields */
diff --git a/dlls/dmusic/port.c b/dlls/dmusic/port.c
index f886d52..3d434e1 100644
--- a/dlls/dmusic/port.c
+++ b/dlls/dmusic/port.c
@@ -44,6 +44,11 @@ static inline SynthPortImpl *impl_from_SynthPortImpl_IDirectMusicThru(IDirectMus
return CONTAINING_RECORD(iface, SynthPortImpl, IDirectMusicThru_iface);
}
+static inline SynthPortImpl *impl_from_SynthPortImpl_IKsControl(IKsControl *iface)
+{
+ return CONTAINING_RECORD(iface, SynthPortImpl, IKsControl_iface);
+}
+
/* IDirectMusicDownloadedInstrument IUnknown part follows: */
static HRESULT WINAPI IDirectMusicDownloadedInstrumentImpl_QueryInterface(IDirectMusicDownloadedInstrument *iface, REFIID riid, VOID **ret_iface)
{
@@ -142,6 +147,10 @@ static HRESULT WINAPI SynthPortImpl_IDirectMusicPort_QueryInterface(LPDIRECTMUSI
*ret_iface = &This->IDirectMusicThru_iface;
IDirectMusicThru_AddRef((LPDIRECTMUSICTHRU)*ret_iface);
return S_OK;
+ } else if (IsEqualGUID(riid, &IID_IKsControl)) {
+ *ret_iface = &This->IKsControl_iface;
+ IKsControl_AddRef((IKsControl*)*ret_iface);
+ return S_OK;
}
WARN("(%p, %s, %p): not found\n", This, debugstr_dmguid(riid), ret_iface);
@@ -672,6 +681,75 @@ static const IDirectMusicThruVtbl SynthPortImpl_DirectMusicThru_Vtbl = {
SynthPortImpl_IDirectMusicThru_ThruChannel
};
+static HRESULT WINAPI SynthPortImpl_IKsControl_QueryInterface(IKsControl* iface, REFIID riid, LPVOID *ppobj)
+{
+ SynthPortImpl *This = impl_from_SynthPortImpl_IKsControl(iface);
+
+ return IDirectMusicPort_QueryInterface(&This->IDirectMusicPort_iface, riid, ppobj);
+}
+
+static ULONG WINAPI SynthPortImpl_IKsControl_AddRef(IKsControl* iface)
+{
+ SynthPortImpl *This = impl_from_SynthPortImpl_IKsControl(iface);
+
+ return IDirectMusicPort_AddRef(&This->IDirectMusicPort_iface);
+}
+
+static ULONG WINAPI SynthPortImpl_IKsControl_Release(IKsControl* iface)
+{
+ SynthPortImpl *This = impl_from_SynthPortImpl_IKsControl(iface);
+
+ return IDirectMusicPort_Release(&This->IDirectMusicPort_iface);
+}
+
+static HRESULT WINAPI SynthPortImpl_IKsControl_KsProperty(IKsControl* iface, PKSPROPERTY Property, ULONG PropertyLength, LPVOID PropertyData,
+ ULONG DataLength, ULONG* BytesReturned)
+{
+ TRACE("(%p)->(%p, %u, %p, %u, %p)\n", iface, Property, PropertyLength, PropertyData, DataLength, BytesReturned);
+
+ TRACE("Property = %s - %u - %u\n", debugstr_guid(&Property->Set), Property->Id, Property->Flags);
+
+ if (Property->Flags != KSPROPERTY_TYPE_GET)
+ {
+ FIXME("Property flags %u not yet supported\n", Property->Flags);
+ return S_FALSE;
+ }
+
+ if (DataLength < sizeof(DWORD))
+ return E_NOT_SUFFICIENT_BUFFER;
+
+ FIXME("Unknown property %s\n", debugstr_guid(&Property->Set));
+ *(DWORD*)PropertyData = FALSE;
+ *BytesReturned = sizeof(DWORD);
+
+ return S_OK;
+}
+
+static HRESULT WINAPI SynthPortImpl_IKsControl_KsMethod(IKsControl* iface, PKSMETHOD Method, ULONG MethodLength, LPVOID MethodData,
+ ULONG DataLength, ULONG* BytesReturned)
+{
+ FIXME("(%p)->(%p, %u, %p, %u, %p): stub\n", iface, Method, MethodLength, MethodData, DataLength, BytesReturned);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI SynthPortImpl_IKsControl_KsEvent(IKsControl* iface, PKSEVENT Event, ULONG EventLength, LPVOID EventData,
+ ULONG DataLength, ULONG* BytesReturned)
+{
+ FIXME("(%p)->(%p, %u, %p, %u, %p): stub\n", iface, Event, EventLength, EventData, DataLength, BytesReturned);
+
+ return E_NOTIMPL;
+}
+
+static const IKsControlVtbl SynthPortImpl_IKsControl_Vtbl = {
+ SynthPortImpl_IKsControl_QueryInterface,
+ SynthPortImpl_IKsControl_AddRef,
+ SynthPortImpl_IKsControl_Release,
+ SynthPortImpl_IKsControl_KsProperty,
+ SynthPortImpl_IKsControl_KsMethod,
+ SynthPortImpl_IKsControl_KsEvent
+};
+
HRESULT DMUSIC_CreateSynthPortImpl(LPCGUID guid, LPVOID *object, LPUNKNOWN unkouter, LPDMUS_PORTPARAMS port_params, LPDMUS_PORTCAPS port_caps, DWORD device)
{
SynthPortImpl *obj;
@@ -689,6 +767,7 @@ HRESULT DMUSIC_CreateSynthPortImpl(LPCGUID guid, LPVOID *object, LPUNKNOWN unkou
obj->IDirectMusicPort_iface.lpVtbl = &SynthPortImpl_DirectMusicPort_Vtbl;
obj->IDirectMusicPortDownload_iface.lpVtbl = &SynthPortImpl_DirectMusicPortDownload_Vtbl;
obj->IDirectMusicThru_iface.lpVtbl = &SynthPortImpl_DirectMusicThru_Vtbl;
+ obj->IKsControl_iface.lpVtbl = &SynthPortImpl_IKsControl_Vtbl;
obj->ref = 0; /* Will be inited by QueryInterface */
obj->fActive = FALSE;
obj->params = *port_params;
--
2.8.0