ReactOS 0.4.17-dev-934-g091855f
acmwrapper.c File Reference
#include "dshow.h"
#include "wine/test.h"
Include dependency graph for acmwrapper.c:

Go to the source code of this file.

Macros

#define COBJMACROS
 
#define check_interface(a, b, c)   check_interface_(__LINE__, a, b, c)
 

Functions

static IBaseFilter * create_acm_wrapper (void)
 
static ULONG get_refcount (void *iface)
 
static void check_interface_ (unsigned int line, void *iface_ptr, REFIID iid, BOOL supported)
 
static void test_interfaces (void)
 
static HRESULT WINAPI outer_QueryInterface (IUnknown *iface, REFIID iid, void **out)
 
static ULONG WINAPI outer_AddRef (IUnknown *iface)
 
static ULONG WINAPI outer_Release (IUnknown *iface)
 
static void test_aggregation (void)
 
static void test_enum_pins (void)
 
static void test_find_pin (void)
 
static void test_pin_info (void)
 
static void test_unconnected_filter_state (void)
 
 START_TEST (acmwrapper)
 

Variables

static const GUID test_iid = {0x33333333}
 
static LONG outer_ref = 1
 
static const IUnknownVtbl outer_vtbl
 
static IUnknown test_outer = {&outer_vtbl}
 

Macro Definition Documentation

◆ check_interface

#define check_interface (   a,
  b,
  c 
)    check_interface_(__LINE__, a, b, c)

Definition at line 41 of file acmwrapper.c.

◆ COBJMACROS

#define COBJMACROS

Definition at line 21 of file acmwrapper.c.

Function Documentation

◆ check_interface_()

static void check_interface_ ( unsigned int  line,
void *  iface_ptr,
REFIID  iid,
BOOL  supported 
)
static

Definition at line 42 of file acmwrapper.c.

43{
44 IUnknown *iface = iface_ptr;
46 IUnknown *unk;
47
48 expected_hr = supported ? S_OK : E_NOINTERFACE;
49
50 hr = IUnknown_QueryInterface(iface, iid, (void **)&unk);
51 ok_(__FILE__, line)(hr == expected_hr, "Got hr %#lx, expected %#lx.\n", hr, expected_hr);
52 if (SUCCEEDED(hr))
53 IUnknown_Release(unk);
54}
#define ok_(x1, x2)
Definition: atltest.h:61
HRESULT expected_hr
HRESULT hr
Definition: delayimp.cpp:582
#define S_OK
Definition: intsafe.h:52
#define SUCCEEDED(hr)
Definition: intsafe.h:50
Definition: parser.c:49
#define E_NOINTERFACE
Definition: winerror.h:3479

◆ create_acm_wrapper()

static IBaseFilter * create_acm_wrapper ( void  )
static

Definition at line 25 of file acmwrapper.c.

26{
28 HRESULT hr = CoCreateInstance(&CLSID_ACMWrapper, NULL, CLSCTX_INPROC_SERVER,
29 &IID_IBaseFilter, (void **)&filter);
30 ok(hr == S_OK, "Got hr %#lx.\n", hr);
31 return filter;
32}
#define ok(value,...)
Definition: atltest.h:57
const GUID IID_IBaseFilter
#define NULL
Definition: types.h:112
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, IUnknown *outer, DWORD cls_context, REFIID riid, void **obj)
Definition: combase.c:1685
Definition: filter.c:165

Referenced by test_enum_pins(), test_find_pin(), test_interfaces(), test_pin_info(), and test_unconnected_filter_state().

◆ get_refcount()

static ULONG get_refcount ( void *  iface)
static

Definition at line 34 of file acmwrapper.c.

35{
36 IUnknown *unknown = iface;
37 IUnknown_AddRef(unknown);
38 return IUnknown_Release(unknown);
39}
static WCHAR unknown[MAX_STRING_RESOURCE_LEN]
Definition: object.c:1674

Referenced by test_aggregation(), test_enum_pins(), and test_pin_info().

◆ outer_AddRef()

static ULONG WINAPI outer_AddRef ( IUnknown *  iface)
static

Definition at line 122 of file acmwrapper.c.

