ReactOS 0.4.16-dev-2354-g16de117
comcat.c File Reference
#include <string.h>
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "winuser.h"
#include "winreg.h"
#include "winerror.h"
#include "ole2.h"
#include "comcat.h"
#include "compobj_private.h"
#include "wine/debug.h"
Include dependency graph for comcat.c:

Go to the source code of this file.

Classes

struct  ComCatMgrImpl
 
struct  class_categories
 
struct  IEnumCATEGORYINFOImpl
 
struct  CLSID_IEnumGUIDImpl
 
struct  CATID_IEnumGUIDImpl
 

Macros

#define COBJMACROS
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (ole)
 
static HRESULT EnumCATEGORYINFO_Construct (LCID lcid, IEnumCATEGORYINFO **ret)
 
static HRESULT CLSIDEnumGUID_Construct (struct class_categories *class_categories, IEnumCLSID **ret)
 
static HRESULT CATIDEnumGUID_Construct (REFCLSID rclsid, LPCWSTR impl_req, IEnumCATID **ret)
 
static HRESULT COMCAT_RegisterClassCategories (REFCLSID rclsid, LPCWSTR type, ULONG cCategories, const CATID *rgcatid)
 
static HRESULT COMCAT_UnRegisterClassCategories (REFCLSID rclsid, LPCWSTR type, ULONG cCategories, const CATID *rgcatid)
 
static HRESULT COMCAT_GetCategoryDesc (HKEY key, LCID lcid, PWCHAR pszDesc, ULONG buf_wchars)
 
static struct class_categoriesCOMCAT_PrepareClassCategories (ULONG impl_count, const CATID *impl_catids, ULONG req_count, const CATID *req_catids)
 
static HRESULT COMCAT_IsClassOfCategories (HKEY key, struct class_categories const *categories)
 
static HRESULT WINAPI COMCAT_ICatRegister_QueryInterface (LPCATREGISTER iface, REFIID riid, LPVOID *ppvObj)
 
static ULONG WINAPI COMCAT_ICatRegister_AddRef (LPCATREGISTER iface)
 
static ULONG WINAPI COMCAT_ICatRegister_Release (LPCATREGISTER iface)
 
static HRESULT WINAPI COMCAT_ICatRegister_RegisterCategories (LPCATREGISTER iface, ULONG cCategories, CATEGORYINFO *rgci)
 
static HRESULT WINAPI COMCAT_ICatRegister_UnRegisterCategories (LPCATREGISTER iface, ULONG cCategories, CATID *rgcatid)
 
static HRESULT WINAPI COMCAT_ICatRegister_RegisterClassImplCategories (LPCATREGISTER iface, REFCLSID rclsid, ULONG cCategories, CATID *rgcatid)
 
static HRESULT WINAPI COMCAT_ICatRegister_UnRegisterClassImplCategories (LPCATREGISTER iface, REFCLSID rclsid, ULONG cCategories, CATID *rgcatid)
 
static HRESULT WINAPI COMCAT_ICatRegister_RegisterClassReqCategories (LPCATREGISTER iface, REFCLSID rclsid, ULONG cCategories, CATID *rgcatid)
 
static HRESULT WINAPI COMCAT_ICatRegister_UnRegisterClassReqCategories (LPCATREGISTER iface, REFCLSID rclsid, ULONG cCategories, CATID *rgcatid)
 
static HRESULT WINAPI COMCAT_ICatInformation_QueryInterface (LPCATINFORMATION iface, REFIID riid, LPVOID *ppvObj)
 
static ULONG WINAPI COMCAT_ICatInformation_AddRef (LPCATINFORMATION iface)
 
static ULONG WINAPI COMCAT_ICatInformation_Release (LPCATINFORMATION iface)
 
static HRESULT WINAPI COMCAT_ICatInformation_EnumCategories (LPCATINFORMATION iface, LCID lcid, IEnumCATEGORYINFO **ppenumCatInfo)
 
static HRESULT WINAPI COMCAT_ICatInformation_GetCategoryDesc (LPCATINFORMATION iface, REFCATID rcatid, LCID lcid, PWCHAR *ppszDesc)
 
static HRESULT WINAPI COMCAT_ICatInformation_EnumClassesOfCategories (LPCATINFORMATION iface, ULONG cImplemented, CATID *rgcatidImpl, ULONG cRequired, CATID *rgcatidReq, LPENUMCLSID *ppenumCLSID)
 
static HRESULT WINAPI COMCAT_ICatInformation_IsClassOfCategories (LPCATINFORMATION iface, REFCLSID rclsid, ULONG cImplemented, CATID *rgcatidImpl, ULONG cRequired, CATID *rgcatidReq)
 
static HRESULT WINAPI COMCAT_ICatInformation_EnumImplCategoriesOfClass (LPCATINFORMATION iface, REFCLSID rclsid, LPENUMCATID *ppenumCATID)
 
static HRESULT WINAPI COMCAT_ICatInformation_EnumReqCategoriesOfClass (LPCATINFORMATION iface, REFCLSID rclsid, LPENUMCATID *ppenumCATID)
 
HRESULT WINAPI ComCat_CreateInstance (IClassFactory *iface, IUnknown *pUnkOuter, REFIID riid, void **ppvObj)
 
