ReactOS  0.4.13-dev-551-gf37fb1f
oleobj.c
Go to the documentation of this file.
1 /*
2  * OLE2 COM objects
3  *
4  * Copyright 1998 Eric Kohl
5  * Copyright 1999 Francis Beaudet
6  *
7  * This library is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Lesser General Public
9  * License as published by the Free Software Foundation; either
10  * version 2.1 of the License, or (at your option) any later version.
11  *
12  * This library is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  * Lesser General Public License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public
18  * License along with this library; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
20  */
21 
22 
23 #include <stdarg.h>
24 #include <string.h>
25 
26 #define COBJMACROS
27 #define NONAMELESSUNION
28 
29 #include "windef.h"
30 #include "winbase.h"
31 #include "winuser.h"
32 #include "winerror.h"
33 #include "wine/debug.h"
34 #include "ole2.h"
35 
36 #include "compobj_private.h"
37 
39 
40 #define INITIAL_SINKS 10
41 
42 static void release_statdata(STATDATA *data)
43 {
44  if(data->formatetc.ptd)
45  {
46  CoTaskMemFree(data->formatetc.ptd);
47  data->formatetc.ptd = NULL;
48  }
49 
50  if(data->pAdvSink)
51  {
52  IAdviseSink_Release(data->pAdvSink);
53  data->pAdvSink = NULL;
54  }
55 }
56 
57 static HRESULT copy_statdata(STATDATA *dst, const STATDATA *src)
58 {
59  HRESULT hr;
60 
61  hr = copy_formatetc( &dst->formatetc, &src->formatetc );
62  if (FAILED(hr)) return hr;
63  dst->advf = src->advf;
64  dst->pAdvSink = src->pAdvSink;
65  if (dst->pAdvSink) IAdviseSink_AddRef( dst->pAdvSink );
66  dst->dwConnection = src->dwConnection;
67  return S_OK;
68 }
69 
70 /**************************************************************************
71  * EnumSTATDATA Implementation
72  */
73 
74 typedef struct
75 {
78 
81  STATDATA *statdata;
83 } EnumSTATDATA;
84 
86 {
87  return CONTAINING_RECORD(iface, EnumSTATDATA, IEnumSTATDATA_iface);
88 }
89 
91 {
92  TRACE("(%s, %p)\n", debugstr_guid(riid), ppv);
93  if (IsEqualIID(riid, &IID_IUnknown) ||
95  {
96  IEnumSTATDATA_AddRef(iface);
97  *ppv = iface;
98  return S_OK;
99  }
100  return E_NOINTERFACE;
101 }
102 
104 {
106  TRACE("()\n");
107  return InterlockedIncrement(&This->ref);
108 }
109 
111 {
113  LONG refs = InterlockedDecrement(&This->ref);
114  TRACE("()\n");
115  if (!refs)
116  {
117  DWORD i;
118  for(i = 0; i < This->num_of_elems; i++)
119  release_statdata(This->statdata + i);
120  HeapFree(GetProcessHeap(), 0, This->statdata);
121  if (This->holder) IUnknown_Release(This->holder);
123  }
124  return refs;
125 }
126 
128  ULONG *fetched)
129 {
131  DWORD count = 0;
132  HRESULT hr = S_OK;
133 
134  TRACE("(%d, %p, %p)\n", num, data, fetched);
135 
136  while(num--)
137  {
138  if (This->index >= This->num_of_elems)
139  {
140  hr = S_FALSE;
141  break;
142  }
143 
144  copy_statdata(data + count, This->statdata + This->index);
145 
146  count++;
147  This->index++;
148  }
149 
150  if (fetched) *fetched = count;
151 
152  return hr;
153 }
154 
156 {
158 
159  TRACE("(%d)\n", num);
160 
161  if(This->index + num >= This->num_of_elems)
162  {
163  This->index = This->num_of_elems;
164  return S_FALSE;
165  }
166 
167  This->index += num;
168  return S_OK;
169 }
170 
172 {
174 
175  TRACE("()\n");
176 
177  This->index = 0;
178  return S_OK;
179 }
180 
182 {
184 
185  return EnumSTATDATA_Construct(This->holder, This->index, This->num_of_elems, This->statdata,
186  TRUE, ppenum);
187 }
188 
189 static const IEnumSTATDATAVtbl EnumSTATDATA_VTable =
190 {
198 };
199 
200 HRESULT EnumSTATDATA_Construct(IUnknown *holder, ULONG index, DWORD array_len, STATDATA *data,
201  BOOL copy, IEnumSTATDATA **ppenum)
202 {
203  EnumSTATDATA *This = HeapAlloc(GetProcessHeap(), 0, sizeof(*This));
204  DWORD i, count;
205 
206  if (!This) return E_OUTOFMEMORY;
207 
208  This->IEnumSTATDATA_iface.lpVtbl = &EnumSTATDATA_VTable;
209  This->ref = 1;
210  This->index = index;
211 
212  if (copy)
213  {
214  This->statdata = HeapAlloc(GetProcessHeap(), 0, array_len * sizeof(*This->statdata));
215  if(!This->statdata)
216  {
218  return E_OUTOFMEMORY;
219  }
220 
221  for(i = 0, count = 0; i < array_len; i++)
222  {
223  if(data[i].pAdvSink)
224  {
225  copy_statdata(This->statdata + count, data + i);
226  count++;
227  }
228  }
229  }
230  else
231  {
232  This->statdata = data;
233  count = array_len;
234  }
235 
236  This->num_of_elems = count;
237  This->holder = holder;
238  if (holder) IUnknown_AddRef(holder);
239  *ppenum = &This->IEnumSTATDATA_iface;
240  return S_OK;
241 }
242 
243 /**************************************************************************
244  * OleAdviseHolder Implementation
245  */
246 typedef struct
247 {
249 
251 
253  STATDATA *connections;
255 
257 {
258  return CONTAINING_RECORD(iface, OleAdviseHolderImpl, IOleAdviseHolder_iface);
259 }
260 
261 /**************************************************************************
262  * OleAdviseHolderImpl_Destructor
263  */
265 {
266  DWORD index;
267  TRACE("%p\n", This);
268 
269  for (index = 0; index < This->max_cons; index++)
270  {
271  if (This->connections[index].pAdvSink != NULL)
272  release_statdata(This->connections + index);
273  }
274 
275  HeapFree(GetProcessHeap(), 0, This->connections);
277 }
278 
279 /**************************************************************************
280  * OleAdviseHolderImpl_QueryInterface
281  */
283  REFIID iid, void **obj)
284 {
286  TRACE("(%p)->(%s,%p)\n",This, debugstr_guid(iid), obj);
287 
288  if (obj == NULL)
289  return E_POINTER;
290 
291  *obj = NULL;
292 
293  if (IsEqualIID(iid, &IID_IUnknown) ||
295  {
296  *obj = &This->IOleAdviseHolder_iface;
297  }
298 
299  if(*obj == NULL)
300  return E_NOINTERFACE;
301 
302  IUnknown_AddRef((IUnknown*)*obj);
303 
304  return S_OK;
305 }
306 
307 /******************************************************************************
308  * OleAdviseHolderImpl_AddRef
309  */
311 {
314 
315  TRACE("(%p)->(ref=%d)\n", This, ref - 1);
316 
317  return ref;
318 }
319 
320 /******************************************************************************
321  * OleAdviseHolderImpl_Release
322  */
324 {
326  ULONG ref;
327  TRACE("(%p)->(ref=%d)\n", This, This->ref);
328  ref = InterlockedDecrement(&This->ref);
329 
331 
332  return ref;
333 }
334 
335 /******************************************************************************
336  * OleAdviseHolderImpl_Advise
337  */
339  IAdviseSink *pAdvise,
340  DWORD *pdwConnection)
341 {
342  DWORD index;
344  STATDATA new_conn;
345  static const FORMATETC empty_fmtetc = {0, NULL, 0, -1, 0};
346 
347  TRACE("(%p)->(%p, %p)\n", This, pAdvise, pdwConnection);
348 
349  if (pdwConnection==NULL)
350  return E_POINTER;
351 
352  *pdwConnection = 0;
353 
354  for (index = 0; index < This->max_cons; index++)
355  {
356  if (This->connections[index].pAdvSink == NULL)
357  break;
358  }
359 
360  if (index == This->max_cons)
361  {
362  This->max_cons += INITIAL_SINKS;
363  This->connections = HeapReAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, This->connections,
364  This->max_cons * sizeof(*This->connections));
365  }
366 
367  new_conn.pAdvSink = pAdvise;
368  new_conn.advf = 0;
369  new_conn.formatetc = empty_fmtetc;
370  new_conn.dwConnection = index + 1; /* 0 is not a valid cookie, so increment the index */
371 
372  copy_statdata(This->connections + index, &new_conn);
373 
374  *pdwConnection = new_conn.dwConnection;
375 
376  return S_OK;
377 }
378 
379 /******************************************************************************
380  * OleAdviseHolderImpl_Unadvise
381  */
383  DWORD dwConnection)
384 {
386  DWORD index;
387 
388  TRACE("(%p)->(%u)\n", This, dwConnection);
389 
390  /* The connection number is 1 more than the index, see OleAdviseHolder_Advise */
391  index = dwConnection - 1;
392 
393  if (index >= This->max_cons || This->connections[index].pAdvSink == NULL)
394  return OLE_E_NOCONNECTION;
395 
396  release_statdata(This->connections + index);
397 
398  return S_OK;
399 }
400 
401 /******************************************************************************
402  * OleAdviseHolderImpl_EnumAdvise
403  */
405 {
407  IUnknown *unk;
408  HRESULT hr;
409 
410  TRACE("(%p)->(%p)\n", This, enum_advise);
411 
412  IOleAdviseHolder_QueryInterface(iface, &IID_IUnknown, (void**)&unk);
413  hr = EnumSTATDATA_Construct(unk, 0, This->max_cons, This->connections, TRUE, enum_advise);
414  IUnknown_Release(unk);
415  return hr;
416 }
417 
418 /******************************************************************************
419  * OleAdviseHolderImpl_SendOnRename
420  */
422 {
423  IEnumSTATDATA *pEnum;
424  HRESULT hr;
425 
426  TRACE("(%p)->(%p)\n", iface, pmk);
427 
428  hr = IOleAdviseHolder_EnumAdvise(iface, &pEnum);
429  if (SUCCEEDED(hr))
430  {
431  STATDATA statdata;
432  while (IEnumSTATDATA_Next(pEnum, 1, &statdata, NULL) == S_OK)
433  {
434  IAdviseSink_OnRename(statdata.pAdvSink, pmk);
435 
436  IAdviseSink_Release(statdata.pAdvSink);
437  }
438  IEnumSTATDATA_Release(pEnum);
439  }
440 
441  return hr;
442 }
443 
444 /******************************************************************************
445  * OleAdviseHolderImpl_SendOnSave
446  */
448 {
449  IEnumSTATDATA *pEnum;
450  HRESULT hr;
451 
452  TRACE("(%p)->()\n", iface);
453 
454  hr = IOleAdviseHolder_EnumAdvise(iface, &pEnum);
455  if (SUCCEEDED(hr))
456  {
457  STATDATA statdata;
458  while (IEnumSTATDATA_Next(pEnum, 1, &statdata, NULL) == S_OK)
459  {
460  IAdviseSink_OnSave(statdata.pAdvSink);
461 
462  IAdviseSink_Release(statdata.pAdvSink);
463  }
464  IEnumSTATDATA_Release(pEnum);
465  }
466 
467  return hr;
468 }
469 
470 /******************************************************************************
471  * OleAdviseHolderImpl_SendOnClose
472  */
474 {
475  IEnumSTATDATA *pEnum;
476  HRESULT hr;
477 
478  TRACE("(%p)->()\n", iface);
479 
480  hr = IOleAdviseHolder_EnumAdvise(iface, &pEnum);
481  if (SUCCEEDED(hr))
482  {
483  STATDATA statdata;
484  while (IEnumSTATDATA_Next(pEnum, 1, &statdata, NULL) == S_OK)
485  {
486  IAdviseSink_OnClose(statdata.pAdvSink);
487 
488  IAdviseSink_Release(statdata.pAdvSink);
489  }
490  IEnumSTATDATA_Release(pEnum);
491  }
492 
493  return hr;
494 }
495 
496 /**************************************************************************
497  * OleAdviseHolderImpl_VTable
498  */
499 static const IOleAdviseHolderVtbl oahvt =
500 {
510 };
511 
512 /**************************************************************************
513  * OleAdviseHolderImpl_Constructor
514  */
515 
517 {
518  OleAdviseHolderImpl* lpoah;
519 
520  lpoah = HeapAlloc(GetProcessHeap(), 0, sizeof(OleAdviseHolderImpl));
521 
522  lpoah->IOleAdviseHolder_iface.lpVtbl = &oahvt;
523  lpoah->ref = 1;
524  lpoah->max_cons = INITIAL_SINKS;
526  lpoah->max_cons * sizeof(*lpoah->connections));
527 
528  TRACE("returning %p\n", &lpoah->IOleAdviseHolder_iface);
529  return &lpoah->IOleAdviseHolder_iface;
530 }
531 
532 /**************************************************************************
533  * DataAdviseHolder Implementation
534  */
535 typedef struct
536 {
538 
541  STATDATA* connections;
545 
546 /* this connection has also has been advised to the delegate data object */
547 #define WINE_ADVF_REMOTE 0x80000000
548 
550 {
551  return CONTAINING_RECORD(iface, DataAdviseHolder, IDataAdviseHolder_iface);
552 }
553 
554 /******************************************************************************
555  * DataAdviseHolder_Destructor
556  */
558 {
559  DWORD index;
560  TRACE("%p\n", ptrToDestroy);
561 
562  for (index = 0; index < ptrToDestroy->maxCons; index++)
563  {
564  if (ptrToDestroy->connections[index].pAdvSink != NULL)
565  {
566  if (ptrToDestroy->delegate &&
567  (ptrToDestroy->connections[index].advf & WINE_ADVF_REMOTE))
568  IDataObject_DUnadvise(ptrToDestroy->delegate,
569  ptrToDestroy->remote_connections[index]);
570 
571  release_statdata(ptrToDestroy->connections + index);
572  }
573  }
574 
575  HeapFree(GetProcessHeap(), 0, ptrToDestroy->remote_connections);
576  HeapFree(GetProcessHeap(), 0, ptrToDestroy->connections);
577  HeapFree(GetProcessHeap(), 0, ptrToDestroy);
578 }
579 
580 /************************************************************************
581  * DataAdviseHolder_QueryInterface (IUnknown)
582  */
584  REFIID riid, void **ppvObject)
585 {
587  TRACE("(%p)->(%s,%p)\n",This,debugstr_guid(riid),ppvObject);
588 
589  if ( (This==0) || (ppvObject==0) )
590  return E_INVALIDARG;
591 
592  *ppvObject = 0;
593 
594  if ( IsEqualIID(&IID_IUnknown, riid) ||
596  {
597  *ppvObject = iface;
598  }
599 
600  if ((*ppvObject)==0)
601  {
602  return E_NOINTERFACE;
603  }
604 
605  IUnknown_AddRef((IUnknown*)*ppvObject);
606  return S_OK;
607 }
608 
609 /************************************************************************
610  * DataAdviseHolder_AddRef (IUnknown)
611  */
613 {
615  TRACE("(%p) (ref=%d)\n", This, This->ref);
616  return InterlockedIncrement(&This->ref);
617 }
618 
619 /************************************************************************
620  * DataAdviseHolder_Release (IUnknown)
621  */
623 {
625  ULONG ref;
626  TRACE("(%p) (ref=%d)\n", This, This->ref);
627 
628  ref = InterlockedDecrement(&This->ref);
630 
631  return ref;
632 }
633 
634 /************************************************************************
635  * DataAdviseHolder_Advise
636  *
637  */
639  IDataObject *pDataObject, FORMATETC *pFetc,
640  DWORD advf, IAdviseSink *pAdvise,
641  DWORD *pdwConnection)
642 {
643  DWORD index;
644  STATDATA new_conn;
646 
647  TRACE("(%p)->(%p, %p, %08x, %p, %p)\n", This, pDataObject, pFetc, advf,
648  pAdvise, pdwConnection);
649 
650  if (pdwConnection==NULL)
651  return E_POINTER;
652 
653  *pdwConnection = 0;
654 
655  for (index = 0; index < This->maxCons; index++)
656  {
657  if (This->connections[index].pAdvSink == NULL)
658  break;
659  }
660 
661  if (index == This->maxCons)
662  {
663  This->maxCons+=INITIAL_SINKS;
665  This->connections,
666  This->maxCons * sizeof(*This->connections));
667  This->remote_connections = HeapReAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY,
668  This->remote_connections,
669  This->maxCons * sizeof(*This->remote_connections));
670  }
671 
672  new_conn.pAdvSink = pAdvise;
673  new_conn.advf = advf & ~WINE_ADVF_REMOTE;
674  new_conn.formatetc = *pFetc;
675  new_conn.dwConnection = index + 1; /* 0 is not a valid cookie, so increment the index */
676 
677  copy_statdata(This->connections + index, &new_conn);
678 
679  if (This->connections[index].pAdvSink != NULL)
680  {
681  /* if we are already connected advise the remote object */
682  if (This->delegate)
683  {
684  HRESULT hr;
685 
686  hr = IDataObject_DAdvise(This->delegate, &new_conn.formatetc,
687  new_conn.advf, new_conn.pAdvSink,
688  &This->remote_connections[index]);
689  if (FAILED(hr))
690  {
691  IDataAdviseHolder_Unadvise(iface, new_conn.dwConnection);
692  return hr;
693  }
694  This->connections[index].advf |= WINE_ADVF_REMOTE;
695  }
696  else if(advf & ADVF_PRIMEFIRST)
697  /* only do this if we have no delegate, since in the above case the
698  * delegate will do the priming for us */
699  IDataAdviseHolder_SendOnDataChange(iface, pDataObject, 0, advf);
700  }
701 
702  *pdwConnection = new_conn.dwConnection;
703 
704  return S_OK;
705 }
706 
707 /******************************************************************************
708  * DataAdviseHolder_Unadvise
709  */
711  DWORD dwConnection)
712 {
714  DWORD index;
715  TRACE("(%p)->(%u)\n", This, dwConnection);
716 
717  /* The connection number is 1 more than the index, see DataAdviseHolder_Advise */
718  index = dwConnection - 1;
719 
720  if (index >= This->maxCons || This->connections[index].pAdvSink == NULL)
721  return OLE_E_NOCONNECTION;
722 
723  if (This->delegate && This->connections[index].advf & WINE_ADVF_REMOTE)
724  {
725  IDataObject_DUnadvise(This->delegate, This->remote_connections[index]);
726  This->remote_connections[index] = 0;
727  }
728 
729  release_statdata(This->connections + index);
730 
731  return S_OK;
732 }
733 
734 /******************************************************************************
735  * DataAdviseHolder_EnumAdvise
736  */
738  IEnumSTATDATA **enum_advise)
739 {
741  IUnknown *unk;
742  HRESULT hr;
743 
744  TRACE("(%p)->(%p)\n", This, enum_advise);
745 
746  IDataAdviseHolder_QueryInterface(iface, &IID_IUnknown, (void**)&unk);
747  hr = EnumSTATDATA_Construct(unk, 0, This->maxCons, This->connections, TRUE, enum_advise);
748  IUnknown_Release(unk);
749  return hr;
750 }
751 
752 /******************************************************************************
753  * DataAdviseHolder_SendOnDataChange
754  */
756  IDataObject *data_obj,
757  DWORD dwReserved, DWORD advf)
758 {
759  IEnumSTATDATA *pEnum;
760  HRESULT hr;
761 
762  TRACE("(%p)->(%p, %08x, %08x)\n", iface, data_obj, dwReserved, advf);
763 
764  hr = IDataAdviseHolder_EnumAdvise(iface, &pEnum);
765  if (SUCCEEDED(hr))
766  {
767  STATDATA statdata;
768  while (IEnumSTATDATA_Next(pEnum, 1, &statdata, NULL) == S_OK)
769  {
770  STGMEDIUM stg;
771  stg.tymed = TYMED_NULL;
772  stg.u.pstg = NULL;
773  stg.pUnkForRelease = NULL;
774 
775  if(!(statdata.advf & ADVF_NODATA))
776  {
777  hr = IDataObject_GetData(data_obj, &statdata.formatetc, &stg);
778  }
779 
780  IAdviseSink_OnDataChange(statdata.pAdvSink, &statdata.formatetc, &stg);
781 
782  if(statdata.advf & ADVF_ONLYONCE)
783  {
784  IDataAdviseHolder_Unadvise(iface, statdata.dwConnection);
785  }
786 
787  release_statdata(&statdata);
788  }
789  IEnumSTATDATA_Release(pEnum);
790  }
791 
792  return S_OK;
793 }
794 
795 /**************************************************************************
796  * DataAdviseHolderImpl_VTable
797  */
798 static const IDataAdviseHolderVtbl DataAdviseHolderImpl_VTable =
799 {
807 };
808 
810 {
812  DWORD index;
813  HRESULT hr = S_OK;
814 
815  for(index = 0; index < This->maxCons; index++)
816  {
817  if(This->connections[index].pAdvSink != NULL)
818  {
819  hr = IDataObject_DAdvise(pDelegate, &This->connections[index].formatetc,
820  This->connections[index].advf,
821  This->connections[index].pAdvSink,
822  &This->remote_connections[index]);
823  if (FAILED(hr)) break;
824  This->connections[index].advf |= WINE_ADVF_REMOTE;
825  }
826  }
827  This->delegate = pDelegate;
828  return hr;
829 }
830 
832 {
834  DWORD index;
835 
836  for(index = 0; index < This->maxCons; index++)
837  {
838  if((This->connections[index].pAdvSink != NULL) &&
839  (This->connections[index].advf & WINE_ADVF_REMOTE))
840  {
841  IDataObject_DUnadvise(This->delegate, This->remote_connections[index]);
842  This->remote_connections[index] = 0;
843  This->connections[index].advf &= ~WINE_ADVF_REMOTE;
844  }
845  }
846  This->delegate = NULL;
847 }
848 
849 /******************************************************************************
850  * DataAdviseHolder_Constructor
851  */
853 {
854  DataAdviseHolder* newHolder;
855 
856  newHolder = HeapAlloc(GetProcessHeap(), 0, sizeof(DataAdviseHolder));
857 
859  newHolder->ref = 1;
860  newHolder->maxCons = INITIAL_SINKS;
862  newHolder->maxCons * sizeof(*newHolder->connections));
864  newHolder->maxCons * sizeof(*newHolder->remote_connections));
865  newHolder->delegate = NULL;
866 
867  TRACE("returning %p\n", &newHolder->IDataAdviseHolder_iface);
868  return &newHolder->IDataAdviseHolder_iface;
869 }
870 
871 /***********************************************************************
872  * API functions
873  */
874 
875 /***********************************************************************
876  * CreateOleAdviseHolder [OLE32.@]
877  */
879 {
880  TRACE("(%p)\n", ppOAHolder);
881 
882  if (ppOAHolder==NULL)
883  return E_POINTER;
884 
885  *ppOAHolder = OleAdviseHolderImpl_Constructor ();
886 
887  if (*ppOAHolder != NULL)
888  return S_OK;
889 
890  return E_OUTOFMEMORY;
891 }
892 
893 /******************************************************************************
894  * CreateDataAdviseHolder [OLE32.@]
895  */
897 {
898  TRACE("(%p)\n", ppDAHolder);
899 
900  if (ppDAHolder==NULL)
901  return E_POINTER;
902 
903  *ppDAHolder = DataAdviseHolder_Constructor();
904 
905  if (*ppDAHolder != NULL)
906  return S_OK;
907 
908  return E_OUTOFMEMORY;
909 }
static HRESULT WINAPI EnumSTATDATA_Clone(IEnumSTATDATA *iface, IEnumSTATDATA **ppenum)
Definition: oleobj.c:181
HRESULT WINAPI CreateOleAdviseHolder(IOleAdviseHolder **ppOAHolder)
Definition: oleobj.c:878
static HRESULT WINAPI DataAdviseHolder_Unadvise(IDataAdviseHolder *iface, DWORD dwConnection)
Definition: oleobj.c:710
#define REFIID
Definition: guiddef.h:113
#define TRUE
Definition: types.h:120
#define E_NOINTERFACE
Definition: winerror.h:2364
VOID WINAPI CoTaskMemFree(LPVOID ptr)
Definition: ifs.c:422
HRESULT hr
Definition: shlfolder.c:183
static void OleAdviseHolderImpl_Destructor(OleAdviseHolderImpl *This)
Definition: oleobj.c:264
static HRESULT WINAPI OleAdviseHolderImpl_QueryInterface(IOleAdviseHolder *iface, REFIID iid, void **obj)
Definition: oleobj.c:282
static ULONG WINAPI OleAdviseHolderImpl_Release(IOleAdviseHolder *iface)
Definition: oleobj.c:323
static HRESULT WINAPI OleAdviseHolderImpl_EnumAdvise(IOleAdviseHolder *iface, IEnumSTATDATA **enum_advise)
Definition: oleobj.c:404
IDataAdviseHolder IDataAdviseHolder_iface
Definition: oleobj.c:537
DWORD * remote_connections
Definition: oleobj.c:542
REFIID riid
Definition: precomp.h:44
HRESULT DataAdviseHolder_OnConnect(IDataAdviseHolder *iface, IDataObject *pDelegate)
Definition: oleobj.c:809
static void DataAdviseHolder_Destructor(DataAdviseHolder *ptrToDestroy)
Definition: oleobj.c:557
static void release_statdata(STATDATA *data)
Definition: oleobj.c:42
static const IDataAdviseHolderVtbl DataAdviseHolderImpl_VTable
Definition: oleobj.c:798
GLuint GLuint GLsizei count
Definition: gl.h:1545
const GUID IID_IDataAdviseHolder
static const IOleAdviseHolderVtbl oahvt
Definition: oleobj.c:499
static ULONG WINAPI DataAdviseHolder_AddRef(IDataAdviseHolder *iface)
Definition: oleobj.c:612
REFIID LPVOID * ppv
Definition: atlbase.h:39
static ULONG WINAPI EnumSTATDATA_Release(IEnumSTATDATA *iface)
Definition: oleobj.c:110
static HRESULT WINAPI EnumSTATDATA_QueryInterface(IEnumSTATDATA *iface, REFIID riid, void **ppv)
Definition: oleobj.c:90
static ULONG WINAPI DataAdviseHolder_Release(IDataAdviseHolder *iface)
Definition: oleobj.c:622
IEnumSTATDATA IEnumSTATDATA_iface
Definition: oleobj.c:76
STATDATA * connections
Definition: oleobj.c:541
static HRESULT copy_statdata(STATDATA *dst, const STATDATA *src)
Definition: oleobj.c:57
static ULONG WINAPI EnumSTATDATA_AddRef(IEnumSTATDATA *iface)
Definition: oleobj.c:103
Definition: send.c:47
static HRESULT WINAPI OleAdviseHolderImpl_SendOnSave(IOleAdviseHolder *iface)
Definition: oleobj.c:447
void DataAdviseHolder_OnDisconnect(IDataAdviseHolder *iface)
Definition: oleobj.c:831
#define OLE_E_NOCONNECTION
Definition: winerror.h:2618
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
_In_ HANDLE _In_ DWORD _In_ DWORD _Inout_opt_ LPOVERLAPPED _In_opt_ LPTRANSMIT_FILE_BUFFERS _In_ DWORD dwReserved
Definition: mswsock.h:90
unsigned int BOOL
Definition: ntddk_ex.h:94
long LONG
Definition: pedump.c:60
GLenum GLint ref
Definition: glext.h:6028
HRESULT WINAPI CreateDataAdviseHolder(IDataAdviseHolder **ppDAHolder)
Definition: oleobj.c:896
#define S_FALSE
Definition: winerror.h:2357
#define E_INVALIDARG
Definition: ddrawi.h:101
static HRESULT copy_formatetc(FORMATETC *dst, const FORMATETC *src)
smooth NULL
Definition: ftsmooth.c:416
const GUID IID_IEnumSTATDATA
GLuint index
Definition: glext.h:6031
ULONG index
Definition: oleobj.c:79
static HRESULT WINAPI OleAdviseHolderImpl_Advise(IOleAdviseHolder *iface, IAdviseSink *pAdvise, DWORD *pdwConnection)
Definition: oleobj.c:338
#define debugstr_guid
Definition: kernel32.h:35
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
static const IEnumSTATDATAVtbl EnumSTATDATA_VTable
Definition: oleobj.c:189
#define TRACE(s)
Definition: solgame.cpp:4
static ULONG WINAPI OleAdviseHolderImpl_AddRef(IOleAdviseHolder *iface)
Definition: oleobj.c:310
#define WINE_ADVF_REMOTE
Definition: oleobj.c:547
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
LONG HRESULT
Definition: typedefs.h:77
const GUID IID_IUnknown
static HRESULT WINAPI DataAdviseHolder_EnumAdvise(IDataAdviseHolder *iface, IEnumSTATDATA **enum_advise)
Definition: oleobj.c:737
STATDATA * statdata
Definition: oleobj.c:81
#define WINAPI
Definition: msvc.h:8
IOleAdviseHolder IOleAdviseHolder_iface
Definition: oleobj.c:248
unsigned long DWORD
Definition: ntddk_ex.h:95
GLuint GLuint num
Definition: glext.h:9618
LONG ref
Definition: oleobj.c:77
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
DWORD maxCons
Definition: oleobj.c:540
#define index(s, c)
Definition: various.h:29
#define InterlockedDecrement
Definition: armddk.h:52
WINE_DEFAULT_DEBUG_CHANNEL(ole)
REFIID LPVOID * ppvObject
Definition: precomp.h:44
GLenum src
Definition: glext.h:6340
IUnknown * holder
Definition: oleobj.c:82
IDataObject * delegate
Definition: oleobj.c:543
STATDATA * connections
Definition: oleobj.c:253
static IOleAdviseHolder * OleAdviseHolderImpl_Constructor(void)
Definition: oleobj.c:516
static IDataAdviseHolder * DataAdviseHolder_Constructor(void)
Definition: oleobj.c:852
static OleAdviseHolderImpl * impl_from_IOleAdviseHolder(IOleAdviseHolder *iface)
Definition: oleobj.c:256
#define S_OK
Definition: intsafe.h:59
#define InterlockedIncrement
Definition: armddk.h:53
static HRESULT WINAPI EnumSTATDATA_Reset(IEnumSTATDATA *iface)
Definition: oleobj.c:171
DWORD num_of_elems
Definition: oleobj.c:80
#define INITIAL_SINKS
Definition: oleobj.c:40
#define HeapReAlloc
Definition: compat.h:393
GLenum GLenum dst
Definition: glext.h:6340
INT copy(TCHAR source[MAX_PATH], TCHAR dest[MAX_PATH], INT append, DWORD lpdwFlags, BOOL bTouch)
Definition: copy.c:51
HRESULT EnumSTATDATA_Construct(IUnknown *holder, ULONG index, DWORD array_len, STATDATA *data, BOOL copy, IEnumSTATDATA **ppenum)
Definition: oleobj.c:200
#define HEAP_ZERO_MEMORY
Definition: compat.h:123
const GUID IID_IOleAdviseHolder
static HRESULT WINAPI OleAdviseHolderImpl_Unadvise(IOleAdviseHolder *iface, DWORD dwConnection)
Definition: oleobj.c:382
static HRESULT WINAPI EnumSTATDATA_Next(IEnumSTATDATA *iface, ULONG num, LPSTATDATA data, ULONG *fetched)
Definition: oleobj.c:127
static HRESULT WINAPI OleAdviseHolderImpl_SendOnClose(IOleAdviseHolder *iface)
Definition: oleobj.c:473
static HRESULT WINAPI DataAdviseHolder_Advise(IDataAdviseHolder *iface, IDataObject *pDataObject, FORMATETC *pFetc, DWORD advf, IAdviseSink *pAdvise, DWORD *pdwConnection)
Definition: oleobj.c:638
unsigned int ULONG
Definition: retypes.h:1
static HRESULT WINAPI EnumSTATDATA_Skip(IEnumSTATDATA *iface, ULONG num)
Definition: oleobj.c:155
static HRESULT WINAPI DataAdviseHolder_SendOnDataChange(IDataAdviseHolder *iface, IDataObject *data_obj, DWORD dwReserved, DWORD advf)
Definition: oleobj.c:755
#define E_POINTER
Definition: winerror.h:2365
static HRESULT WINAPI OleAdviseHolderImpl_SendOnRename(IOleAdviseHolder *iface, IMoniker *pmk)
Definition: oleobj.c:421
static EnumSTATDATA * impl_from_IEnumSTATDATA(IEnumSTATDATA *iface)
Definition: oleobj.c:85
static HRESULT WINAPI DataAdviseHolder_QueryInterface(IDataAdviseHolder *iface, REFIID riid, void **ppvObject)
Definition: oleobj.c:583
#define HeapFree(x, y, z)
Definition: compat.h:394
#define IsEqualIID(riid1, riid2)
Definition: guiddef.h:90
#define SUCCEEDED(hr)
Definition: intsafe.h:57
static DataAdviseHolder * impl_from_IDataAdviseHolder(IDataAdviseHolder *iface)
Definition: oleobj.c:549