+/******************************************************************
+ * IInternetExplorerManager implementation
+ */
+struct InternetExplorerManager {
+ IInternetExplorerManager IInternetExplorerManager_iface;
+ LONG ref;
+};
+
+static inline InternetExplorerManager *impl_from_IInternetExplorerManager(IInternetExplorerManager *iface)
+{
+ return CONTAINING_RECORD(iface, InternetExplorerManager, IInternetExplorerManager_iface);
+}
+
+static HRESULT WINAPI InternetExplorerManager_QueryInterface(IInternetExplorerManager *iface, REFIID riid, void **out)
+{
+ TRACE("(%p)->(%s, %p)\n", iface, debugstr_guid(riid), out);
+
+ if (IsEqualGUID(riid, &IID_IInternetExplorerManager) || IsEqualGUID(riid, &IID_IUnknown))
+ {
+ IInternetExplorerManager_AddRef(iface);
+ *out = iface;
+ return S_OK;
+ }
+
+ FIXME("interface %s not implemented\n", debugstr_guid(riid));
+ *out = NULL;
+ return E_NOINTERFACE;
+}
+
+static ULONG WINAPI InternetExplorerManager_AddRef(IInternetExplorerManager *iface)
+{
+ InternetExplorerManager *This = impl_from_IInternetExplorerManager(iface);
+ ULONG ref = InterlockedIncrement(&This->ref);
+
+ TRACE("(%p) increasing refcount to %u\n", iface, ref);
+
+ return ref;
+}
+
+static ULONG WINAPI InternetExplorerManager_Release(IInternetExplorerManager *iface)
+{
+ InternetExplorerManager *This = impl_from_IInternetExplorerManager(iface);
+ ULONG ref = InterlockedDecrement(&This->ref);
+
+ TRACE("(%p) decreasing refcount to %u\n", iface, ref);
+
+ if (ref == 0)
+ HeapFree(GetProcessHeap(), 0, This);
+
+ return ref;
+}
+
+static HRESULT WINAPI InternetExplorerManager_CreateObject(IInternetExplorerManager *iface, DWORD config, LPCWSTR url, REFIID riid, void **ppv)
+{
+ FIXME("(%p)->(0x%x, %s, %s, %p) stub!\n", iface, config, debugstr_w(url), debugstr_guid(riid), ppv);
+
+ return E_NOTIMPL;
+}
+
+static const IInternetExplorerManagerVtbl InternetExplorerManager_vtbl =
+{
+ InternetExplorerManager_QueryInterface,
+ InternetExplorerManager_AddRef,
+ InternetExplorerManager_Release,
+ InternetExplorerManager_CreateObject,
+};
+
+HRESULT WINAPI InternetExplorerManager_Create(IClassFactory *iface, IUnknown *pOuter, REFIID riid, void **ppv)
+{
+ InternetExplorerManager *ret;
+ HRESULT hr;
+
+ TRACE("(%p %s %p)\n", pOuter, debugstr_guid(riid), ppv);
+
+ if (!(ret = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*ret))))
+ return E_OUTOFMEMORY;
+
+ ret->IInternetExplorerManager_iface.lpVtbl = &InternetExplorerManager_vtbl;
+ ret->ref = 1;
+
+ hr = IInternetExplorerManager_QueryInterface(&ret->IInternetExplorerManager_iface, riid, ppv);
+ IInternetExplorerManager_Release(&ret->IInternetExplorerManager_iface);
+
+ return hr;
+}
+