Ignore:
Timestamp:
Sep 15, 2001, 11:32:00 AM (24 years ago)
Author:
sandervl
Message:

restored old version + wine update

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/oleaut32/connpt.c

    r6689 r6711  
    7272  CONNECTDATA *pCD;
    7373  DWORD nConns;
    74 
     74 
    7575  /* Next connection to enumerate from */
    7676  DWORD nCur;
     
    7979
    8080static EnumConnectionsImpl *EnumConnectionsImpl_Construct(IUnknown *pUnk,
    81                               DWORD nSinks,
    82                               CONNECTDATA *pCD);
     81                                                          DWORD nSinks,
     82                                                          CONNECTDATA *pCD);
    8383
    8484
     
    8787 */
    8888static ConnectionPointImpl *ConnectionPointImpl_Construct(IUnknown *pUnk,
    89                               REFIID riid)
     89                                                          REFIID riid)
    9090{
    9191  ConnectionPointImpl *Obj;
     
    9797  Obj->iid =  *riid;
    9898  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);
    101101  Obj->nSinks = 0;
    102102  return Obj;
     
    139139  if ( (This==0) || (ppvObject==0) )
    140140    return E_INVALIDARG;
    141 
     141 
    142142  /*
    143143   * Initialize the return parameter.
    144144   */
    145145  *ppvObject = 0;
    146 
     146 
    147147  /*
    148148   * Compare the riid with the interface IDs implemented by this object.
    149149   */
    150   if (memcmp(&IID_IUnknown, riid, sizeof(IID_IUnknown)) == 0)
     150  if (memcmp(&IID_IUnknown, riid, sizeof(IID_IUnknown)) == 0) 
    151151  {
    152152    *ppvObject = (IConnectionPoint*)This;
    153153  }
    154   else if (memcmp(&IID_IConnectionPoint, riid, sizeof(IID_IConnectionPoint)) == 0)
     154  else if (memcmp(&IID_IConnectionPoint, riid, sizeof(IID_IConnectionPoint)) == 0) 
    155155  {
    156156    *ppvObject = (IConnectionPoint*)This;
    157157  }
    158 
     158 
    159159  /*
    160160   * Check that we obtained an interface.
     
    165165    return E_NOINTERFACE;
    166166  }
    167 
     167 
    168168  /*
    169169   * Query Interface always increases the reference count by one when it is
     
    189189  return This->ref;
    190190}
    191 
     191       
    192192/************************************************************************
    193193 * ConnectionPointImpl_Release (IUnknown)
     
    195195 * See Windows documentation for more details on IUnknown methods.
    196196 */
    197 static ULONG WINAPI ConnectionPointImpl_Release(
     197static ULONG WINAPI ConnectionPointImpl_Release( 
    198198      IConnectionPoint* iface)
    199199{
     
    215215    return 0;
    216216  }
    217 
     217 
    218218  return This->ref;
    219219}
     
    224224 */
    225225static HRESULT WINAPI ConnectionPointImpl_GetConnectionInterface(
    226                            IConnectionPoint *iface,
    227                            IID              *piid)
     226                                               IConnectionPoint *iface,
     227                                               IID              *piid)
    228228{
    229229  ICOM_THIS(ConnectionPointImpl, iface);
     
    238238 */
    239239static HRESULT WINAPI ConnectionPointImpl_GetConnectionPointContainer(
    240                       IConnectionPoint           *iface,
    241                       IConnectionPointContainer  **ppCPC)
     240                                      IConnectionPoint           *iface,
     241                                      IConnectionPointContainer  **ppCPC)
    242242{
    243243  ICOM_THIS(ConnectionPointImpl, iface);
     
    245245
    246246  return IUnknown_QueryInterface(This->Obj,
    247                 &IID_IConnectionPointContainer,
    248                 (LPVOID)ppCPC);
     247                                &IID_IConnectionPointContainer,
     248                                (LPVOID)ppCPC);
    249249}
    250250
     
    254254 */
    255255static HRESULT WINAPI ConnectionPointImpl_Advise(IConnectionPoint *iface,
    256                         IUnknown *lpUnk,
    257                         DWORD *pdwCookie)
     256                                                IUnknown *lpUnk,
     257                                                DWORD *pdwCookie)
    258258{
    259259  DWORD i;
     
    273273    This->maxSinks += MAXSINKS;
    274274    This->sinks = HeapReAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, This->sinks,
    275                   This->maxSinks * sizeof(IUnknown *));
     275                              This->maxSinks * sizeof(IUnknown *));
    276276  }
    277277  This->sinks[i] = lpSink;
     
    287287 */
    288288static HRESULT WINAPI ConnectionPointImpl_Unadvise(IConnectionPoint *iface,
    289                            DWORD dwCookie)
     289                                                   DWORD dwCookie)
    290290{
    291291  ICOM_THIS(ConnectionPointImpl, iface);
     
    307307 */
    308308static HRESULT WINAPI ConnectionPointImpl_EnumConnections(
    309                             IConnectionPoint *iface,
    310                             LPENUMCONNECTIONS *ppEnum)
    311 {
     309                                                    IConnectionPoint *iface,
     310                                                    LPENUMCONNECTIONS *ppEnum)
     311{ 
    312312  ICOM_THIS(ConnectionPointImpl, iface);
    313313  CONNECTDATA *pCD;
     
    317317
    318318  TRACE("(%p)->(%p)\n", This, ppEnum);
    319 
     319 
    320320  *ppEnum = NULL;
    321321
     
    339339  EnumObj = EnumConnectionsImpl_Construct((IUnknown*)This, This->nSinks, pCD);
    340340  hr = IEnumConnections_QueryInterface((IEnumConnections*)EnumObj,
    341                   &IID_IEnumConnections, (LPVOID)ppEnum);
     341                                  &IID_IEnumConnections, (LPVOID)ppEnum);
    342342  IEnumConnections_Release((IEnumConnections*)EnumObj);
    343343
     
    367367 */
    368368static EnumConnectionsImpl *EnumConnectionsImpl_Construct(IUnknown *pUnk,
    369                               DWORD nSinks,
    370                               CONNECTDATA *pCD)
     369                                                          DWORD nSinks,
     370                                                          CONNECTDATA *pCD)
    371371{
    372372  EnumConnectionsImpl *Obj = HeapAlloc(GetProcessHeap(), 0, sizeof(*Obj));
     
    420420  if ( (This==0) || (ppvObject==0) )
    421421    return E_INVALIDARG;
    422 
     422 
    423423  /*
    424424   * Initialize the return parameter.
    425425   */
    426426  *ppvObject = 0;
    427 
     427 
    428428  /*
    429429   * Compare the riid with the interface IDs implemented by this object.
    430430   */
    431   if (memcmp(&IID_IUnknown, riid, sizeof(IID_IUnknown)) == 0)
     431  if (memcmp(&IID_IUnknown, riid, sizeof(IID_IUnknown)) == 0) 
    432432  {
    433433    *ppvObject = (IEnumConnections*)This;
    434434  }
    435   else if (memcmp(&IID_IEnumConnections, riid, sizeof(IID_IEnumConnections)) == 0)
     435  else if (memcmp(&IID_IEnumConnections, riid, sizeof(IID_IEnumConnections)) == 0) 
    436436  {
    437437    *ppvObject = (IEnumConnections*)This;
    438438  }
    439 
     439 
    440440  /*
    441441   * Check that we obtained an interface.
     
    446446    return E_NOINTERFACE;
    447447  }
    448 
     448 
    449449  /*
    450450   * Query Interface always increases the reference count by one when it is
     
    470470  return This->ref;
    471471}
    472 
     472       
    473473/************************************************************************
    474474 * EnumConnectionsImpl_Release (IUnknown)
     
    497497    return 0;
    498498  }
    499 
     499 
    500500  return This->ref;
    501501}
     
    506506 */
    507507static HRESULT WINAPI EnumConnectionsImpl_Next(IEnumConnections* iface,
    508                            ULONG cConn, LPCONNECTDATA pCD,
    509                            ULONG *pEnum)
     508                                               ULONG cConn, LPCONNECTDATA pCD,
     509                                               ULONG *pEnum)
    510510{
    511511  ICOM_THIS(EnumConnectionsImpl, iface);
     
    542542 */
    543543static HRESULT WINAPI EnumConnectionsImpl_Skip(IEnumConnections* iface,
    544                            ULONG cSkip)
     544                                               ULONG cSkip)
    545545{
    546546  ICOM_THIS(EnumConnectionsImpl, iface);
     
    576576 */
    577577static HRESULT WINAPI EnumConnectionsImpl_Clone(IEnumConnections* iface,
    578                         LPENUMCONNECTIONS *ppEnum)
     578                                                LPENUMCONNECTIONS *ppEnum)
    579579{
    580580  ICOM_THIS(EnumConnectionsImpl, iface);
    581581  EnumConnectionsImpl *newObj;
    582582  TRACE("(%p)->(%p)\n", This, ppEnum);
    583 
     583 
    584584  newObj = EnumConnectionsImpl_Construct(This->pUnk, This->nConns, This->pCD);
    585585  newObj->nCur = This->nCur;
     
    588588  return S_OK;
    589589}
    590 
     590 
    591591static ICOM_VTABLE(IEnumConnections) EnumConnectionsImpl_VTable =
    592592{
     
    616616 */
    617617HRESULT CreateConnectionPoint(IUnknown *pUnk, REFIID riid,
    618                   IConnectionPoint **pCP)
     618                              IConnectionPoint **pCP)
    619619{
    620620  ConnectionPointImpl *Obj;
     
    624624  if(!Obj) return E_OUTOFMEMORY;
    625625
    626   hr = IConnectionPoint_QueryInterface((IConnectionPoint *)Obj,
    627                        &IID_IConnectionPoint, (LPVOID)pCP);
     626  hr = IConnectionPoint_QueryInterface((IConnectionPoint *)Obj, 
     627                                       &IID_IConnectionPoint, (LPVOID)pCP);
    628628  IConnectionPoint_Release((IConnectionPoint *)Obj);
    629629  return hr;
Note: See TracChangeset for help on using the changeset viewer.