Changeset 6711 for trunk/src/oleaut32/connpt.c
- Timestamp:
- Sep 15, 2001, 11:32:00 AM (24 years ago)
- File:
-
- 1 edited
-
trunk/src/oleaut32/connpt.c (modified) (29 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/oleaut32/connpt.c
r6689 r6711 72 72 CONNECTDATA *pCD; 73 73 DWORD nConns; 74 74 75 75 /* Next connection to enumerate from */ 76 76 DWORD nCur; … … 79 79 80 80 static EnumConnectionsImpl *EnumConnectionsImpl_Construct(IUnknown *pUnk, 81 DWORD nSinks,82 CONNECTDATA *pCD);81 DWORD nSinks, 82 CONNECTDATA *pCD); 83 83 84 84 … … 87 87 */ 88 88 static ConnectionPointImpl *ConnectionPointImpl_Construct(IUnknown *pUnk, 89 REFIID riid)89 REFIID riid) 90 90 { 91 91 ConnectionPointImpl *Obj; … … 97 97 Obj->iid = *riid; 98 98 Obj->maxSinks = MAXSINKS; 99 Obj->sinks = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, 100 sizeof(IUnknown*) * MAXSINKS);99 Obj->sinks = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, 100 sizeof(IUnknown*) * MAXSINKS); 101 101 Obj->nSinks = 0; 102 102 return Obj; … … 139 139 if ( (This==0) || (ppvObject==0) ) 140 140 return E_INVALIDARG; 141 141 142 142 /* 143 143 * Initialize the return parameter. 144 144 */ 145 145 *ppvObject = 0; 146 146 147 147 /* 148 148 * Compare the riid with the interface IDs implemented by this object. 149 149 */ 150 if (memcmp(&IID_IUnknown, riid, sizeof(IID_IUnknown)) == 0) 150 if (memcmp(&IID_IUnknown, riid, sizeof(IID_IUnknown)) == 0) 151 151 { 152 152 *ppvObject = (IConnectionPoint*)This; 153 153 } 154 else if (memcmp(&IID_IConnectionPoint, riid, sizeof(IID_IConnectionPoint)) == 0) 154 else if (memcmp(&IID_IConnectionPoint, riid, sizeof(IID_IConnectionPoint)) == 0) 155 155 { 156 156 *ppvObject = (IConnectionPoint*)This; 157 157 } 158 158 159 159 /* 160 160 * Check that we obtained an interface. … … 165 165 return E_NOINTERFACE; 166 166 } 167 167 168 168 /* 169 169 * Query Interface always increases the reference count by one when it is … … 189 189 return This->ref; 190 190 } 191 191 192 192 /************************************************************************ 193 193 * ConnectionPointImpl_Release (IUnknown) … … 195 195 * See Windows documentation for more details on IUnknown methods. 196 196 */ 197 static ULONG WINAPI ConnectionPointImpl_Release( 197 static ULONG WINAPI ConnectionPointImpl_Release( 198 198 IConnectionPoint* iface) 199 199 { … … 215 215 return 0; 216 216 } 217 217 218 218 return This->ref; 219 219 } … … 224 224 */ 225 225 static HRESULT WINAPI ConnectionPointImpl_GetConnectionInterface( 226 IConnectionPoint *iface,227 IID *piid)226 IConnectionPoint *iface, 227 IID *piid) 228 228 { 229 229 ICOM_THIS(ConnectionPointImpl, iface); … … 238 238 */ 239 239 static HRESULT WINAPI ConnectionPointImpl_GetConnectionPointContainer( 240 IConnectionPoint *iface,241 IConnectionPointContainer **ppCPC)240 IConnectionPoint *iface, 241 IConnectionPointContainer **ppCPC) 242 242 { 243 243 ICOM_THIS(ConnectionPointImpl, iface); … … 245 245 246 246 return IUnknown_QueryInterface(This->Obj, 247 &IID_IConnectionPointContainer,248 (LPVOID)ppCPC);247 &IID_IConnectionPointContainer, 248 (LPVOID)ppCPC); 249 249 } 250 250 … … 254 254 */ 255 255 static HRESULT WINAPI ConnectionPointImpl_Advise(IConnectionPoint *iface, 256 IUnknown *lpUnk,257 DWORD *pdwCookie)256 IUnknown *lpUnk, 257 DWORD *pdwCookie) 258 258 { 259 259 DWORD i; … … 273 273 This->maxSinks += MAXSINKS; 274 274 This->sinks = HeapReAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, This->sinks, 275 This->maxSinks * sizeof(IUnknown *));275 This->maxSinks * sizeof(IUnknown *)); 276 276 } 277 277 This->sinks[i] = lpSink; … … 287 287 */ 288 288 static HRESULT WINAPI ConnectionPointImpl_Unadvise(IConnectionPoint *iface, 289 DWORD dwCookie)289 DWORD dwCookie) 290 290 { 291 291 ICOM_THIS(ConnectionPointImpl, iface); … … 307 307 */ 308 308 static HRESULT WINAPI ConnectionPointImpl_EnumConnections( 309 IConnectionPoint *iface,310 LPENUMCONNECTIONS *ppEnum)311 { 309 IConnectionPoint *iface, 310 LPENUMCONNECTIONS *ppEnum) 311 { 312 312 ICOM_THIS(ConnectionPointImpl, iface); 313 313 CONNECTDATA *pCD; … … 317 317 318 318 TRACE("(%p)->(%p)\n", This, ppEnum); 319 319 320 320 *ppEnum = NULL; 321 321 … … 339 339 EnumObj = EnumConnectionsImpl_Construct((IUnknown*)This, This->nSinks, pCD); 340 340 hr = IEnumConnections_QueryInterface((IEnumConnections*)EnumObj, 341 &IID_IEnumConnections, (LPVOID)ppEnum);341 &IID_IEnumConnections, (LPVOID)ppEnum); 342 342 IEnumConnections_Release((IEnumConnections*)EnumObj); 343 343 … … 367 367 */ 368 368 static EnumConnectionsImpl *EnumConnectionsImpl_Construct(IUnknown *pUnk, 369 DWORD nSinks,370 CONNECTDATA *pCD)369 DWORD nSinks, 370 CONNECTDATA *pCD) 371 371 { 372 372 EnumConnectionsImpl *Obj = HeapAlloc(GetProcessHeap(), 0, sizeof(*Obj)); … … 420 420 if ( (This==0) || (ppvObject==0) ) 421 421 return E_INVALIDARG; 422 422 423 423 /* 424 424 * Initialize the return parameter. 425 425 */ 426 426 *ppvObject = 0; 427 427 428 428 /* 429 429 * Compare the riid with the interface IDs implemented by this object. 430 430 */ 431 if (memcmp(&IID_IUnknown, riid, sizeof(IID_IUnknown)) == 0) 431 if (memcmp(&IID_IUnknown, riid, sizeof(IID_IUnknown)) == 0) 432 432 { 433 433 *ppvObject = (IEnumConnections*)This; 434 434 } 435 else if (memcmp(&IID_IEnumConnections, riid, sizeof(IID_IEnumConnections)) == 0) 435 else if (memcmp(&IID_IEnumConnections, riid, sizeof(IID_IEnumConnections)) == 0) 436 436 { 437 437 *ppvObject = (IEnumConnections*)This; 438 438 } 439 439 440 440 /* 441 441 * Check that we obtained an interface. … … 446 446 return E_NOINTERFACE; 447 447 } 448 448 449 449 /* 450 450 * Query Interface always increases the reference count by one when it is … … 470 470 return This->ref; 471 471 } 472 472 473 473 /************************************************************************ 474 474 * EnumConnectionsImpl_Release (IUnknown) … … 497 497 return 0; 498 498 } 499 499 500 500 return This->ref; 501 501 } … … 506 506 */ 507 507 static HRESULT WINAPI EnumConnectionsImpl_Next(IEnumConnections* iface, 508 ULONG cConn, LPCONNECTDATA pCD,509 ULONG *pEnum)508 ULONG cConn, LPCONNECTDATA pCD, 509 ULONG *pEnum) 510 510 { 511 511 ICOM_THIS(EnumConnectionsImpl, iface); … … 542 542 */ 543 543 static HRESULT WINAPI EnumConnectionsImpl_Skip(IEnumConnections* iface, 544 ULONG cSkip)544 ULONG cSkip) 545 545 { 546 546 ICOM_THIS(EnumConnectionsImpl, iface); … … 576 576 */ 577 577 static HRESULT WINAPI EnumConnectionsImpl_Clone(IEnumConnections* iface, 578 LPENUMCONNECTIONS *ppEnum)578 LPENUMCONNECTIONS *ppEnum) 579 579 { 580 580 ICOM_THIS(EnumConnectionsImpl, iface); 581 581 EnumConnectionsImpl *newObj; 582 582 TRACE("(%p)->(%p)\n", This, ppEnum); 583 583 584 584 newObj = EnumConnectionsImpl_Construct(This->pUnk, This->nConns, This->pCD); 585 585 newObj->nCur = This->nCur; … … 588 588 return S_OK; 589 589 } 590 590 591 591 static ICOM_VTABLE(IEnumConnections) EnumConnectionsImpl_VTable = 592 592 { … … 616 616 */ 617 617 HRESULT CreateConnectionPoint(IUnknown *pUnk, REFIID riid, 618 IConnectionPoint **pCP)618 IConnectionPoint **pCP) 619 619 { 620 620 ConnectionPointImpl *Obj; … … 624 624 if(!Obj) return E_OUTOFMEMORY; 625 625 626 hr = IConnectionPoint_QueryInterface((IConnectionPoint *)Obj, 627 &IID_IConnectionPoint, (LPVOID)pCP);626 hr = IConnectionPoint_QueryInterface((IConnectionPoint *)Obj, 627 &IID_IConnectionPoint, (LPVOID)pCP); 628 628 IConnectionPoint_Release((IConnectionPoint *)Obj); 629 629 return hr;
Note:
See TracChangeset
for help on using the changeset viewer.
