| 167 | /* Compares two interfaces and returns TRUE if they are on the same object */ |
| 168 | |
| 169 | BOOL 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 | } |
nothing calls this directly
no test coverage detected