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

Function IsEqualObject

ThirdParty/ASIO/common/combase.cpp:169–202  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

167/* Compares two interfaces and returns TRUE if they are on the same object */
168
169BOOL IsEqualObject(IUnknown *pFirst, IUnknown *pSecond)
170{
171 /* Different objects can't have the same interface pointer for
172 any interface
173 */
174 if (pFirst == pSecond) {
175 return TRUE;
176 }
177 /* OK - do it the hard way - check if they have the same
178 IUnknown pointers - a single object can only have one of these
179 */
180 LPUNKNOWN pUnknown1; // Retrieve the IUnknown interface
181 LPUNKNOWN pUnknown2; // Retrieve the other IUnknown interface
182 HRESULT hr; // General OLE return code
183
184 ASSERT(pFirst);
185 ASSERT(pSecond);
186
187 /* See if the IUnknown pointers match */
188
189 hr = pFirst->QueryInterface(IID_IUnknown,(void **) &pUnknown1);
190 ASSERT(SUCCEEDED(hr));
191 ASSERT(pUnknown1);
192
193 hr = pSecond->QueryInterface(IID_IUnknown,(void **) &pUnknown2);
194 ASSERT(SUCCEEDED(hr));
195 ASSERT(pUnknown2);
196
197 /* Release the extra interfaces we hold */
198
199 pUnknown1->Release();
200 pUnknown2->Release();
201 return (pUnknown1 == pUnknown2);
202}

Callers

nothing calls this directly

Calls 2

QueryInterfaceMethod · 0.80
ReleaseMethod · 0.80

Tested by

no test coverage detected