ReactOS 0.4.15-dev-8145-ga541a46
wmvcore.c File Reference
#include "initguid.h"
#include "wmsdk.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_wmsyncreader_interfaces (void)
 
static void test_profile_manager_interfaces (void)
 
static void test_WMCreateWriterPriv (void)
 
static void test_urlextension (void)
 
 START_TEST (wmvcore)
 

Macro Definition Documentation

◆ COBJMACROS

#define COBJMACROS

Definition at line 19 of file wmvcore.c.

◆ WIN32_LEAN_AND_MEAN

#define WIN32_LEAN_AND_MEAN

Definition at line 20 of file wmvcore.c.

Function Documentation

◆ START_TEST()

START_TEST ( wmvcore  )

Definition at line 341 of file wmvcore.c.

342{
343 HRESULT hr;
344
345 hr = CoInitialize(0);
346 ok(hr == S_OK, "failed to init com\n");
347 if(hr != S_OK)
348 return;
349
356
358}
#define ok(value,...)
Definition: atltest.h:57
HRESULT WINAPI CoInitialize(LPVOID lpReserved)
Definition: compobj.c:1964
void WINAPI DECLSPEC_HOTPATCH CoUninitialize(void)
Definition: compobj.c:2067
#define S_OK
Definition: intsafe.h:52
HRESULT hr
Definition: shlfolder.c:183
static void test_urlextension(void)
Definition: wmvcore.c:321
static void test_wmwriter_interfaces(void)
Definition: wmvcore.c:28
static void test_profile_manager_interfaces(void)
Definition: wmvcore.c:290
static void test_wmsyncreader_interfaces(void)
Definition: wmvcore.c:205
static void test_wmreader_interfaces(void)
Definition: wmvcore.c:62
static void test_WMCreateWriterPriv(void)
Definition: wmvcore.c:306

◆ test_profile_manager_interfaces()

static void test_profile_manager_interfaces ( void  )
static

Definition at line 290 of file wmvcore.c.

291{
292 HRESULT hr;
294
296 ok(hr == S_OK, "WMCreateProfileManager failed 0x%08x\n", hr);
297 if(FAILED(hr))
298 {
299 win_skip("Failed to create IWMProfileManager\n");
300 return;
301 }
302
303 IWMProfileManager_Release(profile);
304}
#define FAILED(hr)
Definition: intsafe.h:51
#define profile
Definition: kernel32.h:12
#define win_skip
Definition: test.h:163
HRESULT WINAPI WMCreateProfileManager(IWMProfileManager **ret)
Definition: wmvcore_main.c:215

Referenced by START_TEST().

◆ test_urlextension()

static void test_urlextension ( void  )
static

Definition at line 321 of file wmvcore.c.

322{
323 HRESULT hr;
324 const WCHAR mp3file[] = {'t','e','s','t','.','m','p','3',0};
325 const WCHAR mkvfile[] = {'t','e','s','t','.','m','k','v',0};
326 const WCHAR urlfile[] = {'a','b','c','d',':','/','/','t','e','s','t','/','t','e','s','t','.','w','m','v',0};
327 const WCHAR testurl[] = {'h','t','t','p',':','/','/','t','e','s','t','/','t','.','a','s','f','?','a','l','t','=','t','.','m','k','v',0};
328
330 ok(hr == E_INVALIDARG, "WMCheckURLExtension failed 0x%08x\n", hr);
331 hr = WMCheckURLExtension(mkvfile);
332 ok(hr == NS_E_INVALID_NAME, "WMCheckURLExtension failed 0x%08x\n", hr);
333 hr = WMCheckURLExtension(mp3file);
334 todo_wine ok(hr == S_OK, "WMCheckURLExtension failed 0x%08x\n", hr);
335 hr = WMCheckURLExtension(urlfile);
336 todo_wine ok(hr == S_OK, "WMCheckURLExtension failed 0x%08x\n", hr);
337 hr = WMCheckURLExtension(testurl);
338 todo_wine ok(hr == S_OK, "WMCheckURLExtension failed 0x%08x\n", hr);
339}
#define E_INVALIDARG
Definition: ddrawi.h:101
#define NULL
Definition: types.h:112
#define todo_wine
Definition: custom.c:79
#define NS_E_INVALID_NAME
Definition: nserror.h:65
HRESULT WINAPI WMCheckURLExtension(const WCHAR *url)
Definition: wmvcore_main.c:51
__wchar_t WCHAR
Definition: xmlstorage.h:180

Referenced by START_TEST().

◆ test_WMCreateWriterPriv()

static void test_WMCreateWriterPriv ( void  )
static

Definition at line 306 of file wmvcore.c.

307{
308 IWMWriter *writer, *writer2;
309 HRESULT hr;
310
311 hr = WMCreateWriterPriv(&writer);
312 ok(hr == S_OK, "got 0x%08x\n", hr);
313
314 hr = IWMWriter_QueryInterface(writer, &IID_IWMWriter, (void**)&writer2);
315 ok(hr == S_OK, "got 0x%08x\n", hr);
316
317 IWMWriter_Release(writer);
318 IWMWriter_Release(writer2);
319}
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 62 of file wmvcore.c.

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

Referenced by START_TEST().

◆ test_wmsyncreader_interfaces()

static void test_wmsyncreader_interfaces ( void  )
static

Definition at line 205 of file wmvcore.c.