123{
125}
#define InterlockedIncrement
Definition: armddk.h:53
static LONG outer_ref
Definition: acmwrapper.c:107

◆ outer_QueryInterface()

static HRESULT WINAPI outer_QueryInterface ( IUnknown *  iface,
REFIID  iid,
void **  out 
)
static

Definition at line 109 of file acmwrapper.c.

110{
111 if (IsEqualGUID(iid, &IID_IUnknown)
113 || IsEqualGUID(iid, &test_iid))
114 {
115 *out = (IUnknown *)0xdeadbeef;
116 return S_OK;
117 }
118 ok(0, "unexpected call %s\n", wine_dbgstr_guid(iid));
119 return E_NOINTERFACE;
120}
const GUID IID_IUnknown
static const GUID test_iid
Definition: acmwrapper.c:106
#define IsEqualGUID(rguid1, rguid2)
Definition: guiddef.h:147
static __inline const char * wine_dbgstr_guid(const GUID *id)
Definition: debug.h:181
wchar_t tm const _CrtWcstime_Writes_and_advances_ptr_ count wchar_t ** out
Definition: wcsftime.cpp:383

◆ outer_Release()

static ULONG WINAPI outer_Release ( IUnknown *  iface)
static

Definition at line 127 of file acmwrapper.c.

128{
130}
#define InterlockedDecrement
Definition: armddk.h:52

◆ START_TEST()

START_TEST ( acmwrapper  )

Definition at line 492 of file acmwrapper.c.

493{
495
502
504}
void WINAPI DECLSPEC_HOTPATCH CoUninitialize(void)
Definition: combase.c:2842
HRESULT WINAPI CoInitialize(LPVOID lpReserved)
Definition: compobj.c:531
static void test_aggregation(void)
Definition: acmwrapper.c:141
static void test_pin_info(void)
Definition: acmwrapper.c:362
static void test_find_pin(void)
Definition: acmwrapper.c:321
static void test_interfaces(void)
Definition: acmwrapper.c:56
static void test_enum_pins(void)
Definition: acmwrapper.c:200
static void test_unconnected_filter_state(void)
Definition: acmwrapper.c:435

◆ test_aggregation()

static void test_aggregation ( void  )
static

Definition at line 141 of file acmwrapper.c.

142{
143 IBaseFilter *filter, *filter2;
144 IUnknown *unk, *unk2;
145 HRESULT hr;
146 ULONG ref;
147
148 filter = (IBaseFilter *)0xdeadbeef;
149 hr = CoCreateInstance(&CLSID_ACMWrapper, &test_outer, CLSCTX_INPROC_SERVER,
150 &IID_IBaseFilter, (void **)&filter);
151 ok(hr == E_NOINTERFACE, "Got hr %#lx.\n", hr);
152 ok(!filter, "Got interface %p.\n", filter);
153
154 hr = CoCreateInstance(&CLSID_ACMWrapper, &test_outer, CLSCTX_INPROC_SERVER,
155 &IID_IUnknown, (void **)&unk);
156 ok(hr == S_OK, "Got hr %#lx.\n", hr);
157 ok(outer_ref == 1, "Got unexpected refcount %ld.\n", outer_ref);
158 ok(unk != &test_outer, "Returned IUnknown should not be outer IUnknown.\n");
159 ref = get_refcount(unk);
160 ok(ref == 1, "Got unexpected refcount %ld.\n", ref);
161
162 ref = IUnknown_AddRef(unk);
163 ok(ref == 2, "Got unexpected refcount %ld.\n", ref);
164 ok(outer_ref == 1, "Got unexpected refcount %ld.\n", outer_ref);
165
166 ref = IUnknown_Release(unk);
167 ok(ref == 1, "Got unexpected refcount %ld.\n", ref);
168 ok(outer_ref == 1, "Got unexpected refcount %ld.\n", outer_ref);
169
170 hr = IUnknown_QueryInterface(unk, &IID_IUnknown, (void **)&unk2);
171 ok(hr == S_OK, "Got hr %#lx.\n", hr);
172 ok(unk2 == unk, "Got unexpected IUnknown %p.\n", unk2);
173 IUnknown_Release(unk2);
174
175 hr = IUnknown_QueryInterface(unk, &IID_IBaseFilter, (void **)&filter);
176 ok(hr == S_OK, "Got hr %#lx.\n", hr);
177
178 hr = IBaseFilter_QueryInterface(filter, &IID_IUnknown, (void **)&unk2);
179 ok(hr == S_OK, "Got hr %#lx.\n", hr);
180 ok(unk2 == (IUnknown *)0xdeadbeef, "Got unexpected IUnknown %p.\n", unk2);
181
182 hr = IBaseFilter_QueryInterface(filter, &IID_IBaseFilter, (void **)&filter2);
183 ok(hr == S_OK, "Got hr %#lx.\n", hr);
184 ok(filter2 == (IBaseFilter *)0xdeadbeef, "Got unexpected IBaseFilter %p.\n", filter2);
185
186 hr = IUnknown_QueryInterface(unk, &test_iid, (void **)&unk2);
187 ok(hr == E_NOINTERFACE, "Got hr %#lx.\n", hr);
188 ok(!unk2, "Got unexpected IUnknown %p.\n", unk2);
189
190 hr = IBaseFilter_QueryInterface(filter, &test_iid, (void **)&unk2);
191 ok(hr == S_OK, "Got hr %#lx.\n", hr);
192 ok(unk2 == (IUnknown *)0xdeadbeef, "Got unexpected IUnknown %p.\n", unk2);
193
194 IBaseFilter_Release(filter);
195 ref = IUnknown_Release(unk);
196 ok(!ref, "Got unexpected refcount %ld.\n", ref);
197 ok(outer_ref == 1, "Got unexpected refcount %ld.\n", outer_ref);
198}
static ULONG get_refcount(void *iface)
Definition: acmwrapper.c:34
static IUnknown test_outer
Definition: acmwrapper.c:139
Definition: send.c:48
uint32_t ULONG
Definition: typedefs.h:59