static IEnumCATEGORYINFOImplimpl_from_IEnumCATEGORYINFO (IEnumCATEGORYINFO *iface)
 
static ULONG WINAPI COMCAT_IEnumCATEGORYINFO_AddRef (IEnumCATEGORYINFO *iface)
 
static HRESULT WINAPI COMCAT_IEnumCATEGORYINFO_QueryInterface (IEnumCATEGORYINFO *iface, REFIID riid, LPVOID *ppvObj)
 
static ULONG WINAPI COMCAT_IEnumCATEGORYINFO_Release (IEnumCATEGORYINFO *iface)
 
static HRESULT WINAPI COMCAT_IEnumCATEGORYINFO_Next (IEnumCATEGORYINFO *iface, ULONG celt, CATEGORYINFO *rgelt, ULONG *pceltFetched)
 
static HRESULT WINAPI COMCAT_IEnumCATEGORYINFO_Skip (IEnumCATEGORYINFO *iface, ULONG celt)
 
static HRESULT WINAPI COMCAT_IEnumCATEGORYINFO_Reset (IEnumCATEGORYINFO *iface)
 
static HRESULT WINAPI COMCAT_IEnumCATEGORYINFO_Clone (IEnumCATEGORYINFO *iface, IEnumCATEGORYINFO **ppenum)
 
static CLSID_IEnumGUIDImplimpl_from_IEnumCLSID (IEnumGUID *iface)
 
static HRESULT WINAPI CLSIDEnumGUID_QueryInterface (IEnumGUID *iface, REFIID riid, LPVOID *ppvObj)
 
static ULONG WINAPI CLSIDEnumGUID_AddRef (IEnumGUID *iface)
 
static ULONG WINAPI CLSIDEnumGUID_Release (IEnumGUID *iface)
 
static HRESULT WINAPI CLSIDEnumGUID_Next (IEnumGUID *iface, ULONG celt, GUID *rgelt, ULONG *pceltFetched)
 
static HRESULT WINAPI CLSIDEnumGUID_Skip (IEnumGUID *iface, ULONG celt)
 
static HRESULT WINAPI CLSIDEnumGUID_Reset (IEnumGUID *iface)
 
static HRESULT WINAPI CLSIDEnumGUID_Clone (IEnumGUID *iface, IEnumGUID **ppenum)
 
static CATID_IEnumGUIDImplimpl_from_IEnumCATID (IEnumGUID *iface)
 
static HRESULT WINAPI CATIDEnumGUID_QueryInterface (IEnumGUID *iface, REFIID riid, LPVOID *ppvObj)
 
static ULONG WINAPI CATIDEnumGUID_AddRef (IEnumGUID *iface)
 
static ULONG WINAPI CATIDEnumGUID_Release (IEnumGUID *iface)
 
static HRESULT WINAPI CATIDEnumGUID_Next (IEnumGUID *iface, ULONG celt, GUID *rgelt, ULONG *pceltFetched)
 
static HRESULT WINAPI CATIDEnumGUID_Skip (IEnumGUID *iface, ULONG celt)
 
static HRESULT WINAPI CATIDEnumGUID_Reset (IEnumGUID *iface)
 
static HRESULT WINAPI CATIDEnumGUID_Clone (IEnumGUID *iface, IEnumGUID **ppenum)
 
static HRESULT CATIDEnumGUID_Construct (REFCLSID rclsid, LPCWSTR postfix, IEnumGUID **ret)
 

Variables

static const ICatRegisterVtbl COMCAT_ICatRegister_Vtbl
 
static const ICatInformationVtbl COMCAT_ICatInformation_Vtbl
 
static ComCatMgrImpl COMCAT_ComCatMgr
 
static const WCHAR comcat_keyname [] = L"Component Categories"
 
static const WCHAR impl_keyname [] = L"Implemented Categories"
 
static const WCHAR req_keyname [] = L"Required Categories"
 
static const IEnumCATEGORYINFOVtbl COMCAT_IEnumCATEGORYINFO_Vtbl
 
static const IEnumGUIDVtbl CLSIDEnumGUIDVtbl
 
static const IEnumGUIDVtbl CATIDEnumGUIDVtbl
 

Macro Definition Documentation

◆ COBJMACROS

#define COBJMACROS

Definition at line 24 of file comcat.c.

Function Documentation

◆ CATIDEnumGUID_AddRef()

static ULONG WINAPI CATIDEnumGUID_AddRef ( IEnumGUID iface)
static

Definition at line 1126 of file comcat.c.

1127{
1129 TRACE("\n");
1130
1131 return InterlockedIncrement(&This->ref);
1132}
#define InterlockedIncrement
Definition: armddk.h:53
static CATID_IEnumGUIDImpl * impl_from_IEnumCATID(IEnumGUID *iface)
Definition: comcat.c:1101
#define TRACE(s)
Definition: solgame.cpp:4

◆ CATIDEnumGUID_Clone()

static HRESULT WINAPI CATIDEnumGUID_Clone ( IEnumGUID iface,
IEnumGUID **  ppenum 
)
static