206{
207 HRESULT hr;
210 IWMHeaderInfo2 *header2;
211 IWMHeaderInfo3 *header3;
214 IWMProfile3 *profile3;
216 IWMPacketSize2 *packet2;
217 IWMReaderTimecode *timecode;
218 IWMReaderPlaylistBurn *playlist;
219 IWMLanguageList *langlist;
220
222 ok(hr == S_OK, "WMCreateSyncReader failed 0x%08x\n", hr);
223 if(FAILED(hr))
224 {
225 win_skip("Failed to create IWMSyncReader\n");
226 return;
227 }
228
229 hr = IWMSyncReader_QueryInterface(reader, &IID_IWMHeaderInfo, (void **)&header);
230 todo_wine ok(hr == S_OK, "Failed 0x%08x\n", hr);
231
232 hr = IWMSyncReader_QueryInterface(reader, &IID_IWMHeaderInfo2, (void **)&header2);
233 todo_wine ok(hr == S_OK, "Failed 0x%08x\n", hr);
234
235 hr = IWMSyncReader_QueryInterface(reader, &IID_IWMHeaderInfo3, (void **)&header3);
236 todo_wine ok(hr == S_OK, "Failed 0x%08x\n", hr);
237
238 hr = IWMSyncReader_QueryInterface(reader, &IID_IWMProfile, (void **)&profile);
239 todo_wine ok(hr == S_OK, "Failed 0x%08x\n", hr);
240
241 hr = IWMSyncReader_QueryInterface(reader, &IID_IWMProfile2, (void **)&profile2);
242 todo_wine ok(hr == S_OK, "Failed 0x%08x\n", hr);
243
244 hr = IWMSyncReader_QueryInterface(reader, &IID_IWMProfile3, (void **)&profile3);
245 todo_wine ok(hr == S_OK, "Failed 0x%08x\n", hr);
246
247 hr = IWMSyncReader_QueryInterface(reader, &IID_IWMPacketSize, (void **)&packet);
248 todo_wine ok(hr == S_OK, "Failed 0x%08x\n", hr);
249
250 hr = IWMSyncReader_QueryInterface(reader, &IID_IWMPacketSize2, (void **)&packet2);
251 todo_wine ok(hr == S_OK, "Failed 0x%08x\n", hr);
252
253 hr = IWMSyncReader_QueryInterface(reader, &IID_IWMReaderTimecode, (void **)&timecode);
254 todo_wine ok(hr == S_OK, "Failed 0x%08x\n", hr);
255
256 hr = IWMSyncReader_QueryInterface(reader, &IID_IWMReaderPlaylistBurn, (void **)&playlist);
257 todo_wine ok(hr == S_OK, "Failed 0x%08x\n", hr);
258
259 hr = IWMSyncReader_QueryInterface(reader, &IID_IWMLanguageList, (void **)&langlist);
260 todo_wine ok(hr == S_OK, "Failed 0x%08x\n", hr);
261
262 if(packet)
263 IWMPacketSize_Release(packet);
264 if(packet2)
265 IWMPacketSize2_Release(packet2);
266 if(profile)
267 IWMProfile_Release(profile);
268 if(profile2)
269 IWMProfile2_Release(profile2);
270 if(profile3)
271 IWMProfile3_Release(profile3);
272 if(header)
273 IWMHeaderInfo_Release(header);
274 if(header2)
275 IWMHeaderInfo2_Release(header2);
276 if(header3)
277 IWMHeaderInfo3_Release(header3);
278 if(timecode)
279 IWMReaderTimecode_Release(timecode);
280 if(playlist)
281 IWMReaderPlaylistBurn_Release(playlist);
282 if(langlist)
283 IWMLanguageList_Release(langlist);
284
285
286 IWMSyncReader_Release(reader);
287}
HRESULT WINAPI WMCreateSyncReader(IUnknown *pcert, DWORD rights, IWMSyncReader **syncreader)
Definition: reader.c:2300

Referenced by START_TEST().

◆ test_wmwriter_interfaces()

static void test_wmwriter_interfaces ( void  )
static

Definition at line 28 of file wmvcore.c.

29{
30 HRESULT hr;
31 IWMWriter *writer;
33 IWMHeaderInfo2 *header2;
34 IWMHeaderInfo3 *header3;
35
36 hr = WMCreateWriter( NULL, &writer );
37 ok(hr == S_OK, "WMCreateWriter failed 0x%08x\n", hr);
38 if(FAILED(hr))
39 {
40 win_skip("Failed to create IWMWriter\n");
41 return;
42 }
43
44 hr = IWMWriter_QueryInterface(writer, &IID_IWMHeaderInfo, (void **)&header);
45 todo_wine ok(hr == S_OK, "Failed 0x%08x\n", hr);
46
47 hr = IWMWriter_QueryInterface(writer, &IID_IWMHeaderInfo2, (void **)&header2);
48 todo_wine ok(hr == S_OK, "Failed 0x%08x\n", hr);
49
50 hr = IWMWriter_QueryInterface(writer, &IID_IWMHeaderInfo3, (void **)&header3);
51 todo_wine ok(hr == S_OK, "Failed 0x%08x\n", hr);
52
53 if(header)
54 IWMHeaderInfo_Release(header);
55 if(header2)
56 IWMHeaderInfo2_Release(header2);
57 if(header3)
58 IWMHeaderInfo3_Release(header3);
59 IWMWriter_Release(writer);
60}
HRESULT WINAPI WMCreateWriter(IUnknown *reserved, IWMWriter **writer)
Definition: writer.c:356

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}

Referenced by test_WMCreateWriterPriv().