Added an unknown VxD error code.
[wine] / dlls / shdocvw / classinfo.c
1 /*
2  * Implementation of IProvideClassInfo interfaces for IE Web Browser control
3  *
4  * 2001 John R. Sheets (for CodeWeavers)
5  */
6
7 #include <string.h>
8 #include "debugtools.h"
9 #include "shdocvw.h"
10
11 DEFAULT_DEBUG_CHANNEL(shdocvw);
12
13 /**********************************************************************
14  * Implement the IProvideClassInfo interface
15  *
16  * FIXME: Should we just pass in the IProvideClassInfo2 methods rather
17  *        reimplementing them here?
18  */
19
20 static HRESULT WINAPI WBPCI_QueryInterface(LPPROVIDECLASSINFO iface,
21                                            REFIID riid, LPVOID *ppobj)
22 {
23     ICOM_THIS(IProvideClassInfoImpl, iface);
24
25     FIXME("(%p)->(%s,%p),stub!\n", This, debugstr_guid(riid), ppobj);
26     return E_NOINTERFACE;
27 }
28
29 static ULONG WINAPI WBPCI_AddRef(LPPROVIDECLASSINFO iface)
30 {
31     ICOM_THIS(IProvideClassInfoImpl, iface);
32
33     TRACE("\n");
34     return ++(This->ref);
35 }
36
37 static ULONG WINAPI WBPCI_Release(LPPROVIDECLASSINFO iface)
38 {
39     ICOM_THIS(IProvideClassInfoImpl, iface);
40
41     /* static class, won't be freed */
42     TRACE("\n");
43     return --(This->ref);
44 }
45
46 /* Return an ITypeInfo interface to retrieve type library info about
47  * this control.
48  */
49 static HRESULT WINAPI WBPCI_GetClassInfo(LPPROVIDECLASSINFO iface, LPTYPEINFO *ppTI)
50 {
51     FIXME("stub: LPTYPEINFO = %p\n", *ppTI);
52     return S_OK;
53 }
54
55 /**********************************************************************
56  * IProvideClassInfo virtual function table for IE Web Browser component
57  */
58
59 static ICOM_VTABLE(IProvideClassInfo) WBPCI_Vtbl = 
60 {
61     ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
62     WBPCI_QueryInterface,
63     WBPCI_AddRef,
64     WBPCI_Release,
65     WBPCI_GetClassInfo
66 };
67
68 IProvideClassInfoImpl SHDOCVW_ProvideClassInfo = { &WBPCI_Vtbl, 1 };
69
70
71 /**********************************************************************
72  * Implement the IProvideClassInfo2 interface (inherits from
73  * IProvideClassInfo).
74  */
75
76 static HRESULT WINAPI WBPCI2_QueryInterface(LPPROVIDECLASSINFO2 iface,
77                                             REFIID riid, LPVOID *ppobj)
78 {
79     ICOM_THIS(IProvideClassInfo2Impl, iface);
80
81     FIXME("(%p)->(%s,%p),stub!\n", This, debugstr_guid(riid), ppobj);
82     return E_NOINTERFACE;
83 }
84
85 static ULONG WINAPI WBPCI2_AddRef(LPPROVIDECLASSINFO2 iface)
86 {
87     ICOM_THIS(IProvideClassInfo2Impl, iface);
88
89     TRACE("\n");
90     return ++(This->ref);
91 }
92
93 static ULONG WINAPI WBPCI2_Release(LPPROVIDECLASSINFO2 iface)
94 {
95     ICOM_THIS(IProvideClassInfo2Impl, iface);
96
97     /* static class, won't be freed */
98     TRACE("\n");
99     return --(This->ref);
100 }
101
102 /* Return an ITypeInfo interface to retrieve type library info about
103  * this control.
104  */
105 static HRESULT WINAPI WBPCI2_GetClassInfo(LPPROVIDECLASSINFO2 iface, LPTYPEINFO *ppTI)
106 {
107     FIXME("stub: LPTYPEINFO = %p\n", *ppTI);
108     return S_OK;
109 }
110
111 /* Get the IID for generic default event callbacks.  This IID will
112  * in theory be used to later query for an IConnectionPoint to connect
113  * an event sink (callback implmentation in the OLE control site)
114  * to this control.
115 */
116 static HRESULT WINAPI WBPCI2_GetGUID(LPPROVIDECLASSINFO2 iface,
117                                      DWORD dwGuidKind, GUID *pGUID)
118 {
119     FIXME("stub: dwGuidKind = %ld, pGUID = %s\n", dwGuidKind, debugstr_guid(pGUID));
120
121     if (dwGuidKind != GUIDKIND_DEFAULT_SOURCE_DISP_IID)
122     {
123         FIXME ("Requested unsupported GUID type: %ld\n", dwGuidKind);
124         return E_FAIL;  /* Is there a better return type here? */
125     }
126
127     /* FIXME: Returning IPropertyNotifySink interface, but should really
128      * return a more generic event set (???) dispinterface.
129      * However, this hack, allows a control site to return with success
130      * (MFC's COleControlSite falls back to older IProvideClassInfo interface
131      * if GetGUID() fails to return a non-NULL GUID).
132      */
133     memcpy(pGUID, &IID_IPropertyNotifySink, sizeof(GUID));
134     FIXME("Wrongly returning IPropertyNotifySink interface %s\n",
135           debugstr_guid(pGUID));
136
137     return S_OK;
138 }
139
140 /**********************************************************************
141  * IProvideClassInfo virtual function table for IE Web Browser component
142  */
143
144 static ICOM_VTABLE(IProvideClassInfo2) WBPCI2_Vtbl = 
145 {
146     ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
147     WBPCI2_QueryInterface,
148     WBPCI2_AddRef,
149     WBPCI2_Release,
150     WBPCI2_GetClassInfo,
151     WBPCI2_GetGUID
152 };
153
154 IProvideClassInfo2Impl SHDOCVW_ProvideClassInfo2 = { &WBPCI2_Vtbl, 1 };