Referenced by START_TEST().

◆ test_enum_pins()

static void test_enum_pins ( void  )
static

Definition at line 200 of file acmwrapper.c.

201{
203 IEnumPins *enum1, *enum2;
204 ULONG count, ref;
205 IPin *pins[3];
206 HRESULT hr;
207
209 ok(ref == 1, "Got unexpected refcount %ld.\n", ref);
210
211 hr = IBaseFilter_EnumPins(filter, NULL);
212 ok(hr == E_POINTER, "Got hr %#lx.\n", hr);
213
214 hr = IBaseFilter_EnumPins(filter, &enum1);
215 ok(hr == S_OK, "Got hr %#lx.\n", hr);
217 ok(ref == 2, "Got unexpected refcount %ld.\n", ref);
218 ref = get_refcount(enum1);
219 ok(ref == 1, "Got unexpected refcount %ld.\n", ref);
220
221 hr = IEnumPins_Next(enum1, 1, NULL, NULL);
222 ok(hr == E_POINTER, "Got hr %#lx.\n", hr);
223
224 hr = IEnumPins_Next(enum1, 1, pins, NULL);
225 ok(hr == S_OK, "Got hr %#lx.\n", hr);
227 ok(ref == 3, "Got unexpected refcount %ld.\n", ref);
228 ref = get_refcount(pins[0]);
229 ok(ref == 3, "Got unexpected refcount %ld.\n", ref);
230 ref = get_refcount(enum1);
231 ok(ref == 1, "Got unexpected refcount %ld.\n", ref);
232 IPin_Release(pins[0]);
234 ok(ref == 2, "Got unexpected refcount %ld.\n", ref);
235
236 hr = IEnumPins_Next(enum1, 1, pins, NULL);
237 ok(hr == S_OK, "Got hr %#lx.\n", hr);
239 ok(ref == 3, "Got unexpected refcount %ld.\n", ref);
240 ref = get_refcount(pins[0]);
241 ok(ref == 3, "Got unexpected refcount %ld.\n", ref);
242 ref = get_refcount(enum1);
243 ok(ref == 1, "Got unexpected refcount %ld.\n", ref);
244 IPin_Release(pins[0]);
246 ok(ref == 2, "Got unexpected refcount %ld.\n", ref);
247
248 hr = IEnumPins_Next(enum1, 1, pins, NULL);
249 ok(hr == S_FALSE, "Got hr %#lx.\n", hr);
250
251 hr = IEnumPins_Reset(enum1);
252 ok(hr == S_OK, "Got hr %#lx.\n", hr);
253
254 hr = IEnumPins_Next(enum1, 1, pins, &count);
255 ok(hr == S_OK, "Got hr %#lx.\n", hr);
256 ok(count == 1, "Got count %lu.\n", count);
257 IPin_Release(pins[0]);
258
259 hr = IEnumPins_Next(enum1, 1, pins, &count);
260 ok(hr == S_OK, "Got hr %#lx.\n", hr);
261 ok(count == 1, "Got count %lu.\n", count);
262 IPin_Release(pins[0]);
263
264 hr = IEnumPins_Next(enum1, 1, pins, &count);
265 ok(hr == S_FALSE, "Got hr %#lx.\n", hr);
266 ok(!count, "Got count %lu.\n", count);
267
268 hr = IEnumPins_Reset(enum1);
269 ok(hr == S_OK, "Got hr %#lx.\n", hr);
270
271 hr = IEnumPins_Next(enum1, 2, pins, NULL);
272 ok(hr == E_INVALIDARG, "Got hr %#lx.\n", hr);
273
274 hr = IEnumPins_Next(enum1, 2, pins, &count);
275 ok(hr == S_OK, "Got hr %#lx.\n", hr);
276 ok(count == 2, "Got count %lu.\n", count);
277 IPin_Release(pins[0]);
278 IPin_Release(pins[1]);
279
280 hr = IEnumPins_Next(enum1, 2, pins, &count);
281 ok(hr == S_FALSE, "Got hr %#lx.\n", hr);
282 ok(!count, "Got count %lu.\n", count);
283
284 hr = IEnumPins_Reset(enum1);
285 ok(hr == S_OK, "Got hr %#lx.\n", hr);
286
287 hr = IEnumPins_Next(enum1, 3, pins, &count);
288 ok(hr == S_FALSE, "Got hr %#lx.\n", hr);
289 ok(count == 2, "Got count %lu.\n", count);
290 IPin_Release(pins[0]);
291 IPin_Release(pins[1]);
292
293 hr = IEnumPins_Reset(enum1);
294 ok(hr == S_OK, "Got hr %#lx.\n", hr);
295
296 hr = IEnumPins_Clone(enum1, &enum2);
297 ok(hr == S_OK, "Got hr %#lx.\n", hr);
298
299 hr = IEnumPins_Skip(enum1, 3);
300 ok(hr == S_FALSE, "Got hr %#lx.\n", hr);
301
302 hr = IEnumPins_Skip(enum1, 2);
303 ok(hr == S_OK, "Got hr %#lx.\n", hr);
304
305 hr = IEnumPins_Skip(enum1, 1);
306 ok(hr == S_FALSE, "Got hr %#lx.\n", hr);
307
308 hr = IEnumPins_Next(enum1, 1, pins, NULL);
309 ok(hr == S_FALSE, "Got hr %#lx.\n", hr);
310
311 hr = IEnumPins_Next(enum2, 1, pins, NULL);
312 ok(hr == S_OK, "Got hr %#lx.\n", hr);
313 IPin_Release(pins[0]);
314
315 IEnumPins_Release(enum2);
316 IEnumPins_Release(enum1);
317 ref = IBaseFilter_Release(filter);
318 ok(!ref, "Got outstanding refcount %ld.\n", ref);
319}
#define E_INVALIDARG
Definition: ddrawi.h:101
GLuint GLuint GLsizei count
Definition: gl.h:1545
Definition: axcore.idl:92
static IBaseFilter * create_acm_wrapper(void)
Definition: acmwrapper.c:25
#define S_FALSE
Definition: winerror.h:3451
#define E_POINTER
Definition: winerror.h:3480