Definition at line 1208 of file comcat.c.

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}
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define NULL
Definition: types.h:112
static LSTATUS open_classes_key(HKEY hkey, const WCHAR *name, REGSAM access, HKEY *retkey)
Definition: combase.c:297
#define GetProcessHeap()
Definition: compat.h:736
#define HeapAlloc
Definition: compat.h:733
#define lstrcpyW
Definition: compat.h:749
#define HEAP_ZERO_MEMORY
Definition: compat.h:134
#define S_OK
Definition: intsafe.h:52
#define KEY_READ
Definition: nt_native.h:1026
IEnumGUID IEnumGUID_iface
Definition: comcat.c:1094
WCHAR keyname[68]
Definition: comcat.c:1096
#define E_POINTER
Definition: winerror.h:3480
#define HKEY_CLASSES_ROOT
Definition: winreg.h:10

◆ CATIDEnumGUID_Construct() [1/2]

static HRESULT CATIDEnumGUID_Construct ( REFCLSID  rclsid,
LPCWSTR  impl_req,
IEnumCATID **  ret 
)
static

◆ CATIDEnumGUID_Construct() [2/2]

static HRESULT CATIDEnumGUID_Construct ( REFCLSID  rclsid,
LPCWSTR  postfix,
IEnumGUID **  ret 
)
static

Definition at line 1244 of file comcat.c.

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 CHARS_IN_GUID
static const WCHAR clsidW[]
INT WINAPI StringFromGUID2(REFGUID guid, LPOLESTR str, INT cmax)
Definition: combase.c:1525
static const IEnumGUIDVtbl CATIDEnumGUIDVtbl
Definition: comcat.c:1233
return ret
Definition: mutex.c:146
#define L(x)
Definition: resources.c:13
LPWSTR WINAPI lstrcatW(LPWSTR lpString1, LPCWSTR lpString2)
Definition: lstring.c:274
__wchar_t WCHAR
Definition: xmlstorage.h:180

◆ CATIDEnumGUID_Next()

static HRESULT WINAPI CATIDEnumGUID_Next ( IEnumGUID iface,
ULONG  celt,
GUID rgelt,
ULONG pceltFetched 
)
static

Definition at line 1150 of file comcat.c.

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}
#define ERROR_MORE_DATA
Definition: dderror.h:13
#define ERROR_SUCCESS
Definition: deptool.c:10
static LSTATUS(WINAPI *pRegDeleteTreeW)(HKEY
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
HRESULT WINAPI CLSIDFromString(LPCOLESTR str, LPCLSID clsid)
Definition: combase.c:1470
unsigned long DWORD
Definition: ntddk_ex.h:95
GLuint res
Definition: glext.h:9613
#define FAILED(hr)
Definition: intsafe.h:51
GUID catid
Definition: msctf.idl:629
HRESULT hr
Definition: shlfolder.c:183
uint32_t ULONG
Definition: typedefs.h:59
#define S_FALSE
Definition: winerror.h:3451

◆ CATIDEnumGUID_QueryInterface()

static HRESULT WINAPI CATIDEnumGUID_QueryInterface ( IEnumGUID iface,
REFIID  riid,
LPVOID ppvObj 
)
static

Definition at line 1106 of file comcat.c.

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}
const GUID IID_IUnknown
REFIID riid
Definition: atlbase.h:39
#define debugstr_guid
Definition: kernel32.h:35
#define IsEqualGUID(rguid1, rguid2)
Definition: guiddef.h:147
#define E_NOINTERFACE
Definition: winerror.h:3479

◆ CATIDEnumGUID_Release()

static ULONG WINAPI CATIDEnumGUID_Release ( IEnumGUID iface)
static

Definition at line 1134 of file comcat.c.

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}
#define InterlockedDecrement
Definition: armddk.h:52
#define RegCloseKey(hKey)
Definition: registry.h:49
#define HeapFree(x, y, z)
Definition: compat.h:735
Definition: send.c:48

◆ CATIDEnumGUID_Reset()

static HRESULT WINAPI CATIDEnumGUID_Reset ( IEnumGUID iface)
static

Definition at line 1198 of file comcat.c.

1199{
1201
1202 TRACE("\n");
1203
1204 This->next_index = 0;
1205 return S_OK;
1206}

◆ CATIDEnumGUID_Skip()

static HRESULT WINAPI CATIDEnumGUID_Skip ( IEnumGUID iface,
ULONG  celt 
)
static

Definition at line 1185 of file comcat.c.

1188{
1190
1191 TRACE("\n");
1192
1193 This->next_index += celt;
1194 FIXME("Never returns S_FALSE\n");
1195 return S_OK;
1196}
#define FIXME(fmt,...)
Definition: precomp.h:53

◆ CLSIDEnumGUID_AddRef()

static ULONG WINAPI CLSIDEnumGUID_AddRef ( IEnumGUID iface)
static

Definition at line 931 of file comcat.c.

932{
934 TRACE("\n");
935
936 return InterlockedIncrement(&This->ref);
937}
static CLSID_IEnumGUIDImpl * impl_from_IEnumCLSID(IEnumGUID *iface)
Definition: comcat.c:906

◆ CLSIDEnumGUID_Clone()

static HRESULT WINAPI CLSIDEnumGUID_Clone ( IEnumGUID iface,
IEnumGUID **  ppenum 
)
static

Definition at line 1022 of file comcat.c.

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}
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
IEnumGUID IEnumGUID_iface
Definition: comcat.c:899
struct class_categories * categories
Definition: comcat.c:901

◆ CLSIDEnumGUID_Construct()

