ReactOS  0.4.14-dev-342-gdc047f9
wmvcore.c File Reference
#include "initguid.h"
#include "wmsdkidl.h"
#include "wine/test.h"
Include dependency graph for wmvcore.c:

Go to the source code of this file.

Macros

#define COBJMACROS
 
#define WIN32_LEAN_AND_MEAN
 

Functions

HRESULT WINAPI WMCreateWriterPriv (IWMWriter **writer)
 
static void test_wmwriter_interfaces (void)
 
static void test_wmreader_interfaces (void)
 
static void test_profile_manager_interfaces (void)
 
static void test_WMCreateWriterPriv (void)
 
 START_TEST (wmvcore)
 

Macro Definition Documentation

◆ COBJMACROS

#define COBJMACROS

Definition at line 18 of file wmvcore.c.

◆ WIN32_LEAN_AND_MEAN

#define WIN32_LEAN_AND_MEAN

Definition at line 19 of file wmvcore.c.

Function Documentation

◆ START_TEST()

START_TEST ( wmvcore  )

Definition at line 235 of file wmvcore.c.

236 {
237  HRESULT hr;
238 
239  hr = CoInitialize(0);
240  ok(hr == S_OK, "failed to init com\n");
241  if(hr != S_OK)
242  return;
243 
248 
249  CoUninitialize();
250 }
HRESULT hr
Definition: shlfolder.c:183
static void test_wmwriter_interfaces(void)
Definition: wmvcore.c:27
static void test_WMCreateWriterPriv(void)
Definition: wmvcore.c:220
static void test_wmreader_interfaces(void)
Definition: wmvcore.c:61
LONG HRESULT
Definition: typedefs.h:77
#define S_OK
Definition: intsafe.h:59
static void test_profile_manager_interfaces(void)
Definition: wmvcore.c:204
void WINAPI DECLSPEC_HOTPATCH CoUninitialize(void)
Definition: compobj.c:2067
#define ok(value,...)
Definition: atltest.h:57
HRESULT WINAPI CoInitialize(LPVOID lpReserved)
Definition: compobj.c:1964

◆ test_profile_manager_interfaces()

static void test_profile_manager_interfaces ( void  )
static

Definition at line 204 of file wmvcore.c.

205 {
206  HRESULT hr;
208 
210  ok(hr == S_OK, "WMCreateProfileManager failed 0x%08x\n", hr);
211  if(FAILED(hr))
212  {
213  win_skip("Failed to create IWMProfileManager\n");
214  return;
215  }
216 
217  IWMProfileManager_Release(profile);
218 }
HRESULT WINAPI WMCreateProfileManager(IWMProfileManager **ret)
HRESULT hr
Definition: shlfolder.c:183
LONG HRESULT
Definition: typedefs.h:77
#define S_OK
Definition: intsafe.h:59
#define ok(value,...)
Definition: atltest.h:57
#define profile
Definition: kernel32.h:12
#define win_skip
Definition: test.h:141

Referenced by START_TEST().

◆ test_WMCreateWriterPriv()

static void test_WMCreateWriterPriv ( void  )
static

Definition at line 220 of file wmvcore.c.

221 {
222  IWMWriter *writer, *writer2;
223  HRESULT hr;
224 
225  hr = WMCreateWriterPriv(&writer);
226  ok(hr == S_OK, "got 0x%08x\n", hr);
227 
228  hr = IWMWriter_QueryInterface(writer, &IID_IWMWriter, (void**)&writer2);
229  ok(hr == S_OK, "got 0x%08x\n", hr);
230 
231  IWMWriter_Release(writer);
232  IWMWriter_Release(writer2);
233 }
HRESULT hr
Definition: shlfolder.c:183
LONG HRESULT
Definition: typedefs.h:77
#define S_OK
Definition: intsafe.h:59
#define ok(value,...)
Definition: atltest.h:57
HRESULT WINAPI WMCreateWriterPriv(IWMWriter **writer)
Definition: writer.c:374

Referenced by START_TEST().

◆ test_wmreader_interfaces()

static void test_wmreader_interfaces ( void  )
static

Definition at line 61 of file wmvcore.c.