Referenced by START_TEST().

◆ test_find_pin()

static void test_find_pin ( void  )
static

Definition at line 321 of file acmwrapper.c.

322{
325 IPin *pin, *pin2;
326 HRESULT hr;
327 ULONG ref;
328
329 hr = IBaseFilter_EnumPins(filter, &enum_pins);
330 ok(hr == S_OK, "Got hr %#lx.\n", hr);
331
332 hr = IBaseFilter_FindPin(filter, L"In", &pin);
333 ok(hr == S_OK, "Got hr %#lx.\n", hr);
334 hr = IEnumPins_Next(enum_pins, 1, &pin2, NULL);
335 ok(hr == S_OK, "Got hr %#lx.\n", hr);
336 ok(pin == pin2, "Pins didn't match.\n");
337 IPin_Release(pin);
338 IPin_Release(pin2);
339
340 hr = IBaseFilter_FindPin(filter, L"Out", &pin);
341 ok(hr == S_OK, "Got hr %#lx.\n", hr);
342 hr = IEnumPins_Next(enum_pins, 1, &pin2, NULL);
343 ok(hr == S_OK, "Got hr %#lx.\n", hr);
344 ok(pin == pin2, "Pins didn't match.\n");
345 IPin_Release(pin);
346 IPin_Release(pin2);
347
348 hr = IBaseFilter_FindPin(filter, L"Input", &pin);
349 ok(hr == VFW_E_NOT_FOUND, "Got hr %#lx.\n", hr);
350 hr = IBaseFilter_FindPin(filter, L"Output", &pin);
351 ok(hr == VFW_E_NOT_FOUND, "Got hr %#lx.\n", hr);
352 hr = IBaseFilter_FindPin(filter, L"input pin", &pin);
353 ok(hr == VFW_E_NOT_FOUND, "Got hr %#lx.\n", hr);
354 hr = IBaseFilter_FindPin(filter, L"output pin", &pin);
355 ok(hr == VFW_E_NOT_FOUND, "Got hr %#lx.\n", hr);
356
357 IEnumPins_Release(enum_pins);
358 ref = IBaseFilter_Release(filter);
359 ok(!ref, "Got outstanding refcount %ld.\n", ref);
360}
#define L(x)
Definition: resources.c:13
#define VFW_E_NOT_FOUND
Definition: vfwmsgs.h:61