static HRESULT CLSIDEnumGUID_Construct ( struct class_categories class_categories,
IEnumCLSID **  ret 
)
static

Definition at line 1067 of file comcat.c.

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}
static const IEnumGUIDVtbl CLSIDEnumGUIDVtbl
Definition: comcat.c:1056
GLsizei GLenum * categories
Definition: glext.h:11561

Referenced by COMCAT_ICatInformation_EnumClassesOfCategories().

◆ CLSIDEnumGUID_Next()

static HRESULT WINAPI CLSIDEnumGUID_Next ( IEnumGUID iface,
ULONG  celt,
GUID rgelt,
ULONG pceltFetched 
)
static

Definition at line 956 of file comcat.c.

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}
static HRESULT COMCAT_IsClassOfCategories(HKEY key, struct class_categories const *categories)
Definition: comcat.c:222
const CLSID * clsid
Definition: msctf.cpp:50

◆ CLSIDEnumGUID_QueryInterface()

static HRESULT WINAPI CLSIDEnumGUID_QueryInterface ( IEnumGUID iface,
REFIID  riid,
LPVOID ppvObj 
)
static

Definition at line 911 of file comcat.c.

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}

◆ CLSIDEnumGUID_Release()

static ULONG WINAPI CLSIDEnumGUID_Release ( IEnumGUID iface)
static

Definition at line 939 of file comcat.c.

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}

◆ CLSIDEnumGUID_Reset()

static HRESULT WINAPI CLSIDEnumGUID_Reset ( IEnumGUID iface)
static

Definition at line 1012 of file comcat.c.

1013{
1015
1016 TRACE("\n");
1017
1018 This->next_index = 0;
1019 return S_OK;
1020}

◆ CLSIDEnumGUID_Skip()

static HRESULT WINAPI CLSIDEnumGUID_Skip ( IEnumGUID iface,
ULONG  celt 
)
static

Definition at line 999 of file comcat.c.

1002{
1004
1005 TRACE("\n");
1006
1007 This->next_index += celt;
1008 FIXME("Never returns S_FALSE\n");
1009 return S_OK;
1010}

◆ ComCat_CreateInstance()

HRESULT WINAPI ComCat_CreateInstance ( IClassFactory iface,
IUnknown pUnkOuter,
REFIID  riid,
void **  ppvObj 
)

Definition at line 686 of file comcat.c.

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}
static ComCatMgrImpl COMCAT_ComCatMgr
Definition: comcat.c:50
#define SUCCEEDED(hr)
Definition: intsafe.h:50
ICatRegister ICatRegister_iface
Definition: comcat.c:45
#define CLASS_E_NOAGGREGATION
Definition: winerror.h:3771
#define CLASS_E_CLASSNOTAVAILABLE
Definition: winerror.h:3772

◆ COMCAT_GetCategoryDesc()

static HRESULT COMCAT_GetCategoryDesc ( HKEY  key,
LCID  lcid,
PWCHAR  pszDesc,
ULONG  buf_wchars 
)
static

Definition at line 164 of file comcat.c.

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}
#define E_INVALIDARG
Definition: ddrawi.h:101
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
LCID lcid
Definition: locale.c:5656
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
GLsizeiptr size
Definition: glext.h:5919
#define REG_SZ
Definition: layer.c:22
Definition: copy.c:22
unsigned char * LPBYTE
Definition: typedefs.h:53
#define CAT_E_NODESCRIPTION
Definition: winerror.h:3810
int WINAPIV wsprintfW(_Out_ LPWSTR, _In_ _Printf_format_string_ LPCWSTR,...)

Referenced by COMCAT_ICatInformation_GetCategoryDesc(), and COMCAT_IEnumCATEGORYINFO_Next().

◆ COMCAT_ICatInformation_AddRef()

static ULONG WINAPI COMCAT_ICatInformation_AddRef ( LPCATINFORMATION  iface)
static

Definition at line 467 of file comcat.c.

468{
469 return ICatRegister_AddRef(&COMCAT_ComCatMgr.ICatRegister_iface);
470}

◆ COMCAT_ICatInformation_EnumCategories()

static HRESULT WINAPI COMCAT_ICatInformation_EnumCategories ( LPCATINFORMATION  iface,
LCID  lcid,
IEnumCATEGORYINFO **  ppenumCatInfo 
)
static

Definition at line 483 of file comcat.c.

487{
488 TRACE("\n");
489
490 if (ppenumCatInfo == NULL) return E_POINTER;
491
492 return EnumCATEGORYINFO_Construct(lcid, ppenumCatInfo);
493}
static HRESULT EnumCATEGORYINFO_Construct(LCID lcid, IEnumCATEGORYINFO **ret)
Definition: comcat.c:873

◆ COMCAT_ICatInformation_EnumClassesOfCategories()

static HRESULT WINAPI COMCAT_ICatInformation_EnumClassesOfCategories ( LPCATINFORMATION  iface,
ULONG  cImplemented,
CATID rgcatidImpl,
ULONG  cRequired,
CATID rgcatidReq,
LPENUMCLSID *  ppenumCLSID 
)
static

Definition at line 538 of file comcat.c.

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}
static HRESULT CLSIDEnumGUID_Construct(struct class_categories *class_categories, IEnumCLSID **ret)
Definition: comcat.c:1067
static struct class_categories * COMCAT_PrepareClassCategories(ULONG impl_count, const CATID *impl_catids, ULONG req_count, const CATID *req_catids)
Definition: comcat.c:188