62 {
63  HRESULT hr;
65  IWMReaderAdvanced *advanced;
66  IWMReaderAdvanced2 *advanced2;
68  IWMHeaderInfo2 *header2;
69  IWMHeaderInfo3 *header3;
72  IWMProfile3 *profile3;
74  IWMPacketSize2 *packet2;
75  IWMReaderAccelerator *accel;
76  IWMReaderTimecode *timecode;
78  IWMReaderNetworkConfig2 *netconfig2;
80  IWMReaderTypeNegotiation *negotiation;
81  IWMDRMReader *drmreader;
82  IWMDRMReader2 *drmreader2;
83  IWMDRMReader3 *drmreader3;
84  IWMReaderPlaylistBurn *playlist;
85  IWMLanguageList *langlist;
86  IReferenceClock *refclock;
87 
88  hr = WMCreateReader( NULL, 0, &reader );
89  ok(hr == S_OK, "WMCreateReader failed 0x%08x\n", hr);
90  if(FAILED(hr))
91  {
92  win_skip("Failed to create IWMReader\n");
93  return;
94  }
95 
96  hr = IWMReader_QueryInterface(reader, &IID_IWMReaderAdvanced, (void **)&advanced);
97  ok(hr == S_OK, "Failed 0x%08x\n", hr);
98 
99  hr = IWMReader_QueryInterface(reader, &IID_IWMReaderAdvanced2, (void **)&advanced2);
100  ok(hr == S_OK, "Failed 0x%08x\n", hr);
101 
102  hr = IWMReader_QueryInterface(reader, &IID_IWMHeaderInfo, (void **)&header);
103  ok(hr == S_OK, "Failed 0x%08x\n", hr);
104 
105  hr = IWMReader_QueryInterface(reader, &IID_IWMHeaderInfo2, (void **)&header2);
106  ok(hr == S_OK, "Failed 0x%08x\n", hr);
107 
108  hr = IWMReader_QueryInterface(reader, &IID_IWMHeaderInfo3, (void **)&header3);
109  ok(hr == S_OK, "Failed 0x%08x\n", hr);
110 
111  hr = IWMReader_QueryInterface(reader, &IID_IWMProfile, (void **)&profile);
112  ok(hr == S_OK, "Failed 0x%08x\n", hr);
113 
114  hr = IWMReader_QueryInterface(reader, &IID_IWMProfile2, (void **)&profile2);
115  ok(hr == S_OK, "Failed 0x%08x\n", hr);
116 
117  hr = IWMReader_QueryInterface(reader, &IID_IWMProfile3, (void **)&profile3);
118  ok(hr == S_OK, "Failed 0x%08x\n", hr);
119 
120  hr = IWMReader_QueryInterface(reader, &IID_IWMPacketSize, (void **)&packet);
121  ok(hr == S_OK, "Failed 0x%08x\n", hr);
122 
123  hr = IWMReader_QueryInterface(reader, &IID_IWMPacketSize2, (void **)&packet2);
124  ok(hr == S_OK, "Failed 0x%08x\n", hr);
125 
126  hr = IWMReader_QueryInterface(reader, &IID_IWMReaderAccelerator, (void **)&accel);
127  ok(hr == S_OK, "Failed 0x%08x\n", hr);
128 
129  hr = IWMReader_QueryInterface(reader, &IID_IWMReaderTimecode, (void **)&timecode);
130  ok(hr == S_OK, "Failed 0x%08x\n", hr);
131 
132  hr = IWMReader_QueryInterface(reader, &IID_IWMReaderNetworkConfig, (void **)&netconfig);
133  ok(hr == S_OK, "Failed 0x%08x\n", hr);
134 
135  hr = IWMReader_QueryInterface(reader, &IID_IWMReaderNetworkConfig2, (void **)&netconfig2);
136  ok(hr == S_OK, "Failed 0x%08x\n", hr);
137 
138  hr = IWMReader_QueryInterface(reader, &IID_IWMReaderStreamClock, (void **)&clock);
139  ok(hr == S_OK, "Failed 0x%08x\n", hr);
140 
141  hr = IWMReader_QueryInterface(reader, &IID_IWMReaderTypeNegotiation, (void **)&negotiation);
142  ok(hr == S_OK, "Failed 0x%08x\n", hr);
143 
144  hr = IWMReader_QueryInterface(reader, &IID_IWMDRMReader, (void **)&drmreader);
145  ok(hr == E_NOINTERFACE, "Failed 0x%08x\n", hr);
146 
147  hr = IWMReader_QueryInterface(reader, &IID_IWMDRMReader2, (void **)&drmreader2);
148  ok(hr == E_NOINTERFACE, "Failed 0x%08x\n", hr);
149 
150  hr = IWMReader_QueryInterface(reader, &IID_IWMDRMReader3, (void **)&drmreader3);
151  ok(hr == E_NOINTERFACE, "Failed 0x%08x\n", hr);
152 
153  hr = IWMReader_QueryInterface(reader, &IID_IWMReaderPlaylistBurn, (void **)&playlist);
154  ok(hr == S_OK, "Failed 0x%08x\n", hr);
155 
156  hr = IWMReader_QueryInterface(reader, &IID_IWMLanguageList, (void **)&langlist);
157  ok(hr == S_OK, "Failed 0x%08x\n", hr);
158 
159  hr = IWMReader_QueryInterface(reader, &IID_IReferenceClock, (void **)&refclock);
160  ok(hr == S_OK, "Failed 0x%08x\n", hr);
161 
162  if(packet)
163  IWMPacketSize_Release(packet);
164  if(packet2)
165  IWMPacketSize2_Release(packet2);
166  if(advanced)
167  IWMReaderAdvanced_Release(advanced);
168  if(advanced2)
169  IWMReaderAdvanced2_Release(advanced2);
170  if(profile)
171  IWMProfile_Release(profile);
172  if(profile2)
173  IWMProfile2_Release(profile2);
174  if(profile3)
175  IWMProfile3_Release(profile3);
176  if(header)
177  IWMHeaderInfo_Release(header);
178  if(header2)
179  IWMHeaderInfo2_Release(header2);
180  if(header3)
181  IWMHeaderInfo3_Release(header3);
182  if(accel)
183  IWMReaderAccelerator_Release(accel);
184  if(timecode)
185  IWMReaderTimecode_Release(timecode);
186  if(netconfig)
187  IWMReaderNetworkConfig_Release(netconfig);
188  if(netconfig2)
189  IWMReaderNetworkConfig2_Release(netconfig2);
190  if(clock)
191  IWMReaderStreamClock_Release(clock);
192  if(negotiation)
193  IWMReaderTypeNegotiation_Release(negotiation);
194  if(playlist)
195  IWMReaderPlaylistBurn_Release(playlist);
196  if(langlist)
197  IWMLanguageList_Release(langlist);
198  if(refclock)
199  IReferenceClock_Release(refclock);
200 
201  IWMReader_Release(reader);
202 }
#define E_NOINTERFACE
Definition: winerror.h:2364
HRESULT hr
Definition: shlfolder.c:183
UCHAR packet[_PAGE_SIZE]
Definition: serial.c:53
HRESULT WINAPI WMCreateReader(IUnknown *reserved, DWORD rights, IWMReader **ret_reader)
smooth NULL
Definition: ftsmooth.c:416
Definition: dhcpd.h:135
static const char profile2[]
Definition: profile.c:118
LONG HRESULT
Definition: typedefs.h:77
#define S_OK
Definition: intsafe.h:59
#define IReferenceClock_Release(p)
Definition: dmusicc.h:752
#define ok(value,...)
Definition: atltest.h:57
_Check_return_ _CRTIMP clock_t __cdecl clock(void)
Definition: clock.c:23
Definition: reader.h:83
#define profile
Definition: kernel32.h:12
#define win_skip
Definition: test.h:141
struct CFHEADER header
Definition: fdi.c:101

