ReactOS 0.4.17-dev-966-gf06eace
dmoreg.c
Go to the documentation of this file.
1/*
2 * Copyright (C) 2003 Michael Günnewig
3 * Copyright (C) 2003 CodeWeavers Inc. (Ulrich Czekalla)
4 *
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.
9 *
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.
14 *
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
18 */
19
20#include <stdarg.h>
21
22#define COBJMACROS
23
24#include "windef.h"
25#include "winbase.h"
26#include "winuser.h"
27#include "winerror.h"
28#include "winreg.h"
29#include "objbase.h"
30#include "wine/debug.h"
31#include "dmo.h"
32
34
35BOOL array_reserve(void **elements, unsigned int *capacity, unsigned int count, unsigned int size)
36{
37 unsigned int max_capacity, new_capacity;
38 void *new_elements;
39
40 if (count <= *capacity)
41 return TRUE;
42
43 max_capacity = ~0u / size;
44 if (count > max_capacity)
45 return FALSE;
46
47 new_capacity = max(8, *capacity);
48 while (new_capacity < count && new_capacity <= max_capacity / 2)
49 new_capacity *= 2;
50 if (new_capacity < count)
51 new_capacity = count;
52
53 if (!(new_elements = realloc(*elements, new_capacity * size)))
54 {
55 ERR("Failed to allocate memory.\n");
56 return FALSE;
57 }
58
59 *elements = new_elements;
60 *capacity = new_capacity;
61 return TRUE;
62}
63
64typedef struct
65{
77
79{
80 return CONTAINING_RECORD(iface, IEnumDMOImpl, IEnumDMO_iface);
81}
82
83static const IEnumDMOVtbl edmovt;
84
85static const WCHAR *GUIDToString(WCHAR *string, const GUID *guid)
86{
87 swprintf(string, 37, L"%08X-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X",
88 guid->Data1, guid->Data2, guid->Data3,
89 guid->Data4[0], guid->Data4[1], guid->Data4[2], guid->Data4[3],
90 guid->Data4[4], guid->Data4[5], guid->Data4[6], guid->Data4[7]);
91 return string;
92}
93
94static HRESULT string_to_guid(const WCHAR *string, GUID *guid)
95{
96 WCHAR buffer[39];
97 buffer[0] = '{';
98 wcscpy(buffer + 1, string);
99 buffer[37] = '}';
100 buffer[38] = 0;
101 return CLSIDFromString(buffer, guid);
102}
103
105{
106
107 return (IsEqualCLSID(&mt1->type, &mt2->type) ||
108 IsEqualCLSID(&mt2->type, &GUID_NULL) ||
109 IsEqualCLSID(&mt1->type, &GUID_NULL)) &&
110 (IsEqualCLSID(&mt1->subtype, &mt2->subtype) ||
111 IsEqualCLSID(&mt2->subtype, &GUID_NULL) ||
113}
114
116{
118 (const BYTE *)types, count * sizeof(DMO_PARTIAL_MEDIATYPE)));
119}
120
121/***************************************************************
122 * DMORegister (MSDMO.@)
123 *
124 * Register a DirectX Media Object.
125 */
128 REFCLSID clsidDMO,
129 REFGUID guidCategory,
131 DWORD cInTypes,
132 const DMO_PARTIAL_MEDIATYPE *pInTypes,
133 DWORD cOutTypes,
134 const DMO_PARTIAL_MEDIATYPE *pOutTypes
135)
136{
137 WCHAR szguid[64];
139 HKEY hrkey = 0;
140 HKEY hkey = 0;
141 HKEY hckey = 0;
142 HKEY hclskey = 0;
143 LONG ret;
144
145 TRACE("%s %s %s\n", debugstr_w(szName), debugstr_guid(clsidDMO), debugstr_guid(guidCategory));
146
147 if (IsEqualGUID(guidCategory, &GUID_NULL))
148 return E_INVALIDARG;
149
150 ret = RegCreateKeyExW(HKEY_CLASSES_ROOT, L"DirectShow\\MediaObjects", 0,
151 NULL, 0, KEY_WRITE, NULL, &hrkey, NULL);
152 if (ret)
153 return E_FAIL;
154
155 /* Create clsidDMO key under MediaObjects */
156 ret = RegCreateKeyExW(hrkey, GUIDToString(szguid, clsidDMO), 0, NULL,
158 if (ret)
159 goto lend;
160
161 /* Set default Name value */
162 ret = RegSetValueExW(hkey, NULL, 0, REG_SZ, (const BYTE*) szName,
163 (wcslen(szName) + 1) * sizeof(WCHAR));
164
165 /* Set InputTypes */
166 hres = write_types(hkey, L"InputTypes", pInTypes, cInTypes);
167
168 /* Set OutputTypes */
169 hres = write_types(hkey, L"OutputTypes", pOutTypes, cOutTypes);
170
172 {
173 /* Create Keyed key */
174 ret = RegCreateKeyExW(hkey, L"Keyed", 0, NULL, 0, KEY_WRITE, NULL, &hckey, NULL);
175 if (ret)
176 goto lend;
177 RegCloseKey(hckey);
178 }
179
180 /* Register the category */
181 ret = RegCreateKeyExW(hrkey, L"Categories", 0, NULL, 0, KEY_WRITE, NULL, &hckey, NULL);
182 if (ret)
183 goto lend;
184
185 RegCloseKey(hkey);
186
187 ret = RegCreateKeyExW(hckey, GUIDToString(szguid, guidCategory), 0, NULL,
189 if (ret)
190 goto lend;
191 ret = RegCreateKeyExW(hkey, GUIDToString(szguid, clsidDMO), 0, NULL,
193 if (ret)
194 goto lend;
195
196lend:
197 if (hkey)
198 RegCloseKey(hkey);
199 if (hckey)
200 RegCloseKey(hckey);
201 if (hclskey)
202 RegCloseKey(hclskey);
203 if (hrkey)
204 RegCloseKey(hrkey);
205
207 TRACE(" hresult=0x%08lx\n", hres);
208 return hres;
209}
210
212{
213 HKEY catkey;
214 LONG ret;
215
216 ret = RegOpenKeyExW(categories, catW, 0, KEY_WRITE, &catkey);
217 if (!ret)
218 {
219 ret = RegDeleteKeyW(catkey, dmoW);
220 RegCloseKey(catkey);
221 }
222
223 return !ret ? S_OK : S_FALSE;
224}
225
226/***************************************************************
227 * DMOUnregister (MSDMO.@)
228 *
229 * Unregister a DirectX Media Object.
230 */
232{
233 HKEY rootkey = 0, categorieskey = 0;
234 WCHAR dmoW[64], catW[64];
236 LONG ret;
237
238 TRACE("%s %s\n", debugstr_guid(dmo), debugstr_guid(category));
239
240 if (RegOpenKeyExW(HKEY_CLASSES_ROOT, L"DirectShow\\MediaObjects", 0, KEY_WRITE, &rootkey))
241 return S_FALSE;
242
243 GUIDToString(dmoW, dmo);
244 RegDeleteKeyW(rootkey, dmoW);
245
246 /* open 'Categories' */
247 ret = RegOpenKeyExW(rootkey, L"Categories", 0, KEY_WRITE|KEY_ENUMERATE_SUB_KEYS, &categorieskey);
248 RegCloseKey(rootkey);
249 if (ret)
250 {
252 goto lend;
253 }
254
255 /* remove from all categories */
257 {
258 DWORD index = 0, len = ARRAY_SIZE(catW);
259
260 while (!RegEnumKeyExW(categorieskey, index++, catW, &len, NULL, NULL, NULL, NULL))
261 hr = unregister_dmo_from_category(dmoW, catW, categorieskey);
262 }
263 else
264 {
265 GUIDToString(catW, category);
266 hr = unregister_dmo_from_category(dmoW, catW, categorieskey);
267 }
268
269lend:
270 if (categorieskey)
271 RegCloseKey(categorieskey);
272
273 return hr;
274}
275
276
277/***************************************************************
278 * DMOGetName (MSDMO.@)
279 *
280 * Get DMO Name from the registry
281 */
283{
284 static const INT max_name_len = 80*sizeof(WCHAR);
285 DWORD count = max_name_len;
286 WCHAR szguid[64];
287 HKEY hrkey, hkey;
288 LONG ret;
289
290 TRACE("%s %p\n", debugstr_guid(clsidDMO), name);
291
292 if (RegOpenKeyExW(HKEY_CLASSES_ROOT, L"DirectShow\\MediaObjects", 0, KEY_READ, &hrkey))
293 return E_FAIL;
294
295 ret = RegOpenKeyExW(hrkey, GUIDToString(szguid, clsidDMO), 0, KEY_READ, &hkey);
296 RegCloseKey(hrkey);
297 if (ret)
298 return E_FAIL;
299
301 RegCloseKey(hkey);
302
303 if (!ret && count > 1)
304 {
305 TRACE("name=%s\n", debugstr_w(name));
306 return S_OK;
307 }
308
309 name[0] = 0;
310 return S_FALSE;
311}
312
314{
315 *ret = NULL;
316
317 if (count == 0)
318 return S_OK;
319
320 *ret = HeapAlloc(GetProcessHeap(), 0, count*sizeof(*types));
321 if (!*ret)
322 return E_OUTOFMEMORY;
323
324 memcpy(*ret, types, count*sizeof(*types));
325 return S_OK;
326}
327
328/**************************************************************************
329 * IEnumDMO_Constructor
330 */
332 REFGUID guidCategory,
334 DWORD cInTypes,
335 const DMO_PARTIAL_MEDIATYPE *pInTypes,
336 DWORD cOutTypes,
337 const DMO_PARTIAL_MEDIATYPE *pOutTypes,
338 IEnumDMO **obj)
339{
340 IEnumDMOImpl* lpedmo;
341 HRESULT hr;
342
343 *obj = NULL;
344
346 if (!lpedmo)
347 return E_OUTOFMEMORY;
348
349 lpedmo->IEnumDMO_iface.lpVtbl = &edmovt;
350 lpedmo->ref = 1;
351 lpedmo->index = -1;
352 lpedmo->category = *guidCategory;
353 lpedmo->dwFlags = dwFlags;
354 lpedmo->cInTypes = cInTypes;
355 lpedmo->cOutTypes = cOutTypes;
356 lpedmo->hkey = NULL;
357
358 hr = dup_partial_mediatype(pInTypes, cInTypes, &lpedmo->pInTypes);
359 if (FAILED(hr))
360 goto lerr;
361
362 hr = dup_partial_mediatype(pOutTypes, cOutTypes, &lpedmo->pOutTypes);
363 if (FAILED(hr))
364 goto lerr;
365
366 /* If not filtering by category enum from media objects root */
367 if (IsEqualGUID(guidCategory, &GUID_NULL))
368 {
369 RegOpenKeyExW(HKEY_CLASSES_ROOT, L"DirectShow\\MediaObjects", 0, KEY_READ, &lpedmo->hkey);
370 }
371 else
372 {
373 WCHAR szguid[64];
374 WCHAR szKey[MAX_PATH];
375
376 swprintf(szKey, ARRAY_SIZE(szKey), L"DirectShow\\MediaObjects\\Categories\\%s",
377 GUIDToString(szguid, guidCategory));
378 RegOpenKeyExW(HKEY_CLASSES_ROOT, szKey, 0, KEY_READ, &lpedmo->hkey);
379 }
380
381lerr:
382
383 if (FAILED(hr))
384 IEnumDMO_Release(&lpedmo->IEnumDMO_iface);
385 else
386 {
387 TRACE("returning %p\n", lpedmo);
388 *obj = &lpedmo->IEnumDMO_iface;
389 }
390
391 return hr;
392}
393
394/******************************************************************************
395 * IEnumDMO_fnAddRef
396 */
398{
400 ULONG refCount = InterlockedIncrement(&This->ref);
401 TRACE("(%p)->(%ld)\n", This, refCount);
402 return refCount;
403}
404
405/**************************************************************************
406 * EnumDMO_QueryInterface
407 */
409{
411
412 TRACE("(%p)->(%s %p)\n", This, debugstr_guid(riid), ppvObj);
413
414 *ppvObj = NULL;
415
416 if (IsEqualIID(riid, &IID_IEnumDMO) ||
418 {
419 *ppvObj = iface;
420 IEnumDMO_AddRef(iface);
421 }
422
423 return *ppvObj ? S_OK : E_NOINTERFACE;
424}
425
426/******************************************************************************
427 * IEnumDMO_fnRelease
428 */
430{
432 ULONG refCount = InterlockedDecrement(&This->ref);
433
434 TRACE("(%p)->(%ld)\n", This, refCount);
435
436 if (!refCount)
437 {
438 if (This->hkey)
439 RegCloseKey(This->hkey);
440 HeapFree(GetProcessHeap(), 0, This->pInTypes);
441 HeapFree(GetProcessHeap(), 0, This->pOutTypes);
443 }
444 return refCount;
445}
446
447static BOOL any_types_match(const DMO_PARTIAL_MEDIATYPE *a, unsigned int a_count,
448 const DMO_PARTIAL_MEDIATYPE *b, unsigned int b_count)
449{
450 unsigned int i, j;
451
452 for (i = 0; i < a_count; ++i)
453 {
454 for (j = 0; j < b_count; ++j)
455 {
456 if (IsMediaTypeEqual(&a[i], &b[j]))
457 return TRUE;
458 }
459 }
460 return FALSE;
461}
462
463/******************************************************************************
464 * IEnumDMO_fnNext
465 */
467 IEnumDMO * iface,
468 DWORD cItemsToFetch,
469 CLSID * pCLSID,
470 WCHAR ** Names,
471 DWORD * pcItemsFetched)
472{
474 unsigned int types_size = 0;
475 HKEY hkey;
476 WCHAR szNextKey[MAX_PATH];
478 WCHAR szValue[MAX_PATH];
479 DWORD len;
480 UINT count = 0;
481 HRESULT hres = S_OK;
482 LONG ret;
483
485
486 TRACE("(%p)->(%ld %p %p %p)\n", This, cItemsToFetch, pCLSID, Names, pcItemsFetched);
487
488 if (!pCLSID)
489 return E_POINTER;
490
491 if (!pcItemsFetched && cItemsToFetch > 1)
492 return E_INVALIDARG;
493
494 while (count < cItemsToFetch)
495 {
496 This->index++;
497
498 len = MAX_PATH;
499 ret = RegEnumKeyExW(This->hkey, This->index, szNextKey, &len, NULL, NULL, NULL, NULL);
500 if (ret != ERROR_SUCCESS)
501 {
503 break;
504 }
505
506 if (string_to_guid(szNextKey, &pCLSID[count]) != S_OK)
507 continue;
508
509 TRACE("found %s\n", debugstr_w(szNextKey));
510
511 if (!(This->dwFlags & DMO_ENUMF_INCLUDE_KEYED))
512 {
513 swprintf(path, ARRAY_SIZE(path), L"DirectShow\\MediaObjects\\%s\\Keyed", szNextKey);
515 if (ERROR_SUCCESS == ret)
516 {
517 RegCloseKey(hkey);
518 /* Skip Keyed entries */
519 continue;
520 }
521 }
522
523 swprintf(path, ARRAY_SIZE(path), L"DirectShow\\MediaObjects\\%s", szNextKey);
525 TRACE("Testing %s.\n", debugstr_w(path));
526
527 if (This->pInTypes)
528 {
529 DWORD size, i;
530
531 for (;;)
532 {
533 size = types_size;
534 ret = RegQueryValueExW(hkey, L"InputTypes", NULL, NULL, (BYTE *)types, &size);
536 break;
537 if (size <= types_size)
538 break;
539 if (!array_reserve((void **)&types, &types_size, size, 1))
540 {
541 RegCloseKey(hkey);
542 free(types);
543 return E_OUTOFMEMORY;
544 }
545 }
546 if (ret)
547 {
548 RegCloseKey(hkey);
549 continue;
550 }
551
552 for (i = 0; i < size / sizeof(DMO_PARTIAL_MEDIATYPE); ++i)
553 TRACE("intype %ld: type %s, subtype %s\n", i, debugstr_guid(&types[i].type),
555
556 if (!any_types_match(types, size / sizeof(DMO_PARTIAL_MEDIATYPE), This->pInTypes, This->cInTypes))
557 {
558 RegCloseKey(hkey);
559 continue;
560 }
561 }
562
563 if (This->pOutTypes)
564 {
565 DWORD size = types_size, i;
566
567 for (;;)
568 {
569 size = types_size;
570 ret = RegQueryValueExW(hkey, L"OutputTypes", NULL, NULL, (BYTE *)types, &size);
572 break;
573 if (size <= types_size)
574 break;
575 if (!array_reserve((void **)&types, &types_size, size, 1))
576 {
577 RegCloseKey(hkey);
578 free(types);
579 return E_OUTOFMEMORY;
580 }
581 }
582 if (ret)
583 {
584 RegCloseKey(hkey);
585 continue;
586 }
587
588 for (i = 0; i < size / sizeof(DMO_PARTIAL_MEDIATYPE); ++i)
589 TRACE("outtype %ld: type %s, subtype %s\n", i, debugstr_guid(&types[i].type),
591
592 if (!any_types_match(types, size / sizeof(DMO_PARTIAL_MEDIATYPE), This->pOutTypes, This->cOutTypes))
593 {
594 RegCloseKey(hkey);
595 continue;
596 }
597 }
598
599 /* Media object wasn't filtered so add it to return list */
600 len = MAX_PATH * sizeof(WCHAR);
601 ret = RegQueryValueExW(hkey, NULL, NULL, NULL, (LPBYTE)szValue, &len);
602 if (Names)
603 {
604 Names[count] = NULL;
605 if (ret == ERROR_SUCCESS)
606 {
607 Names[count] = CoTaskMemAlloc((wcslen(szValue) + 1) * sizeof(WCHAR));
608 if (Names[count])
609 wcscpy(Names[count], szValue);
610 }
611 }
612
613 TRACE("found match %s %s\n", debugstr_w(szValue), debugstr_w(szNextKey));
614 RegCloseKey(hkey);
615 count++;
616 }
617
618 free(types);
619
620 if (pcItemsFetched) *pcItemsFetched = count;
621 if (count < cItemsToFetch)
622 hres = S_FALSE;
623
624 TRACE("<-- %i found\n",count);
625 return hres;
626}
627
628
629/******************************************************************************
630 * IEnumDMO_fnSkip
631 */
632static HRESULT WINAPI IEnumDMO_fnSkip(IEnumDMO * iface, DWORD cItemsToSkip)
633{
635
636 TRACE("(%p)->(%ld)\n", This, cItemsToSkip);
637 This->index += cItemsToSkip;
638
639 return S_OK;
640}
641
642
643/******************************************************************************
644 * IEnumDMO_fnReset
645 */
647{
649
650 TRACE("(%p)\n", This);
651 This->index = -1;
652
653 return S_OK;
654}
655
656
657/******************************************************************************
658 * IEnumDMO_fnClone
659 */
661{
663 TRACE("(%p)->(%p)\n", This, ppEnum);
664 return IEnumDMO_Constructor(&This->category, This->dwFlags, This->cInTypes, This->pInTypes,
665 This->cOutTypes, This->pOutTypes, ppEnum);
666}
667
668
669/***************************************************************
670 * DMOEnum (MSDMO.@)
671 *
672 * Enumerate DirectX Media Objects in the registry.
673 */
676 DWORD flags,
677 DWORD cInTypes,
678 const DMO_PARTIAL_MEDIATYPE *pInTypes,
679 DWORD cOutTypes,
680 const DMO_PARTIAL_MEDIATYPE *pOutTypes,
681 IEnumDMO **ppEnum)
682{
683 TRACE("%s 0x%08lx %ld %p %ld %p %p\n", debugstr_guid(category), flags, cInTypes, pInTypes,
684 cOutTypes, pOutTypes, ppEnum);
685
686 if (TRACE_ON(msdmo))
687 {
688 DWORD i;
689 if (cInTypes)
690 {
691 for (i = 0; i < cInTypes; i++)
692 TRACE("intype %ld - type %s, subtype %s\n", i, debugstr_guid(&pInTypes[i].type),
693 debugstr_guid(&pInTypes[i].subtype));
694 }
695
696 if (cOutTypes) {
697 for (i = 0; i < cOutTypes; i++)
698 TRACE("outtype %ld - type %s, subtype %s\n", i, debugstr_guid(&pOutTypes[i].type),
699 debugstr_guid(&pOutTypes[i].subtype));
700 }
701 }
702
703 return IEnumDMO_Constructor(category, flags, cInTypes,
704 pInTypes, cOutTypes, pOutTypes, ppEnum);
705}
706
707
708static const IEnumDMOVtbl edmovt =
709{
717};
718
719/***************************************************************
720 * DMOGetTypes (MSDMO.@)
721 */
723 ULONG output_count, ULONG *ret_output_count, DMO_PARTIAL_MEDIATYPE *output)
724{
725 WCHAR guidstr[64];
726 HKEY root, key;
727 LSTATUS ret;
728 DWORD size;
729
730 TRACE("clsid %s, input_count %lu, ret_input_count %p, input %p, output_count %lu, ret_output_count %p, output %p.\n",
731 debugstr_guid(clsid), input_count, ret_input_count, input, output_count, ret_output_count, output);
732
733 if (RegOpenKeyExW(HKEY_CLASSES_ROOT, L"DirectShow\\MediaObjects", 0, KEY_READ, &root))
734 return E_FAIL;
735
736 if (RegOpenKeyExW(root, GUIDToString(guidstr, clsid), 0, KEY_READ, &key))
737 {
739 return E_FAIL;
740 }
741
742 *ret_input_count = 0;
743 size = input_count * sizeof(DMO_PARTIAL_MEDIATYPE);
744 ret = RegQueryValueExW(key, L"InputTypes", NULL, NULL, (BYTE *)input, &size);
745 if (!ret || ret == ERROR_MORE_DATA)
746 *ret_input_count = min(input_count, size / sizeof(DMO_PARTIAL_MEDIATYPE));
747
748 *ret_output_count = 0;
749 size = output_count * sizeof(DMO_PARTIAL_MEDIATYPE);
750 ret = RegQueryValueExW(key, L"OutputTypes", NULL, NULL, (BYTE *)output, &size);
751 if (!ret || ret == ERROR_MORE_DATA)
752 *ret_output_count = min(output_count, size / sizeof(DMO_PARTIAL_MEDIATYPE));
753
756 return S_OK;
757}
PWSTR Names[]
#define REG_SZ
Definition: layer.c:22
#define InterlockedIncrement
Definition: armddk.h:53
#define InterlockedDecrement
Definition: armddk.h:52
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
Definition: precomp.h:23
#define ARRAY_SIZE(A)
Definition: main.h:20
#define ERR(fmt,...)
Definition: precomp.h:57
const GUID IID_IUnknown
#define RegCloseKey(hKey)
Definition: registry.h:49
struct _root root
#define ERROR_MORE_DATA
Definition: dderror.h:13
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define E_INVALIDARG
Definition: ddrawi.h:101
#define E_FAIL
Definition: ddrawi.h:102
#define realloc
Definition: debug_ros.c:6
#define free
Definition: debug_ros.c:5
HRESULT hr
Definition: delayimp.cpp:582
#define ERROR_SUCCESS
Definition: deptool.c:10
static LSTATUS(WINAPI *pRegDeleteTreeW)(HKEY
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
LONG WINAPI RegCreateKeyExW(_In_ HKEY hKey, _In_ LPCWSTR lpSubKey, _In_ DWORD Reserved, _In_opt_ LPWSTR lpClass, _In_ DWORD dwOptions, _In_ REGSAM samDesired, _In_opt_ LPSECURITY_ATTRIBUTES lpSecurityAttributes, _Out_ PHKEY phkResult, _Out_opt_ LPDWORD lpdwDisposition)
Definition: reg.c:1096
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3333
LONG WINAPI RegEnumKeyExW(_In_ HKEY hKey, _In_ DWORD dwIndex, _Out_ LPWSTR lpName, _Inout_ LPDWORD lpcbName, _Reserved_ LPDWORD lpReserved, _Out_opt_ LPWSTR lpClass, _Inout_opt_ LPDWORD lpcbClass, _Out_opt_ PFILETIME lpftLastWriteTime)
Definition: reg.c:2504
LONG WINAPI RegSetValueExW(_In_ HKEY hKey, _In_ LPCWSTR lpValueName, _In_ DWORD Reserved, _In_ DWORD dwType, _In_ CONST BYTE *lpData, _In_ DWORD cbData)
Definition: reg.c:4882
LONG WINAPI RegDeleteKeyW(_In_ HKEY hKey, _In_ LPCWSTR lpSubKey)
Definition: reg.c:1239
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
Definition: reg.c:4103
HRESULT WINAPI CLSIDFromString(LPCOLESTR str, LPCLSID clsid)
Definition: combase.c:1470
void *WINAPI CoTaskMemAlloc(SIZE_T size)
Definition: malloc.c:381
#define GetProcessHeap()
Definition: compat.h:736
#define HeapAlloc
Definition: compat.h:733
#define TRACE_ON(x)
Definition: compat.h:75
#define MAX_PATH
Definition: compat.h:34
#define HeapFree(x, y, z)
Definition: compat.h:735
#define HEAP_ZERO_MEMORY
Definition: compat.h:134
GUID guid
Definition: version.c:147
_ACRTIMP size_t __cdecl wcslen(const wchar_t *)
Definition: wcs.c:2988
#define swprintf
Definition: precomp.h:40
static BOOL any_types_match(const DMO_PARTIAL_MEDIATYPE *a, unsigned int a_count, const DMO_PARTIAL_MEDIATYPE *b, unsigned int b_count)
Definition: dmoreg.c:447
static HRESULT string_to_guid(const WCHAR *string, GUID *guid)
Definition: dmoreg.c:94
static const IEnumDMOVtbl edmovt
Definition: dmoreg.c:83
static BOOL IsMediaTypeEqual(const DMO_PARTIAL_MEDIATYPE *mt1, const DMO_PARTIAL_MEDIATYPE *mt2)
Definition: dmoreg.c:104
static HRESULT write_types(HKEY hkey, LPCWSTR name, const DMO_PARTIAL_MEDIATYPE *types, DWORD count)
Definition: dmoreg.c:115
static HRESULT WINAPI IEnumDMO_fnNext(IEnumDMO *iface, DWORD cItemsToFetch, CLSID *pCLSID, WCHAR **Names, DWORD *pcItemsFetched)
Definition: dmoreg.c:466
HRESULT WINAPI DMOEnum(REFGUID category, DWORD flags, DWORD cInTypes, const DMO_PARTIAL_MEDIATYPE *pInTypes, DWORD cOutTypes, const DMO_PARTIAL_MEDIATYPE *pOutTypes, IEnumDMO **ppEnum)
Definition: dmoreg.c:674
BOOL array_reserve(void **elements, unsigned int *capacity, unsigned int count, unsigned int size)
Definition: dmoreg.c:35
HRESULT WINAPI DMOGetName(REFCLSID clsidDMO, WCHAR name[80])
Definition: dmoreg.c:282
HRESULT WINAPI DMORegister(LPCWSTR szName, REFCLSID clsidDMO, REFGUID guidCategory, DWORD dwFlags, DWORD cInTypes, const DMO_PARTIAL_MEDIATYPE *pInTypes, DWORD cOutTypes, const DMO_PARTIAL_MEDIATYPE *pOutTypes)
Definition: dmoreg.c:126
static HRESULT IEnumDMO_Constructor(REFGUID guidCategory, DWORD dwFlags, DWORD cInTypes, const DMO_PARTIAL_MEDIATYPE *pInTypes, DWORD cOutTypes, const DMO_PARTIAL_MEDIATYPE *pOutTypes, IEnumDMO **obj)
Definition: dmoreg.c:331
HRESULT WINAPI DMOUnregister(REFCLSID dmo, REFGUID category)
Definition: dmoreg.c:231
static const WCHAR * GUIDToString(WCHAR *string, const GUID *guid)
Definition: dmoreg.c:85
static HRESULT WINAPI IEnumDMO_fnClone(IEnumDMO *iface, IEnumDMO **ppEnum)
Definition: dmoreg.c:660
static HRESULT WINAPI IEnumDMO_fnReset(IEnumDMO *iface)
Definition: dmoreg.c:646
static HRESULT WINAPI IEnumDMO_fnQueryInterface(IEnumDMO *iface, REFIID riid, void **ppvObj)
Definition: dmoreg.c:408
static IEnumDMOImpl * impl_from_IEnumDMO(IEnumDMO *iface)
Definition: dmoreg.c:78
HRESULT WINAPI DMOGetTypes(REFCLSID clsid, ULONG input_count, ULONG *ret_input_count, DMO_PARTIAL_MEDIATYPE *input, ULONG output_count, ULONG *ret_output_count, DMO_PARTIAL_MEDIATYPE *output)
Definition: dmoreg.c:722
static HRESULT unregister_dmo_from_category(const WCHAR *dmoW, const WCHAR *catW, HKEY categories)
Definition: dmoreg.c:211
static HRESULT WINAPI IEnumDMO_fnSkip(IEnumDMO *iface, DWORD cItemsToSkip)
Definition: dmoreg.c:632
static HRESULT dup_partial_mediatype(const DMO_PARTIAL_MEDIATYPE *types, DWORD count, DMO_PARTIAL_MEDIATYPE **ret)
Definition: dmoreg.c:313
static ULONG WINAPI IEnumDMO_fnRelease(IEnumDMO *iface)
Definition: dmoreg.c:429
static ULONG WINAPI IEnumDMO_fnAddRef(IEnumDMO *iface)
Definition: dmoreg.c:397
return ret
Definition: mutex.c:147
#define L(x)
Definition: resources.c:13
struct _DMO_PARTIAL_MEDIATYPE DMO_PARTIAL_MEDIATYPE
@ DMO_ENUMF_INCLUDE_KEYED
Definition: dmoreg.h:37
@ DMO_REGISTERF_IS_KEYED
Definition: dmoreg.h:32
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
GLuint GLuint GLsizei count
Definition: gl.h:1545
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
GLsizei GLenum * categories
Definition: glext.h:11561
GLuint buffer
Definition: glext.h:5915
GLsizeiptr size
Definition: glext.h:5919
GLuint index
Definition: glext.h:6031
GLboolean GLboolean GLboolean b
Definition: glext.h:6204
GLbitfield flags
Definition: glext.h:7161
GLenum GLsizei len
Definition: glext.h:6722
GLboolean GLboolean GLboolean GLboolean a
Definition: glext.h:6204
GLenum GLenum GLenum input
Definition: glext.h:9031
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble * u
Definition: glfuncs.h:240
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
Definition: glfuncs.h:250
unsigned int UINT
Definition: sysinfo.c:13
REFIID riid
Definition: atlbase.h:39
#define S_OK
Definition: intsafe.h:52
#define FAILED(hr)
Definition: intsafe.h:51
#define debugstr_guid
Definition: kernel32.h:35
#define debugstr_w
Definition: kernel32.h:32
#define GUID_NULL
Definition: ks.h:106
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
char string[160]
Definition: util.h:11
HRESULT hres
Definition: protocol.c:432
#define min(a, b)
Definition: monoChain.cc:55
const GUID * subtype
Definition: mpegvideo.c:120
const CLSID * clsid
Definition: msctf.cpp:50
_In_ LPWSTR _In_ DWORD _In_ DWORD _In_ DWORD dwFlags
Definition: netsh.h:141
#define REG_BINARY
Definition: nt_native.h:1499
#define KEY_READ
Definition: nt_native.h:1026
#define REG_OPTION_NON_VOLATILE
Definition: nt_native.h:1060
#define KEY_ENUMERATE_SUB_KEYS
Definition: nt_native.h:1022
#define KEY_WRITE
Definition: nt_native.h:1034
short WCHAR
Definition: pedump.c:58
long LONG
Definition: pedump.c:60
static const WCHAR szName[]
Definition: powrprof.c:45
#define IsEqualGUID(rguid1, rguid2)
Definition: guiddef.h:147
#define IsEqualIID(riid1, riid2)
Definition: guiddef.h:95
#define REFIID
Definition: guiddef.h:118
#define REFCLSID
Definition: guiddef.h:117
#define IsEqualCLSID(rclsid1, rclsid2)
Definition: guiddef.h:96
wcscpy
#define TRACE(s)
Definition: solgame.cpp:4
HKEY hkey
Definition: dmoreg.c:75
DWORD index
Definition: dmoreg.c:68
DWORD dwFlags
Definition: dmoreg.c:70
DMO_PARTIAL_MEDIATYPE * pOutTypes
Definition: dmoreg.c:74
GUID category
Definition: dmoreg.c:69
DWORD cOutTypes
Definition: dmoreg.c:73
IEnumDMO IEnumDMO_iface
Definition: dmoreg.c:66
LONG ref
Definition: dmoreg.c:67
DMO_PARTIAL_MEDIATYPE * pInTypes
Definition: dmoreg.c:72
DWORD cInTypes
Definition: dmoreg.c:71
Definition: scsiwmi.h:51
Definition: copy.c:22
Definition: name.c:39
Definition: cmds.c:130
#define max(a, b)
Definition: svc.c:63
const uint16_t * LPCWSTR
Definition: typedefs.h:57
unsigned char * LPBYTE
Definition: typedefs.h:53
int32_t INT
Definition: typedefs.h:58
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260
uint32_t ULONG
Definition: typedefs.h:59
#define WINAPI
Definition: msvc.h:6
#define S_FALSE
Definition: winerror.h:3451
static HRESULT HRESULT_FROM_WIN32(unsigned int x)
Definition: winerror.h:210
#define E_NOINTERFACE
Definition: winerror.h:3479
#define E_POINTER
Definition: winerror.h:3480
#define HKEY_CLASSES_ROOT
Definition: winreg.h:10
unsigned char BYTE
Definition: xxhash.c:193