◆ COMCAT_ICatInformation_EnumImplCategoriesOfClass()

static HRESULT WINAPI COMCAT_ICatInformation_EnumImplCategoriesOfClass ( LPCATINFORMATION  iface,
REFCLSID  rclsid,
LPENUMCATID *  ppenumCATID 
)
static

Definition at line 624 of file comcat.c.

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}
static HRESULT CATIDEnumGUID_Construct(REFCLSID rclsid, LPCWSTR impl_req, IEnumCATID **ret)

◆ COMCAT_ICatInformation_EnumReqCategoriesOfClass()

static HRESULT WINAPI COMCAT_ICatInformation_EnumReqCategoriesOfClass ( LPCATINFORMATION  iface,
REFCLSID  rclsid,
LPENUMCATID *  ppenumCATID 
)
static

Definition at line 640 of file comcat.c.

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}

◆ COMCAT_ICatInformation_GetCategoryDesc()

static HRESULT WINAPI COMCAT_ICatInformation_GetCategoryDesc ( LPCATINFORMATION  iface,
REFCATID  rcatid,
LCID  lcid,
PWCHAR ppszDesc 
)
static

Definition at line 498 of file comcat.c.

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}
#define E_FAIL
Definition: ddrawi.h:102
static HRESULT COMCAT_GetCategoryDesc(HKEY key, LCID lcid, PWCHAR pszDesc, ULONG buf_wchars)
Definition: comcat.c:164
void *WINAPI CoTaskMemAlloc(SIZE_T size)
Definition: malloc.c:381
void WINAPI CoTaskMemFree(void *ptr)
Definition: malloc.c:389
#define CAT_E_CATIDNOEXIST
Definition: winerror.h:3809

◆ COMCAT_ICatInformation_IsClassOfCategories()

static HRESULT WINAPI COMCAT_ICatInformation_IsClassOfCategories ( LPCATINFORMATION  iface,
REFCLSID  rclsid,
ULONG  cImplemented,
CATID rgcatidImpl,
ULONG  cRequired,
CATID rgcatidReq 
)
static

Definition at line 577 of file comcat.c.

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}
#define TRACE_ON(x)
Definition: compat.h:75
GLuint GLuint GLsizei count
Definition: gl.h:1545

◆ COMCAT_ICatInformation_QueryInterface()

static HRESULT WINAPI COMCAT_ICatInformation_QueryInterface ( LPCATINFORMATION  iface,
REFIID  riid,
LPVOID ppvObj 
)
static

Definition at line 456 of file comcat.c.

460{
461 return ICatRegister_QueryInterface(&COMCAT_ComCatMgr.ICatRegister_iface, riid, ppvObj);
462}

◆ COMCAT_ICatInformation_Release()

static ULONG WINAPI COMCAT_ICatInformation_Release ( LPCATINFORMATION  iface)
static

Definition at line 475 of file comcat.c.

476{
477 return ICatRegister_Release(&COMCAT_ComCatMgr.ICatRegister_iface);
478}

◆ COMCAT_ICatRegister_AddRef()

static ULONG WINAPI COMCAT_ICatRegister_AddRef ( LPCATREGISTER  iface)
static

Definition at line 305 of file comcat.c.

306{
307 return 2; /* non-heap based object */
308}

◆ COMCAT_ICatRegister_QueryInterface()

static HRESULT WINAPI COMCAT_ICatRegister_QueryInterface ( LPCATREGISTER  iface,
REFIID  riid,
LPVOID ppvObj 
)
static

Definition at line 278 of file comcat.c.

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}
ICatInformation ICatInformation_iface
Definition: comcat.c:46

◆ COMCAT_ICatRegister_RegisterCategories()

static HRESULT WINAPI COMCAT_ICatRegister_RegisterCategories ( LPCATREGISTER  iface,
ULONG  cCategories,
CATEGORYINFO *  rgci 
)
static

Definition at line 321 of file comcat.c.

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}
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
static LSTATUS create_classes_key(HKEY hkey, const WCHAR *name, REGSAM access, HKEY *retkey)
Definition: combase.c:254
#define lstrlenW
Definition: compat.h:750
static const WCHAR comcat_keyname[]
Definition: comcat.c:70
#define KEY_WRITE
Definition: nt_native.h:1034
unsigned char BYTE
Definition: xxhash.c:193

◆ COMCAT_ICatRegister_RegisterClassImplCategories()

static HRESULT WINAPI COMCAT_ICatRegister_RegisterClassImplCategories ( LPCATREGISTER  iface,
REFCLSID  rclsid,
ULONG  cCategories,
CATID rgcatid 
)
static

Definition at line 396 of file comcat.c.

401{
402 TRACE("\n");
403
405 rclsid, impl_keyname, cCategories, rgcatid);
406}
static const WCHAR impl_keyname[]
Definition: comcat.c:71
static HRESULT COMCAT_RegisterClassCategories(REFCLSID rclsid, LPCWSTR type, ULONG cCategories, const CATID *rgcatid)
Definition: comcat.c:77

◆ COMCAT_ICatRegister_RegisterClassReqCategories()