Referenced by START_TEST().

◆ test_wmwriter_interfaces()

static void test_wmwriter_interfaces ( void  )
static

Definition at line 27 of file wmvcore.c.

28 {
29  HRESULT hr;
30  IWMWriter *writer;
32  IWMHeaderInfo2 *header2;
33  IWMHeaderInfo3 *header3;
34 
35  hr = WMCreateWriter( NULL, &writer );
36  ok(hr == S_OK, "WMCreateWriter failed 0x%08x\n", hr);
37  if(FAILED(hr))
38  {
39  win_skip("Failed to create IWMWriter\n");
40  return;
41  }
42 
43  hr = IWMWriter_QueryInterface(writer, &IID_IWMHeaderInfo, (void **)&header);
44  todo_wine ok(hr == S_OK, "Failed 0x%08x\n", hr);
45 
46  hr = IWMWriter_QueryInterface(writer, &IID_IWMHeaderInfo2, (void **)&header2);
47  todo_wine ok(hr == S_OK, "Failed 0x%08x\n", hr);
48 
49  hr = IWMWriter_QueryInterface(writer, &IID_IWMHeaderInfo3, (void **)&header3);
50  todo_wine ok(hr == S_OK, "Failed 0x%08x\n", hr);
51 
52  if(header)
53  IWMHeaderInfo_Release(header);
54  if(header2)
55  IWMHeaderInfo2_Release(header2);
56  if(header3)
57  IWMHeaderInfo3_Release(header3);
58  IWMWriter_Release(writer);
59 }
HRESULT hr
Definition: shlfolder.c:183
HRESULT WINAPI WMCreateWriter(IUnknown *reserved, IWMWriter **writer)
Definition: writer.c:356
smooth NULL
Definition: ftsmooth.c:416
LONG HRESULT
Definition: typedefs.h:77
#define todo_wine
Definition: test.h:154
#define S_OK
Definition: intsafe.h:59
#define ok(value,...)
Definition: atltest.h:57
#define win_skip
Definition: test.h:141
struct CFHEADER header
Definition: fdi.c:101

Referenced by START_TEST().

◆ WMCreateWriterPriv()

HRESULT WINAPI WMCreateWriterPriv ( IWMWriter **  writer)

Definition at line 374 of file writer.c.

375 {
376  return WMCreateWriter(NULL, writer);
377 }
HRESULT WINAPI WMCreateWriter(IUnknown *reserved, IWMWriter **writer)
Definition: writer.c:356
smooth NULL
Definition: ftsmooth.c:416

Referenced by test_WMCreateWriterPriv().