Referenced by START_TEST().

◆ test_interfaces()

static void test_interfaces ( void  )
static

Definition at line 56 of file acmwrapper.c.

57{
59 IPin *pin;
60
62 check_interface(filter, &IID_IMediaFilter, TRUE);
66
67 check_interface(filter, &IID_IAMFilterMiscFlags, FALSE);
68 check_interface(filter, &IID_IBasicAudio, FALSE);
69 check_interface(filter, &IID_IBasicVideo, FALSE);
71 check_interface(filter, &IID_IMediaPosition, FALSE);
72 check_interface(filter, &IID_IMediaSeeking, FALSE);
74 check_interface(filter, &IID_IQualityControl, FALSE);
75 check_interface(filter, &IID_IQualProp, FALSE);
76 check_interface(filter, &IID_IReferenceClock, FALSE);
77 check_interface(filter, &IID_IVideoWindow, FALSE);
78
79 IBaseFilter_FindPin(filter, L"In", &pin);
80
81 check_interface(pin, &IID_IMemInputPin, TRUE);
83 todo_wine check_interface(pin, &IID_IQualityControl, TRUE);
85
86 check_interface(pin, &IID_IMediaPosition, FALSE);
87 check_interface(pin, &IID_IMediaSeeking, FALSE);
88
89 IPin_Release(pin);
90
91 IBaseFilter_FindPin(filter, L"Out", &pin);
92
94 todo_wine check_interface(pin, &IID_IMediaPosition, TRUE);
95 check_interface(pin, &IID_IMediaSeeking, TRUE);
96 check_interface(pin, &IID_IQualityControl, TRUE);
98
100
101 IPin_Release(pin);
102
103 IBaseFilter_Release(filter);
104}
const GUID IID_IKsPropertySet
Definition: controlnode.cpp:13
const GUID IID_IAsyncReader
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define todo_wine
Definition: minitest.h:80
#define check_interface(a, b, c)
Definition: acmwrapper.c:41
const GUID IID_IPin
Definition: pincontrol.cpp:15
const GUID IID_IPersist
Definition: proxy.cpp:14
const GUID IID_IPersistPropertyBag
Definition: proxy.cpp:11

