mshtml: Check for null pointers in IHTMLLocation_get*.
[wine/hramrach.git] / dlls / shdocvw / classinfo.c
blobf054398cd925b8c823f6ab0124a962eee734f744
1 /*
2 * Implementation of IProvideClassInfo interfaces for WebBrowser control
4 * Copyright 2001 John R. Sheets (for CodeWeavers)
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
21 #include <stdarg.h>
22 #include <string.h>
24 #include "windef.h"
25 #include "winbase.h"
26 #include "shdocvw.h"
27 #include "wine/debug.h"
29 WINE_DEFAULT_DEBUG_CHANNEL(shdocvw);
31 /**********************************************************************
32 * Implement the IProvideClassInfo2 interface
35 #define CLASSINFO_THIS(iface) DEFINE_THIS(WebBrowser, ProvideClassInfo, iface)
37 static HRESULT WINAPI ProvideClassInfo_QueryInterface(IProvideClassInfo2 *iface,
38 REFIID riid, LPVOID *ppobj)
40 WebBrowser *This = CLASSINFO_THIS(iface);
41 return IWebBrowser_QueryInterface(WEBBROWSER(This), riid, ppobj);
44 static ULONG WINAPI ProvideClassInfo_AddRef(IProvideClassInfo2 *iface)
46 WebBrowser *This = CLASSINFO_THIS(iface);
47 return IWebBrowser_AddRef(WEBBROWSER(This));
50 static ULONG WINAPI ProvideClassInfo_Release(IProvideClassInfo2 *iface)
52 WebBrowser *This = CLASSINFO_THIS(iface);
53 return IWebBrowser_Release(WEBBROWSER(This));
56 static HRESULT WINAPI ProvideClassInfo_GetClassInfo(IProvideClassInfo2 *iface, LPTYPEINFO *ppTI)
58 WebBrowser *This = CLASSINFO_THIS(iface);
59 FIXME("(%p)->(%p)\n", This, ppTI);
60 return E_NOTIMPL;
63 static HRESULT WINAPI ProvideClassInfo_GetGUID(IProvideClassInfo2 *iface,
64 DWORD dwGuidKind, GUID *pGUID)
66 WebBrowser *This = CLASSINFO_THIS(iface);
68 TRACE("(%p)->(%d %p)\n", This, dwGuidKind, pGUID);
70 if(!pGUID)
71 return E_POINTER;
73 if (dwGuidKind != GUIDKIND_DEFAULT_SOURCE_DISP_IID) {
74 WARN("Wrong GUID type: %d\n", dwGuidKind);
75 *pGUID = IID_NULL;
76 return E_FAIL;
79 memcpy(pGUID, This->version == 1 ? &DIID_DWebBrowserEvents : &DIID_DWebBrowserEvents2,
80 sizeof(GUID));
81 return S_OK;
84 #undef CLASSINFO_THIS
86 static const IProvideClassInfo2Vtbl ProvideClassInfoVtbl =
88 ProvideClassInfo_QueryInterface,
89 ProvideClassInfo_AddRef,
90 ProvideClassInfo_Release,
91 ProvideClassInfo_GetClassInfo,
92 ProvideClassInfo_GetGUID
95 void WebBrowser_ClassInfo_Init(WebBrowser *This)
97 This->lpProvideClassInfoVtbl = &ProvideClassInfoVtbl;