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
193 TRACE("%s %s %s\n", debugstr_w(szName
), debugstr_guid(clsidDMO
), debugstr_guid(guidCategory
));
195 if (IsEqualGUID(guidCategory
, &GUID_NULL
))
198 hres
= RegCreateKeyExW(HKEY_CLASSES_ROOT
, szDMORootKey
, 0, NULL
,
199 REG_OPTION_NON_VOLATILE
, KEY_WRITE
, NULL
, &hrkey
, NULL
);
200 if (ERROR_SUCCESS
!= hres
)
203 /* Create clsidDMO key under MediaObjects */
204 hres
= RegCreateKeyExW(hrkey
, GUIDToString(szguid
, clsidDMO
), 0, NULL
,
205 REG_OPTION_NON_VOLATILE
, KEY_WRITE
, NULL
, &hkey
, NULL
);
206 if (ERROR_SUCCESS
!= hres
)
209 /* Set default Name value */
210 hres
= RegSetValueExW(hkey
, NULL
, 0, REG_SZ
, (const BYTE
*) szName
,
211 (strlenW(szName
) + 1) * sizeof(WCHAR
));
214 hres
= write_types(hkey
, szDMOInputType
, pInTypes
, cInTypes
);
216 /* Set OutputTypes */
217 hres
= write_types(hkey
, szDMOOutputType
, pOutTypes
, cOutTypes
);
219 if (dwFlags
& DMO_REGISTERF_IS_KEYED
)
221 /* Create Keyed key */
222 hres
= RegCreateKeyExW(hkey
, szDMOKeyed
, 0, NULL
,
223 REG_OPTION_NON_VOLATILE
, KEY_WRITE
, NULL
, &hckey
, NULL
);
224 if (ERROR_SUCCESS
!= hres
)
229 /* Register the category */
230 hres
= RegCreateKeyExW(hrkey
, szDMOCategories
, 0, NULL
,
231 REG_OPTION_NON_VOLATILE
, KEY_WRITE
, NULL
, &hckey
, NULL
);
232 if (ERROR_SUCCESS
!= hres
)
237 hres
= RegCreateKeyExW(hckey
, GUIDToString(szguid
, guidCategory
), 0, NULL
,
238 REG_OPTION_NON_VOLATILE
, KEY_WRITE
, NULL
, &hkey
, NULL
);
239 if (ERROR_SUCCESS
!= hres
)
241 hres
= RegCreateKeyExW(hkey
, GUIDToString(szguid
, clsidDMO
), 0, NULL
,
242 REG_OPTION_NON_VOLATILE
, KEY_WRITE
, NULL
, &hclskey
, NULL
);
243 if (ERROR_SUCCESS
!= hres
)
252 RegCloseKey(hclskey
);
256 TRACE(" hresult=0x%08x\n", hres
);
260 static HRESULT
unregister_dmo_from_category(const WCHAR
*dmoW
, const WCHAR
*catW
, HKEY categories
)
265 ret
= RegOpenKeyExW(categories
, catW
, 0, KEY_WRITE
, &catkey
);
268 ret
= RegDeleteKeyW(catkey
, dmoW
);
272 return !ret
? S_OK
: S_FALSE
;
275 /***************************************************************
276 * DMOUnregister (MSDMO.@)
278 * Unregister a DirectX Media Object.
280 HRESULT WINAPI
DMOUnregister(REFCLSID dmo
, REFGUID category
)
282 HKEY rootkey
= 0, categorieskey
= 0;
283 WCHAR dmoW
[64], catW
[64];
284 HRESULT hr
= S_FALSE
;
287 TRACE("%s %s\n", debugstr_guid(dmo
), debugstr_guid(category
));
289 ret
= RegOpenKeyExW(HKEY_CLASSES_ROOT
, szDMORootKey
, 0, KEY_WRITE
, &rootkey
);
293 GUIDToString(dmoW
, dmo
);
294 RegDeleteKeyW(rootkey
, dmoW
);
296 /* open 'Categories' */
297 ret
= RegOpenKeyExW(rootkey
, szDMOCategories
, 0, KEY_WRITE
|KEY_ENUMERATE_SUB_KEYS
, &categorieskey
);
298 RegCloseKey(rootkey
);
301 hr
= HRESULT_FROM_WIN32(ret
);
305 /* remove from all categories */
306 if (IsEqualGUID(category
, &GUID_NULL
))
308 DWORD index
= 0, len
= sizeof(catW
)/sizeof(WCHAR
);
310 while (!RegEnumKeyExW(categorieskey
, index
++, catW
, &len
, NULL
, NULL
, NULL
, NULL
))
311 hr
= unregister_dmo_from_category(dmoW
, catW
, categorieskey
);
315 GUIDToString(catW
, category
);
316 hr
= unregister_dmo_from_category(dmoW
, catW
, categorieskey
);
321 RegCloseKey(categorieskey
);
327 /***************************************************************
328 * DMOGetName (MSDMO.@)
330 * Get DMO Name from the registry
332 HRESULT WINAPI
DMOGetName(REFCLSID clsidDMO
, WCHAR name
[])
334 static const INT max_name_len
= 80*sizeof(WCHAR
);
335 DWORD count
= max_name_len
;
340 TRACE("%s %p\n", debugstr_guid(clsidDMO
), name
);
342 if (RegOpenKeyExW(HKEY_CLASSES_ROOT
, szDMORootKey
, 0, KEY_READ
, &hrkey
))
345 ret
= RegOpenKeyExW(hrkey
, GUIDToString(szguid
, clsidDMO
), 0, KEY_READ
, &hkey
);
350 ret
= RegQueryValueExW(hkey
, NULL
, NULL
, NULL
, (LPBYTE
)name
, &count
);
353 if (!ret
&& count
> 1)
355 TRACE("name=%s\n", debugstr_w(name
));
363 static HRESULT
dup_partial_mediatype(const DMO_PARTIAL_MEDIATYPE
*types
, DWORD count
, DMO_PARTIAL_MEDIATYPE
**ret
)
370 *ret
= HeapAlloc(GetProcessHeap(), 0, count
*sizeof(*types
));
372 return E_OUTOFMEMORY
;
374 memcpy(*ret
, types
, count
*sizeof(*types
));
378 /**************************************************************************
379 * IEnumDMO_Constructor
381 static HRESULT
IEnumDMO_Constructor(
382 REFGUID guidCategory
,
385 const DMO_PARTIAL_MEDIATYPE
*pInTypes
,
387 const DMO_PARTIAL_MEDIATYPE
*pOutTypes
,
390 IEnumDMOImpl
* lpedmo
;
396 lpedmo
= HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY
, sizeof(IEnumDMOImpl
));
398 return E_OUTOFMEMORY
;
400 lpedmo
->IEnumDMO_iface
.lpVtbl
= &edmovt
;
403 lpedmo
->category
= *guidCategory
;
404 lpedmo
->dwFlags
= dwFlags
;
405 lpedmo
->cInTypes
= cInTypes
;
406 lpedmo
->cOutTypes
= cOutTypes
;
408 hr
= dup_partial_mediatype(pInTypes
, cInTypes
, &lpedmo
->pInTypes
);
412 hr
= dup_partial_mediatype(pOutTypes
, cOutTypes
, &lpedmo
->pOutTypes
);
416 /* If not filtering by category enum from media objects root */
417 if (IsEqualGUID(guidCategory
, &GUID_NULL
))
419 if ((ret
= RegOpenKeyExW(HKEY_CLASSES_ROOT
, szDMORootKey
, 0, KEY_READ
, &lpedmo
->hkey
)))
420 hr
= HRESULT_FROM_WIN32(ret
);
425 WCHAR szKey
[MAX_PATH
];
427 wsprintfW(szKey
, szCat3Fmt
, szDMORootKey
, szDMOCategories
, GUIDToString(szguid
, guidCategory
));
428 if ((ret
= RegOpenKeyExW(HKEY_CLASSES_ROOT
, szKey
, 0, KEY_READ
, &lpedmo
->hkey
)))
429 hr
= HRESULT_FROM_WIN32(ret
);
435 IEnumDMO_Release(&lpedmo
->IEnumDMO_iface
);
438 TRACE("returning %p\n", lpedmo
);
439 *obj
= &lpedmo
->IEnumDMO_iface
;
445 /******************************************************************************
448 static ULONG WINAPI
IEnumDMO_fnAddRef(IEnumDMO
* iface
)
450 IEnumDMOImpl
*This
= impl_from_IEnumDMO(iface
);
451 ULONG refCount
= InterlockedIncrement(&This
->ref
);
452 TRACE("(%p)->(%d)\n", This
, refCount
);
456 /**************************************************************************
457 * EnumDMO_QueryInterface
459 static HRESULT WINAPI
IEnumDMO_fnQueryInterface(IEnumDMO
* iface
, REFIID riid
, void **ppvObj
)
461 IEnumDMOImpl
*This
= impl_from_IEnumDMO(iface
);
463 TRACE("(%p)->(%s %p)\n", This
, debugstr_guid(riid
), ppvObj
);
467 if (IsEqualIID(riid
, &IID_IEnumDMO
) ||
468 IsEqualIID(riid
, &IID_IUnknown
))
471 IEnumDMO_AddRef(iface
);
474 return *ppvObj
? S_OK
: E_NOINTERFACE
;
477 /******************************************************************************
480 static ULONG WINAPI
IEnumDMO_fnRelease(IEnumDMO
* iface
)
482 IEnumDMOImpl
*This
= impl_from_IEnumDMO(iface
);
483 ULONG refCount
= InterlockedDecrement(&This
->ref
);
485 TRACE("(%p)->(%d)\n", This
, refCount
);
490 RegCloseKey(This
->hkey
);
491 HeapFree(GetProcessHeap(), 0, This
->pInTypes
);
492 HeapFree(GetProcessHeap(), 0, This
->pOutTypes
);
493 HeapFree(GetProcessHeap(), 0, This
);
499 /******************************************************************************
502 static HRESULT WINAPI
IEnumDMO_fnNext(
507 DWORD
* pcItemsFetched
)
510 WCHAR szNextKey
[MAX_PATH
];
512 WCHAR szKey
[MAX_PATH
];
513 WCHAR szValue
[MAX_PATH
];
519 IEnumDMOImpl
*This
= impl_from_IEnumDMO(iface
);
521 TRACE("(%p)->(%d %p %p %p)\n", This
, cItemsToFetch
, pCLSID
, Names
, pcItemsFetched
);
523 if (!pCLSID
|| !Names
|| !pcItemsFetched
)
526 while (count
< cItemsToFetch
)
531 ret
= RegEnumKeyExW(This
->hkey
, This
->index
, szNextKey
, &len
, NULL
, NULL
, NULL
, NULL
);
532 if (ret
!= ERROR_SUCCESS
)
534 hres
= HRESULT_FROM_WIN32(ret
);
538 TRACE("found %s\n", debugstr_w(szNextKey
));
540 if (!(This
->dwFlags
& DMO_ENUMF_INCLUDE_KEYED
))
542 wsprintfW(szKey
, szCat3Fmt
, szDMORootKey
, szNextKey
, szDMOKeyed
);
543 ret
= RegOpenKeyExW(HKEY_CLASSES_ROOT
, szKey
, 0, KEY_READ
, &hkey
);
544 if (ERROR_SUCCESS
== ret
)
547 /* Skip Keyed entries */
552 wsprintfW(szKey
, szCat2Fmt
, szDMORootKey
, szNextKey
);
553 ret
= RegOpenKeyExW(HKEY_CLASSES_ROOT
, szKey
, 0, KEY_READ
, &hkey
);
554 TRACE("testing %s\n", debugstr_w(szKey
));
560 DMO_PARTIAL_MEDIATYPE
* pInTypes
;
562 hres
= read_types(hkey
, szDMOInputType
, &cInTypes
,
563 sizeof(szValue
)/sizeof(DMO_PARTIAL_MEDIATYPE
),
564 (DMO_PARTIAL_MEDIATYPE
*)szValue
);
572 pInTypes
= (DMO_PARTIAL_MEDIATYPE
*) szValue
;
574 TRACE("read %d intypes for %s:\n", cInTypes
, debugstr_w(szKey
));
575 for (i
= 0; i
< cInTypes
; i
++) {
576 TRACE("intype %d: type %s, subtype %s\n", i
, debugstr_guid(&pInTypes
[i
].type
),
577 debugstr_guid(&pInTypes
[i
].subtype
));
580 for (i
= 0; i
< This
->cInTypes
; i
++)
582 for (j
= 0; j
< cInTypes
; j
++)
584 if (IsMediaTypeEqual(&pInTypes
[j
], &This
->pInTypes
[i
]))
592 if (i
< This
->cInTypes
)
603 DMO_PARTIAL_MEDIATYPE
* pOutTypes
;
605 hres
= read_types(hkey
, szDMOOutputType
, &cOutTypes
,
606 sizeof(szValue
)/sizeof(DMO_PARTIAL_MEDIATYPE
),
607 (DMO_PARTIAL_MEDIATYPE
*)szValue
);
615 pOutTypes
= (DMO_PARTIAL_MEDIATYPE
*) szValue
;
617 TRACE("read %d outtypes for %s:\n", cOutTypes
, debugstr_w(szKey
));
618 for (i
= 0; i
< cOutTypes
; i
++) {
619 TRACE("outtype %d: type %s, subtype %s\n", i
, debugstr_guid(&pOutTypes
[i
].type
),
620 debugstr_guid(&pOutTypes
[i
].subtype
));
623 for (i
= 0; i
< This
->cOutTypes
; i
++)
625 for (j
= 0; j
< cOutTypes
; j
++)
627 if (IsMediaTypeEqual(&pOutTypes
[j
], &This
->pOutTypes
[i
]))
635 if (i
< This
->cOutTypes
)
642 /* Media object wasn't filtered so add it to return list */
644 len
= MAX_PATH
* sizeof(WCHAR
);
645 ret
= RegQueryValueExW(hkey
, NULL
, NULL
, NULL
, (LPBYTE
)szValue
, &len
);
646 if (ERROR_SUCCESS
== ret
)
648 Names
[count
] = CoTaskMemAlloc((strlenW(szValue
) + 1) * sizeof(WCHAR
));
650 strcpyW(Names
[count
], szValue
);
652 wsprintfW(szGuidKey
,szToGuidFmt
,szNextKey
);
653 CLSIDFromString(szGuidKey
, &pCLSID
[count
]);
655 TRACE("found match %s %s\n", debugstr_w(szValue
), debugstr_w(szNextKey
));
660 *pcItemsFetched
= count
;
661 if (*pcItemsFetched
< cItemsToFetch
)
664 TRACE("<-- %i found\n",count
);
669 /******************************************************************************
672 static HRESULT WINAPI
IEnumDMO_fnSkip(IEnumDMO
* iface
, DWORD cItemsToSkip
)
674 IEnumDMOImpl
*This
= impl_from_IEnumDMO(iface
);
676 TRACE("(%p)->(%d)\n", This
, cItemsToSkip
);
677 This
->index
+= cItemsToSkip
;
683 /******************************************************************************
686 static HRESULT WINAPI
IEnumDMO_fnReset(IEnumDMO
* iface
)
688 IEnumDMOImpl
*This
= impl_from_IEnumDMO(iface
);
690 TRACE("(%p)\n", This
);
697 /******************************************************************************
700 static HRESULT WINAPI
IEnumDMO_fnClone(IEnumDMO
*iface
, IEnumDMO
**ppEnum
)
702 IEnumDMOImpl
*This
= impl_from_IEnumDMO(iface
);
703 TRACE("(%p)->(%p)\n", This
, ppEnum
);
704 return IEnumDMO_Constructor(&This
->category
, This
->dwFlags
, This
->cInTypes
, This
->pInTypes
,
705 This
->cOutTypes
, This
->pOutTypes
, ppEnum
);
709 /***************************************************************
712 * Enumerate DirectX Media Objects in the registry.
714 HRESULT WINAPI
DMOEnum(
718 const DMO_PARTIAL_MEDIATYPE
*pInTypes
,
720 const DMO_PARTIAL_MEDIATYPE
*pOutTypes
,
723 TRACE("%s 0x%08x %d %p %d %p %p\n", debugstr_guid(category
), flags
, cInTypes
, pInTypes
,
724 cOutTypes
, pOutTypes
, ppEnum
);
731 for (i
= 0; i
< cInTypes
; i
++)
732 TRACE("intype %d - type %s, subtype %s\n", i
, debugstr_guid(&pInTypes
[i
].type
),
733 debugstr_guid(&pInTypes
[i
].subtype
));
737 for (i
= 0; i
< cOutTypes
; i
++)
738 TRACE("outtype %d - type %s, subtype %s\n", i
, debugstr_guid(&pOutTypes
[i
].type
),
739 debugstr_guid(&pOutTypes
[i
].subtype
));
743 return IEnumDMO_Constructor(category
, flags
, cInTypes
,
744 pInTypes
, cOutTypes
, pOutTypes
, ppEnum
);
748 static const IEnumDMOVtbl edmovt
=
750 IEnumDMO_fnQueryInterface
,
760 HRESULT
read_types(HKEY root
, LPCWSTR key
, ULONG
*supplied
, ULONG requested
, DMO_PARTIAL_MEDIATYPE
* types
)
764 if (MSDMO_MAJOR_VERSION
> 5)
769 len
= requested
* sizeof(DMO_PARTIAL_MEDIATYPE
);
770 rc
= RegQueryValueExW(root
, key
, NULL
, NULL
, (LPBYTE
) types
, &len
);
771 ret
= HRESULT_FROM_WIN32(rc
);
773 *supplied
= len
/ sizeof(DMO_PARTIAL_MEDIATYPE
);
781 if (ERROR_SUCCESS
== RegOpenKeyExW(root
, key
, 0, KEY_READ
, &hkey
))
784 WCHAR szNextKey
[MAX_PATH
];
786 LONG rc
= ERROR_SUCCESS
;
788 while (rc
== ERROR_SUCCESS
)
791 rc
= RegEnumKeyExW(hkey
, index
, szNextKey
, &len
, NULL
, NULL
, NULL
, NULL
);
792 if (rc
== ERROR_SUCCESS
)
796 LONG rcs
= ERROR_SUCCESS
;
797 WCHAR szSubKey
[MAX_PATH
];
799 RegOpenKeyExW(hkey
, szNextKey
, 0, KEY_READ
, &subk
);
800 while (rcs
== ERROR_SUCCESS
)
803 rcs
= RegEnumKeyExW(subk
, sub_index
, szSubKey
, &len
, NULL
, NULL
, NULL
, NULL
);
804 if (rcs
== ERROR_SUCCESS
)
806 if (*supplied
>= requested
)
810 rc
= ERROR_MORE_DATA
;
811 rcs
= ERROR_MORE_DATA
;
815 wsprintfW(szGuidKey
,szToGuidFmt
,szNextKey
);
816 CLSIDFromString(szGuidKey
, &types
[*supplied
].type
);
817 wsprintfW(szGuidKey
,szToGuidFmt
,szSubKey
);
818 CLSIDFromString(szGuidKey
, &types
[*supplied
].subtype
);
819 TRACE("Adding type %s subtype %s at index %i\n",
820 debugstr_guid(&types
[*supplied
].type
),
821 debugstr_guid(&types
[*supplied
].subtype
),
836 /***************************************************************
837 * DMOGetTypes (MSDMO.@)
839 HRESULT WINAPI
DMOGetTypes(REFCLSID clsidDMO
,
840 ULONG ulInputTypesRequested
,
841 ULONG
* pulInputTypesSupplied
,
842 DMO_PARTIAL_MEDIATYPE
* pInputTypes
,
843 ULONG ulOutputTypesRequested
,
844 ULONG
* pulOutputTypesSupplied
,
845 DMO_PARTIAL_MEDIATYPE
* pOutputTypes
)
851 TRACE ("(%s,%u,%p,%p,%u,%p,%p)\n", debugstr_guid(clsidDMO
), ulInputTypesRequested
,
852 pulInputTypesSupplied
, pInputTypes
, ulOutputTypesRequested
, pulOutputTypesSupplied
,
855 if (ERROR_SUCCESS
!= RegOpenKeyExW(HKEY_CLASSES_ROOT
, szDMORootKey
, 0,
859 if (ERROR_SUCCESS
!= RegOpenKeyExW(root
,GUIDToString(szguid
,clsidDMO
) , 0,
866 if (ulInputTypesRequested
> 0)
868 ret
= read_types(hkey
, szDMOInputType
, pulInputTypesSupplied
, ulInputTypesRequested
, pInputTypes
);
871 *pulInputTypesSupplied
= 0;
873 if (ulOutputTypesRequested
> 0)
876 ret2
= read_types(hkey
, szDMOOutputType
, pulOutputTypesSupplied
, ulOutputTypesRequested
, pOutputTypes
);
882 *pulOutputTypesSupplied
= 0;