2 * Copyright (C) 2003 Michael Günnewig
3 * Copyright (C) 2003 CodeWeavers Inc. (Ulrich Czekalla)
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
30 #include "wine/unicode.h"
31 #include "wine/debug.h"
35 WINE_DEFAULT_DEBUG_CHANNEL(msdmo
);
37 #define MSDMO_MAJOR_VERSION 6
39 static const WCHAR szDMORootKey
[] =
41 'D','i','r','e','c','t','S','h','o','w','\\',
42 'M','e','d','i','a','O','b','j','e','c','t','s',0
45 static const WCHAR szDMOInputType
[] =
47 'I','n','p','u','t','T','y','p','e','s',0
50 static const WCHAR szDMOOutputType
[] =
52 'O','u','t','p','u','t','T','y','p','e','s',0
55 static const WCHAR szDMOKeyed
[] =
60 static const WCHAR szDMOCategories
[] =
62 'C','a','t','e','g','o','r','i','e','s',0
65 static const WCHAR szGUIDFmt
[] =
67 '%','0','8','X','-','%','0','4','X','-','%','0','4','X','-','%','0',
68 '2','X','%','0','2','X','-','%','0','2','X','%','0','2','X','%','0','2',
69 'X','%','0','2','X','%','0','2','X','%','0','2','X',0
72 static const WCHAR szCat3Fmt
[] =
74 '%','s','\\','%','s','\\','%','s',0
77 static const WCHAR szCat2Fmt
[] =
79 '%','s','\\','%','s',0
82 static const WCHAR szToGuidFmt
[] =
90 IEnumDMO IEnumDMO_iface
;
96 DMO_PARTIAL_MEDIATYPE
*pInTypes
;
98 DMO_PARTIAL_MEDIATYPE
*pOutTypes
;
102 static inline IEnumDMOImpl
*impl_from_IEnumDMO(IEnumDMO
*iface
)
104 return CONTAINING_RECORD(iface
, IEnumDMOImpl
, IEnumDMO_iface
);
107 static HRESULT
read_types(HKEY root
, LPCWSTR key
, ULONG
*supplied
, ULONG requested
, DMO_PARTIAL_MEDIATYPE
* types
);
109 static const IEnumDMOVtbl edmovt
;
111 static LPWSTR
GUIDToString(LPWSTR lpwstr
, REFGUID lpcguid
)
113 wsprintfW(lpwstr
, szGUIDFmt
, lpcguid
->Data1
, lpcguid
->Data2
,
114 lpcguid
->Data3
, lpcguid
->Data4
[0], lpcguid
->Data4
[1],
115 lpcguid
->Data4
[2], lpcguid
->Data4
[3], lpcguid
->Data4
[4],
116 lpcguid
->Data4
[5], lpcguid
->Data4
[6], lpcguid
->Data4
[7]);
121 static BOOL
IsMediaTypeEqual(const DMO_PARTIAL_MEDIATYPE
* mt1
, const DMO_PARTIAL_MEDIATYPE
* mt2
)
124 return (IsEqualCLSID(&mt1
->type
, &mt2
->type
) ||
125 IsEqualCLSID(&mt2
->type
, &GUID_NULL
) ||
126 IsEqualCLSID(&mt1
->type
, &GUID_NULL
)) &&
127 (IsEqualCLSID(&mt1
->subtype
, &mt2
->subtype
) ||
128 IsEqualCLSID(&mt2
->subtype
, &GUID_NULL
) ||
129 IsEqualCLSID(&mt1
->subtype
, &GUID_NULL
));
132 static HRESULT
write_types(HKEY hkey
, LPCWSTR name
, const DMO_PARTIAL_MEDIATYPE
* types
, DWORD count
)
136 if (MSDMO_MAJOR_VERSION
> 5)
138 ret
= RegSetValueExW(hkey
, name
, 0, REG_BINARY
, (const BYTE
*) types
,
139 count
* sizeof(DMO_PARTIAL_MEDIATYPE
));
143 HKEY skey1
,skey2
,skey3
;
147 ret
= RegCreateKeyExW(hkey
, name
, 0, NULL
, REG_OPTION_NON_VOLATILE
,
148 KEY_WRITE
, NULL
, &skey1
, NULL
);
150 return HRESULT_FROM_WIN32(ret
);
152 while (index
< count
)
154 GUIDToString(szGuidKey
,&types
[index
].type
);
155 ret
= RegCreateKeyExW(skey1
, szGuidKey
, 0, NULL
,
156 REG_OPTION_NON_VOLATILE
, KEY_WRITE
, NULL
, &skey2
, NULL
);
157 GUIDToString(szGuidKey
,&types
[index
].subtype
);
158 ret
= RegCreateKeyExW(skey2
, szGuidKey
, 0, NULL
,
159 REG_OPTION_NON_VOLATILE
, KEY_WRITE
, NULL
, &skey3
, NULL
);
167 return HRESULT_FROM_WIN32(ret
);
170 /***************************************************************
171 * DMORegister (MSDMO.@)
173 * Register a DirectX Media Object.
175 HRESULT WINAPI
DMORegister(
178 REFGUID guidCategory
,
181 const DMO_PARTIAL_MEDIATYPE
*pInTypes
,
183 const DMO_PARTIAL_MEDIATYPE
*pOutTypes
194 TRACE("%s %s %s\n", debugstr_w(szName
), debugstr_guid(clsidDMO
), debugstr_guid(guidCategory
));
196 if (IsEqualGUID(guidCategory
, &GUID_NULL
))
199 ret
= RegCreateKeyExW(HKEY_CLASSES_ROOT
, szDMORootKey
, 0, NULL
,
200 REG_OPTION_NON_VOLATILE
, KEY_WRITE
, NULL
, &hrkey
, NULL
);
202 return HRESULT_FROM_WIN32(ret
);
204 /* Create clsidDMO key under MediaObjects */
205 ret
= RegCreateKeyExW(hrkey
, GUIDToString(szguid
, clsidDMO
), 0, NULL
,
206 REG_OPTION_NON_VOLATILE
, KEY_WRITE
, NULL
, &hkey
, NULL
);
210 /* Set default Name value */
211 ret
= RegSetValueExW(hkey
, NULL
, 0, REG_SZ
, (const BYTE
*) szName
,
212 (strlenW(szName
) + 1) * sizeof(WCHAR
));
215 hres
= write_types(hkey
, szDMOInputType
, pInTypes
, cInTypes
);
217 /* Set OutputTypes */
218 hres
= write_types(hkey
, szDMOOutputType
, pOutTypes
, cOutTypes
);
220 if (dwFlags
& DMO_REGISTERF_IS_KEYED
)
222 /* Create Keyed key */
223 ret
= RegCreateKeyExW(hkey
, szDMOKeyed
, 0, NULL
,
224 REG_OPTION_NON_VOLATILE
, KEY_WRITE
, NULL
, &hckey
, NULL
);
230 /* Register the category */
231 ret
= RegCreateKeyExW(hrkey
, szDMOCategories
, 0, NULL
,
232 REG_OPTION_NON_VOLATILE
, KEY_WRITE
, NULL
, &hckey
, NULL
);
238 ret
= RegCreateKeyExW(hckey
, GUIDToString(szguid
, guidCategory
), 0, NULL
,
239 REG_OPTION_NON_VOLATILE
, KEY_WRITE
, NULL
, &hkey
, NULL
);
242 ret
= RegCreateKeyExW(hkey
, GUIDToString(szguid
, clsidDMO
), 0, NULL
,
243 REG_OPTION_NON_VOLATILE
, KEY_WRITE
, NULL
, &hclskey
, NULL
);
253 RegCloseKey(hclskey
);
257 hres
= HRESULT_FROM_WIN32(ret
);
258 TRACE(" hresult=0x%08x\n", hres
);
262 static HRESULT
unregister_dmo_from_category(const WCHAR
*dmoW
, const WCHAR
*catW
, HKEY categories
)
267 ret
= RegOpenKeyExW(categories
, catW
, 0, KEY_WRITE
, &catkey
);
270 ret
= RegDeleteKeyW(catkey
, dmoW
);
274 return !ret
? S_OK
: S_FALSE
;
277 /***************************************************************
278 * DMOUnregister (MSDMO.@)
280 * Unregister a DirectX Media Object.
282 HRESULT WINAPI
DMOUnregister(REFCLSID dmo
, REFGUID category
)
284 HKEY rootkey
= 0, categorieskey
= 0;
285 WCHAR dmoW
[64], catW
[64];
286 HRESULT hr
= S_FALSE
;
289 TRACE("%s %s\n", debugstr_guid(dmo
), debugstr_guid(category
));
291 ret
= RegOpenKeyExW(HKEY_CLASSES_ROOT
, szDMORootKey
, 0, KEY_WRITE
, &rootkey
);
295 GUIDToString(dmoW
, dmo
);
296 RegDeleteKeyW(rootkey
, dmoW
);
298 /* open 'Categories' */
299 ret
= RegOpenKeyExW(rootkey
, szDMOCategories
, 0, KEY_WRITE
|KEY_ENUMERATE_SUB_KEYS
, &categorieskey
);
300 RegCloseKey(rootkey
);
303 hr
= HRESULT_FROM_WIN32(ret
);
307 /* remove from all categories */
308 if (IsEqualGUID(category
, &GUID_NULL
))
310 DWORD index
= 0, len
= sizeof(catW
)/sizeof(WCHAR
);
312 while (!RegEnumKeyExW(categorieskey
, index
++, catW
, &len
, NULL
, NULL
, NULL
, NULL
))
313 hr
= unregister_dmo_from_category(dmoW
, catW
, categorieskey
);
317 GUIDToString(catW
, category
);
318 hr
= unregister_dmo_from_category(dmoW
, catW
, categorieskey
);
323 RegCloseKey(categorieskey
);
329 /***************************************************************
330 * DMOGetName (MSDMO.@)
332 * Get DMO Name from the registry
334 HRESULT WINAPI
DMOGetName(REFCLSID clsidDMO
, WCHAR name
[])
336 static const INT max_name_len
= 80*sizeof(WCHAR
);
337 DWORD count
= max_name_len
;
342 TRACE("%s %p\n", debugstr_guid(clsidDMO
), name
);
344 if (RegOpenKeyExW(HKEY_CLASSES_ROOT
, szDMORootKey
, 0, KEY_READ
, &hrkey
))
347 ret
= RegOpenKeyExW(hrkey
, GUIDToString(szguid
, clsidDMO
), 0, KEY_READ
, &hkey
);
352 ret
= RegQueryValueExW(hkey
, NULL
, NULL
, NULL
, (LPBYTE
)name
, &count
);
355 if (!ret
&& count
> 1)
357 TRACE("name=%s\n", debugstr_w(name
));
365 static HRESULT
dup_partial_mediatype(const DMO_PARTIAL_MEDIATYPE
*types
, DWORD count
, DMO_PARTIAL_MEDIATYPE
**ret
)
372 *ret
= HeapAlloc(GetProcessHeap(), 0, count
*sizeof(*types
));
374 return E_OUTOFMEMORY
;
376 memcpy(*ret
, types
, count
*sizeof(*types
));
380 /**************************************************************************
381 * IEnumDMO_Constructor
383 static HRESULT
IEnumDMO_Constructor(
384 REFGUID guidCategory
,
387 const DMO_PARTIAL_MEDIATYPE
*pInTypes
,
389 const DMO_PARTIAL_MEDIATYPE
*pOutTypes
,
392 IEnumDMOImpl
* lpedmo
;
398 lpedmo
= HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY
, sizeof(IEnumDMOImpl
));
400 return E_OUTOFMEMORY
;
402 lpedmo
->IEnumDMO_iface
.lpVtbl
= &edmovt
;
405 lpedmo
->category
= *guidCategory
;
406 lpedmo
->dwFlags
= dwFlags
;
407 lpedmo
->cInTypes
= cInTypes
;
408 lpedmo
->cOutTypes
= cOutTypes
;
410 hr
= dup_partial_mediatype(pInTypes
, cInTypes
, &lpedmo
->pInTypes
);
414 hr
= dup_partial_mediatype(pOutTypes
, cOutTypes
, &lpedmo
->pOutTypes
);
418 /* If not filtering by category enum from media objects root */
419 if (IsEqualGUID(guidCategory
, &GUID_NULL
))
421 if ((ret
= RegOpenKeyExW(HKEY_CLASSES_ROOT
, szDMORootKey
, 0, KEY_READ
, &lpedmo
->hkey
)))
422 hr
= HRESULT_FROM_WIN32(ret
);
427 WCHAR szKey
[MAX_PATH
];
429 wsprintfW(szKey
, szCat3Fmt
, szDMORootKey
, szDMOCategories
, GUIDToString(szguid
, guidCategory
));
430 if ((ret
= RegOpenKeyExW(HKEY_CLASSES_ROOT
, szKey
, 0, KEY_READ
, &lpedmo
->hkey
)))
431 hr
= HRESULT_FROM_WIN32(ret
);
437 IEnumDMO_Release(&lpedmo
->IEnumDMO_iface
);
440 TRACE("returning %p\n", lpedmo
);
441 *obj
= &lpedmo
->IEnumDMO_iface
;
447 /******************************************************************************
450 static ULONG WINAPI
IEnumDMO_fnAddRef(IEnumDMO
* iface
)
452 IEnumDMOImpl
*This
= impl_from_IEnumDMO(iface
);
453 ULONG refCount
= InterlockedIncrement(&This
->ref
);
454 TRACE("(%p)->(%d)\n", This
, refCount
);
458 /**************************************************************************
459 * EnumDMO_QueryInterface
461 static HRESULT WINAPI
IEnumDMO_fnQueryInterface(IEnumDMO
* iface
, REFIID riid
, void **ppvObj
)
463 IEnumDMOImpl
*This
= impl_from_IEnumDMO(iface
);
465 TRACE("(%p)->(%s %p)\n", This
, debugstr_guid(riid
), ppvObj
);
469 if (IsEqualIID(riid
, &IID_IEnumDMO
) ||
470 IsEqualIID(riid
, &IID_IUnknown
))
473 IEnumDMO_AddRef(iface
);
476 return *ppvObj
? S_OK
: E_NOINTERFACE
;
479 /******************************************************************************
482 static ULONG WINAPI
IEnumDMO_fnRelease(IEnumDMO
* iface
)
484 IEnumDMOImpl
*This
= impl_from_IEnumDMO(iface
);
485 ULONG refCount
= InterlockedDecrement(&This
->ref
);
487 TRACE("(%p)->(%d)\n", This
, refCount
);
492 RegCloseKey(This
->hkey
);
493 HeapFree(GetProcessHeap(), 0, This
->pInTypes
);
494 HeapFree(GetProcessHeap(), 0, This
->pOutTypes
);
495 HeapFree(GetProcessHeap(), 0, This
);
501 /******************************************************************************
504 static HRESULT WINAPI
IEnumDMO_fnNext(
509 DWORD
* pcItemsFetched
)
512 WCHAR szNextKey
[MAX_PATH
];
514 WCHAR szKey
[MAX_PATH
];
515 WCHAR szValue
[MAX_PATH
];
521 IEnumDMOImpl
*This
= impl_from_IEnumDMO(iface
);
523 TRACE("(%p)->(%d %p %p %p)\n", This
, cItemsToFetch
, pCLSID
, Names
, pcItemsFetched
);
525 if (!pCLSID
|| !Names
|| !pcItemsFetched
)
528 while (count
< cItemsToFetch
)
533 ret
= RegEnumKeyExW(This
->hkey
, This
->index
, szNextKey
, &len
, NULL
, NULL
, NULL
, NULL
);
534 if (ret
!= ERROR_SUCCESS
)
536 hres
= HRESULT_FROM_WIN32(ret
);
540 TRACE("found %s\n", debugstr_w(szNextKey
));
542 if (!(This
->dwFlags
& DMO_ENUMF_INCLUDE_KEYED
))
544 wsprintfW(szKey
, szCat3Fmt
, szDMORootKey
, szNextKey
, szDMOKeyed
);
545 ret
= RegOpenKeyExW(HKEY_CLASSES_ROOT
, szKey
, 0, KEY_READ
, &hkey
);
546 if (ERROR_SUCCESS
== ret
)
549 /* Skip Keyed entries */
554 wsprintfW(szKey
, szCat2Fmt
, szDMORootKey
, szNextKey
);
555 ret
= RegOpenKeyExW(HKEY_CLASSES_ROOT
, szKey
, 0, KEY_READ
, &hkey
);
556 TRACE("testing %s\n", debugstr_w(szKey
));
562 DMO_PARTIAL_MEDIATYPE
* pInTypes
;
564 hres
= read_types(hkey
, szDMOInputType
, &cInTypes
,
565 sizeof(szValue
)/sizeof(DMO_PARTIAL_MEDIATYPE
),
566 (DMO_PARTIAL_MEDIATYPE
*)szValue
);
574 pInTypes
= (DMO_PARTIAL_MEDIATYPE
*) szValue
;
576 TRACE("read %d intypes for %s:\n", cInTypes
, debugstr_w(szKey
));
577 for (i
= 0; i
< cInTypes
; i
++) {
578 TRACE("intype %d: type %s, subtype %s\n", i
, debugstr_guid(&pInTypes
[i
].type
),
579 debugstr_guid(&pInTypes
[i
].subtype
));
582 for (i
= 0; i
< This
->cInTypes
; i
++)
584 for (j
= 0; j
< cInTypes
; j
++)
586 if (IsMediaTypeEqual(&pInTypes
[j
], &This
->pInTypes
[i
]))
594 if (i
< This
->cInTypes
)
605 DMO_PARTIAL_MEDIATYPE
* pOutTypes
;
607 hres
= read_types(hkey
, szDMOOutputType
, &cOutTypes
,
608 sizeof(szValue
)/sizeof(DMO_PARTIAL_MEDIATYPE
),
609 (DMO_PARTIAL_MEDIATYPE
*)szValue
);
617 pOutTypes
= (DMO_PARTIAL_MEDIATYPE
*) szValue
;
619 TRACE("read %d outtypes for %s:\n", cOutTypes
, debugstr_w(szKey
));
620 for (i
= 0; i
< cOutTypes
; i
++) {
621 TRACE("outtype %d: type %s, subtype %s\n", i
, debugstr_guid(&pOutTypes
[i
].type
),
622 debugstr_guid(&pOutTypes
[i
].subtype
));
625 for (i
= 0; i
< This
->cOutTypes
; i
++)
627 for (j
= 0; j
< cOutTypes
; j
++)
629 if (IsMediaTypeEqual(&pOutTypes
[j
], &This
->pOutTypes
[i
]))
637 if (i
< This
->cOutTypes
)
644 /* Media object wasn't filtered so add it to return list */
646 len
= MAX_PATH
* sizeof(WCHAR
);
647 ret
= RegQueryValueExW(hkey
, NULL
, NULL
, NULL
, (LPBYTE
)szValue
, &len
);
648 if (ERROR_SUCCESS
== ret
)
650 Names
[count
] = CoTaskMemAlloc((strlenW(szValue
) + 1) * sizeof(WCHAR
));
652 strcpyW(Names
[count
], szValue
);
654 wsprintfW(szGuidKey
,szToGuidFmt
,szNextKey
);
655 CLSIDFromString(szGuidKey
, &pCLSID
[count
]);
657 TRACE("found match %s %s\n", debugstr_w(szValue
), debugstr_w(szNextKey
));
662 *pcItemsFetched
= count
;
663 if (*pcItemsFetched
< cItemsToFetch
)
666 TRACE("<-- %i found\n",count
);
671 /******************************************************************************
674 static HRESULT WINAPI
IEnumDMO_fnSkip(IEnumDMO
* iface
, DWORD cItemsToSkip
)
676 IEnumDMOImpl
*This
= impl_from_IEnumDMO(iface
);
678 TRACE("(%p)->(%d)\n", This
, cItemsToSkip
);
679 This
->index
+= cItemsToSkip
;
685 /******************************************************************************
688 static HRESULT WINAPI
IEnumDMO_fnReset(IEnumDMO
* iface
)
690 IEnumDMOImpl
*This
= impl_from_IEnumDMO(iface
);
692 TRACE("(%p)\n", This
);
699 /******************************************************************************
702 static HRESULT WINAPI
IEnumDMO_fnClone(IEnumDMO
*iface
, IEnumDMO
**ppEnum
)
704 IEnumDMOImpl
*This
= impl_from_IEnumDMO(iface
);
705 TRACE("(%p)->(%p)\n", This
, ppEnum
);
706 return IEnumDMO_Constructor(&This
->category
, This
->dwFlags
, This
->cInTypes
, This
->pInTypes
,
707 This
->cOutTypes
, This
->pOutTypes
, ppEnum
);
711 /***************************************************************
714 * Enumerate DirectX Media Objects in the registry.
716 HRESULT WINAPI
DMOEnum(
720 const DMO_PARTIAL_MEDIATYPE
*pInTypes
,
722 const DMO_PARTIAL_MEDIATYPE
*pOutTypes
,
725 TRACE("%s 0x%08x %d %p %d %p %p\n", debugstr_guid(category
), flags
, cInTypes
, pInTypes
,
726 cOutTypes
, pOutTypes
, ppEnum
);
733 for (i
= 0; i
< cInTypes
; i
++)
734 TRACE("intype %d - type %s, subtype %s\n", i
, debugstr_guid(&pInTypes
[i
].type
),
735 debugstr_guid(&pInTypes
[i
].subtype
));
739 for (i
= 0; i
< cOutTypes
; i
++)
740 TRACE("outtype %d - type %s, subtype %s\n", i
, debugstr_guid(&pOutTypes
[i
].type
),
741 debugstr_guid(&pOutTypes
[i
].subtype
));
745 return IEnumDMO_Constructor(category
, flags
, cInTypes
,
746 pInTypes
, cOutTypes
, pOutTypes
, ppEnum
);
750 static const IEnumDMOVtbl edmovt
=
752 IEnumDMO_fnQueryInterface
,
762 HRESULT
read_types(HKEY root
, LPCWSTR key
, ULONG
*supplied
, ULONG requested
, DMO_PARTIAL_MEDIATYPE
* types
)
766 if (MSDMO_MAJOR_VERSION
> 5)
771 len
= requested
* sizeof(DMO_PARTIAL_MEDIATYPE
);
772 rc
= RegQueryValueExW(root
, key
, NULL
, NULL
, (LPBYTE
) types
, &len
);
773 ret
= HRESULT_FROM_WIN32(rc
);
775 *supplied
= len
/ sizeof(DMO_PARTIAL_MEDIATYPE
);
783 if (ERROR_SUCCESS
== RegOpenKeyExW(root
, key
, 0, KEY_READ
, &hkey
))
786 WCHAR szNextKey
[MAX_PATH
];
788 LONG rc
= ERROR_SUCCESS
;
790 while (rc
== ERROR_SUCCESS
)
793 rc
= RegEnumKeyExW(hkey
, index
, szNextKey
, &len
, NULL
, NULL
, NULL
, NULL
);
794 if (rc
== ERROR_SUCCESS
)
798 LONG rcs
= ERROR_SUCCESS
;
799 WCHAR szSubKey
[MAX_PATH
];
801 RegOpenKeyExW(hkey
, szNextKey
, 0, KEY_READ
, &subk
);
802 while (rcs
== ERROR_SUCCESS
)
805 rcs
= RegEnumKeyExW(subk
, sub_index
, szSubKey
, &len
, NULL
, NULL
, NULL
, NULL
);
806 if (rcs
== ERROR_SUCCESS
)
808 if (*supplied
>= requested
)
812 rc
= ERROR_MORE_DATA
;
813 rcs
= ERROR_MORE_DATA
;
817 wsprintfW(szGuidKey
,szToGuidFmt
,szNextKey
);
818 CLSIDFromString(szGuidKey
, &types
[*supplied
].type
);
819 wsprintfW(szGuidKey
,szToGuidFmt
,szSubKey
);
820 CLSIDFromString(szGuidKey
, &types
[*supplied
].subtype
);
821 TRACE("Adding type %s subtype %s at index %i\n",
822 debugstr_guid(&types
[*supplied
].type
),
823 debugstr_guid(&types
[*supplied
].subtype
),
838 /***************************************************************
839 * DMOGetTypes (MSDMO.@)
841 HRESULT WINAPI
DMOGetTypes(REFCLSID clsidDMO
,
842 ULONG ulInputTypesRequested
,
843 ULONG
* pulInputTypesSupplied
,
844 DMO_PARTIAL_MEDIATYPE
* pInputTypes
,
845 ULONG ulOutputTypesRequested
,
846 ULONG
* pulOutputTypesSupplied
,
847 DMO_PARTIAL_MEDIATYPE
* pOutputTypes
)
853 TRACE ("(%s,%u,%p,%p,%u,%p,%p)\n", debugstr_guid(clsidDMO
), ulInputTypesRequested
,
854 pulInputTypesSupplied
, pInputTypes
, ulOutputTypesRequested
, pulOutputTypesSupplied
,
857 if (ERROR_SUCCESS
!= RegOpenKeyExW(HKEY_CLASSES_ROOT
, szDMORootKey
, 0,
861 if (ERROR_SUCCESS
!= RegOpenKeyExW(root
,GUIDToString(szguid
,clsidDMO
) , 0,
868 if (ulInputTypesRequested
> 0)
870 ret
= read_types(hkey
, szDMOInputType
, pulInputTypesSupplied
, ulInputTypesRequested
, pInputTypes
);
873 *pulInputTypesSupplied
= 0;
875 if (ulOutputTypesRequested
> 0)
878 ret2
= read_types(hkey
, szDMOOutputType
, pulOutputTypesSupplied
, ulOutputTypesRequested
, pOutputTypes
);
884 *pulOutputTypesSupplied
= 0;