winhttp/tests: Fix resource leak.
[wine.git] / dlls / ieframe / frame.c
blobd86c2714c9f116d0ad43d726705e8581719b02f2
1 /*
2 * Copyright 2005 Jacek Caban 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
19 #include "ieframe.h"
21 #include "wine/debug.h"
23 WINE_DEFAULT_DEBUG_CHANNEL(ieframe);
25 static inline DocHost *impl_from_IOleInPlaceFrame(IOleInPlaceFrame *iface)
27 return CONTAINING_RECORD(iface, DocHost, IOleInPlaceFrame_iface);
30 static HRESULT WINAPI InPlaceFrame_QueryInterface(IOleInPlaceFrame *iface,
31 REFIID riid, void **ppv)
33 DocHost *This = impl_from_IOleInPlaceFrame(iface);
35 if(IsEqualGUID(&IID_IUnknown, riid)) {
36 TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv);
37 *ppv = &This->IOleInPlaceFrame_iface;
38 }else if(IsEqualGUID(&IID_IOleWindow, riid)) {
39 TRACE("(%p)->(IID_IOleWindow %p)\n", This, ppv);
40 *ppv = &This->IOleInPlaceFrame_iface;
41 }else if(IsEqualGUID(&IID_IOleInPlaceUIWindow, riid)) {
42 TRACE("(%p)->(IID_IOleInPlaceUIWindow %p)\n", This, ppv);
43 *ppv = &This->IOleInPlaceFrame_iface;
44 }else if(IsEqualGUID(&IID_IOleInPlaceFrame, riid)) {
45 TRACE("(%p)->(IID_IOleInPlaceFrame %p)\n", This, ppv);
46 *ppv = &This->IOleInPlaceFrame_iface;
47 }else {
48 *ppv = NULL;
49 WARN("Unsopported interface %s\n", debugstr_guid(riid));
50 return E_NOINTERFACE;
54 IUnknown_AddRef((IUnknown*)*ppv);
55 return S_OK;
58 static ULONG WINAPI InPlaceFrame_AddRef(IOleInPlaceFrame *iface)
60 DocHost *This = impl_from_IOleInPlaceFrame(iface);
61 return IOleClientSite_AddRef(&This->IOleClientSite_iface);
64 static ULONG WINAPI InPlaceFrame_Release(IOleInPlaceFrame *iface)
66 DocHost *This = impl_from_IOleInPlaceFrame(iface);
67 return IOleClientSite_Release(&This->IOleClientSite_iface);
70 static HRESULT WINAPI InPlaceFrame_GetWindow(IOleInPlaceFrame *iface, HWND *phwnd)
72 DocHost *This = impl_from_IOleInPlaceFrame(iface);
73 FIXME("(%p)->(%p)\n", This, phwnd);
74 return E_NOTIMPL;
77 static HRESULT WINAPI InPlaceFrame_ContextSensitiveHelp(IOleInPlaceFrame *iface,
78 BOOL fEnterMode)
80 DocHost *This = impl_from_IOleInPlaceFrame(iface);
81 FIXME("(%p)->(%x)\n", This, fEnterMode);
82 return E_NOTIMPL;
85 static HRESULT WINAPI InPlaceFrame_GetBorder(IOleInPlaceFrame *iface, LPRECT lprectBorder)
87 DocHost *This = impl_from_IOleInPlaceFrame(iface);
88 FIXME("(%p)->(%p)\n", This, lprectBorder);
89 return E_NOTIMPL;
92 static HRESULT WINAPI InPlaceFrame_RequestBorderSpace(IOleInPlaceFrame *iface,
93 LPCBORDERWIDTHS pborderwidths)
95 DocHost *This = impl_from_IOleInPlaceFrame(iface);
96 FIXME("(%p)->(%p)\n", This, pborderwidths);
97 return E_NOTIMPL;
100 static HRESULT WINAPI InPlaceFrame_SetBorderSpace(IOleInPlaceFrame *iface,
101 LPCBORDERWIDTHS pborderwidths)
103 DocHost *This = impl_from_IOleInPlaceFrame(iface);
104 FIXME("(%p)->(%p)\n", This, pborderwidths);
105 return E_NOTIMPL;
108 static HRESULT WINAPI InPlaceFrame_SetActiveObject(IOleInPlaceFrame *iface,
109 IOleInPlaceActiveObject *pActiveObject, LPCOLESTR pszObjName)
111 DocHost *This = impl_from_IOleInPlaceFrame(iface);
112 FIXME("(%p)->(%p %s)\n", This, pActiveObject, debugstr_w(pszObjName));
113 return E_NOTIMPL;
116 static HRESULT WINAPI InPlaceFrame_InsertMenus(IOleInPlaceFrame *iface, HMENU hmenuShared,
117 LPOLEMENUGROUPWIDTHS lpMenuWidths)
119 DocHost *This = impl_from_IOleInPlaceFrame(iface);
120 FIXME("(%p)->(%p %p)\n", This, hmenuShared, lpMenuWidths);
121 return E_NOTIMPL;
124 static HRESULT WINAPI InPlaceFrame_SetMenu(IOleInPlaceFrame *iface, HMENU hmenuShared,
125 HOLEMENU holemenu, HWND hwndActiveObject)
127 DocHost *This = impl_from_IOleInPlaceFrame(iface);
128 FIXME("(%p)->(%p %p %p)\n", This, hmenuShared, holemenu, hwndActiveObject);
129 return E_NOTIMPL;
132 static HRESULT WINAPI InPlaceFrame_RemoveMenus(IOleInPlaceFrame *iface, HMENU hmenuShared)
134 DocHost *This = impl_from_IOleInPlaceFrame(iface);
135 FIXME("(%p)->(%p)\n", This, hmenuShared);
136 return E_NOTIMPL;
139 static HRESULT WINAPI InPlaceFrame_SetStatusText(IOleInPlaceFrame *iface,
140 LPCOLESTR pszStatusText)
142 DocHost *This = impl_from_IOleInPlaceFrame(iface);
143 TRACE("(%p)->(%s)\n", This, debugstr_w(pszStatusText));
144 return This->container_vtbl->set_status_text(This, pszStatusText);
147 static HRESULT WINAPI InPlaceFrame_EnableModeless(IOleInPlaceFrame *iface, BOOL fEnable)
149 DocHost *This = impl_from_IOleInPlaceFrame(iface);
150 FIXME("(%p)->(%x)\n", This, fEnable);
151 return E_NOTIMPL;
154 static HRESULT WINAPI InPlaceFrame_TranslateAccelerator(IOleInPlaceFrame *iface, LPMSG lpmsg,
155 WORD wID)
157 DocHost *This = impl_from_IOleInPlaceFrame(iface);
158 FIXME("(%p)->(%p %d)\n", This, lpmsg, wID);
159 return E_NOTIMPL;
162 #undef impl_from_IOleInPlaceFrame
164 static const IOleInPlaceFrameVtbl OleInPlaceFrameVtbl = {
165 InPlaceFrame_QueryInterface,
166 InPlaceFrame_AddRef,
167 InPlaceFrame_Release,
168 InPlaceFrame_GetWindow,
169 InPlaceFrame_ContextSensitiveHelp,
170 InPlaceFrame_GetBorder,
171 InPlaceFrame_RequestBorderSpace,
172 InPlaceFrame_SetBorderSpace,
173 InPlaceFrame_SetActiveObject,
174 InPlaceFrame_InsertMenus,
175 InPlaceFrame_SetMenu,
176 InPlaceFrame_RemoveMenus,
177 InPlaceFrame_SetStatusText,
178 InPlaceFrame_EnableModeless,
179 InPlaceFrame_TranslateAccelerator
182 void DocHost_Frame_Init(DocHost *This)
184 This->IOleInPlaceFrame_iface.lpVtbl = &OleInPlaceFrameVtbl;