Referenced by START_TEST().

◆ test_pin_info()

static void test_pin_info ( void  )
static

Definition at line 362 of file acmwrapper.c.

363{
367 HRESULT hr;
368 WCHAR *id;
369 ULONG ref;
370 IPin *pin;
371
372 hr = IBaseFilter_FindPin(filter, L"In", &pin);
373 ok(hr == S_OK, "Got hr %#lx.\n", hr);
375 ok(ref == 2, "Got unexpected refcount %ld.\n", ref);
376 ref = get_refcount(pin);
377 ok(ref == 2, "Got unexpected refcount %ld.\n", ref);
378
379 hr = IPin_QueryPinInfo(pin, &info);
380 ok(hr == S_OK, "Got hr %#lx.\n", hr);
381 ok(info.pFilter == filter, "Expected filter %p, got %p.\n", filter, info.pFilter);
382 ok(info.dir == PINDIR_INPUT, "Got direction %d.\n", info.dir);
383 ok(!wcscmp(info.achName, L"Input"), "Got name %s.\n", debugstr_w(info.achName));
385 ok(ref == 3, "Got unexpected refcount %ld.\n", ref);
386 ref = get_refcount(pin);
387 ok(ref == 3, "Got unexpected refcount %ld.\n", ref);
388 IBaseFilter_Release(info.pFilter);
389
390 hr = IPin_QueryDirection(pin, &dir);
391 ok(hr == S_OK, "Got hr %#lx.\n", hr);
392 ok(dir == PINDIR_INPUT, "Got direction %d.\n", dir);
393
394 hr = IPin_QueryId(pin, &id);
395 ok(hr == S_OK, "Got hr %#lx.\n", hr);
396 ok(!wcscmp(id, L"In"), "Got id %s.\n", wine_dbgstr_w(id));
397 CoTaskMemFree(id);
398
399 hr = IPin_QueryInternalConnections(pin, NULL, NULL);
400 ok(hr == E_NOTIMPL, "Got hr %#lx.\n", hr);
401
402 IPin_Release(pin);
403
404 hr = IBaseFilter_FindPin(filter, L"Out", &pin);
405 ok(hr == S_OK, "Got hr %#lx.\n", hr);
406
408 check_interface(pin, &IID_IMediaSeeking, TRUE);
409
410 hr = IPin_QueryPinInfo(pin, &info);
411 ok(hr == S_OK, "Got hr %#lx.\n", hr);
412 ok(info.pFilter == filter, "Expected filter %p, got %p.\n", filter, info.pFilter);
413 ok(info.dir == PINDIR_OUTPUT, "Got direction %d.\n", info.dir);
414 ok(!wcscmp(info.achName, L"Output"), "Got name %s.\n", debugstr_w(info.achName));
415 IBaseFilter_Release(info.pFilter);
416
417 hr = IPin_QueryDirection(pin, &dir);
418 ok(hr == S_OK, "Got hr %#lx.\n", hr);
419 ok(dir == PINDIR_OUTPUT, "Got direction %d.\n", dir);
420
421 hr = IPin_QueryId(pin, &id);
422 ok(hr == S_OK, "Got hr %#lx.\n", hr);
423 ok(!wcscmp(id, L"Out"), "Got id %s.\n", wine_dbgstr_w(id));
424 CoTaskMemFree(id);
425
426 hr = IPin_QueryInternalConnections(pin, NULL, NULL);
427 ok(hr == E_NOTIMPL, "Got hr %#lx.\n", hr);
428
429 IPin_Release(pin);
430
431 ref = IBaseFilter_Release(filter);
432 ok(!ref, "Got outstanding refcount %ld.\n", ref);
433}
unsigned int dir
Definition: maze.c:112
enum _PinDirection PIN_DIRECTION
@ PINDIR_OUTPUT
Definition: axcore.idl:42
@ PINDIR_INPUT
Definition: axcore.idl:41
#define E_NOTIMPL
Definition: ddrawi.h:99
void WINAPI CoTaskMemFree(void *ptr)
Definition: malloc.c:389
_ACRTIMP int __cdecl wcscmp(const wchar_t *, const wchar_t *)
Definition: wcs.c:1977
GLuint id
Definition: glext.h:5910
#define debugstr_w
Definition: kernel32.h:32
#define wine_dbgstr_w
Definition: kernel32.h:34
short WCHAR
Definition: pedump.c:58

