ReactOS 0.4.16-dev-2332-g4cba65d
comcat.c
Go to the documentation of this file.
1/*
2 * Comcat implementation
3 *
4 * Copyright (C) 2002 John K. Hohm
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
10 *
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19 */
20
21#include <string.h>
22#include <stdarg.h>
23
24#define COBJMACROS
25
26#include "windef.h"
27#include "winbase.h"
28#include "winuser.h"
29#include "winreg.h"
30#include "winerror.h"
31
32#include "ole2.h"
33#include "comcat.h"
34#include "compobj_private.h"
35
36#include "wine/debug.h"
37
39
40static const ICatRegisterVtbl COMCAT_ICatRegister_Vtbl;
41static const ICatInformationVtbl COMCAT_ICatInformation_Vtbl;
42
43typedef struct
44{
48
49/* static ComCatMgr instance */
51{
54};
55
57{
58 ULONG size; /* total length, including structure itself */
61};
62
66
67/**********************************************************************
68 * File-scope string constants
69 */
70static const WCHAR comcat_keyname[] = L"Component Categories";
71static const WCHAR impl_keyname[] = L"Implemented Categories";
72static const WCHAR req_keyname[] = L"Required Categories";
73
74/**********************************************************************
75 * COMCAT_RegisterClassCategories
76 */
78 REFCLSID rclsid,
80 ULONG cCategories,
81 const CATID *rgcatid)
82{
83 WCHAR keyname[CHARS_IN_GUID];
85 HKEY clsid_key, class_key, type_key;
86
87 if (cCategories && rgcatid == NULL) return E_POINTER;
88
89 /* Format the class key name. */
90 res = StringFromGUID2(rclsid, keyname, CHARS_IN_GUID);
91 if (FAILED(res)) return res;
92
93 /* Create (or open) the CLSID key. */
95 if (res != ERROR_SUCCESS) return E_FAIL;
96
97 /* Create (or open) the class key. */
98 res = create_classes_key(clsid_key, keyname, KEY_READ|KEY_WRITE, &class_key);
99 if (res == ERROR_SUCCESS) {
100 /* Create (or open) the category type key. */
101 res = create_classes_key(class_key, type, KEY_READ|KEY_WRITE, &type_key);
102 if (res == ERROR_SUCCESS) {
103 for (; cCategories; --cCategories, ++rgcatid) {
104 HKEY key;
105
106 /* Format the category key name. */
107 res = StringFromGUID2(rgcatid, keyname, CHARS_IN_GUID);
108 if (FAILED(res)) continue;
109
110 /* Do the register. */
111 res = create_classes_key(type_key, keyname, KEY_READ|KEY_WRITE, &key);
113 }
114 res = S_OK;
115 } else res = E_FAIL;
116 RegCloseKey(class_key);
117 } else res = E_FAIL;
118 RegCloseKey(clsid_key);
119
120 return res;
121}
122
123/**********************************************************************
124 * COMCAT_UnRegisterClassCategories
125 */
127 REFCLSID rclsid,
129 ULONG cCategories,
130 const CATID *rgcatid)
131{
132 WCHAR keyname[68] = L"CLSID\\";
133 HRESULT res;
134 HKEY type_key;
135
136 if (cCategories && rgcatid == NULL) return E_POINTER;
137
138 /* Format the class category type key name. */
139 res = StringFromGUID2(rclsid, keyname + 6, CHARS_IN_GUID);
140 if (FAILED(res)) return res;
141 keyname[44] = '\\';
142 lstrcpyW(keyname + 45, type);
143
144 /* Open the class category type key. */
146 if (res != ERROR_SUCCESS) return E_FAIL;
147
148 for (; cCategories; --cCategories, ++rgcatid) {
149 /* Format the category key name. */
150 res = StringFromGUID2(rgcatid, keyname, CHARS_IN_GUID);
151 if (FAILED(res)) continue;
152
153 /* Do the unregister. */
154 RegDeleteKeyW(type_key, keyname);
155 }
156 RegCloseKey(type_key);
157
158 return S_OK;
159}
160
161/**********************************************************************
162 * COMCAT_GetCategoryDesc
163 */
165 ULONG buf_wchars)
166{
167 WCHAR valname[5];
168 HRESULT res;
169 DWORD type, size = (buf_wchars - 1) * sizeof(WCHAR);
170
171 if (pszDesc == NULL) return E_INVALIDARG;
172
173 /* FIXME: lcid comparisons are more complex than this! */
174 wsprintfW(valname, L"%lX", lcid);
175 res = RegQueryValueExW(key, valname, 0, &type, (LPBYTE)pszDesc, &size);
176 if (res != ERROR_SUCCESS || type != REG_SZ) {
177 FIXME("Simplified lcid comparison\n");
178 return CAT_E_NODESCRIPTION;
179 }
180 pszDesc[size / sizeof(WCHAR)] = 0;
181
182 return S_OK;
183}
184
185/**********************************************************************
186 * COMCAT_PrepareClassCategories
187 */
189 ULONG impl_count, const CATID *impl_catids, ULONG req_count, const CATID *req_catids)
190{
192 WCHAR *strings;
193 ULONG size;
194
195 size = sizeof(struct class_categories) + ((impl_count + req_count)*CHARS_IN_GUID + 2)*sizeof(WCHAR);
197 if (categories == NULL) return categories;
198
199 categories->size = size;
200 categories->impl_offset = sizeof(struct class_categories);
201 categories->req_offset = categories->impl_offset + (impl_count*CHARS_IN_GUID + 1)*sizeof(WCHAR);
202
203 strings = (WCHAR *)(categories + 1);
204 while (impl_count--) {
205 StringFromGUID2(impl_catids++, strings, CHARS_IN_GUID);
207 }
208 *strings++ = 0;
209
210 while (req_count--) {
211 StringFromGUID2(req_catids++, strings, CHARS_IN_GUID);
213 }
214 *strings++ = 0;
215
216 return categories;
217}
218
219/**********************************************************************
220 * COMCAT_IsClassOfCategories
221 */
223 HKEY key,
224 struct class_categories const* categories)
225{
226 const WCHAR *impl_strings, *req_strings;
227 HKEY subkey;
228 HRESULT res;
229 DWORD index;
231
232 impl_strings = (WCHAR*)((BYTE*)categories + categories->impl_offset);
233 req_strings = (WCHAR*)((BYTE*)categories + categories->req_offset);
234
235 /* Check that every given category is implemented by class. */
236 if (*impl_strings) {
238 if (res != ERROR_SUCCESS) return S_FALSE;
239 for (string = impl_strings; *string; string += CHARS_IN_GUID) {
240 HKEY catkey;
241 res = open_classes_key(subkey, string, READ_CONTROL, &catkey);
242 if (res != ERROR_SUCCESS) {
243 RegCloseKey(subkey);
244 return S_FALSE;
245 }
246 RegCloseKey(catkey);
247 }
248 RegCloseKey(subkey);
249 }
250
251 /* Check that all categories required by class are given. */
253 if (res == ERROR_SUCCESS) {
254 for (index = 0; ; ++index) {
255 WCHAR keyname[CHARS_IN_GUID];
257
258 res = RegEnumKeyExW(subkey, index, keyname, &size,
259 NULL, NULL, NULL, NULL);
260 if (res != ERROR_SUCCESS && res != ERROR_MORE_DATA) break;
261 if (size != CHARS_IN_GUID-1) continue; /* bogus catid in registry */
262 for (string = req_strings; *string; string += CHARS_IN_GUID)
263 if (!wcsicmp(string, keyname)) break;
264 if (!*string) {
265 RegCloseKey(subkey);
266 return S_FALSE;
267 }
268 }
269 RegCloseKey(subkey);
270 }
271
272 return S_OK;
273}
274
275/**********************************************************************
276 * COMCAT_ICatRegister_QueryInterface
277 */
279 LPCATREGISTER iface,
280 REFIID riid,
281 LPVOID *ppvObj)
282{
283 TRACE("%s\n",debugstr_guid(riid));
284
285 if (ppvObj == NULL) return E_POINTER;
286
287 if (IsEqualGUID(riid, &IID_IUnknown) || IsEqualGUID(riid, &IID_ICatRegister)) {
288 *ppvObj = iface;
289 ICatRegister_AddRef(iface);
290 return S_OK;
291 }
292
293 if (IsEqualGUID(riid, &IID_ICatInformation)) {
295 ICatRegister_AddRef(iface);
296 return S_OK;
297 }
298
299 return E_NOINTERFACE;
300}
301
302/**********************************************************************
303 * COMCAT_ICatRegister_AddRef
304 */
305static ULONG WINAPI COMCAT_ICatRegister_AddRef(LPCATREGISTER iface)
306{
307 return 2; /* non-heap based object */
308}
309
310/**********************************************************************
311 * COMCAT_ICatRegister_Release
312 */
313static ULONG WINAPI COMCAT_ICatRegister_Release(LPCATREGISTER iface)
314{
315 return 1; /* non-heap based object */
316}
317
318/**********************************************************************
319 * COMCAT_ICatRegister_RegisterCategories
320 */
322 LPCATREGISTER iface,
323 ULONG cCategories,
324 CATEGORYINFO *rgci)
325{
326 HKEY comcat_key;
327 HRESULT res;
328
329 TRACE("\n");
330
331 if (cCategories && rgci == NULL)
332 return E_POINTER;
333
334 /* Create (or open) the component categories key. */
336 if (res != ERROR_SUCCESS) return E_FAIL;
337
338 for (; cCategories; --cCategories, ++rgci)
339 {
340 WCHAR keyname[CHARS_IN_GUID];
341 WCHAR valname[9];
342 HKEY cat_key;
343
344 /* Create (or open) the key for this category. */
345 if (!StringFromGUID2(&rgci->catid, keyname, CHARS_IN_GUID)) continue;
346 res = create_classes_key(comcat_key, keyname, KEY_READ|KEY_WRITE, &cat_key);
347 if (res != ERROR_SUCCESS) continue;
348
349 /* Set the value for this locale's description. */
350 wsprintfW(valname, L"%lX", rgci->lcid);
351 RegSetValueExW(cat_key, valname, 0, REG_SZ, (const BYTE*)rgci->szDescription,
352 (lstrlenW(rgci->szDescription) + 1) * sizeof(WCHAR));
353
354 RegCloseKey(cat_key);
355 }
356
357 RegCloseKey(comcat_key);
358 return S_OK;
359}
360
361/**********************************************************************
362 * COMCAT_ICatRegister_UnRegisterCategories
363 */
365 LPCATREGISTER iface,
366 ULONG cCategories,
367 CATID *rgcatid)
368{
369 HKEY comcat_key;
370 HRESULT res;
371
372 TRACE("\n");
373
374 if (cCategories && rgcatid == NULL)
375 return E_POINTER;
376
377 /* Open the component categories key. */
379 if (res != ERROR_SUCCESS) return E_FAIL;
380
381 for (; cCategories; --cCategories, ++rgcatid) {
382 WCHAR keyname[CHARS_IN_GUID];
383
384 /* Delete the key for this category. */
385 if (!StringFromGUID2(rgcatid, keyname, CHARS_IN_GUID)) continue;
386 RegDeleteKeyW(comcat_key, keyname);
387 }
388
389 RegCloseKey(comcat_key);
390 return S_OK;
391}
392
393/**********************************************************************
394 * COMCAT_ICatRegister_RegisterClassImplCategories
395 */
397 LPCATREGISTER iface,
398 REFCLSID rclsid,
399 ULONG cCategories,
400 CATID *rgcatid)
401{
402 TRACE("\n");
403
405 rclsid, impl_keyname, cCategories, rgcatid);
406}
407
408/**********************************************************************
409 * COMCAT_ICatRegister_UnRegisterClassImplCategories
410 */
412 LPCATREGISTER iface,
413 REFCLSID rclsid,
414 ULONG cCategories,
415 CATID *rgcatid)
416{
417 TRACE("\n");
418
420 rclsid, impl_keyname, cCategories, rgcatid);
421}
422
423/**********************************************************************
424 * COMCAT_ICatRegister_RegisterClassReqCategories
425 */
427 LPCATREGISTER iface,
428 REFCLSID rclsid,
429 ULONG cCategories,
430 CATID *rgcatid)
431{
432 TRACE("\n");
433
435 rclsid, req_keyname, cCategories, rgcatid);
436}
437
438/**********************************************************************
439 * COMCAT_ICatRegister_UnRegisterClassReqCategories
440 */
442 LPCATREGISTER iface,
443 REFCLSID rclsid,
444 ULONG cCategories,
445 CATID *rgcatid)
446{
447 TRACE("\n");
448
450 rclsid, req_keyname, cCategories, rgcatid);
451}
452
453/**********************************************************************
454 * COMCAT_ICatInformation_QueryInterface
455 */
457 LPCATINFORMATION iface,
458 REFIID riid,
459 LPVOID *ppvObj)
460{
461 return ICatRegister_QueryInterface(&COMCAT_ComCatMgr.ICatRegister_iface, riid, ppvObj);
462}
463
464/**********************************************************************
465 * COMCAT_ICatInformation_AddRef
466 */
467static ULONG WINAPI COMCAT_ICatInformation_AddRef(LPCATINFORMATION iface)
468{
469 return ICatRegister_AddRef(&COMCAT_ComCatMgr.ICatRegister_iface);
470}
471
472/**********************************************************************
473 * COMCAT_ICatInformation_Release
474 */
475static ULONG WINAPI COMCAT_ICatInformation_Release(LPCATINFORMATION iface)
476{
477 return ICatRegister_Release(&COMCAT_ComCatMgr.ICatRegister_iface);
478}
479
480/**********************************************************************
481 * COMCAT_ICatInformation_EnumCategories
482 */
484 LPCATINFORMATION iface,
485 LCID lcid,
486 IEnumCATEGORYINFO **ppenumCatInfo)
487{
488 TRACE("\n");
489
490 if (ppenumCatInfo == NULL) return E_POINTER;
491
492 return EnumCATEGORYINFO_Construct(lcid, ppenumCatInfo);
493}
494
495/**********************************************************************
496 * COMCAT_ICatInformation_GetCategoryDesc
497 */
499 LPCATINFORMATION iface,
500 REFCATID rcatid,
501 LCID lcid,
502 PWCHAR *ppszDesc)
503{
504 WCHAR keyname[60] = L"Component Categories\\";
505 HKEY key;
506 HRESULT res;
507
508 TRACE("CATID: %s LCID: %lx\n",debugstr_guid(rcatid), lcid);
509
510 if (rcatid == NULL || ppszDesc == NULL) return E_INVALIDARG;
511
512 /* Open the key for this category. */
513 if (!StringFromGUID2(rcatid, keyname + 21, CHARS_IN_GUID)) return E_FAIL;
515 if (res != ERROR_SUCCESS) return CAT_E_CATIDNOEXIST;
516
517 /* Allocate a sensible amount of memory for the description. */
518 *ppszDesc = CoTaskMemAlloc(128 * sizeof(WCHAR));
519 if (*ppszDesc == NULL) {
521 return E_OUTOFMEMORY;
522 }
523
524 /* Get the description, and make sure it's null terminated. */
525 res = COMCAT_GetCategoryDesc(key, lcid, *ppszDesc, 128);
527 if (FAILED(res)) {
528 CoTaskMemFree(*ppszDesc);
529 return res;
530 }
531
532 return S_OK;
533}
534
535/**********************************************************************
536 * COMCAT_ICatInformation_EnumClassesOfCategories
537 */
539 LPCATINFORMATION iface,
540 ULONG cImplemented,
541 CATID *rgcatidImpl,
542 ULONG cRequired,
543 CATID *rgcatidReq,
544 LPENUMCLSID *ppenumCLSID)
545{
547 HRESULT hr;
548
549 TRACE("\n");
550
551 if (cImplemented == (ULONG)-1)
552 cImplemented = 0;
553 if (cRequired == (ULONG)-1)
554 cRequired = 0;
555
556 if (ppenumCLSID == NULL ||
557 (cImplemented && rgcatidImpl == NULL) ||
558 (cRequired && rgcatidReq == NULL)) return E_POINTER;
559
560 categories = COMCAT_PrepareClassCategories(cImplemented, rgcatidImpl,
561 cRequired, rgcatidReq);
562 if (categories == NULL) return E_OUTOFMEMORY;
563
564 hr = CLSIDEnumGUID_Construct(categories, ppenumCLSID);
565 if (FAILED(hr))
566 {
568 return hr;
569 }
570
571 return hr;
572}
573
574/**********************************************************************
575 * COMCAT_ICatInformation_IsClassOfCategories
576 */
578 LPCATINFORMATION iface,
579 REFCLSID rclsid,
580 ULONG cImplemented,
581 CATID *rgcatidImpl,
582 ULONG cRequired,
583 CATID *rgcatidReq)
584{
585 WCHAR keyname[45] = L"CLSID\\";
586 HRESULT res;
588 HKEY key;
589
590 if (TRACE_ON(ole)) {
591 ULONG count;
592 TRACE("CLSID: %s Implemented %lu\n",debugstr_guid(rclsid),cImplemented);
593 for (count = 0; count < cImplemented; ++count)
594 TRACE(" %s\n",debugstr_guid(&rgcatidImpl[count]));
595 TRACE("Required %lu\n",cRequired);
596 for (count = 0; count < cRequired; ++count)
597 TRACE(" %s\n",debugstr_guid(&rgcatidReq[count]));
598 }
599
600 if ((cImplemented && rgcatidImpl == NULL) ||
601 (cRequired && rgcatidReq == NULL)) return E_POINTER;
602
603 res = StringFromGUID2(rclsid, keyname + 6, CHARS_IN_GUID);
604 if (FAILED(res)) return res;
605
606 categories = COMCAT_PrepareClassCategories(cImplemented, rgcatidImpl,
607 cRequired, rgcatidReq);
608 if (categories == NULL) return E_OUTOFMEMORY;
609
611 if (res == ERROR_SUCCESS) {
614 } else res = S_FALSE;
615
617
618 return res;
619}
620
621/**********************************************************************
622 * COMCAT_ICatInformation_EnumImplCategoriesOfClass
623 */
625 LPCATINFORMATION iface,
626 REFCLSID rclsid,
627 LPENUMCATID *ppenumCATID)
628{
629 TRACE("%s\n",debugstr_guid(rclsid));
630
631 if (rclsid == NULL || ppenumCATID == NULL)
632 return E_POINTER;
633
634 return CATIDEnumGUID_Construct(rclsid, L"\\Implemented Categories", ppenumCATID);
635}
636
637/**********************************************************************
638 * COMCAT_ICatInformation_EnumReqCategoriesOfClass
639 */
641 LPCATINFORMATION iface,
642 REFCLSID rclsid,
643 LPENUMCATID *ppenumCATID)
644{
645 TRACE("%s\n",debugstr_guid(rclsid));
646
647 if (rclsid == NULL || ppenumCATID == NULL)
648 return E_POINTER;
649
650 return CATIDEnumGUID_Construct(rclsid, L"\\Required Categories", ppenumCATID);
651}
652
653/**********************************************************************
654 * COMCAT_ICatRegister_Vtbl
655 */
656static const ICatRegisterVtbl COMCAT_ICatRegister_Vtbl =
657{
667};
668
669
670/**********************************************************************
671 * COMCAT_ICatInformation_Vtbl
672 */
673static const ICatInformationVtbl COMCAT_ICatInformation_Vtbl =
674{
684};
685
687{
688 HRESULT res;
689 TRACE("%s\n",debugstr_guid(riid));
690
691 if (ppvObj == NULL) return E_POINTER;
692
693 /* Don't support aggregation (Windows doesn't) */
694 if (pUnkOuter != NULL) return CLASS_E_NOAGGREGATION;
695
696 res = ICatRegister_QueryInterface(&COMCAT_ComCatMgr.ICatRegister_iface, riid, ppvObj);
697 if (SUCCEEDED(res)) {
698 return res;
699 }
700
702}
703
704/**********************************************************************
705 * IEnumCATEGORYINFO implementation
706 *
707 * This implementation is not thread-safe. The manager itself is, but
708 * I can't imagine a valid use of an enumerator in several threads.
709 */
710typedef struct
711{
718
720{
721 return CONTAINING_RECORD(iface, IEnumCATEGORYINFOImpl, IEnumCATEGORYINFO_iface);
722}
723
725{
727
728 TRACE("\n");
729
730 return InterlockedIncrement(&This->ref);
731}
732
734 IEnumCATEGORYINFO *iface,
735 REFIID riid,
736 LPVOID *ppvObj)
737{
738 TRACE("%s\n",debugstr_guid(riid));
739
740 if (ppvObj == NULL) return E_POINTER;
741
743 IsEqualGUID(riid, &IID_IEnumCATEGORYINFO))
744 {
745 *ppvObj = iface;
747 return S_OK;
748 }
749
750 return E_NOINTERFACE;
751}
752
754{
756 ULONG ref;
757
758 TRACE("\n");
759
761 if (ref == 0) {
762 if (This->key) RegCloseKey(This->key);
764 return 0;
765 }
766 return ref;
767}
768
770 IEnumCATEGORYINFO *iface,
771 ULONG celt,
772 CATEGORYINFO *rgelt,
773 ULONG *pceltFetched)
774{
776 ULONG fetched = 0;
777
778 TRACE("\n");
779
780 if (rgelt == NULL) return E_POINTER;
781
782 if (This->key) while (fetched < celt) {
783 LSTATUS res;
784 HRESULT hr;
786 DWORD cName = CHARS_IN_GUID;
787 HKEY subkey;
788
789 res = RegEnumKeyExW(This->key, This->next_index, catid, &cName,
790 NULL, NULL, NULL, NULL);
791 if (res != ERROR_SUCCESS && res != ERROR_MORE_DATA) break;
792 ++(This->next_index);
793
794 hr = CLSIDFromString(catid, &rgelt->catid);
795 if (FAILED(hr)) continue;
796
797 res = open_classes_key(This->key, catid, KEY_READ, &subkey);
798 if (res != ERROR_SUCCESS) continue;
799
800 hr = COMCAT_GetCategoryDesc(subkey, This->lcid,
801 rgelt->szDescription, 128);
802 RegCloseKey(subkey);
803 if (FAILED(hr)) continue;
804
805 rgelt->lcid = This->lcid;
806 ++fetched;
807 ++rgelt;
808 }
809
810 if (pceltFetched) *pceltFetched = fetched;
811 return fetched == celt ? S_OK : S_FALSE;
812}
813
815 IEnumCATEGORYINFO *iface,
816 ULONG celt)
817{
819
820 TRACE("\n");
821
822 This->next_index += celt;
823 /* This should return S_FALSE when there aren't celt elems to skip. */
824 return S_OK;
825}
826
828{
830
831 TRACE("\n");
832
833 This->next_index = 0;
834 return S_OK;
835}
836
838 IEnumCATEGORYINFO *iface,
839 IEnumCATEGORYINFO **ppenum)
840{
842 IEnumCATEGORYINFOImpl *new_this;
843
844 TRACE("\n");
845
846 if (ppenum == NULL) return E_POINTER;
847
849 if (new_this == NULL) return E_OUTOFMEMORY;
850
851 new_this->IEnumCATEGORYINFO_iface = This->IEnumCATEGORYINFO_iface;
852 new_this->ref = 1;
853 new_this->lcid = This->lcid;
854 /* FIXME: could we more efficiently use DuplicateHandle? */
856 new_this->next_index = This->next_index;
857
858 *ppenum = &new_this->IEnumCATEGORYINFO_iface;
859 return S_OK;
860}
861
862static const IEnumCATEGORYINFOVtbl COMCAT_IEnumCATEGORYINFO_Vtbl =
863{
871};
872
874{
876
877 *ret = NULL;
878
880 if (!This) return E_OUTOFMEMORY;
881
882 This->IEnumCATEGORYINFO_iface.lpVtbl = &COMCAT_IEnumCATEGORYINFO_Vtbl;
883 This->ref = 1;
884 This->lcid = lcid;
886
887 *ret = &This->IEnumCATEGORYINFO_iface;
888 return S_OK;
889}
890
891/**********************************************************************
892 * ClassesOfCategories IEnumCLSID (IEnumGUID) implementation
893 *
894 * This implementation is not thread-safe. The manager itself is, but
895 * I can't imagine a valid use of an enumerator in several threads.
896 */
897typedef struct
898{
905
907{
908 return CONTAINING_RECORD(iface, CLSID_IEnumGUIDImpl, IEnumGUID_iface);
909}
910
912 IEnumGUID *iface,
913 REFIID riid,
914 LPVOID *ppvObj)
915{
916 TRACE("%s\n",debugstr_guid(riid));
917
918 if (ppvObj == NULL) return E_POINTER;
919
921 IsEqualGUID(riid, &IID_IEnumGUID))
922 {
923 *ppvObj = iface;
924 IEnumGUID_AddRef(iface);
925 return S_OK;
926 }
927
928 return E_NOINTERFACE;
929}
930
932{
934 TRACE("\n");
935
936 return InterlockedIncrement(&This->ref);
937}
938
940{
942 ULONG ref;
943
944 TRACE("\n");
945
947 if (ref == 0) {
948 if (This->key) RegCloseKey(This->key);
949 HeapFree(GetProcessHeap(), 0, This->categories);
951 return 0;
952 }
953 return ref;
954}
955
957 IEnumGUID *iface,
958 ULONG celt,
959 GUID *rgelt,
960 ULONG *pceltFetched)
961{
963 ULONG fetched = 0;
964
965 TRACE("\n");
966
967 if (rgelt == NULL) return E_POINTER;
968
969 if (This->key) while (fetched < celt) {
970 LSTATUS res;
971 HRESULT hr;
973 DWORD cName = CHARS_IN_GUID;
974 HKEY subkey;
975
976 res = RegEnumKeyExW(This->key, This->next_index, clsid, &cName,
977 NULL, NULL, NULL, NULL);
978 if (res != ERROR_SUCCESS && res != ERROR_MORE_DATA) break;
979 ++(This->next_index);
980
981 hr = CLSIDFromString(clsid, rgelt);
982 if (FAILED(hr)) continue;
983
984 res = open_classes_key(This->key, clsid, KEY_READ, &subkey);
985 if (res != ERROR_SUCCESS) continue;
986
987 hr = COMCAT_IsClassOfCategories(subkey, This->categories);
988 RegCloseKey(subkey);
989 if (hr != S_OK) continue;
990
991 ++fetched;
992 ++rgelt;
993 }
994
995 if (pceltFetched) *pceltFetched = fetched;
996 return fetched == celt ? S_OK : S_FALSE;
997}
998
1000 IEnumGUID *iface,
1001 ULONG celt)
1002{
1004
1005 TRACE("\n");
1006
1007 This->next_index += celt;
1008 FIXME("Never returns S_FALSE\n");
1009 return S_OK;
1010}
1011
1013{
1015
1016 TRACE("\n");
1017
1018 This->next_index = 0;
1019 return S_OK;
1020}
1021
1023 IEnumGUID *iface,
1024 IEnumGUID **ppenum)
1025{
1027 CLSID_IEnumGUIDImpl *cloned;
1028
1029 TRACE("(%p)->(%p)\n", This, ppenum);
1030
1031 if (ppenum == NULL) return E_POINTER;
1032
1033 *ppenum = NULL;
1034
1035 cloned = HeapAlloc(GetProcessHeap(), 0, sizeof(CLSID_IEnumGUIDImpl));
1036 if (cloned == NULL) return E_OUTOFMEMORY;
1037
1038 cloned->IEnumGUID_iface.lpVtbl = This->IEnumGUID_iface.lpVtbl;
1039 cloned->ref = 1;
1040
1041 cloned->categories = HeapAlloc(GetProcessHeap(), 0, This->categories->size);
1042 if (cloned->categories == NULL) {
1043 HeapFree(GetProcessHeap(), 0, cloned);
1044 return E_OUTOFMEMORY;
1045 }
1046 memcpy(cloned->categories, This->categories, This->categories->size);
1047
1048 cloned->key = NULL;
1049 open_classes_key(HKEY_CLASSES_ROOT, L"CLSID", KEY_READ, &cloned->key);
1050 cloned->next_index = This->next_index;
1051
1052 *ppenum = &cloned->IEnumGUID_iface;
1053 return S_OK;
1054}
1055
1056static const IEnumGUIDVtbl CLSIDEnumGUIDVtbl =
1057{
1065};
1066
1068{
1070
1071 *ret = NULL;
1072
1074 if (!This) return E_OUTOFMEMORY;
1075
1076 This->IEnumGUID_iface.lpVtbl = &CLSIDEnumGUIDVtbl;
1077 This->ref = 1;
1078 This->categories = categories;
1080
1081 *ret = &This->IEnumGUID_iface;
1082
1083 return S_OK;
1084}
1085
1086/**********************************************************************
1087 * CategoriesOfClass IEnumCATID (IEnumGUID) implementation
1088 *
1089 * This implementation is not thread-safe. The manager itself is, but
1090 * I can't imagine a valid use of an enumerator in several threads.
1091 */
1092typedef struct
1093{
1096 WCHAR keyname[68];
1100
1102{
1103 return CONTAINING_RECORD(iface, CATID_IEnumGUIDImpl, IEnumGUID_iface);
1104}
1105
1107 IEnumGUID *iface,
1108 REFIID riid,
1109 LPVOID *ppvObj)
1110{
1111 TRACE("%s\n",debugstr_guid(riid));
1112
1113 if (ppvObj == NULL) return E_POINTER;
1114
1115 if (IsEqualGUID(riid, &IID_IUnknown) ||
1116 IsEqualGUID(riid, &IID_IEnumGUID))
1117 {
1118 *ppvObj = iface;
1119 IEnumGUID_AddRef(iface);
1120 return S_OK;
1121 }
1122
1123 return E_NOINTERFACE;
1124}
1125
1127{
1129 TRACE("\n");
1130
1131 return InterlockedIncrement(&This->ref);
1132}
1133
1135{
1137 ULONG ref;
1138
1139 TRACE("\n");
1140
1141 ref = InterlockedDecrement(&This->ref);
1142 if (ref == 0) {
1143 if (This->key) RegCloseKey(This->key);
1145 return 0;
1146 }
1147 return ref;
1148}
1149
1151 IEnumGUID *iface,
1152 ULONG celt,
1153 GUID *rgelt,
1154 ULONG *pceltFetched)
1155{
1157 ULONG fetched = 0;
1158
1159 TRACE("\n");
1160
1161 if (rgelt == NULL) return E_POINTER;
1162
1163 if (This->key) while (fetched < celt) {
1164 LSTATUS res;
1165 HRESULT hr;
1167 DWORD cName = CHARS_IN_GUID;
1168
1169 res = RegEnumKeyExW(This->key, This->next_index, catid, &cName,
1170 NULL, NULL, NULL, NULL);
1171 if (res != ERROR_SUCCESS && res != ERROR_MORE_DATA) break;
1172 ++(This->next_index);
1173
1174 hr = CLSIDFromString(catid, rgelt);
1175 if (FAILED(hr)) continue;
1176
1177 ++fetched;
1178 ++rgelt;
1179 }
1180
1181 if (pceltFetched) *pceltFetched = fetched;
1182 return fetched == celt ? S_OK : S_FALSE;
1183}
1184
1186 IEnumGUID *iface,
1187 ULONG celt)
1188{
1190
1191 TRACE("\n");
1192
1193 This->next_index += celt;
1194 FIXME("Never returns S_FALSE\n");
1195 return S_OK;
1196}
1197
1199{
1201
1202 TRACE("\n");
1203
1204 This->next_index = 0;
1205 return S_OK;
1206}
1207
1209 IEnumGUID *iface,
1210 IEnumGUID **ppenum)
1211{
1213 CATID_IEnumGUIDImpl *new_this;
1214
1215 TRACE("\n");
1216
1217 if (ppenum == NULL) return E_POINTER;
1218
1220 if (new_this == NULL) return E_OUTOFMEMORY;
1221
1222 new_this->IEnumGUID_iface.lpVtbl = This->IEnumGUID_iface.lpVtbl;
1223 new_this->ref = 1;
1224 lstrcpyW(new_this->keyname, This->keyname);
1225 /* FIXME: could we more efficiently use DuplicateHandle? */
1226 open_classes_key(HKEY_CLASSES_ROOT, new_this->keyname, KEY_READ, &new_this->key);
1227 new_this->next_index = This->next_index;
1228
1229 *ppenum = &new_this->IEnumGUID_iface;
1230 return S_OK;
1231}
1232
1233static const IEnumGUIDVtbl CATIDEnumGUIDVtbl =
1234{
1242};
1243
1245{
1246 WCHAR keyname[100], clsidW[CHARS_IN_GUID];
1248
1249 *ret = NULL;
1250
1252 if (!This) return E_OUTOFMEMORY;
1253
1255
1256 This->IEnumGUID_iface.lpVtbl = &CATIDEnumGUIDVtbl;
1257 This->ref = 1;
1258 lstrcpyW(keyname, L"CLSID\\");
1259 lstrcatW(keyname, clsidW);
1260 lstrcatW(keyname, postfix);
1261
1263
1264 *ret = &This->IEnumGUID_iface;
1265 return S_OK;
1266}
#define InterlockedIncrement
Definition: armddk.h:53
#define InterlockedDecrement
Definition: armddk.h:52
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
Definition: precomp.h:23
#define index(s, c)
Definition: various.h:29
#define FIXME(fmt,...)
Definition: precomp.h:53
const GUID IID_IUnknown
#define RegCloseKey(hKey)
Definition: registry.h:49
#define CHARS_IN_GUID
#define IEnumCLSID
Definition: comcat.idl:40
#define IEnumCATID
Definition: comcat.idl:36
#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 ERROR_SUCCESS
Definition: deptool.c:10
static const WCHAR clsidW[]
static LSTATUS(WINAPI *pRegDeleteTreeW)(HKEY
#define NULL
Definition: types.h:112
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
static LSTATUS create_classes_key(HKEY hkey, const WCHAR *name, REGSAM access, HKEY *retkey)
Definition: combase.c:254
INT WINAPI StringFromGUID2(REFGUID guid, LPOLESTR str, INT cmax)
Definition: combase.c:1525
static LSTATUS open_classes_key(HKEY hkey, const WCHAR *name, REGSAM access, HKEY *retkey)
Definition: combase.c:297
HRESULT WINAPI CLSIDFromString(LPCOLESTR str, LPCLSID clsid)
Definition: combase.c:1470
#define GetProcessHeap()
Definition: compat.h:736
#define HeapAlloc
Definition: compat.h:733
#define TRACE_ON(x)
Definition: compat.h:75
#define HeapFree(x, y, z)
Definition: compat.h:735
#define lstrcpyW
Definition: compat.h:749
#define HEAP_ZERO_MEMORY
Definition: compat.h:134
#define wcsicmp
Definition: compat.h:15
#define lstrlenW
Definition: compat.h:750
LCID lcid
Definition: locale.c:5656
static HRESULT CATIDEnumGUID_Construct(REFCLSID rclsid, LPCWSTR impl_req, IEnumCATID **ret)
static HRESULT WINAPI COMCAT_IEnumCATEGORYINFO_QueryInterface(IEnumCATEGORYINFO *iface, REFIID riid, LPVOID *ppvObj)
Definition: comcat.c:733
static HRESULT WINAPI COMCAT_IEnumCATEGORYINFO_Clone(IEnumCATEGORYINFO *iface, IEnumCATEGORYINFO **ppenum)
Definition: comcat.c:837
static ULONG WINAPI COMCAT_IEnumCATEGORYINFO_AddRef(IEnumCATEGORYINFO *iface)
Definition: comcat.c:724
static HRESULT WINAPI CATIDEnumGUID_Skip(IEnumGUID *iface, ULONG celt)
Definition: comcat.c:1185
static ULONG WINAPI CLSIDEnumGUID_AddRef(IEnumGUID *iface)
Definition: comcat.c:931
static HRESULT WINAPI COMCAT_ICatInformation_QueryInterface(LPCATINFORMATION iface, REFIID riid, LPVOID *ppvObj)
Definition: comcat.c:456
static ULONG WINAPI CATIDEnumGUID_Release(IEnumGUID *iface)
Definition: comcat.c:1134
static HRESULT WINAPI CLSIDEnumGUID_QueryInterface(IEnumGUID *iface, REFIID riid, LPVOID *ppvObj)
Definition: comcat.c:911
static ULONG WINAPI CATIDEnumGUID_AddRef(IEnumGUID *iface)
Definition: comcat.c:1126
static const WCHAR impl_keyname[]
Definition: comcat.c:71
static HRESULT WINAPI CATIDEnumGUID_Clone(IEnumGUID *iface, IEnumGUID **ppenum)
Definition: comcat.c:1208
HRESULT WINAPI ComCat_CreateInstance(IClassFactory *iface, IUnknown *pUnkOuter, REFIID riid, void **ppvObj)
Definition: comcat.c:686
static ULONG WINAPI COMCAT_ICatRegister_AddRef(LPCATREGISTER iface)
Definition: comcat.c:305
static const ICatRegisterVtbl COMCAT_ICatRegister_Vtbl
Definition: comcat.c:40
static HRESULT WINAPI COMCAT_ICatRegister_UnRegisterClassImplCategories(LPCATREGISTER iface, REFCLSID rclsid, ULONG cCategories, CATID *rgcatid)
Definition: comcat.c:411
static const IEnumCATEGORYINFOVtbl COMCAT_IEnumCATEGORYINFO_Vtbl
Definition: comcat.c:862
static HRESULT CLSIDEnumGUID_Construct(struct class_categories *class_categories, IEnumCLSID **ret)
Definition: comcat.c:1067
static HRESULT WINAPI COMCAT_IEnumCATEGORYINFO_Skip(IEnumCATEGORYINFO *iface, ULONG celt)
Definition: comcat.c:814
static HRESULT WINAPI CLSIDEnumGUID_Skip(IEnumGUID *iface, ULONG celt)
Definition: comcat.c:999
static IEnumCATEGORYINFOImpl * impl_from_IEnumCATEGORYINFO(IEnumCATEGORYINFO *iface)
Definition: comcat.c:719
static ULONG WINAPI COMCAT_IEnumCATEGORYINFO_Release(IEnumCATEGORYINFO *iface)
Definition: comcat.c:753
static ComCatMgrImpl COMCAT_ComCatMgr
Definition: comcat.c:50
static HRESULT WINAPI COMCAT_ICatInformation_EnumCategories(LPCATINFORMATION iface, LCID lcid, IEnumCATEGORYINFO **ppenumCatInfo)
Definition: comcat.c:483
static HRESULT WINAPI COMCAT_ICatRegister_RegisterCategories(LPCATREGISTER iface, ULONG cCategories, CATEGORYINFO *rgci)
Definition: comcat.c:321
static CLSID_IEnumGUIDImpl * impl_from_IEnumCLSID(IEnumGUID *iface)
Definition: comcat.c:906
static HRESULT COMCAT_UnRegisterClassCategories(REFCLSID rclsid, LPCWSTR type, ULONG cCategories, const CATID *rgcatid)
Definition: comcat.c:126
static ULONG WINAPI CLSIDEnumGUID_Release(IEnumGUID *iface)
Definition: comcat.c:939
static const WCHAR req_keyname[]
Definition: comcat.c:72
static HRESULT WINAPI COMCAT_ICatInformation_GetCategoryDesc(LPCATINFORMATION iface, REFCATID rcatid, LCID lcid, PWCHAR *ppszDesc)
Definition: comcat.c:498
static CATID_IEnumGUIDImpl * impl_from_IEnumCATID(IEnumGUID *iface)
Definition: comcat.c:1101
static HRESULT COMCAT_RegisterClassCategories(REFCLSID rclsid, LPCWSTR type, ULONG cCategories, const CATID *rgcatid)
Definition: comcat.c:77
static HRESULT WINAPI COMCAT_ICatInformation_EnumClassesOfCategories(LPCATINFORMATION iface, ULONG cImplemented, CATID *rgcatidImpl, ULONG cRequired, CATID *rgcatidReq, LPENUMCLSID *ppenumCLSID)
Definition: comcat.c:538
static HRESULT WINAPI COMCAT_ICatRegister_RegisterClassImplCategories(LPCATREGISTER iface, REFCLSID rclsid, ULONG cCategories, CATID *rgcatid)
Definition: comcat.c:396
static ULONG WINAPI COMCAT_ICatInformation_AddRef(LPCATINFORMATION iface)
Definition: comcat.c:467
static HRESULT WINAPI CATIDEnumGUID_Next(IEnumGUID *iface, ULONG celt, GUID *rgelt, ULONG *pceltFetched)
Definition: comcat.c:1150
static HRESULT WINAPI COMCAT_ICatRegister_UnRegisterClassReqCategories(LPCATREGISTER iface, REFCLSID rclsid, ULONG cCategories, CATID *rgcatid)
Definition: comcat.c:441
static HRESULT WINAPI COMCAT_ICatRegister_UnRegisterCategories(LPCATREGISTER iface, ULONG cCategories, CATID *rgcatid)
Definition: comcat.c:364
static HRESULT WINAPI COMCAT_ICatInformation_IsClassOfCategories(LPCATINFORMATION iface, REFCLSID rclsid, ULONG cImplemented, CATID *rgcatidImpl, ULONG cRequired, CATID *rgcatidReq)
Definition: comcat.c:577
static const ICatInformationVtbl COMCAT_ICatInformation_Vtbl
Definition: comcat.c:41
static HRESULT COMCAT_GetCategoryDesc(HKEY key, LCID lcid, PWCHAR pszDesc, ULONG buf_wchars)
Definition: comcat.c:164
static const WCHAR comcat_keyname[]
Definition: comcat.c:70
static HRESULT WINAPI CATIDEnumGUID_Reset(IEnumGUID *iface)
Definition: comcat.c:1198
static HRESULT EnumCATEGORYINFO_Construct(LCID lcid, IEnumCATEGORYINFO **ret)
Definition: comcat.c:873
static HRESULT WINAPI CLSIDEnumGUID_Next(IEnumGUID *iface, ULONG celt, GUID *rgelt, ULONG *pceltFetched)
Definition: comcat.c:956
static HRESULT COMCAT_IsClassOfCategories(HKEY key, struct class_categories const *categories)
Definition: comcat.c:222
static HRESULT WINAPI COMCAT_ICatInformation_EnumImplCategoriesOfClass(LPCATINFORMATION iface, REFCLSID rclsid, LPENUMCATID *ppenumCATID)
Definition: comcat.c:624
static HRESULT WINAPI COMCAT_ICatInformation_EnumReqCategoriesOfClass(LPCATINFORMATION iface, REFCLSID rclsid, LPENUMCATID *ppenumCATID)
Definition: comcat.c:640
static HRESULT WINAPI CLSIDEnumGUID_Reset(IEnumGUID *iface)
Definition: comcat.c:1012
static HRESULT WINAPI CLSIDEnumGUID_Clone(IEnumGUID *iface, IEnumGUID **ppenum)
Definition: comcat.c:1022
static HRESULT WINAPI COMCAT_IEnumCATEGORYINFO_Next(IEnumCATEGORYINFO *iface, ULONG celt, CATEGORYINFO *rgelt, ULONG *pceltFetched)
Definition: comcat.c:769
static HRESULT WINAPI CATIDEnumGUID_QueryInterface(IEnumGUID *iface, REFIID riid, LPVOID *ppvObj)
Definition: comcat.c:1106
static HRESULT WINAPI COMCAT_IEnumCATEGORYINFO_Reset(IEnumCATEGORYINFO *iface)
Definition: comcat.c:827
static const IEnumGUIDVtbl CATIDEnumGUIDVtbl
Definition: comcat.c:1233
static struct class_categories * COMCAT_PrepareClassCategories(ULONG impl_count, const CATID *impl_catids, ULONG req_count, const CATID *req_catids)
Definition: comcat.c:188
static HRESULT WINAPI COMCAT_ICatRegister_RegisterClassReqCategories(LPCATREGISTER iface, REFCLSID rclsid, ULONG cCategories, CATID *rgcatid)
Definition: comcat.c:426
static ULONG WINAPI COMCAT_ICatInformation_Release(LPCATINFORMATION iface)
Definition: comcat.c:475
static ULONG WINAPI COMCAT_ICatRegister_Release(LPCATREGISTER iface)
Definition: comcat.c:313
static const IEnumGUIDVtbl CLSIDEnumGUIDVtbl
Definition: comcat.c:1056
static HRESULT WINAPI COMCAT_ICatRegister_QueryInterface(LPCATREGISTER iface, REFIID riid, LPVOID *ppvObj)
Definition: comcat.c:278
return ret
Definition: mutex.c:146
#define L(x)
Definition: resources.c:13
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 res
Definition: glext.h:9613
GLsizei const GLchar *const * strings
Definition: glext.h:7622
GLsizeiptr size
Definition: glext.h:5919
GLuint index
Definition: glext.h:6031
REFIID riid
Definition: atlbase.h:39
#define S_OK
Definition: intsafe.h:52
#define SUCCEEDED(hr)
Definition: intsafe.h:50
#define FAILED(hr)
Definition: intsafe.h:51
#define debugstr_guid
Definition: kernel32.h:35
#define REG_SZ
Definition: layer.c:22
LPWSTR WINAPI lstrcatW(LPWSTR lpString1, LPCWSTR lpString2)
Definition: lstring.c:274
void *WINAPI CoTaskMemAlloc(SIZE_T size)
Definition: malloc.c:381
void WINAPI CoTaskMemFree(void *ptr)
Definition: malloc.c:389
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
char string[160]
Definition: util.h:11
const CLSID * clsid
Definition: msctf.cpp:50
GUID catid
Definition: msctf.idl:629
#define KEY_READ
Definition: nt_native.h:1026
#define KEY_WRITE
Definition: nt_native.h:1034
#define READ_CONTROL
Definition: nt_native.h:58
long LONG
Definition: pedump.c:60
#define IsEqualGUID(rguid1, rguid2)
Definition: guiddef.h:147
#define REFIID
Definition: guiddef.h:118
#define REFCLSID
Definition: guiddef.h:117
DWORD LCID
Definition: nls.h:13
HRESULT hr
Definition: shlfolder.c:183
#define TRACE(s)
Definition: solgame.cpp:4
IEnumGUID IEnumGUID_iface
Definition: comcat.c:1094
WCHAR keyname[68]
Definition: comcat.c:1096
IEnumGUID IEnumGUID_iface
Definition: comcat.c:899
struct class_categories * categories
Definition: comcat.c:901
ICatRegister ICatRegister_iface
Definition: comcat.c:45
ICatInformation ICatInformation_iface
Definition: comcat.c:46
IEnumCATEGORYINFO IEnumCATEGORYINFO_iface
Definition: comcat.c:712
Definition: scsiwmi.h:51
ULONG size
Definition: comcat.c:58
ULONG impl_offset
Definition: comcat.c:59
ULONG req_offset
Definition: comcat.c:60
Definition: copy.c:22
Definition: send.c:48
unsigned char * LPBYTE
Definition: typedefs.h:53
uint16_t * PWCHAR
Definition: typedefs.h:56
#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
#define E_NOINTERFACE
Definition: winerror.h:3479
#define CAT_E_NODESCRIPTION
Definition: winerror.h:3810
#define CLASS_E_NOAGGREGATION
Definition: winerror.h:3771
#define E_POINTER
Definition: winerror.h:3480
#define CAT_E_CATIDNOEXIST
Definition: winerror.h:3809
#define CLASS_E_CLASSNOTAVAILABLE
Definition: winerror.h:3772
#define HKEY_CLASSES_ROOT
Definition: winreg.h:10
int WINAPIV wsprintfW(_Out_ LPWSTR, _In_ _Printf_format_string_ LPCWSTR,...)
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
__wchar_t WCHAR
Definition: xmlstorage.h:180
unsigned char BYTE
Definition: xxhash.c:193