shell32/tests: Drop progman DDE test workarounds for Windows <= 2000.
[wine.git] / dlls / mfplat / main.c
blob7c5be652d29741b354d7e3e45363630d3a90234b
1 /*
3 * Copyright 2014 Austin English
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
20 #include <stdarg.h>
21 #include <string.h>
23 #define COBJMACROS
25 #include "windef.h"
26 #include "winbase.h"
27 #include "winuser.h"
28 #include "winreg.h"
30 #include "initguid.h"
31 #include "mfapi.h"
32 #include "mfidl.h"
33 #include "mferror.h"
35 #include "wine/debug.h"
36 #include "wine/unicode.h"
38 WINE_DEFAULT_DEBUG_CHANNEL(mfplat);
40 static const WCHAR transform_keyW[] = {'M','e','d','i','a','F','o','u','n','d','a','t','i','o','n','\\',
41 'T','r','a','n','s','f','o','r','m','s',0};
42 static const WCHAR categories_keyW[] = {'M','e','d','i','a','F','o','u','n','d','a','t','i','o','n','\\',
43 'T','r','a','n','s','f','o','r','m','s','\\',
44 'C','a','t','e','g','o','r','i','e','s',0};
45 static const WCHAR inputtypesW[] = {'I','n','p','u','t','T','y','p','e','s',0};
46 static const WCHAR outputtypesW[] = {'O','u','t','p','u','t','T','y','p','e','s',0};
47 static const WCHAR szGUIDFmt[] =
49 '%','0','8','x','-','%','0','4','x','-','%','0','4','x','-','%','0',
50 '2','x','%','0','2','x','-','%','0','2','x','%','0','2','x','%','0','2',
51 'x','%','0','2','x','%','0','2','x','%','0','2','x',0
54 static const BYTE guid_conv_table[256] =
56 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x00 */
57 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x10 */
58 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x20 */
59 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 0, 0, 0, 0, 0, /* 0x30 */
60 0, 0xa, 0xb, 0xc, 0xd, 0xe, 0xf, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x40 */
61 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x50 */
62 0, 0xa, 0xb, 0xc, 0xd, 0xe, 0xf /* 0x60 */
65 static WCHAR* GUIDToString(WCHAR *str, REFGUID guid)
67 sprintfW(str, szGUIDFmt, guid->Data1, guid->Data2,
68 guid->Data3, guid->Data4[0], guid->Data4[1],
69 guid->Data4[2], guid->Data4[3], guid->Data4[4],
70 guid->Data4[5], guid->Data4[6], guid->Data4[7]);
72 return str;
75 static inline BOOL is_valid_hex(WCHAR c)
77 if (!(((c >= '0') && (c <= '9')) ||
78 ((c >= 'a') && (c <= 'f')) ||
79 ((c >= 'A') && (c <= 'F'))))
80 return FALSE;
81 return TRUE;
84 static BOOL GUIDFromString(LPCWSTR s, GUID *id)
86 int i;
88 /* in form XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX */
90 id->Data1 = 0;
91 for (i = 0; i < 8; i++)
93 if (!is_valid_hex(s[i])) return FALSE;
94 id->Data1 = (id->Data1 << 4) | guid_conv_table[s[i]];
96 if (s[8]!='-') return FALSE;
98 id->Data2 = 0;
99 for (i = 9; i < 13; i++)
101 if (!is_valid_hex(s[i])) return FALSE;
102 id->Data2 = (id->Data2 << 4) | guid_conv_table[s[i]];
104 if (s[13]!='-') return FALSE;
106 id->Data3 = 0;
107 for (i = 14; i < 18; i++)
109 if (!is_valid_hex(s[i])) return FALSE;
110 id->Data3 = (id->Data3 << 4) | guid_conv_table[s[i]];
112 if (s[18]!='-') return FALSE;
114 for (i = 19; i < 36; i+=2)
116 if (i == 23)
118 if (s[i]!='-') return FALSE;
119 i++;
121 if (!is_valid_hex(s[i]) || !is_valid_hex(s[i+1])) return FALSE;
122 id->Data4[(i-19)/2] = guid_conv_table[s[i]] << 4 | guid_conv_table[s[i+1]];
125 if (!s[37]) return TRUE;
126 return FALSE;
129 BOOL WINAPI DllMain(HINSTANCE instance, DWORD reason, LPVOID reserved)
131 switch (reason)
133 case DLL_WINE_PREATTACH:
134 return FALSE; /* prefer native version */
135 case DLL_PROCESS_ATTACH:
136 DisableThreadLibraryCalls(instance);
137 break;
140 return TRUE;
143 static HRESULT register_transform(CLSID *clsid, WCHAR *name,
144 UINT32 cinput, MFT_REGISTER_TYPE_INFO *input_types,
145 UINT32 coutput, MFT_REGISTER_TYPE_INFO *output_types)
147 static const WCHAR reg_format[] = {'%','s','\\','%','s',0};
148 HKEY hclsid = 0;
149 WCHAR buffer[64];
150 DWORD size;
151 WCHAR str[250];
153 GUIDToString(buffer, clsid);
154 sprintfW(str, reg_format, transform_keyW, buffer);
156 if (RegCreateKeyW(HKEY_CLASSES_ROOT, str, &hclsid))
157 return E_FAIL;
159 size = (strlenW(name) + 1) * sizeof(WCHAR);
160 if (RegSetValueExW(hclsid, NULL, 0, REG_SZ, (BYTE *)name, size))
161 goto err;
163 if (cinput && input_types)
165 size = cinput * sizeof(MFT_REGISTER_TYPE_INFO);
166 if (RegSetValueExW(hclsid, inputtypesW, 0, REG_BINARY, (BYTE *)input_types, size))
167 goto err;
170 if (coutput && output_types)
172 size = coutput * sizeof(MFT_REGISTER_TYPE_INFO);
173 if (RegSetValueExW(hclsid, outputtypesW, 0, REG_BINARY, (BYTE *)output_types, size))
174 goto err;
177 RegCloseKey(hclsid);
178 return S_OK;
180 err:
181 RegCloseKey(hclsid);
182 return E_FAIL;
185 static HRESULT register_category(CLSID *clsid, GUID *category)
187 static const WCHAR reg_format[] = {'%','s','\\','%','s','\\','%','s',0};
188 HKEY htmp1;
189 WCHAR guid1[64], guid2[64];
190 WCHAR str[350];
192 GUIDToString(guid1, category);
193 GUIDToString(guid2, clsid);
195 sprintfW(str, reg_format, categories_keyW, guid1, guid2);
197 if (RegCreateKeyW(HKEY_CLASSES_ROOT, str, &htmp1))
198 return E_FAIL;
200 RegCloseKey(htmp1);
201 return S_OK;
204 /***********************************************************************
205 * MFTRegister (mfplat.@)
207 HRESULT WINAPI MFTRegister(CLSID clsid, GUID category, LPWSTR name, UINT32 flags, UINT32 cinput,
208 MFT_REGISTER_TYPE_INFO *input_types, UINT32 coutput,
209 MFT_REGISTER_TYPE_INFO *output_types, IMFAttributes *attributes)
211 HRESULT hr;
213 TRACE("(%s, %s, %s, %x, %u, %p, %u, %p, %p)\n", debugstr_guid(&clsid), debugstr_guid(&category),
214 debugstr_w(name), flags, cinput, input_types,
215 coutput, output_types, attributes);
217 if (attributes)
218 FIXME("attributes not yet supported.\n");
220 if (flags)
221 FIXME("flags not yet supported.\n");
223 hr = register_transform(&clsid, name, cinput, input_types, coutput, output_types);
224 if(FAILED(hr))
225 ERR("Failed to write register transform\n");
227 if (SUCCEEDED(hr))
228 hr = register_category(&clsid, &category);
230 return hr;
233 static BOOL match_type(const WCHAR *clsid_str, const WCHAR *type_str, MFT_REGISTER_TYPE_INFO *type)
235 HKEY htransform, hfilter;
236 DWORD reg_type, size;
237 LONG ret = FALSE;
238 MFT_REGISTER_TYPE_INFO *info = NULL;
239 int i;
241 if (RegOpenKeyW(HKEY_CLASSES_ROOT, transform_keyW, &htransform))
242 return FALSE;
244 if (RegOpenKeyW(htransform, clsid_str, &hfilter))
246 RegCloseKey(htransform);
247 return FALSE;
250 if (RegQueryValueExW(hfilter, type_str, NULL, &reg_type, NULL, &size) != ERROR_SUCCESS)
251 goto out;
253 if (reg_type != REG_BINARY)
254 goto out;
256 if (!size || size % (sizeof(MFT_REGISTER_TYPE_INFO)) != 0)
257 goto out;
259 info = HeapAlloc(GetProcessHeap(), 0, size);
260 if (!info)
261 goto out;
263 if (RegQueryValueExW(hfilter, type_str, NULL, &reg_type, (LPBYTE)info, &size) != ERROR_SUCCESS)
264 goto out;
266 for (i = 0; i < size / sizeof(MFT_REGISTER_TYPE_INFO); i++)
268 if (IsEqualGUID(&info[i].guidMajorType, &type->guidMajorType) &&
269 IsEqualGUID(&info[i].guidSubtype, &type->guidSubtype))
271 ret = TRUE;
272 break;
276 out:
277 HeapFree(GetProcessHeap(), 0, info);
278 RegCloseKey(hfilter);
279 RegCloseKey(htransform);
280 return ret;
283 /***********************************************************************
284 * MFTEnum (mfplat.@)
286 HRESULT WINAPI MFTEnum(GUID category, UINT32 flags, MFT_REGISTER_TYPE_INFO *input_type,
287 MFT_REGISTER_TYPE_INFO *output_type, IMFAttributes *attributes,
288 CLSID **pclsids, UINT32 *pcount)
290 WCHAR buffer[64], clsid_str[MAX_PATH] = {0};
291 HKEY hcategory, hlist;
292 DWORD index = 0;
293 DWORD size = MAX_PATH;
294 CLSID *clsids = NULL;
295 UINT32 count = 0;
296 LONG ret;
298 TRACE("(%s, %x, %p, %p, %p, %p, %p)\n", debugstr_guid(&category), flags, input_type,
299 output_type, attributes, pclsids, pcount);
301 if (!pclsids || !pcount)
302 return E_INVALIDARG;
304 if (RegOpenKeyW(HKEY_CLASSES_ROOT, categories_keyW, &hcategory))
305 return E_FAIL;
307 GUIDToString(buffer, &category);
309 ret = RegOpenKeyW(hcategory, buffer, &hlist);
310 RegCloseKey(hcategory);
311 if (ret) return E_FAIL;
313 while (RegEnumKeyExW(hlist, index, clsid_str, &size, NULL, NULL, NULL, NULL) == ERROR_SUCCESS)
315 GUID clsid;
316 void *tmp;
318 if (!GUIDFromString(clsid_str, &clsid))
319 goto next;
321 if (output_type && !match_type(clsid_str, outputtypesW, output_type))
322 goto next;
324 if (input_type && !match_type(clsid_str, inputtypesW, input_type))
325 goto next;
327 tmp = CoTaskMemRealloc(clsids, (count + 1) * sizeof(GUID));
328 if (!tmp)
330 CoTaskMemFree(clsids);
331 RegCloseKey(hlist);
332 return E_OUTOFMEMORY;
335 clsids = tmp;
336 clsids[count++] = clsid;
338 next:
339 size = MAX_PATH;
340 index++;
343 *pclsids = clsids;
344 *pcount = count;
346 RegCloseKey(hlist);
347 return S_OK;
350 /***********************************************************************
351 * MFTEnumEx (mfplat.@)
353 HRESULT WINAPI MFTEnumEx(GUID category, UINT32 flags, const MFT_REGISTER_TYPE_INFO *input_type,
354 const MFT_REGISTER_TYPE_INFO *output_type, IMFActivate ***activate,
355 UINT32 *pcount)
357 FIXME("(%s, %x, %p, %p, %p, %p): stub\n", debugstr_guid(&category), flags, input_type,
358 output_type, activate, pcount);
360 *pcount = 0;
361 return S_OK;
364 /***********************************************************************
365 * MFTUnregister (mfplat.@)
367 HRESULT WINAPI MFTUnregister(CLSID clsid)
369 WCHAR buffer[64], category[MAX_PATH];
370 HKEY htransform, hcategory, htmp;
371 DWORD size = MAX_PATH;
372 DWORD index = 0;
374 TRACE("(%s)\n", debugstr_guid(&clsid));
376 GUIDToString(buffer, &clsid);
378 if (!RegOpenKeyW(HKEY_CLASSES_ROOT, transform_keyW, &htransform))
380 RegDeleteKeyW(htransform, buffer);
381 RegCloseKey(htransform);
384 if (!RegOpenKeyW(HKEY_CLASSES_ROOT, categories_keyW, &hcategory))
386 while (RegEnumKeyExW(hcategory, index, category, &size, NULL, NULL, NULL, NULL) == ERROR_SUCCESS)
388 if (!RegOpenKeyW(hcategory, category, &htmp))
390 RegDeleteKeyW(htmp, buffer);
391 RegCloseKey(htmp);
393 size = MAX_PATH;
394 index++;
396 RegCloseKey(hcategory);
399 return S_OK;
402 /***********************************************************************
403 * MFStartup (mfplat.@)
405 HRESULT WINAPI MFStartup(ULONG version, DWORD flags)
407 FIXME("(%u, %u): stub\n", version, flags);
408 return MF_E_BAD_STARTUP_VERSION;
411 /***********************************************************************
412 * MFShutdown (mfplat.@)
414 HRESULT WINAPI MFShutdown(void)
416 FIXME("(): stub\n");
417 return S_OK;
420 static HRESULT WINAPI MFPluginControl_QueryInterface(IMFPluginControl *iface, REFIID riid, void **ppv)
422 if(IsEqualGUID(riid, &IID_IUnknown)) {
423 TRACE("(IID_IUnknown %p)\n", ppv);
424 *ppv = iface;
425 }else if(IsEqualGUID(riid, &IID_IMFPluginControl)) {
426 TRACE("(IID_IMFPluginControl %p)\n", ppv);
427 *ppv = iface;
428 }else {
429 FIXME("(%s %p)\n", debugstr_guid(riid), ppv);
430 *ppv = NULL;
431 return E_NOINTERFACE;
434 IUnknown_AddRef((IUnknown*)*ppv);
435 return S_OK;
438 static ULONG WINAPI MFPluginControl_AddRef(IMFPluginControl *iface)
440 TRACE("\n");
441 return 2;
444 static ULONG WINAPI MFPluginControl_Release(IMFPluginControl *iface)
446 TRACE("\n");
447 return 1;
450 static HRESULT WINAPI MFPluginControl_GetPreferredClsid(IMFPluginControl *iface, DWORD plugin_type,
451 const WCHAR *selector, CLSID *clsid)
453 FIXME("(%d %s %p)\n", plugin_type, debugstr_w(selector), clsid);
454 return E_NOTIMPL;
457 static HRESULT WINAPI MFPluginControl_GetPreferredClsidByIndex(IMFPluginControl *iface, DWORD plugin_type,
458 DWORD index, WCHAR **selector, CLSID *clsid)
460 FIXME("(%d %d %p %p)\n", plugin_type, index, selector, clsid);
461 return E_NOTIMPL;
464 static HRESULT WINAPI MFPluginControl_SetPreferredClsid(IMFPluginControl *iface, DWORD plugin_type,
465 const WCHAR *selector, const CLSID *clsid)
467 FIXME("(%d %s %s)\n", plugin_type, debugstr_w(selector), debugstr_guid(clsid));
468 return E_NOTIMPL;
471 static HRESULT WINAPI MFPluginControl_IsDisabled(IMFPluginControl *iface, DWORD plugin_type, REFCLSID clsid)
473 FIXME("(%d %s)\n", plugin_type, debugstr_guid(clsid));
474 return E_NOTIMPL;
477 static HRESULT WINAPI MFPluginControl_GetDisabledByIndex(IMFPluginControl *iface, DWORD plugin_type, DWORD index, CLSID *clsid)
479 FIXME("(%d %d %p)\n", plugin_type, index, clsid);
480 return E_NOTIMPL;
483 static HRESULT WINAPI MFPluginControl_SetDisabled(IMFPluginControl *iface, DWORD plugin_type, REFCLSID clsid, BOOL disabled)
485 FIXME("(%d %s %x)\n", plugin_type, debugstr_guid(clsid), disabled);
486 return E_NOTIMPL;
489 static const IMFPluginControlVtbl MFPluginControlVtbl = {
490 MFPluginControl_QueryInterface,
491 MFPluginControl_AddRef,
492 MFPluginControl_Release,
493 MFPluginControl_GetPreferredClsid,
494 MFPluginControl_GetPreferredClsidByIndex,
495 MFPluginControl_SetPreferredClsid,
496 MFPluginControl_IsDisabled,
497 MFPluginControl_GetDisabledByIndex,
498 MFPluginControl_SetDisabled
501 static IMFPluginControl plugin_control = { &MFPluginControlVtbl };
503 /***********************************************************************
504 * MFGetPluginControl (mfplat.@)
506 HRESULT WINAPI MFGetPluginControl(IMFPluginControl **ret)
508 TRACE("(%p)\n", ret);
510 *ret = &plugin_control;
511 return S_OK;
514 typedef struct _mfattributes
516 IMFAttributes IMFAttributes_iface;
517 LONG ref;
518 } mfattributes;
520 static inline mfattributes *impl_from_IMFAttributes(IMFAttributes *iface)
522 return CONTAINING_RECORD(iface, mfattributes, IMFAttributes_iface);
525 static HRESULT WINAPI mfattributes_QueryInterface(IMFAttributes *iface, REFIID riid, void **out)
527 mfattributes *This = impl_from_IMFAttributes(iface);
529 TRACE("(%p)->(%s %p)\n", This, debugstr_guid(riid), out);
531 if(IsEqualGUID(riid, &IID_IUnknown) ||
532 IsEqualGUID(riid, &IID_IMFAttributes))
534 *out = &This->IMFAttributes_iface;
536 else
538 FIXME("(%s, %p)\n", debugstr_guid(riid), out);
539 *out = NULL;
540 return E_NOINTERFACE;
543 IUnknown_AddRef((IUnknown*)*out);
544 return S_OK;
547 static ULONG WINAPI mfattributes_AddRef(IMFAttributes *iface)
549 mfattributes *This = impl_from_IMFAttributes(iface);
550 ULONG ref = InterlockedIncrement(&This->ref);
552 TRACE("(%p) ref=%u\n", This, ref);
554 return ref;
557 static ULONG WINAPI mfattributes_Release(IMFAttributes *iface)
559 mfattributes *This = impl_from_IMFAttributes(iface);
560 ULONG ref = InterlockedDecrement(&This->ref);
562 TRACE("(%p) ref=%u\n", This, ref);
564 if (!ref)
566 HeapFree(GetProcessHeap(), 0, This);
569 return ref;
572 static HRESULT WINAPI mfattributes_GetItem(IMFAttributes *iface, REFGUID key, PROPVARIANT *value)
574 mfattributes *This = impl_from_IMFAttributes(iface);
576 FIXME("%p, %s, %p\n", This, debugstr_guid(key), value);
578 return E_NOTIMPL;
581 static HRESULT WINAPI mfattributes_GetItemType(IMFAttributes *iface, REFGUID key, MF_ATTRIBUTE_TYPE *type)
583 mfattributes *This = impl_from_IMFAttributes(iface);
585 FIXME("%p, %s, %p\n", This, debugstr_guid(key), type);
587 return E_NOTIMPL;
590 static HRESULT WINAPI mfattributes_CompareItem(IMFAttributes *iface, REFGUID key, REFPROPVARIANT value, BOOL *result)
592 mfattributes *This = impl_from_IMFAttributes(iface);
594 FIXME("%p, %s, %p, %p\n", This, debugstr_guid(key), value, result);
596 return E_NOTIMPL;
599 static HRESULT WINAPI mfattributes_Compare(IMFAttributes *iface, IMFAttributes *theirs, MF_ATTRIBUTES_MATCH_TYPE type,
600 BOOL *result)
602 mfattributes *This = impl_from_IMFAttributes(iface);
604 FIXME("%p, %p, %d, %p\n", This, theirs, type, result);
606 return E_NOTIMPL;
609 static HRESULT WINAPI mfattributes_GetUINT32(IMFAttributes *iface, REFGUID key, UINT32 *value)
611 mfattributes *This = impl_from_IMFAttributes(iface);
613 FIXME("%p, %s, %p\n", This, debugstr_guid(key), value);
615 return E_NOTIMPL;
618 static HRESULT WINAPI mfattributes_GetUINT64(IMFAttributes *iface, REFGUID key, UINT64 *value)
620 mfattributes *This = impl_from_IMFAttributes(iface);
622 FIXME("%p, %s, %p\n", This, debugstr_guid(key), value);
624 return E_NOTIMPL;
627 static HRESULT WINAPI mfattributes_GetDouble(IMFAttributes *iface, REFGUID key, double *value)
629 mfattributes *This = impl_from_IMFAttributes(iface);
631 FIXME("%p, %s, %p\n", This, debugstr_guid(key), value);
633 return E_NOTIMPL;
636 static HRESULT WINAPI mfattributes_GetGUID(IMFAttributes *iface, REFGUID key, GUID *value)
638 mfattributes *This = impl_from_IMFAttributes(iface);
640 FIXME("%p, %s, %p\n", This, debugstr_guid(key), value);
642 return E_NOTIMPL;
645 static HRESULT WINAPI mfattributes_GetStringLength(IMFAttributes *iface, REFGUID key, UINT32 *length)
647 mfattributes *This = impl_from_IMFAttributes(iface);
649 FIXME("%p, %s, %p\n", This, debugstr_guid(key), length);
651 return E_NOTIMPL;
654 static HRESULT WINAPI mfattributes_GetString(IMFAttributes *iface, REFGUID key, WCHAR *value,
655 UINT32 size, UINT32 *length)
657 mfattributes *This = impl_from_IMFAttributes(iface);
659 FIXME("%p, %s, %p, %d, %p\n", This, debugstr_guid(key), value, size, length);
661 return E_NOTIMPL;
664 static HRESULT WINAPI mfattributes_GetAllocatedString(IMFAttributes *iface, REFGUID key,
665 WCHAR **value, UINT32 *length)
667 mfattributes *This = impl_from_IMFAttributes(iface);
669 FIXME("%p, %s, %p, %p\n", This, debugstr_guid(key), value, length);
671 return E_NOTIMPL;
674 static HRESULT WINAPI mfattributes_GetBlobSize(IMFAttributes *iface, REFGUID key, UINT32 *size)
676 mfattributes *This = impl_from_IMFAttributes(iface);
678 FIXME("%p, %s, %p\n", This, debugstr_guid(key), size);
680 return E_NOTIMPL;
683 static HRESULT WINAPI mfattributes_GetBlob(IMFAttributes *iface, REFGUID key, UINT8 *buf,
684 UINT32 bufsize, UINT32 *blobsize)
686 mfattributes *This = impl_from_IMFAttributes(iface);
688 FIXME("%p, %s, %p, %d, %p\n", This, debugstr_guid(key), buf, bufsize, blobsize);
690 return E_NOTIMPL;
693 static HRESULT WINAPI mfattributes_GetAllocatedBlob(IMFAttributes *iface, REFGUID key, UINT8 **buf, UINT32 *size)
695 mfattributes *This = impl_from_IMFAttributes(iface);
697 FIXME("%p, %s, %p, %p\n", This, debugstr_guid(key), buf, size);
699 return E_NOTIMPL;
702 static HRESULT WINAPI mfattributes_GetUnknown(IMFAttributes *iface, REFGUID key, REFIID riid, void **ppv)
704 mfattributes *This = impl_from_IMFAttributes(iface);
706 FIXME("%p, %s, %s, %p\n", This, debugstr_guid(key), debugstr_guid(riid), ppv);
708 return E_NOTIMPL;
711 static HRESULT WINAPI mfattributes_SetItem(IMFAttributes *iface, REFGUID key, REFPROPVARIANT Value)
713 mfattributes *This = impl_from_IMFAttributes(iface);
715 FIXME("%p, %s, %p\n", This, debugstr_guid(key), Value);
717 return E_NOTIMPL;
720 static HRESULT WINAPI mfattributes_DeleteItem(IMFAttributes *iface, REFGUID key)
722 mfattributes *This = impl_from_IMFAttributes(iface);
724 FIXME("%p, %s\n", This, debugstr_guid(key));
726 return E_NOTIMPL;
729 static HRESULT WINAPI mfattributes_DeleteAllItems(IMFAttributes *iface)
731 mfattributes *This = impl_from_IMFAttributes(iface);
733 FIXME("%p\n", This);
735 return E_NOTIMPL;
738 static HRESULT WINAPI mfattributes_SetUINT32(IMFAttributes *iface, REFGUID key, UINT32 value)
740 mfattributes *This = impl_from_IMFAttributes(iface);
742 FIXME("%p, %s, %d\n", This, debugstr_guid(key), value);
744 return E_NOTIMPL;
747 static HRESULT WINAPI mfattributes_SetUINT64(IMFAttributes *iface, REFGUID key, UINT64 value)
749 mfattributes *This = impl_from_IMFAttributes(iface);
751 FIXME("%p, %s, %s\n", This, debugstr_guid(key), wine_dbgstr_longlong(value));
753 return E_NOTIMPL;
756 static HRESULT WINAPI mfattributes_SetDouble(IMFAttributes *iface, REFGUID key, double value)
758 mfattributes *This = impl_from_IMFAttributes(iface);
760 FIXME("%p, %s, %f\n", This, debugstr_guid(key), value);
762 return E_NOTIMPL;
765 static HRESULT WINAPI mfattributes_SetGUID(IMFAttributes *iface, REFGUID key, REFGUID value)
767 mfattributes *This = impl_from_IMFAttributes(iface);
769 FIXME("%p, %s, %s\n", This, debugstr_guid(key), debugstr_guid(value));
771 return E_NOTIMPL;
774 static HRESULT WINAPI mfattributes_SetString(IMFAttributes *iface, REFGUID key, const WCHAR *value)
776 mfattributes *This = impl_from_IMFAttributes(iface);
778 FIXME("%p, %s, %s\n", This, debugstr_guid(key), debugstr_w(value));
780 return E_NOTIMPL;
783 static HRESULT WINAPI mfattributes_SetBlob(IMFAttributes *iface, REFGUID key, const UINT8 *buf, UINT32 size)
785 mfattributes *This = impl_from_IMFAttributes(iface);
787 FIXME("%p, %s, %p, %d\n", This, debugstr_guid(key), buf, size);
789 return E_NOTIMPL;
792 static HRESULT WINAPI mfattributes_SetUnknown(IMFAttributes *iface, REFGUID key, IUnknown *unknown)
794 mfattributes *This = impl_from_IMFAttributes(iface);
796 FIXME("%p, %s, %p\n", This, debugstr_guid(key), unknown);
798 return E_NOTIMPL;
801 static HRESULT WINAPI mfattributes_LockStore(IMFAttributes *iface)
803 mfattributes *This = impl_from_IMFAttributes(iface);
805 FIXME("%p\n", This);
807 return E_NOTIMPL;
810 static HRESULT WINAPI mfattributes_UnlockStore(IMFAttributes *iface)
812 mfattributes *This = impl_from_IMFAttributes(iface);
814 FIXME("%p\n", This);
816 return E_NOTIMPL;
819 static HRESULT WINAPI mfattributes_GetCount(IMFAttributes *iface, UINT32 *items)
821 mfattributes *This = impl_from_IMFAttributes(iface);
823 FIXME("%p, %p\n", This, items);
825 if(items)
826 *items = 0;
828 return E_NOTIMPL;
831 static HRESULT WINAPI mfattributes_GetItemByIndex(IMFAttributes *iface, UINT32 index, GUID *key, PROPVARIANT *value)
833 mfattributes *This = impl_from_IMFAttributes(iface);
835 FIXME("%p, %d, %p, %p\n", This, index, key, value);
837 return E_NOTIMPL;
840 static HRESULT WINAPI mfattributes_CopyAllItems(IMFAttributes *iface, IMFAttributes *dest)
842 mfattributes *This = impl_from_IMFAttributes(iface);
844 FIXME("%p, %p\n", This, dest);
846 return E_NOTIMPL;
849 static const IMFAttributesVtbl mfattributes_vtbl =
851 mfattributes_QueryInterface,
852 mfattributes_AddRef,
853 mfattributes_Release,
854 mfattributes_GetItem,
855 mfattributes_GetItemType,
856 mfattributes_CompareItem,
857 mfattributes_Compare,
858 mfattributes_GetUINT32,
859 mfattributes_GetUINT64,
860 mfattributes_GetDouble,
861 mfattributes_GetGUID,
862 mfattributes_GetStringLength,
863 mfattributes_GetString,
864 mfattributes_GetAllocatedString,
865 mfattributes_GetBlobSize,
866 mfattributes_GetBlob,
867 mfattributes_GetAllocatedBlob,
868 mfattributes_GetUnknown,
869 mfattributes_SetItem,
870 mfattributes_DeleteItem,
871 mfattributes_DeleteAllItems,
872 mfattributes_SetUINT32,
873 mfattributes_SetUINT64,
874 mfattributes_SetDouble,
875 mfattributes_SetGUID,
876 mfattributes_SetString,
877 mfattributes_SetBlob,
878 mfattributes_SetUnknown,
879 mfattributes_LockStore,
880 mfattributes_UnlockStore,
881 mfattributes_GetCount,
882 mfattributes_GetItemByIndex,
883 mfattributes_CopyAllItems
886 /***********************************************************************
887 * MFCreateAttributes (mfplat.@)
889 HRESULT WINAPI MFCreateAttributes(IMFAttributes **attributes, UINT32 size)
891 mfattributes *object;
893 TRACE("%p, %d\n", attributes, size);
895 object = HeapAlloc( GetProcessHeap(), 0, sizeof(*object) );
896 if(!object)
897 return E_OUTOFMEMORY;
899 object->ref = 1;
900 object->IMFAttributes_iface.lpVtbl = &mfattributes_vtbl;
902 *attributes = &object->IMFAttributes_iface;
903 return S_OK;
906 typedef struct _mfsourceresolver
908 IMFSourceResolver IMFSourceResolver_iface;
909 LONG ref;
910 } mfsourceresolver;
912 static inline mfsourceresolver *impl_from_IMFSourceResolver(IMFSourceResolver *iface)
914 return CONTAINING_RECORD(iface, mfsourceresolver, IMFSourceResolver_iface);
917 static HRESULT WINAPI mfsourceresolver_QueryInterface(IMFSourceResolver *iface, REFIID riid, void **obj)
919 mfsourceresolver *This = impl_from_IMFSourceResolver(iface);
921 TRACE("(%p->(%s, %p)\n", This, debugstr_guid(riid), obj);
923 if (IsEqualIID(riid, &IID_IMFSourceResolver) ||
924 IsEqualIID(riid, &IID_IUnknown))
926 *obj = &This->IMFSourceResolver_iface;
928 else
930 *obj = NULL;
931 FIXME("unsupported interface %s\n", debugstr_guid(riid));
932 return E_NOINTERFACE;
935 IUnknown_AddRef((IUnknown *)*obj);
936 return S_OK;
939 static ULONG WINAPI mfsourceresolver_AddRef(IMFSourceResolver *iface)
941 mfsourceresolver *This = impl_from_IMFSourceResolver(iface);
942 ULONG ref = InterlockedIncrement(&This->ref);
944 TRACE("(%p)->(%u)\n", This, ref);
946 return ref;
949 static ULONG WINAPI mfsourceresolver_Release(IMFSourceResolver *iface)
951 mfsourceresolver *This = impl_from_IMFSourceResolver(iface);
952 ULONG ref = InterlockedDecrement(&This->ref);
954 TRACE("(%p)->(%u)\n", This, ref);
956 if (!ref)
957 HeapFree(GetProcessHeap(), 0, This);
959 return ref;
962 static HRESULT WINAPI mfsourceresolver_CreateObjectFromURL(IMFSourceResolver *iface, const WCHAR *url,
963 DWORD flags, IPropertyStore *props, MF_OBJECT_TYPE *obj_type, IUnknown **object)
965 mfsourceresolver *This = impl_from_IMFSourceResolver(iface);
967 FIXME("(%p)->(%s, %#x, %p, %p, %p): stub\n", This, debugstr_w(url), flags, props, obj_type, object);
969 return E_NOTIMPL;
972 static HRESULT WINAPI mfsourceresolver_CreateObjectFromByteStream(IMFSourceResolver *iface, IMFByteStream *stream,
973 const WCHAR *url, DWORD flags, IPropertyStore *props, MF_OBJECT_TYPE *obj_type, IUnknown **object)
975 mfsourceresolver *This = impl_from_IMFSourceResolver(iface);
977 FIXME("(%p)->(%p, %s, %#x, %p, %p, %p): stub\n", This, stream, debugstr_w(url), flags, props, obj_type, object);
979 return E_NOTIMPL;
982 static HRESULT WINAPI mfsourceresolver_BeginCreateObjectFromURL(IMFSourceResolver *iface, const WCHAR *url,
983 DWORD flags, IPropertyStore *props, IUnknown **cancel_cookie, IMFAsyncCallback *callback, IUnknown *unk_state)
985 mfsourceresolver *This = impl_from_IMFSourceResolver(iface);
987 FIXME("(%p)->(%s, %#x, %p, %p, %p, %p): stub\n", This, debugstr_w(url), flags, props, cancel_cookie,
988 callback, unk_state);
990 return E_NOTIMPL;
993 static HRESULT WINAPI mfsourceresolver_EndCreateObjectFromURL(IMFSourceResolver *iface, IMFAsyncResult *result,
994 MF_OBJECT_TYPE *obj_type, IUnknown **object)
996 mfsourceresolver *This = impl_from_IMFSourceResolver(iface);
998 FIXME("(%p)->(%p, %p, %p): stub\n", This, result, obj_type, object);
1000 return E_NOTIMPL;
1003 static HRESULT WINAPI mfsourceresolver_BeginCreateObjectFromByteStream(IMFSourceResolver *iface, IMFByteStream *stream,
1004 const WCHAR *url, DWORD flags, IPropertyStore *props, IUnknown **cancel_cookie, IMFAsyncCallback *callback,
1005 IUnknown *unk_state)
1007 mfsourceresolver *This = impl_from_IMFSourceResolver(iface);
1009 FIXME("(%p)->(%p, %s, %#x, %p, %p, %p, %p): stub\n", This, stream, debugstr_w(url), flags, props, cancel_cookie,
1010 callback, unk_state);
1012 return E_NOTIMPL;
1015 static HRESULT WINAPI mfsourceresolver_EndCreateObjectFromByteStream(IMFSourceResolver *iface, IMFAsyncResult *result,
1016 MF_OBJECT_TYPE *obj_type, IUnknown **object)
1018 mfsourceresolver *This = impl_from_IMFSourceResolver(iface);
1020 FIXME("(%p)->(%p, %p, %p): stub\n", This, result, obj_type, object);
1022 return E_NOTIMPL;
1025 static HRESULT WINAPI mfsourceresolver_CancelObjectCreation(IMFSourceResolver *iface, IUnknown *cancel_cookie)
1027 mfsourceresolver *This = impl_from_IMFSourceResolver(iface);
1029 FIXME("(%p)->(%p): stub\n", This, cancel_cookie);
1031 return E_NOTIMPL;
1034 static const IMFSourceResolverVtbl mfsourceresolvervtbl =
1036 mfsourceresolver_QueryInterface,
1037 mfsourceresolver_AddRef,
1038 mfsourceresolver_Release,
1039 mfsourceresolver_CreateObjectFromURL,
1040 mfsourceresolver_CreateObjectFromByteStream,
1041 mfsourceresolver_BeginCreateObjectFromURL,
1042 mfsourceresolver_EndCreateObjectFromURL,
1043 mfsourceresolver_BeginCreateObjectFromByteStream,
1044 mfsourceresolver_EndCreateObjectFromByteStream,
1045 mfsourceresolver_CancelObjectCreation,
1048 /***********************************************************************
1049 * MFCreateSourceResolver (mfplat.@)
1051 HRESULT WINAPI MFCreateSourceResolver(IMFSourceResolver **resolver)
1053 mfsourceresolver *object;
1055 TRACE("%p\n", resolver);
1057 if (!resolver)
1058 return E_POINTER;
1060 object = HeapAlloc( GetProcessHeap(), 0, sizeof(*object) );
1061 if (!object)
1062 return E_OUTOFMEMORY;
1064 object->IMFSourceResolver_iface.lpVtbl = &mfsourceresolvervtbl;
1065 object->ref = 1;
1067 *resolver = &object->IMFSourceResolver_iface;
1068 return S_OK;
1071 typedef struct _mfmediatype
1073 IMFMediaType IMFMediaType_iface;
1074 LONG ref;
1075 } mfmediatype;
1077 static inline mfmediatype *impl_from_IMFMediaType(IMFMediaType *iface)
1079 return CONTAINING_RECORD(iface, mfmediatype, IMFMediaType_iface);
1082 static HRESULT WINAPI mediatype_QueryInterface(IMFMediaType *iface, REFIID riid, void **object)
1084 mfmediatype *This = impl_from_IMFMediaType(iface);
1086 TRACE("(%p)->(%s %p)\n", This, debugstr_guid(riid), object);
1088 if(IsEqualGUID(riid, &IID_IUnknown) ||
1089 IsEqualGUID(riid, &IID_IMFAttributes) ||
1090 IsEqualGUID(riid, &IID_IMFMediaType))
1092 *object = &This->IMFMediaType_iface;
1094 else
1096 FIXME("(%s, %p)\n", debugstr_guid(riid), object);
1097 *object = NULL;
1098 return E_NOINTERFACE;
1101 IUnknown_AddRef((IUnknown*)*object);
1102 return S_OK;
1105 static ULONG WINAPI mediatype_AddRef(IMFMediaType *iface)
1107 mfmediatype *This = impl_from_IMFMediaType(iface);
1108 ULONG ref = InterlockedIncrement(&This->ref);
1110 TRACE("(%p) ref=%u\n", This, ref);
1112 return ref;
1115 static ULONG WINAPI mediatype_Release(IMFMediaType *iface)
1117 mfmediatype *This = impl_from_IMFMediaType(iface);
1118 ULONG ref = InterlockedDecrement(&This->ref);
1120 TRACE("(%p) ref=%u\n", This, ref);
1122 if (!ref)
1124 HeapFree(GetProcessHeap(), 0, This);
1127 return ref;
1130 static HRESULT WINAPI mediatype_GetItem(IMFMediaType *iface, REFGUID key, PROPVARIANT *value)
1132 mfmediatype *This = impl_from_IMFMediaType(iface);
1134 FIXME("%p, %s, %p\n", This, debugstr_guid(key), value);
1136 return E_NOTIMPL;
1139 static HRESULT WINAPI mediatype_GetItemType(IMFMediaType *iface, REFGUID key, MF_ATTRIBUTE_TYPE *type)
1141 mfmediatype *This = impl_from_IMFMediaType(iface);
1143 FIXME("%p, %s, %p\n", This, debugstr_guid(key), type);
1145 return E_NOTIMPL;
1148 static HRESULT WINAPI mediatype_CompareItem(IMFMediaType *iface, REFGUID key, REFPROPVARIANT value, BOOL *result)
1150 mfmediatype *This = impl_from_IMFMediaType(iface);
1152 FIXME("%p, %s, %p, %p\n", This, debugstr_guid(key), value, result);
1154 return E_NOTIMPL;
1157 static HRESULT WINAPI mediatype_Compare(IMFMediaType *iface, IMFAttributes *attrs, MF_ATTRIBUTES_MATCH_TYPE type,
1158 BOOL *result)
1160 mfmediatype *This = impl_from_IMFMediaType(iface);
1162 FIXME("%p, %p, %d, %p\n", This, attrs, type, result);
1164 return E_NOTIMPL;
1167 static HRESULT WINAPI mediatype_GetUINT32(IMFMediaType *iface, REFGUID key, UINT32 *value)
1169 mfmediatype *This = impl_from_IMFMediaType(iface);
1171 FIXME("%p, %s, %p\n", This, debugstr_guid(key), value);
1173 return E_NOTIMPL;
1176 static HRESULT WINAPI mediatype_GetUINT64(IMFMediaType *iface, REFGUID key, UINT64 *value)
1178 mfmediatype *This = impl_from_IMFMediaType(iface);
1180 FIXME("%p, %s, %p\n", This, debugstr_guid(key), value);
1182 return E_NOTIMPL;
1185 static HRESULT WINAPI mediatype_GetDouble(IMFMediaType *iface, REFGUID key, double *value)
1187 mfmediatype *This = impl_from_IMFMediaType(iface);
1189 FIXME("%p, %s, %p\n", This, debugstr_guid(key), value);
1191 return E_NOTIMPL;
1194 static HRESULT WINAPI mediatype_GetGUID(IMFMediaType *iface, REFGUID key, GUID *value)
1196 mfmediatype *This = impl_from_IMFMediaType(iface);
1198 FIXME("%p, %s, %p\n", This, debugstr_guid(key), value);
1200 return E_NOTIMPL;
1203 static HRESULT WINAPI mediatype_GetStringLength(IMFMediaType *iface, REFGUID key, UINT32 *length)
1205 mfmediatype *This = impl_from_IMFMediaType(iface);
1207 FIXME("%p, %s, %p\n", This, debugstr_guid(key), length);
1209 return E_NOTIMPL;
1212 static HRESULT WINAPI mediatype_GetString(IMFMediaType *iface, REFGUID key, WCHAR *value,
1213 UINT32 size, UINT32 *length)
1215 mfmediatype *This = impl_from_IMFMediaType(iface);
1217 FIXME("%p, %s, %p, %d, %p\n", This, debugstr_guid(key), value, size, length);
1219 return E_NOTIMPL;
1222 static HRESULT WINAPI mediatype_GetAllocatedString(IMFMediaType *iface, REFGUID key,
1223 WCHAR **value, UINT32 *length)
1225 mfmediatype *This = impl_from_IMFMediaType(iface);
1227 FIXME("%p, %s, %p, %p\n", This, debugstr_guid(key), value, length);
1229 return E_NOTIMPL;
1232 static HRESULT WINAPI mediatype_GetBlobSize(IMFMediaType *iface, REFGUID key, UINT32 *size)
1234 mfmediatype *This = impl_from_IMFMediaType(iface);
1236 FIXME("%p, %s, %p\n", This, debugstr_guid(key), size);
1238 return E_NOTIMPL;
1241 static HRESULT WINAPI mediatype_GetBlob(IMFMediaType *iface, REFGUID key, UINT8 *buf,
1242 UINT32 bufsize, UINT32 *blobsize)
1244 mfmediatype *This = impl_from_IMFMediaType(iface);
1246 FIXME("%p, %s, %p, %d, %p\n", This, debugstr_guid(key), buf, bufsize, blobsize);
1248 return E_NOTIMPL;
1251 static HRESULT WINAPI mediatype_GetAllocatedBlob(IMFMediaType *iface, REFGUID key, UINT8 **buf, UINT32 *size)
1253 mfmediatype *This = impl_from_IMFMediaType(iface);
1255 FIXME("%p, %s, %p, %p\n", This, debugstr_guid(key), buf, size);
1257 return E_NOTIMPL;
1260 static HRESULT WINAPI mediatype_GetUnknown(IMFMediaType *iface, REFGUID key, REFIID riid, void **ppv)
1262 mfmediatype *This = impl_from_IMFMediaType(iface);
1264 FIXME("%p, %s, %s, %p\n", This, debugstr_guid(key), debugstr_guid(riid), ppv);
1266 return E_NOTIMPL;
1269 static HRESULT WINAPI mediatype_SetItem(IMFMediaType *iface, REFGUID key, REFPROPVARIANT value)
1271 mfmediatype *This = impl_from_IMFMediaType(iface);
1273 FIXME("%p, %s, %p\n", This, debugstr_guid(key), value);
1275 return E_NOTIMPL;
1278 static HRESULT WINAPI mediatype_DeleteItem(IMFMediaType *iface, REFGUID key)
1280 mfmediatype *This = impl_from_IMFMediaType(iface);
1282 FIXME("%p, %s\n", This, debugstr_guid(key));
1284 return E_NOTIMPL;
1287 static HRESULT WINAPI mediatype_DeleteAllItems(IMFMediaType *iface)
1289 mfmediatype *This = impl_from_IMFMediaType(iface);
1291 FIXME("%p\n", This);
1293 return E_NOTIMPL;
1296 static HRESULT WINAPI mediatype_SetUINT32(IMFMediaType *iface, REFGUID key, UINT32 value)
1298 mfmediatype *This = impl_from_IMFMediaType(iface);
1300 FIXME("%p, %s, %d\n", This, debugstr_guid(key), value);
1302 return E_NOTIMPL;
1305 static HRESULT WINAPI mediatype_SetUINT64(IMFMediaType *iface, REFGUID key, UINT64 value)
1307 mfmediatype *This = impl_from_IMFMediaType(iface);
1309 FIXME("%p, %s, %s\n", This, debugstr_guid(key), wine_dbgstr_longlong(value));
1311 return E_NOTIMPL;
1314 static HRESULT WINAPI mediatype_SetDouble(IMFMediaType *iface, REFGUID key, double value)
1316 mfmediatype *This = impl_from_IMFMediaType(iface);
1318 FIXME("%p, %s, %f\n", This, debugstr_guid(key), value);
1320 return E_NOTIMPL;
1323 static HRESULT WINAPI mediatype_SetGUID(IMFMediaType *iface, REFGUID key, REFGUID value)
1325 mfmediatype *This = impl_from_IMFMediaType(iface);
1327 FIXME("%p, %s, %s\n", This, debugstr_guid(key), debugstr_guid(value));
1329 return E_NOTIMPL;
1332 static HRESULT WINAPI mediatype_SetString(IMFMediaType *iface, REFGUID key, const WCHAR *value)
1334 mfmediatype *This = impl_from_IMFMediaType(iface);
1336 FIXME("%p, %s, %s\n", This, debugstr_guid(key), debugstr_w(value));
1338 return E_NOTIMPL;
1341 static HRESULT WINAPI mediatype_SetBlob(IMFMediaType *iface, REFGUID key, const UINT8 *buf, UINT32 size)
1343 mfmediatype *This = impl_from_IMFMediaType(iface);
1345 FIXME("%p, %s, %p, %d\n", This, debugstr_guid(key), buf, size);
1347 return E_NOTIMPL;
1350 static HRESULT WINAPI mediatype_SetUnknown(IMFMediaType *iface, REFGUID key, IUnknown *unknown)
1352 mfmediatype *This = impl_from_IMFMediaType(iface);
1354 FIXME("%p, %s, %p\n", This, debugstr_guid(key), unknown);
1356 return E_NOTIMPL;
1359 static HRESULT WINAPI mediatype_LockStore(IMFMediaType *iface)
1361 mfmediatype *This = impl_from_IMFMediaType(iface);
1363 FIXME("%p\n", This);
1365 return E_NOTIMPL;
1368 static HRESULT WINAPI mediatype_UnlockStore(IMFMediaType *iface)
1370 mfmediatype *This = impl_from_IMFMediaType(iface);
1372 FIXME("%p\n", This);
1374 return E_NOTIMPL;
1377 static HRESULT WINAPI mediatype_GetCount(IMFMediaType *iface, UINT32 *items)
1379 mfmediatype *This = impl_from_IMFMediaType(iface);
1381 FIXME("%p, %p\n", This, items);
1383 if(items)
1384 *items = 0;
1386 return E_NOTIMPL;
1389 static HRESULT WINAPI mediatype_GetItemByIndex(IMFMediaType *iface, UINT32 index, GUID *key, PROPVARIANT *value)
1391 mfmediatype *This = impl_from_IMFMediaType(iface);
1393 FIXME("%p, %d, %p, %p\n", This, index, key, value);
1395 return E_NOTIMPL;
1398 static HRESULT WINAPI mediatype_CopyAllItems(IMFMediaType *iface, IMFAttributes *dest)
1400 mfmediatype *This = impl_from_IMFMediaType(iface);
1402 FIXME("%p, %p\n", This, dest);
1404 return E_NOTIMPL;
1407 static HRESULT WINAPI mediatype_GetMajorType(IMFMediaType *iface, GUID *guid)
1409 mfmediatype *This = impl_from_IMFMediaType(iface);
1411 FIXME("%p, %p\n", This, guid);
1413 return E_NOTIMPL;
1416 static HRESULT WINAPI mediatype_IsCompressedFormat(IMFMediaType *iface, BOOL *compressed)
1418 mfmediatype *This = impl_from_IMFMediaType(iface);
1420 FIXME("%p, %p\n", This, compressed);
1422 return E_NOTIMPL;
1425 static HRESULT WINAPI mediatype_IsEqual(IMFMediaType *iface, IMFMediaType *type, DWORD *flags)
1427 mfmediatype *This = impl_from_IMFMediaType(iface);
1429 FIXME("%p, %p, %p\n", This, type, flags);
1431 return E_NOTIMPL;
1434 static HRESULT WINAPI mediatype_GetRepresentation(IMFMediaType *iface, GUID guid, void **representation)
1436 mfmediatype *This = impl_from_IMFMediaType(iface);
1438 FIXME("%p, %s, %p\n", This, debugstr_guid(&guid), representation);
1440 return E_NOTIMPL;
1443 static HRESULT WINAPI mediatype_FreeRepresentation(IMFMediaType *iface, GUID guid, void *representation)
1445 mfmediatype *This = impl_from_IMFMediaType(iface);
1447 FIXME("%p, %s, %p\n", This, debugstr_guid(&guid), representation);
1449 return E_NOTIMPL;
1452 static const IMFMediaTypeVtbl mediatype_vtbl =
1454 mediatype_QueryInterface,
1455 mediatype_AddRef,
1456 mediatype_Release,
1457 mediatype_GetItem,
1458 mediatype_GetItemType,
1459 mediatype_CompareItem,
1460 mediatype_Compare,
1461 mediatype_GetUINT32,
1462 mediatype_GetUINT64,
1463 mediatype_GetDouble,
1464 mediatype_GetGUID,
1465 mediatype_GetStringLength,
1466 mediatype_GetString,
1467 mediatype_GetAllocatedString,
1468 mediatype_GetBlobSize,
1469 mediatype_GetBlob,
1470 mediatype_GetAllocatedBlob,
1471 mediatype_GetUnknown,
1472 mediatype_SetItem,
1473 mediatype_DeleteItem,
1474 mediatype_DeleteAllItems,
1475 mediatype_SetUINT32,
1476 mediatype_SetUINT64,
1477 mediatype_SetDouble,
1478 mediatype_SetGUID,
1479 mediatype_SetString,
1480 mediatype_SetBlob,
1481 mediatype_SetUnknown,
1482 mediatype_LockStore,
1483 mediatype_UnlockStore,
1484 mediatype_GetCount,
1485 mediatype_GetItemByIndex,
1486 mediatype_CopyAllItems,
1487 mediatype_GetMajorType,
1488 mediatype_IsCompressedFormat,
1489 mediatype_IsEqual,
1490 mediatype_GetRepresentation,
1491 mediatype_FreeRepresentation
1494 /***********************************************************************
1495 * MFCreateMediaType (mfplat.@)
1497 HRESULT WINAPI MFCreateMediaType(IMFMediaType **type)
1499 mfmediatype *object;
1501 TRACE("%p\n", type);
1503 if(!type)
1504 return E_INVALIDARG;
1506 object = HeapAlloc( GetProcessHeap(), 0, sizeof(*object) );
1507 if(!object)
1508 return E_OUTOFMEMORY;
1510 object->ref = 1;
1511 object->IMFMediaType_iface.lpVtbl = &mediatype_vtbl;
1513 *type = &object->IMFMediaType_iface;
1514 return S_OK;
1517 typedef struct _mfeventqueue
1519 IMFMediaEventQueue IMFMediaEventQueue_iface;
1520 LONG ref;
1521 } mfeventqueue;
1523 static inline mfeventqueue *impl_from_IMFMediaEventQueue(IMFMediaEventQueue *iface)
1525 return CONTAINING_RECORD(iface, mfeventqueue, IMFMediaEventQueue_iface);
1528 static HRESULT WINAPI mfeventqueue_QueryInterface(IMFMediaEventQueue *iface, REFIID riid, void **out)
1530 mfeventqueue *This = impl_from_IMFMediaEventQueue(iface);
1532 TRACE("(%p)->(%s %p)\n", This, debugstr_guid(riid), out);
1534 if(IsEqualGUID(riid, &IID_IUnknown) ||
1535 IsEqualGUID(riid, &IID_IMFMediaEventQueue))
1537 *out = &This->IMFMediaEventQueue_iface;
1539 else
1541 FIXME("(%s, %p)\n", debugstr_guid(riid), out);
1542 *out = NULL;
1543 return E_NOINTERFACE;
1546 IUnknown_AddRef((IUnknown*)*out);
1547 return S_OK;
1550 static ULONG WINAPI mfeventqueue_AddRef(IMFMediaEventQueue *iface)
1552 mfeventqueue *This = impl_from_IMFMediaEventQueue(iface);
1553 ULONG ref = InterlockedIncrement(&This->ref);
1555 TRACE("(%p) ref=%u\n", This, ref);
1557 return ref;
1560 static ULONG WINAPI mfeventqueue_Release(IMFMediaEventQueue *iface)
1562 mfeventqueue *This = impl_from_IMFMediaEventQueue(iface);
1563 ULONG ref = InterlockedDecrement(&This->ref);
1565 TRACE("(%p) ref=%u\n", This, ref);
1567 if (!ref)
1569 HeapFree(GetProcessHeap(), 0, This);
1572 return ref;
1575 static HRESULT WINAPI mfeventqueue_GetEvent(IMFMediaEventQueue *iface, DWORD flags, IMFMediaEvent **event)
1577 mfeventqueue *This = impl_from_IMFMediaEventQueue(iface);
1579 FIXME("%p, %p\n", This, event);
1581 return E_NOTIMPL;
1584 static HRESULT WINAPI mfeventqueue_BeginGetEvent(IMFMediaEventQueue *iface, IMFAsyncCallback *callback, IUnknown *state)
1586 mfeventqueue *This = impl_from_IMFMediaEventQueue(iface);
1588 FIXME("%p, %p, %p\n", This, callback, state);
1590 return E_NOTIMPL;
1593 static HRESULT WINAPI mfeventqueue_EndGetEvent(IMFMediaEventQueue *iface, IMFAsyncResult *result, IMFMediaEvent **event)
1595 mfeventqueue *This = impl_from_IMFMediaEventQueue(iface);
1597 FIXME("%p, %p, %p\n", This, result, event);
1599 return E_NOTIMPL;
1602 static HRESULT WINAPI mfeventqueue_QueueEvent(IMFMediaEventQueue *iface, IMFMediaEvent *event)
1604 mfeventqueue *This = impl_from_IMFMediaEventQueue(iface);
1606 FIXME("%p, %p\n", This, event);
1608 return E_NOTIMPL;
1611 static HRESULT WINAPI mfeventqueue_QueueEventParamVar(IMFMediaEventQueue *iface, MediaEventType met,
1612 REFGUID type, HRESULT status, const PROPVARIANT *value)
1614 mfeventqueue *This = impl_from_IMFMediaEventQueue(iface);
1616 FIXME("%p, %d, %s, 0x%08x, %p\n", This, met, debugstr_guid(type), status, value);
1618 return E_NOTIMPL;
1621 static HRESULT WINAPI mfeventqueue_QueueEventParamUnk(IMFMediaEventQueue *iface, MediaEventType met, REFGUID type,
1622 HRESULT status, IUnknown *unk)
1624 mfeventqueue *This = impl_from_IMFMediaEventQueue(iface);
1626 FIXME("%p, %d, %s, 0x%08x, %p\n", This, met, debugstr_guid(type), status, unk);
1628 return E_NOTIMPL;
1631 static HRESULT WINAPI mfeventqueue_Shutdown(IMFMediaEventQueue *iface)
1633 mfeventqueue *This = impl_from_IMFMediaEventQueue(iface);
1635 FIXME("%p\n", This);
1637 return E_NOTIMPL;
1640 static const IMFMediaEventQueueVtbl mfeventqueue_vtbl =
1642 mfeventqueue_QueryInterface,
1643 mfeventqueue_AddRef,
1644 mfeventqueue_Release,
1645 mfeventqueue_GetEvent,
1646 mfeventqueue_BeginGetEvent,
1647 mfeventqueue_EndGetEvent,
1648 mfeventqueue_QueueEvent,
1649 mfeventqueue_QueueEventParamVar,
1650 mfeventqueue_QueueEventParamUnk,
1651 mfeventqueue_Shutdown
1654 /***********************************************************************
1655 * MFCreateEventQueue (mfplat.@)
1657 HRESULT WINAPI MFCreateEventQueue(IMFMediaEventQueue **queue)
1659 mfeventqueue *object;
1661 TRACE("%p\n", queue);
1663 object = HeapAlloc( GetProcessHeap(), 0, sizeof(*object) );
1664 if(!object)
1665 return E_OUTOFMEMORY;
1667 object->ref = 1;
1668 object->IMFMediaEventQueue_iface.lpVtbl = &mfeventqueue_vtbl;
1670 *queue = &object->IMFMediaEventQueue_iface;
1672 return S_OK;
1675 typedef struct _mfdescriptor
1677 IMFStreamDescriptor IMFStreamDescriptor_iface;
1678 LONG ref;
1679 } mfdescriptor;
1681 static inline mfdescriptor *impl_from_IMFStreamDescriptor(IMFStreamDescriptor *iface)
1683 return CONTAINING_RECORD(iface, mfdescriptor, IMFStreamDescriptor_iface);
1686 static HRESULT WINAPI mfdescriptor_QueryInterface(IMFStreamDescriptor *iface, REFIID riid, void **out)
1688 mfdescriptor *This = impl_from_IMFStreamDescriptor(iface);
1690 TRACE("(%p)->(%s %p)\n", This, debugstr_guid(riid), out);
1692 if(IsEqualGUID(riid, &IID_IUnknown) ||
1693 IsEqualGUID(riid, &IID_IMFAttributes) ||
1694 IsEqualGUID(riid, &IID_IMFStreamDescriptor))
1696 *out = &This->IMFStreamDescriptor_iface;
1698 else
1700 FIXME("(%s, %p)\n", debugstr_guid(riid), out);
1701 *out = NULL;
1702 return E_NOINTERFACE;
1705 IUnknown_AddRef((IUnknown*)*out);
1706 return S_OK;
1709 static ULONG WINAPI mfdescriptor_AddRef(IMFStreamDescriptor *iface)
1711 mfdescriptor *This = impl_from_IMFStreamDescriptor(iface);
1712 ULONG ref = InterlockedIncrement(&This->ref);
1714 TRACE("(%p) ref=%u\n", This, ref);
1716 return ref;
1719 static ULONG WINAPI mfdescriptor_Release(IMFStreamDescriptor *iface)
1721 mfdescriptor *This = impl_from_IMFStreamDescriptor(iface);
1722 ULONG ref = InterlockedDecrement(&This->ref);
1724 TRACE("(%p) ref=%u\n", This, ref);
1726 if (!ref)
1728 HeapFree(GetProcessHeap(), 0, This);
1731 return ref;
1734 static HRESULT WINAPI mfdescriptor_GetItem(IMFStreamDescriptor *iface, REFGUID key, PROPVARIANT *value)
1736 mfdescriptor *This = impl_from_IMFStreamDescriptor(iface);
1738 FIXME("%p, %s, %p\n", This, debugstr_guid(key), value);
1740 return E_NOTIMPL;
1743 static HRESULT WINAPI mfdescriptor_GetItemType(IMFStreamDescriptor *iface, REFGUID key, MF_ATTRIBUTE_TYPE *type)
1745 mfdescriptor *This = impl_from_IMFStreamDescriptor(iface);
1747 FIXME("%p, %s, %p\n", This, debugstr_guid(key), type);
1749 return E_NOTIMPL;
1752 static HRESULT WINAPI mfdescriptor_CompareItem(IMFStreamDescriptor *iface, REFGUID key, REFPROPVARIANT value, BOOL *result)
1754 mfdescriptor *This = impl_from_IMFStreamDescriptor(iface);
1756 FIXME("%p, %s, %p, %p\n", This, debugstr_guid(key), value, result);
1758 return E_NOTIMPL;
1761 static HRESULT WINAPI mfdescriptor_Compare(IMFStreamDescriptor *iface, IMFAttributes *theirs, MF_ATTRIBUTES_MATCH_TYPE type,
1762 BOOL *result)
1764 mfdescriptor *This = impl_from_IMFStreamDescriptor(iface);
1766 FIXME("%p, %p, %d, %p\n", This, theirs, type, result);
1768 return E_NOTIMPL;
1771 static HRESULT WINAPI mfdescriptor_GetUINT32(IMFStreamDescriptor *iface, REFGUID key, UINT32 *value)
1773 mfdescriptor *This = impl_from_IMFStreamDescriptor(iface);
1775 FIXME("%p, %s, %p\n", This, debugstr_guid(key), value);
1777 return E_NOTIMPL;
1780 static HRESULT WINAPI mfdescriptor_GetUINT64(IMFStreamDescriptor *iface, REFGUID key, UINT64 *value)
1782 mfdescriptor *This = impl_from_IMFStreamDescriptor(iface);
1784 FIXME("%p, %s, %p\n", This, debugstr_guid(key), value);
1786 return E_NOTIMPL;
1789 static HRESULT WINAPI mfdescriptor_GetDouble(IMFStreamDescriptor *iface, REFGUID key, double *value)
1791 mfdescriptor *This = impl_from_IMFStreamDescriptor(iface);
1793 FIXME("%p, %s, %p\n", This, debugstr_guid(key), value);
1795 return E_NOTIMPL;
1798 static HRESULT WINAPI mfdescriptor_GetGUID(IMFStreamDescriptor *iface, REFGUID key, GUID *value)
1800 mfdescriptor *This = impl_from_IMFStreamDescriptor(iface);
1802 FIXME("%p, %s, %p\n", This, debugstr_guid(key), value);
1804 return E_NOTIMPL;
1807 static HRESULT WINAPI mfdescriptor_GetStringLength(IMFStreamDescriptor *iface, REFGUID key, UINT32 *length)
1809 mfdescriptor *This = impl_from_IMFStreamDescriptor(iface);
1811 FIXME("%p, %s, %p\n", This, debugstr_guid(key), length);
1813 return E_NOTIMPL;
1816 static HRESULT WINAPI mfdescriptor_GetString(IMFStreamDescriptor *iface, REFGUID key, WCHAR *value,
1817 UINT32 size, UINT32 *length)
1819 mfdescriptor *This = impl_from_IMFStreamDescriptor(iface);
1821 FIXME("%p, %s, %p, %d, %p\n", This, debugstr_guid(key), value, size, length);
1823 return E_NOTIMPL;
1826 static HRESULT WINAPI mfdescriptor_GetAllocatedString(IMFStreamDescriptor *iface, REFGUID key,
1827 WCHAR **value, UINT32 *length)
1829 mfdescriptor *This = impl_from_IMFStreamDescriptor(iface);
1831 FIXME("%p, %s, %p, %p\n", This, debugstr_guid(key), value, length);
1833 return E_NOTIMPL;
1836 static HRESULT WINAPI mfdescriptor_GetBlobSize(IMFStreamDescriptor *iface, REFGUID key, UINT32 *size)
1838 mfdescriptor *This = impl_from_IMFStreamDescriptor(iface);
1840 FIXME("%p, %s, %p\n", This, debugstr_guid(key), size);
1842 return E_NOTIMPL;
1845 static HRESULT WINAPI mfdescriptor_GetBlob(IMFStreamDescriptor *iface, REFGUID key, UINT8 *buf,
1846 UINT32 bufsize, UINT32 *blobsize)
1848 mfdescriptor *This = impl_from_IMFStreamDescriptor(iface);
1850 FIXME("%p, %s, %p, %d, %p\n", This, debugstr_guid(key), buf, bufsize, blobsize);
1852 return E_NOTIMPL;
1855 static HRESULT WINAPI mfdescriptor_GetAllocatedBlob(IMFStreamDescriptor *iface, REFGUID key, UINT8 **buf, UINT32 *size)
1857 mfdescriptor *This = impl_from_IMFStreamDescriptor(iface);
1859 FIXME("%p, %s, %p, %p\n", This, debugstr_guid(key), buf, size);
1861 return E_NOTIMPL;
1864 static HRESULT WINAPI mfdescriptor_GetUnknown(IMFStreamDescriptor *iface, REFGUID key, REFIID riid, void **ppv)
1866 mfdescriptor *This = impl_from_IMFStreamDescriptor(iface);
1868 FIXME("%p, %s, %s, %p\n", This, debugstr_guid(key), debugstr_guid(riid), ppv);
1870 return E_NOTIMPL;
1873 static HRESULT WINAPI mfdescriptor_SetItem(IMFStreamDescriptor *iface, REFGUID key, REFPROPVARIANT Value)
1875 mfdescriptor *This = impl_from_IMFStreamDescriptor(iface);
1877 FIXME("%p, %s, %p\n", This, debugstr_guid(key), Value);
1879 return E_NOTIMPL;
1882 static HRESULT WINAPI mfdescriptor_DeleteItem(IMFStreamDescriptor *iface, REFGUID key)
1884 mfdescriptor *This = impl_from_IMFStreamDescriptor(iface);
1886 FIXME("%p, %s\n", This, debugstr_guid(key));
1888 return E_NOTIMPL;
1891 static HRESULT WINAPI mfdescriptor_DeleteAllItems(IMFStreamDescriptor *iface)
1893 mfdescriptor *This = impl_from_IMFStreamDescriptor(iface);
1895 FIXME("%p\n", This);
1897 return E_NOTIMPL;
1900 static HRESULT WINAPI mfdescriptor_SetUINT32(IMFStreamDescriptor *iface, REFGUID key, UINT32 value)
1902 mfdescriptor *This = impl_from_IMFStreamDescriptor(iface);
1904 FIXME("%p, %s, %d\n", This, debugstr_guid(key), value);
1906 return E_NOTIMPL;
1909 static HRESULT WINAPI mfdescriptor_SetUINT64(IMFStreamDescriptor *iface, REFGUID key, UINT64 value)
1911 mfdescriptor *This = impl_from_IMFStreamDescriptor(iface);
1913 FIXME("%p, %s, %s\n", This, debugstr_guid(key), wine_dbgstr_longlong(value));
1915 return E_NOTIMPL;
1918 static HRESULT WINAPI mfdescriptor_SetDouble(IMFStreamDescriptor *iface, REFGUID key, double value)
1920 mfdescriptor *This = impl_from_IMFStreamDescriptor(iface);
1922 FIXME("%p, %s, %f\n", This, debugstr_guid(key), value);
1924 return E_NOTIMPL;
1927 static HRESULT WINAPI mfdescriptor_SetGUID(IMFStreamDescriptor *iface, REFGUID key, REFGUID value)
1929 mfdescriptor *This = impl_from_IMFStreamDescriptor(iface);
1931 FIXME("%p, %s, %s\n", This, debugstr_guid(key), debugstr_guid(value));
1933 return E_NOTIMPL;
1936 static HRESULT WINAPI mfdescriptor_SetString(IMFStreamDescriptor *iface, REFGUID key, const WCHAR *value)
1938 mfdescriptor *This = impl_from_IMFStreamDescriptor(iface);
1940 FIXME("%p, %s, %s\n", This, debugstr_guid(key), debugstr_w(value));
1942 return E_NOTIMPL;
1945 static HRESULT WINAPI mfdescriptor_SetBlob(IMFStreamDescriptor *iface, REFGUID key, const UINT8 *buf, UINT32 size)
1947 mfdescriptor *This = impl_from_IMFStreamDescriptor(iface);
1949 FIXME("%p, %s, %p, %d\n", This, debugstr_guid(key), buf, size);
1951 return E_NOTIMPL;
1954 static HRESULT WINAPI mfdescriptor_SetUnknown(IMFStreamDescriptor *iface, REFGUID key, IUnknown *unknown)
1956 mfdescriptor *This = impl_from_IMFStreamDescriptor(iface);
1958 FIXME("%p, %s, %p\n", This, debugstr_guid(key), unknown);
1960 return E_NOTIMPL;
1963 static HRESULT WINAPI mfdescriptor_LockStore(IMFStreamDescriptor *iface)
1965 mfdescriptor *This = impl_from_IMFStreamDescriptor(iface);
1967 FIXME("%p\n", This);
1969 return E_NOTIMPL;
1972 static HRESULT WINAPI mfdescriptor_UnlockStore(IMFStreamDescriptor *iface)
1974 mfdescriptor *This = impl_from_IMFStreamDescriptor(iface);
1976 FIXME("%p\n", This);
1978 return E_NOTIMPL;
1981 static HRESULT WINAPI mfdescriptor_GetCount(IMFStreamDescriptor *iface, UINT32 *items)
1983 mfdescriptor *This = impl_from_IMFStreamDescriptor(iface);
1985 FIXME("%p, %p\n", This, items);
1987 if(items)
1988 *items = 0;
1990 return E_NOTIMPL;
1993 static HRESULT WINAPI mfdescriptor_GetItemByIndex(IMFStreamDescriptor *iface, UINT32 index, GUID *key, PROPVARIANT *value)
1995 mfdescriptor *This = impl_from_IMFStreamDescriptor(iface);
1997 FIXME("%p, %d, %p, %p\n", This, index, key, value);
1999 return E_NOTIMPL;
2002 static HRESULT WINAPI mfdescriptor_CopyAllItems(IMFStreamDescriptor *iface, IMFAttributes *dest)
2004 mfdescriptor *This = impl_from_IMFStreamDescriptor(iface);
2006 FIXME("%p, %p\n", This, dest);
2008 return E_NOTIMPL;
2011 static HRESULT WINAPI mfdescriptor_GetStreamIdentifier(IMFStreamDescriptor *iface, DWORD *identifier)
2013 mfdescriptor *This = impl_from_IMFStreamDescriptor(iface);
2015 FIXME("%p, %p\n", This, identifier);
2017 return E_NOTIMPL;
2020 static HRESULT WINAPI mfdescriptor_GetMediaTypeHandler(IMFStreamDescriptor *iface, IMFMediaTypeHandler **handler)
2022 mfdescriptor *This = impl_from_IMFStreamDescriptor(iface);
2024 FIXME("%p, %p\n", This, handler);
2026 return E_NOTIMPL;
2029 static const IMFStreamDescriptorVtbl mfdescriptor_vtbl =
2031 mfdescriptor_QueryInterface,
2032 mfdescriptor_AddRef,
2033 mfdescriptor_Release,
2034 mfdescriptor_GetItem,
2035 mfdescriptor_GetItemType,
2036 mfdescriptor_CompareItem,
2037 mfdescriptor_Compare,
2038 mfdescriptor_GetUINT32,
2039 mfdescriptor_GetUINT64,
2040 mfdescriptor_GetDouble,
2041 mfdescriptor_GetGUID,
2042 mfdescriptor_GetStringLength,
2043 mfdescriptor_GetString,
2044 mfdescriptor_GetAllocatedString,
2045 mfdescriptor_GetBlobSize,
2046 mfdescriptor_GetBlob,
2047 mfdescriptor_GetAllocatedBlob,
2048 mfdescriptor_GetUnknown,
2049 mfdescriptor_SetItem,
2050 mfdescriptor_DeleteItem,
2051 mfdescriptor_DeleteAllItems,
2052 mfdescriptor_SetUINT32,
2053 mfdescriptor_SetUINT64,
2054 mfdescriptor_SetDouble,
2055 mfdescriptor_SetGUID,
2056 mfdescriptor_SetString,
2057 mfdescriptor_SetBlob,
2058 mfdescriptor_SetUnknown,
2059 mfdescriptor_LockStore,
2060 mfdescriptor_UnlockStore,
2061 mfdescriptor_GetCount,
2062 mfdescriptor_GetItemByIndex,
2063 mfdescriptor_CopyAllItems,
2064 mfdescriptor_GetStreamIdentifier,
2065 mfdescriptor_GetMediaTypeHandler
2068 HRESULT WINAPI MFCreateStreamDescriptor(DWORD identifier, DWORD count,
2069 IMFMediaType **types, IMFStreamDescriptor **descriptor)
2071 mfdescriptor *object;
2073 TRACE("%d, %d, %p, %p\n", identifier, count, types, descriptor);
2075 object = HeapAlloc( GetProcessHeap(), 0, sizeof(*object) );
2076 if(!object)
2077 return E_OUTOFMEMORY;
2079 object->ref = 1;
2080 object->IMFStreamDescriptor_iface.lpVtbl = &mfdescriptor_vtbl;
2082 *descriptor = &object->IMFStreamDescriptor_iface;
2083 return S_OK;