static HRESULT WINAPI COMCAT_ICatRegister_RegisterClassReqCategories ( LPCATREGISTER  iface,
REFCLSID  rclsid,
ULONG  cCategories,
CATID rgcatid 
)
static

Definition at line 426 of file comcat.c.

431{
432 TRACE("\n");
433
435 rclsid, req_keyname, cCategories, rgcatid);
436}
static const WCHAR req_keyname[]
Definition: comcat.c:72

◆ COMCAT_ICatRegister_Release()

static ULONG WINAPI COMCAT_ICatRegister_Release ( LPCATREGISTER  iface)
static

Definition at line 313 of file comcat.c.

314{
315 return 1; /* non-heap based object */
316}

◆ COMCAT_ICatRegister_UnRegisterCategories()

static HRESULT WINAPI COMCAT_ICatRegister_UnRegisterCategories ( LPCATREGISTER  iface,
ULONG  cCategories,
CATID rgcatid 
)
static

Definition at line 364 of file comcat.c.

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}
LONG WINAPI RegDeleteKeyW(_In_ HKEY hKey, _In_ LPCWSTR lpSubKey)
Definition: reg.c:1239

◆ COMCAT_ICatRegister_UnRegisterClassImplCategories()

static HRESULT WINAPI COMCAT_ICatRegister_UnRegisterClassImplCategories ( LPCATREGISTER  iface,
REFCLSID  rclsid,
ULONG  cCategories,
CATID rgcatid 
)
static

Definition at line 411 of file comcat.c.

416{
417 TRACE("\n");
418
420 rclsid, impl_keyname, cCategories, rgcatid);
421}
static HRESULT COMCAT_UnRegisterClassCategories(REFCLSID rclsid, LPCWSTR type, ULONG cCategories, const CATID *rgcatid)
Definition: comcat.c:126

◆ COMCAT_ICatRegister_UnRegisterClassReqCategories()

static HRESULT WINAPI COMCAT_ICatRegister_UnRegisterClassReqCategories ( LPCATREGISTER  iface,
REFCLSID  rclsid,
ULONG  cCategories,
CATID rgcatid 
)
static

Definition at line 441 of file comcat.c.

446{
447 TRACE("\n");
448
450 rclsid, req_keyname, cCategories, rgcatid);
451}

◆ COMCAT_IEnumCATEGORYINFO_AddRef()

static ULONG WINAPI COMCAT_IEnumCATEGORYINFO_AddRef ( IEnumCATEGORYINFO iface)
static

Definition at line 724 of file comcat.c.

725{
727
728 TRACE("\n");
729
730 return InterlockedIncrement(&This->ref);
731}
static IEnumCATEGORYINFOImpl * impl_from_IEnumCATEGORYINFO(IEnumCATEGORYINFO *iface)
Definition: comcat.c:719

Referenced by COMCAT_IEnumCATEGORYINFO_QueryInterface().

◆ COMCAT_IEnumCATEGORYINFO_Clone()

static HRESULT WINAPI COMCAT_IEnumCATEGORYINFO_Clone ( IEnumCATEGORYINFO iface,
IEnumCATEGORYINFO **  ppenum 
)
static

Definition at line 837 of file comcat.c.

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}
IEnumCATEGORYINFO IEnumCATEGORYINFO_iface
Definition: comcat.c:712

◆ COMCAT_IEnumCATEGORYINFO_Next()

static HRESULT WINAPI COMCAT_IEnumCATEGORYINFO_Next ( IEnumCATEGORYINFO iface,
ULONG  celt,
CATEGORYINFO *  rgelt,
ULONG pceltFetched 
)
static

Definition at line 769 of file comcat.c.

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}

◆ COMCAT_IEnumCATEGORYINFO_QueryInterface()

static HRESULT WINAPI COMCAT_IEnumCATEGORYINFO_QueryInterface ( IEnumCATEGORYINFO iface,
REFIID  riid,
LPVOID ppvObj 
)
static

Definition at line 733 of file comcat.c.

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}
static ULONG WINAPI COMCAT_IEnumCATEGORYINFO_AddRef(IEnumCATEGORYINFO *iface)
Definition: comcat.c:724

◆ COMCAT_IEnumCATEGORYINFO_Release()

static ULONG WINAPI COMCAT_IEnumCATEGORYINFO_Release ( IEnumCATEGORYINFO iface)
static

Definition at line 753 of file comcat.c.

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}

◆ COMCAT_IEnumCATEGORYINFO_Reset()

static HRESULT WINAPI COMCAT_IEnumCATEGORYINFO_Reset ( IEnumCATEGORYINFO iface)
static

Definition at line 827 of file comcat.c.

828{
830
831 TRACE("\n");
832
833 This->next_index = 0;
834 return S_OK;
835}

◆ COMCAT_IEnumCATEGORYINFO_Skip()

static HRESULT WINAPI COMCAT_IEnumCATEGORYINFO_Skip ( IEnumCATEGORYINFO iface,
ULONG  celt 
)
static

Definition at line 814 of file comcat.c.

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}

◆ COMCAT_IsClassOfCategories()

static HRESULT COMCAT_IsClassOfCategories ( HKEY  key,
struct class_categories const categories 
)
static