Referenced by START_TEST().

◆ test_unconnected_filter_state()

static void test_unconnected_filter_state ( void  )
static

Definition at line 435 of file acmwrapper.c.

436{
438 FILTER_STATE state;
439 HRESULT hr;
440 ULONG ref;
441
442 hr = IBaseFilter_GetState(filter, 0, &state);
443 ok(hr == S_OK, "Got hr %#lx.\n", hr);
444 ok(state == State_Stopped, "Got state %u.\n", state);
445
446 hr = IBaseFilter_Pause(filter);
447 ok(hr == S_OK, "Got hr %#lx.\n", hr);
448
449 hr = IBaseFilter_GetState(filter, 0, &state);
450 ok(hr == S_OK, "Got hr %#lx.\n", hr);
451 ok(state == State_Paused, "Got state %u.\n", state);
452
453 hr = IBaseFilter_Run(filter, 0);
454 ok(hr == S_OK, "Got hr %#lx.\n", hr);
455
456 hr = IBaseFilter_GetState(filter, 0, &state);
457 ok(hr == S_OK, "Got hr %#lx.\n", hr);
458 ok(state == State_Running, "Got state %u.\n", state);
459
460 hr = IBaseFilter_Pause(filter);
461 ok(hr == S_OK, "Got hr %#lx.\n", hr);
462
463 hr = IBaseFilter_GetState(filter, 0, &state);
464 ok(hr == S_OK, "Got hr %#lx.\n", hr);
465 ok(state == State_Paused, "Got state %u.\n", state);
466
467 hr = IBaseFilter_Stop(filter);
468 ok(hr == S_OK, "Got hr %#lx.\n", hr);
469
470 hr = IBaseFilter_GetState(filter, 0, &state);
471 ok(hr == S_OK, "Got hr %#lx.\n", hr);
472 ok(state == State_Stopped, "Got state %u.\n", state);
473
474 hr = IBaseFilter_Run(filter, 0);
475 ok(hr == S_OK, "Got hr %#lx.\n", hr);
476
477 hr = IBaseFilter_GetState(filter, 0, &state);
478 ok(hr == S_OK, "Got hr %#lx.\n", hr);
479 ok(state == State_Running, "Got state %u.\n", state);
480
481 hr = IBaseFilter_Stop(filter);
482 ok(hr == S_OK, "Got hr %#lx.\n", hr);
483
484 hr = IBaseFilter_GetState(filter, 0, &state);
485 ok(hr == S_OK, "Got hr %#lx.\n", hr);
486 ok(state == State_Stopped, "Got state %u.\n", state);
487
488 ref = IBaseFilter_Release(filter);
489 ok(!ref, "Got outstanding refcount %ld.\n", ref);
490}
static int state
Definition: maze.c:121

Referenced by START_TEST().

Variable Documentation

◆ outer_ref

LONG outer_ref = 1
static

Definition at line 107 of file acmwrapper.c.

Referenced by outer_AddRef(), outer_Release(), and test_aggregation().

◆ outer_vtbl

const IUnknownVtbl outer_vtbl
static
Initial value:
=
{
}
static ULONG WINAPI outer_AddRef(IUnknown *iface)
Definition: acmwrapper.c:122
static HRESULT WINAPI outer_QueryInterface(IUnknown *iface, REFIID iid, void **out)
Definition: acmwrapper.c:109
static ULONG WINAPI outer_Release(IUnknown *iface)
Definition: acmwrapper.c:127

Definition at line 132 of file acmwrapper.c.

◆ test_iid

const GUID test_iid = {0x33333333}
static

Definition at line 106 of file acmwrapper.c.

Referenced by outer_QueryInterface(), and test_aggregation().

◆ test_outer

IUnknown test_outer = {&outer_vtbl}
static

Definition at line 139 of file acmwrapper.c.

Referenced by test_aggregation().