MCPcopy Create free account
hub / github.com/DamRsn/NeuralNote / DllGetClassObject

Function DllGetClassObject

ThirdParty/ASIO/common/dllentry.cpp:176–202  ·  view source on GitHub ↗

called by COM to get the class factory object for a given class

Source from the content-addressed store, hash-verified

174
175//called by COM to get the class factory object for a given class
176STDAPI DllGetClassObject(REFCLSID rClsID,REFIID riid,void **pv)
177{
178 // DebugBreak();
179
180 if (!(riid == IID_IUnknown) && !(riid == IID_IClassFactory)) {
181 return E_NOINTERFACE;
182 }
183
184 // traverse the array of templates looking for one with this
185 // class id
186 for (int i = 0; i < g_cTemplates; i++) {
187 const CFactoryTemplate * pT = &g_Templates[i];
188 if (pT->IsClassID(rClsID)) {
189
190 // found a template - make a class factory based on this
191 // template
192
193 *pv = (LPVOID) (LPUNKNOWN) new CClassFactory(pT);
194 if (*pv == NULL) {
195 return E_OUTOFMEMORY;
196 }
197 ((LPUNKNOWN)*pv)->AddRef();
198 return NOERROR;
199 }
200 }
201 return CLASS_E_CLASSNOTAVAILABLE;
202}
203
204//
205// Call any initialization routines

Callers

nothing calls this directly

Calls 2

IsClassIDMethod · 0.80
AddRefMethod · 0.80

Tested by

no test coverage detected