Definition at line 222 of file comcat.c.

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}
#define index(s, c)
Definition: various.h:29
#define wcsicmp
Definition: compat.h:15
GLuint index
Definition: glext.h:6031
char string[160]
Definition: util.h:11
#define READ_CONTROL
Definition: nt_native.h:58
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185

Referenced by CLSIDEnumGUID_Next(), and COMCAT_ICatInformation_IsClassOfCategories().

◆ COMCAT_PrepareClassCategories()

static struct class_categories * COMCAT_PrepareClassCategories ( ULONG  impl_count,
const CATID impl_catids,
ULONG  req_count,
const CATID req_catids 
)
static

Definition at line 188 of file comcat.c.

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}
GLsizei const GLchar *const * strings
Definition: glext.h:7622

Referenced by COMCAT_ICatInformation_EnumClassesOfCategories(), and COMCAT_ICatInformation_IsClassOfCategories().

◆ COMCAT_RegisterClassCategories()

static HRESULT COMCAT_RegisterClassCategories ( REFCLSID  rclsid,
LPCWSTR  type,
ULONG  cCategories,
const CATID rgcatid 
)
static

Definition at line 77 of file comcat.c.

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}

Referenced by COMCAT_ICatRegister_RegisterClassImplCategories(), and COMCAT_ICatRegister_RegisterClassReqCategories().

◆ COMCAT_UnRegisterClassCategories()

static HRESULT COMCAT_UnRegisterClassCategories ( REFCLSID  rclsid,
LPCWSTR  type,
ULONG  cCategories,
const CATID rgcatid 
)
static

Definition at line 126 of file comcat.c.

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}

Referenced by COMCAT_ICatRegister_UnRegisterClassImplCategories(), and COMCAT_ICatRegister_UnRegisterClassReqCategories().

◆ EnumCATEGORYINFO_Construct()

static HRESULT EnumCATEGORYINFO_Construct ( LCID  lcid,
IEnumCATEGORYINFO **  ret 
)
static

Definition at line 873 of file comcat.c.

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}
static const IEnumCATEGORYINFOVtbl COMCAT_IEnumCATEGORYINFO_Vtbl
Definition: comcat.c:862

Referenced by COMCAT_ICatInformation_EnumCategories().

◆ impl_from_IEnumCATEGORYINFO()

static IEnumCATEGORYINFOImpl * impl_from_IEnumCATEGORYINFO ( IEnumCATEGORYINFO iface)
inlinestatic

◆ impl_from_IEnumCATID()

static CATID_IEnumGUIDImpl * impl_from_IEnumCATID ( IEnumGUID iface)
inlinestatic

◆ impl_from_IEnumCLSID()

static CLSID_IEnumGUIDImpl * impl_from_IEnumCLSID ( IEnumGUID iface)
inlinestatic

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( ole  )

Variable Documentation

◆ CATIDEnumGUIDVtbl

const IEnumGUIDVtbl CATIDEnumGUIDVtbl
static
Initial value:
=
{
}
static HRESULT WINAPI CATIDEnumGUID_Skip(IEnumGUID *iface, ULONG celt)
Definition: comcat.c:1185
static ULONG WINAPI CATIDEnumGUID_Release(IEnumGUID *iface)
Definition: comcat.c:1134
static ULONG WINAPI CATIDEnumGUID_AddRef(IEnumGUID *iface)
Definition: comcat.c:1126
static HRESULT WINAPI CATIDEnumGUID_Clone(IEnumGUID *iface, IEnumGUID **ppenum)
Definition: comcat.c:1208
static HRESULT WINAPI CATIDEnumGUID_Next(IEnumGUID *iface, ULONG celt, GUID *rgelt, ULONG *pceltFetched)
Definition: comcat.c:1150
static HRESULT WINAPI CATIDEnumGUID_Reset(IEnumGUID *iface)
Definition: comcat.c:1198
static HRESULT WINAPI CATIDEnumGUID_QueryInterface(IEnumGUID *iface, REFIID riid, LPVOID *ppvObj)
Definition: comcat.c:1106

Definition at line 1233 of file comcat.c.

Referenced by CATIDEnumGUID_Construct().

◆ CLSIDEnumGUIDVtbl

const IEnumGUIDVtbl CLSIDEnumGUIDVtbl
static
Initial value:
=
{
}
static ULONG WINAPI CLSIDEnumGUID_AddRef(IEnumGUID *iface)
Definition: comcat.c:931
static HRESULT WINAPI CLSIDEnumGUID_QueryInterface(IEnumGUID *iface, REFIID riid, LPVOID *ppvObj)
Definition: comcat.c:911
static HRESULT WINAPI CLSIDEnumGUID_Skip(IEnumGUID *iface, ULONG celt)
Definition: comcat.c:999
static ULONG WINAPI CLSIDEnumGUID_Release(IEnumGUID *iface)
Definition: comcat.c:939
static HRESULT WINAPI CLSIDEnumGUID_Next(IEnumGUID *iface, ULONG celt, GUID *rgelt, ULONG *pceltFetched)
Definition: comcat.c:956
static HRESULT WINAPI CLSIDEnumGUID_Reset(IEnumGUID *iface)
Definition: comcat.c:1012
static HRESULT WINAPI CLSIDEnumGUID_Clone(IEnumGUID *iface, IEnumGUID **ppenum)
Definition: comcat.c:1022

Definition at line 1056 of file comcat.c.

