2 * Copyright 2009 Henri Verbeet for CodeWeavers
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
21 #include "wine/port.h"
22 #include "wine/debug.h"
26 WINE_DEFAULT_DEBUG_CHANNEL(shdocvw
);
30 ITaskbarList ITaskbarList_iface
;
34 static inline struct taskbar_list
*impl_from_ITaskbarList(ITaskbarList
*iface
)
36 return CONTAINING_RECORD(iface
, struct taskbar_list
, ITaskbarList_iface
);
39 /* IUnknown methods */
41 static HRESULT STDMETHODCALLTYPE
taskbar_list_QueryInterface(ITaskbarList
*iface
, REFIID riid
, void **object
)
43 TRACE("iface %p, riid %s, object %p\n", iface
, debugstr_guid(riid
), object
);
45 if (IsEqualGUID(riid
, &IID_ITaskbarList
)
46 || IsEqualGUID(riid
, &IID_IUnknown
))
48 IUnknown_AddRef(iface
);
53 WARN("%s not implemented, returning E_NOINTERFACE\n", debugstr_guid(riid
));
59 static ULONG STDMETHODCALLTYPE
taskbar_list_AddRef(ITaskbarList
*iface
)
61 struct taskbar_list
*This
= impl_from_ITaskbarList(iface
);
62 ULONG refcount
= InterlockedIncrement(&This
->refcount
);
64 TRACE("%p increasing refcount to %u\n", This
, refcount
);
69 static ULONG STDMETHODCALLTYPE
taskbar_list_Release(ITaskbarList
*iface
)
71 struct taskbar_list
*This
= impl_from_ITaskbarList(iface
);
72 ULONG refcount
= InterlockedDecrement(&This
->refcount
);
74 TRACE("%p decreasing refcount to %u\n", This
, refcount
);
78 HeapFree(GetProcessHeap(), 0, This
);
79 SHDOCVW_UnlockModule();
85 /* ITaskbarList methods */
87 static HRESULT STDMETHODCALLTYPE
taskbar_list_HrInit(ITaskbarList
*iface
)
89 TRACE("iface %p\n", iface
);
94 static HRESULT STDMETHODCALLTYPE
taskbar_list_AddTab(ITaskbarList
*iface
, HWND hwnd
)
96 FIXME("iface %p, hwnd %p stub!\n", iface
, hwnd
);
101 static HRESULT STDMETHODCALLTYPE
taskbar_list_DeleteTab(ITaskbarList
*iface
, HWND hwnd
)
103 FIXME("iface %p, hwnd %p stub!\n", iface
, hwnd
);
108 static HRESULT STDMETHODCALLTYPE
taskbar_list_ActivateTab(ITaskbarList
*iface
, HWND hwnd
)
110 FIXME("iface %p, hwnd %p stub!\n", iface
, hwnd
);
115 static HRESULT STDMETHODCALLTYPE
taskbar_list_SetActiveAlt(ITaskbarList
*iface
, HWND hwnd
)
117 FIXME("iface %p, hwnd %p stub!\n", iface
, hwnd
);
122 static const struct ITaskbarListVtbl taskbar_list_vtbl
=
124 /* IUnknown methods */
125 taskbar_list_QueryInterface
,
127 taskbar_list_Release
,
128 /* ITaskbarList methods */
131 taskbar_list_DeleteTab
,
132 taskbar_list_ActivateTab
,
133 taskbar_list_SetActiveAlt
,
136 HRESULT
TaskbarList_Create(IUnknown
*outer
, REFIID riid
, void **taskbar_list
)
138 struct taskbar_list
*object
;
141 TRACE("outer %p, riid %s, taskbar_list %p\n", outer
, debugstr_guid(riid
), taskbar_list
);
145 WARN("Aggregation not supported\n");
146 *taskbar_list
= NULL
;
147 return CLASS_E_NOAGGREGATION
;
150 object
= HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY
, sizeof(*object
));
153 ERR("Failed to allocate taskbar list object memory\n");
154 *taskbar_list
= NULL
;
155 return E_OUTOFMEMORY
;
158 object
->ITaskbarList_iface
.lpVtbl
= &taskbar_list_vtbl
;
159 object
->refcount
= 0;
161 TRACE("Created ITaskbarList %p\n", object
);
163 hr
= ITaskbarList_QueryInterface(&object
->ITaskbarList_iface
, riid
, taskbar_list
);
166 HeapFree(GetProcessHeap(), 0, object
);
170 SHDOCVW_LockModule();