~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~ [ freetext search ] ~ [ file search ] ~

Wine Cross Reference
wine/dlls/msxml3/parseerror.c

Version: ~ [ wine-1.5.31 ] ~ [ wine-1.5.30 ] ~ [ wine-1.5.29 ] ~ [ wine-1.5.28 ] ~ [ wine-1.5.27 ] ~ [ wine-1.5.26 ] ~ [ wine-1.5.25 ] ~ [ wine-1.5.24 ] ~ [ wine-1.5.23 ] ~ [ wine-1.5.22 ] ~ [ wine-1.5.21 ] ~ [ wine-1.5.20 ] ~ [ wine-1.5.19 ] ~ [ wine-1.5.18 ] ~ [ wine-1.5.17 ] ~ [ wine-1.5.16 ] ~ [ wine-1.5.15 ] ~ [ wine-1.5.14 ] ~ [ wine-1.5.13 ] ~ [ wine-1.5.12 ] ~ [ wine-1.5.11 ] ~ [ wine-1.5.10 ] ~ [ wine-1.5.9 ] ~ [ wine-1.5.8 ] ~ [ wine-1.5.7 ] ~ [ wine-1.4.1 ] ~ [ wine-1.5.6 ] ~ [ wine-1.5.5 ] ~ [ wine-1.5.4 ] ~ [ wine-1.5.3 ] ~ [ wine-1.5.2 ] ~ [ wine-1.5.1 ] ~ [ wine-1.5.0 ] ~ [ wine-1.4 ] ~ [ wine-1.4-rc6 ] ~ [ wine-1.4-rc5 ] ~ [ wine-1.4-rc4 ] ~ [ wine-1.4-rc3 ] ~ [ wine-1.4-rc2 ] ~ [ wine-1.4-rc1 ] ~ [ wine-1.3.37 ] ~ [ wine-1.3.36 ] ~ [ wine-1.3.35 ] ~ [ wine-1.3.34 ] ~ [ wine-1.3.33 ] ~ [ wine-1.3.32 ] ~ [ wine-1.3.31 ] ~ [ wine-1.3.30 ] ~ [ wine-1.3.29 ] ~ [ wine-1.3.28 ] ~ [ wine-1.3.27 ] ~ [ wine-1.3.26 ] ~ [ wine-1.3.25 ] ~ [ wine-1.3.24 ] ~ [ wine-1.3.23 ] ~ [ wine-1.3.22 ] ~ [ wine-1.3.21 ] ~ [ wine-1.3.20 ] ~ [ wine-1.3.19 ] ~ [ wine-1.3.18 ] ~ [ wine-1.2.3 ] ~ [ wine-1.3.17 ] ~ [ wine-1.3.16 ] ~ [ wine-1.3.15 ] ~ [ wine-1.3.14 ] ~ [ wine-1.3.13 ] ~ [ wine-1.3.12 ] ~ [ wine-1.3.11 ] ~ [ wine-1.3.10 ] ~ [ wine-1.3.9 ] ~ [ wine-1.2.2 ] ~ [ wine-1.3.8 ] ~ [ wine-1.3.7 ] ~ [ wine-1.3.6 ] ~ [ wine-1.3.5 ] ~ [ wine-1.2.1 ] ~ [ wine-1.3.4 ] ~ [ wine-1.3.3 ] ~ [ wine-1.3.2 ] ~ [ wine-1.3.1 ] ~ [ wine-1.3.0 ] ~ [ wine-1.2 ] ~ [ wine-1.2-rc7 ] ~ [ wine-1.2-rc6 ] ~ [ wine-1.2-rc5 ] ~ [ wine-1.2-rc4 ] ~ [ wine-1.2-rc3 ] ~ [ wine-1.2-rc2 ] ~ [ wine-1.2-rc1 ] ~ [ wine-1.1.44 ] ~ [ wine-1.1.43 ] ~ [ wine-1.1.42 ] ~ [ wine-1.1.41 ] ~ [ wine-1.1.40 ] ~ [ wine-1.1.39 ] ~ [ wine-1.1.38 ] ~ [ wine-1.1.37 ] ~ [ wine-1.1.36 ] ~ [ wine-1.1.35 ] ~ [ wine-1.1.34 ] ~ [ wine-1.1.33 ] ~ [ wine-1.1.32 ] ~ [ wine-1.1.31 ] ~ [ wine-1.1.30 ] ~ [ wine-1.1.29 ] ~ [ wine-1.1.28 ] ~ [ wine-1.1.27 ] ~ [ wine-1.1.26 ] ~ [ wine-1.1.25 ] ~ [ wine-1.1.24 ] ~ [ wine-1.1.23 ] ~ [ wine-1.1.22 ] ~ [ wine-1.1.21 ] ~ [ wine-1.1.20 ] ~ [ wine-1.1.19 ] ~ [ wine-1.1.18 ] ~ [ wine-1.1.17 ] ~ [ wine-1.1.16 ] ~ [ wine-1.1.15 ] ~ [ wine-1.1.14 ] ~ [ wine-1.1.13 ] ~ [ wine-1.1.12 ] ~ [ wine-1.1.11 ] ~ [ wine-1.1.10 ] ~ [ wine-1.1.9 ] ~ [ wine-1.1.8 ] ~ [ wine-1.1.7 ] ~ [ wine-1.0.1 ] ~ [ wine-1.1.6 ] ~ [ wine-1.1.5 ] ~ [ wine-1.1.4 ] ~ [ wine-1.1.3 ] ~ [ wine-1.1.2 ] ~ [ wine-1.1.1 ] ~ [ wine-1.1.0 ] ~ [ wine-1.0 ] ~

  1 /*
  2  *    ParseError implementation
  3  *
  4  * Copyright 2005 Huw Davies
  5  *
  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.
 10  *
 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.
 15  *
 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
 19  */
 20 
 21 
 22 #define COBJMACROS
 23 
 24 #include "config.h"
 25 
 26 #include <stdarg.h>
 27 #include <assert.h>
 28 #include "windef.h"
 29 #include "winbase.h"
 30 #include "winerror.h"
 31 #include "winuser.h"
 32 #include "ole2.h"
 33 #include "msxml2.h"
 34 
 35 #include "msxml_private.h"
 36 
 37 #include "wine/debug.h"
 38 
 39 WINE_DEFAULT_DEBUG_CHANNEL(msxml);
 40 
 41 typedef struct
 42 {
 43     const struct IXMLDOMParseErrorVtbl *lpVtbl;
 44     LONG ref;
 45     LONG code, line, linepos, filepos;
 46     BSTR url, reason, srcText;
 47 } parse_error_t;
 48 
 49 static inline parse_error_t *impl_from_IXMLDOMParseError( IXMLDOMParseError *iface )
 50 {
 51     return (parse_error_t *)((char*)iface - FIELD_OFFSET(parse_error_t, lpVtbl));
 52 }
 53 
 54 static HRESULT WINAPI parseError_QueryInterface(
 55     IXMLDOMParseError *iface,
 56     REFIID riid,
 57     void** ppvObject )
 58 {
 59     TRACE("(%p)->(%s %p)\n", iface, debugstr_guid(riid), ppvObject);
 60 
 61     if ( IsEqualGUID( riid, &IID_IUnknown ) ||
 62          IsEqualGUID( riid, &IID_IDispatch ) ||
 63          IsEqualGUID( riid, &IID_IXMLDOMParseError ) )
 64     {
 65         *ppvObject = iface;
 66     }
 67     else
 68     {
 69         FIXME("interface %s not implemented\n", debugstr_guid(riid));
 70         return E_NOINTERFACE;
 71     }
 72 
 73     IXMLDOMParseError_AddRef( iface );
 74 
 75     return S_OK;
 76 }
 77 
 78 static ULONG WINAPI parseError_AddRef(
 79     IXMLDOMParseError *iface )
 80 {
 81     parse_error_t *This = impl_from_IXMLDOMParseError( iface );
 82     ULONG ref = InterlockedIncrement( &This->ref );
 83     TRACE("(%p) ref now %d\n", This, ref);
 84     return ref;
 85 }
 86 
 87 static ULONG WINAPI parseError_Release(
 88     IXMLDOMParseError *iface )
 89 {
 90     parse_error_t *This = impl_from_IXMLDOMParseError( iface );
 91     ULONG ref;
 92 
 93     ref = InterlockedDecrement( &This->ref );
 94     TRACE("(%p) ref now %d\n", This, ref);
 95     if ( ref == 0 )
 96     {
 97         SysFreeString(This->url);
 98         SysFreeString(This->reason);
 99         SysFreeString(This->srcText);
100         heap_free( This );
101     }
102 
103     return ref;
104 }
105 
106 static HRESULT WINAPI parseError_GetTypeInfoCount(
107     IXMLDOMParseError *iface,
108     UINT* pctinfo )
109 {
110     parse_error_t *This = impl_from_IXMLDOMParseError( iface );
111 
112     TRACE("(%p)->(%p)\n", This, pctinfo);
113 
114     *pctinfo = 1;
115 
116     return S_OK;
117 }
118 
119 static HRESULT WINAPI parseError_GetTypeInfo(
120     IXMLDOMParseError *iface,
121     UINT iTInfo,
122     LCID lcid,
123     ITypeInfo** ppTInfo )
124 {
125     parse_error_t *This = impl_from_IXMLDOMParseError( iface );
126     HRESULT hr;
127 
128     TRACE("(%p)->(%u %u %p)\n", This, iTInfo, lcid, ppTInfo);
129 
130     hr = get_typeinfo(IXMLDOMParseError_tid, ppTInfo);
131 
132     return hr;
133 }
134 
135 static HRESULT WINAPI parseError_GetIDsOfNames(
136     IXMLDOMParseError *iface,
137     REFIID riid,
138     LPOLESTR* rgszNames,
139     UINT cNames,
140     LCID lcid,
141     DISPID* rgDispId )
142 {
143     parse_error_t *This = impl_from_IXMLDOMParseError( iface );
144     ITypeInfo *typeinfo;
145     HRESULT hr;
146 
147     TRACE("(%p)->(%s %p %u %u %p)\n", This, debugstr_guid(riid), rgszNames, cNames,
148           lcid, rgDispId);
149 
150     if(!rgszNames || cNames == 0 || !rgDispId)
151         return E_INVALIDARG;
152 
153     hr = get_typeinfo(IXMLDOMParseError_tid, &typeinfo);
154     if(SUCCEEDED(hr))
155     {
156         hr = ITypeInfo_GetIDsOfNames(typeinfo, rgszNames, cNames, rgDispId);
157         ITypeInfo_Release(typeinfo);
158     }
159 
160     return hr;
161 }
162 
163 static HRESULT WINAPI parseError_Invoke(
164     IXMLDOMParseError *iface,
165     DISPID dispIdMember,
166     REFIID riid,
167     LCID lcid,
168     WORD wFlags,
169     DISPPARAMS* pDispParams,
170     VARIANT* pVarResult,
171     EXCEPINFO* pExcepInfo,
172     UINT* puArgErr )
173 {
174     parse_error_t *This = impl_from_IXMLDOMParseError( iface );
175     ITypeInfo *typeinfo;
176     HRESULT hr;
177 
178     TRACE("(%p)->(%d %s %d %d %p %p %p %p)\n", This, dispIdMember, debugstr_guid(riid),
179           lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
180 
181     hr = get_typeinfo(IXMLDOMParseError_tid, &typeinfo);
182     if(SUCCEEDED(hr))
183     {
184         hr = ITypeInfo_Invoke(typeinfo, &(This->lpVtbl), dispIdMember, wFlags, pDispParams,
185                 pVarResult, pExcepInfo, puArgErr);
186         ITypeInfo_Release(typeinfo);
187     }
188 
189     return hr;
190 }
191 
192 static HRESULT WINAPI parseError_get_errorCode(
193     IXMLDOMParseError *iface,
194     LONG *code )
195 {
196     parse_error_t *This = impl_from_IXMLDOMParseError( iface );
197     TRACE("(%p)->(%p)\n", This, code);
198 
199     *code = This->code;
200 
201     if(This->code == 0)
202         return S_FALSE;
203 
204     return S_OK;
205 }
206 
207 static HRESULT WINAPI parseError_get_url(
208     IXMLDOMParseError *iface,
209     BSTR *url )
210 {
211     parse_error_t *This = impl_from_IXMLDOMParseError( iface );
212     FIXME("(%p)->(%p)\n", This, url);
213     return E_NOTIMPL;
214 }
215 
216 static HRESULT WINAPI parseError_get_reason(
217     IXMLDOMParseError *iface,
218     BSTR *reason )
219 {
220     parse_error_t *This = impl_from_IXMLDOMParseError( iface );
221     TRACE("(%p)->(%p)\n", This, reason);
222     
223     if(!This->reason)
224     {
225         *reason = NULL;
226         return S_FALSE;
227     }
228     *reason = SysAllocString(This->reason);
229     return S_OK;
230 }
231 
232 static HRESULT WINAPI parseError_get_srcText(
233     IXMLDOMParseError *iface,
234     BSTR *srcText )
235 {
236     parse_error_t *This = impl_from_IXMLDOMParseError( iface );
237     FIXME("(%p)->(%p)\n", This, srcText);
238     return E_NOTIMPL;
239 }
240 
241 static HRESULT WINAPI parseError_get_line(
242     IXMLDOMParseError *iface,
243     LONG *line )
244 {
245     parse_error_t *This = impl_from_IXMLDOMParseError( iface );
246     FIXME("(%p)->(%p)\n", This, line);
247     return E_NOTIMPL;
248 }
249 
250 static HRESULT WINAPI parseError_get_linepos(
251     IXMLDOMParseError *iface,
252     LONG *linepos )
253 {
254     parse_error_t *This = impl_from_IXMLDOMParseError( iface );
255     FIXME("(%p)->(%p)\n", This, linepos);
256     return E_NOTIMPL;
257 }
258 
259 static HRESULT WINAPI parseError_get_filepos(
260     IXMLDOMParseError *iface,
261     LONG *filepos )
262 {
263     parse_error_t *This = impl_from_IXMLDOMParseError( iface );
264     FIXME("(%p)->(%p)\n", This, filepos);
265     return E_NOTIMPL;
266 }
267 
268 static const struct IXMLDOMParseErrorVtbl parseError_vtbl =
269 {
270     parseError_QueryInterface,
271     parseError_AddRef,
272     parseError_Release,
273     parseError_GetTypeInfoCount,
274     parseError_GetTypeInfo,
275     parseError_GetIDsOfNames,
276     parseError_Invoke,
277     parseError_get_errorCode,
278     parseError_get_url,
279     parseError_get_reason,
280     parseError_get_srcText,
281     parseError_get_line,
282     parseError_get_linepos,
283     parseError_get_filepos
284 };
285 
286 IXMLDOMParseError *create_parseError( LONG code, BSTR url, BSTR reason, BSTR srcText,
287                                       LONG line, LONG linepos, LONG filepos )
288 {
289     parse_error_t *This;
290 
291     This = heap_alloc( sizeof(*This) );
292     if ( !This )
293         return NULL;
294 
295     This->lpVtbl = &parseError_vtbl;
296     This->ref = 1;
297 
298     This->code = code;
299     This->url = url;
300     This->reason = reason;
301     This->srcText = srcText;
302     This->line = line;
303     This->linepos = linepos;
304     This->filepos = filepos;
305 
306     return (IXMLDOMParseError*) &This->lpVtbl;
307 }
308 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~ [ freetext search ] ~ [ file search ] ~

This page was automatically generated by the LXR engine.
Visit the LXR main site for more information.