Referenced by CLSIDEnumGUID_Construct().

◆ COMCAT_ComCatMgr

ComCatMgrImpl COMCAT_ComCatMgr
static
Initial value:
=
{
}
static const ICatRegisterVtbl COMCAT_ICatRegister_Vtbl
Definition: comcat.c:40
static const ICatInformationVtbl COMCAT_ICatInformation_Vtbl
Definition: comcat.c:41

Definition at line 50 of file comcat.c.

Referenced by ComCat_CreateInstance(), COMCAT_ICatInformation_AddRef(), COMCAT_ICatInformation_QueryInterface(), COMCAT_ICatInformation_Release(), and COMCAT_ICatRegister_QueryInterface().

◆ COMCAT_ICatInformation_Vtbl

static const ICatInformationVtbl COMCAT_ICatInformation_Vtbl
static
Initial value:
=
{
}
static HRESULT WINAPI COMCAT_ICatInformation_QueryInterface(LPCATINFORMATION iface, REFIID riid, LPVOID *ppvObj)
Definition: comcat.c:456
static HRESULT WINAPI COMCAT_ICatInformation_EnumCategories(LPCATINFORMATION iface, LCID lcid, IEnumCATEGORYINFO **ppenumCatInfo)
Definition: comcat.c:483
static HRESULT WINAPI COMCAT_ICatInformation_GetCategoryDesc(LPCATINFORMATION iface, REFCATID rcatid, LCID lcid, PWCHAR *ppszDesc)
Definition: comcat.c:498
static HRESULT WINAPI COMCAT_ICatInformation_EnumClassesOfCategories(LPCATINFORMATION iface, ULONG cImplemented, CATID *rgcatidImpl, ULONG cRequired, CATID *rgcatidReq, LPENUMCLSID *ppenumCLSID)
Definition: comcat.c:538
static ULONG WINAPI COMCAT_ICatInformation_AddRef(LPCATINFORMATION iface)
Definition: comcat.c:467
static HRESULT WINAPI COMCAT_ICatInformation_IsClassOfCategories(LPCATINFORMATION iface, REFCLSID rclsid, ULONG cImplemented, CATID *rgcatidImpl, ULONG cRequired, CATID *rgcatidReq)
Definition: comcat.c:577
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 ULONG WINAPI COMCAT_ICatInformation_Release(LPCATINFORMATION iface)
Definition: comcat.c:475

Definition at line 41 of file comcat.c.

◆ COMCAT_ICatRegister_Vtbl

static const ICatRegisterVtbl COMCAT_ICatRegister_Vtbl
static
Initial value:
=
{
}
static ULONG WINAPI COMCAT_ICatRegister_AddRef(LPCATREGISTER iface)
Definition: comcat.c:305
static HRESULT WINAPI COMCAT_ICatRegister_UnRegisterClassImplCategories(LPCATREGISTER iface, REFCLSID rclsid, ULONG cCategories, CATID *rgcatid)
Definition: comcat.c:411
static HRESULT WINAPI COMCAT_ICatRegister_RegisterCategories(LPCATREGISTER iface, ULONG cCategories, CATEGORYINFO *rgci)
Definition: comcat.c:321
static HRESULT WINAPI COMCAT_ICatRegister_RegisterClassImplCategories(LPCATREGISTER iface, REFCLSID rclsid, ULONG cCategories, CATID *rgcatid)
Definition: comcat.c:396
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_ICatRegister_RegisterClassReqCategories(LPCATREGISTER iface, REFCLSID rclsid, ULONG cCategories, CATID *rgcatid)
Definition: comcat.c:426
static ULONG WINAPI COMCAT_ICatRegister_Release(LPCATREGISTER iface)
Definition: comcat.c:313
static HRESULT WINAPI COMCAT_ICatRegister_QueryInterface(LPCATREGISTER iface, REFIID riid, LPVOID *ppvObj)
Definition: comcat.c:278

Definition at line 40 of file comcat.c.

◆ COMCAT_IEnumCATEGORYINFO_Vtbl

const IEnumCATEGORYINFOVtbl COMCAT_IEnumCATEGORYINFO_Vtbl
static
Initial value:
=
{
}
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 HRESULT WINAPI COMCAT_IEnumCATEGORYINFO_Skip(IEnumCATEGORYINFO *iface, ULONG celt)
Definition: comcat.c:814
static ULONG WINAPI COMCAT_IEnumCATEGORYINFO_Release(IEnumCATEGORYINFO *iface)
Definition: comcat.c:753
static HRESULT WINAPI COMCAT_IEnumCATEGORYINFO_Next(IEnumCATEGORYINFO *iface, ULONG celt, CATEGORYINFO *rgelt, ULONG *pceltFetched)
Definition: comcat.c:769
static HRESULT WINAPI COMCAT_IEnumCATEGORYINFO_Reset(IEnumCATEGORYINFO *iface)
Definition: comcat.c:827

Definition at line 862 of file comcat.c.

Referenced by EnumCATEGORYINFO_Construct().

◆ comcat_keyname

const WCHAR comcat_keyname[] = L"Component Categories"
static

◆ impl_keyname

const WCHAR impl_keyname[] = L"Implemented Categories"
static

◆ req_keyname

const WCHAR req_keyname[] = L"Required Categories"
static