crypt32: Don't check for no data to decode in CryptDecodeObject{Ex}, doing so masks...
[wine] / dlls / mshtml / htmlinput.c
1 /*
2  * Copyright 2006 Jacek Caban for CodeWeavers
3  *
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.
8  *
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.
13  *
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
17  */
18
19 #include <stdarg.h>
20
21 #define COBJMACROS
22
23 #include "windef.h"
24 #include "winbase.h"
25 #include "winuser.h"
26 #include "ole2.h"
27
28 #include "wine/debug.h"
29
30 #include "mshtml_private.h"
31
32 WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
33
34 typedef struct {
35     HTMLElement element;
36
37     const IHTMLInputElementVtbl *lpHTMLInputElementVtbl;
38     const IHTMLInputTextElementVtbl *lpHTMLInputTextElementVtbl;
39
40     nsIDOMHTMLInputElement *nsinput;
41 } HTMLInputElement;
42
43 #define HTMLINPUT(x)      ((IHTMLInputElement*)      &(x)->lpHTMLInputElementVtbl)
44 #define HTMLINPUTTEXT(x)  ((IHTMLInputTextElement*)  &(x)->lpHTMLInputTextElementVtbl)
45
46 #define HTMLINPUT_THIS(iface) DEFINE_THIS(HTMLInputElement, HTMLInputElement, iface)
47
48 static HRESULT WINAPI HTMLInputElement_QueryInterface(IHTMLInputElement *iface,
49                                                          REFIID riid, void **ppv)
50 {
51     HTMLInputElement *This = HTMLINPUT_THIS(iface);
52
53     return IHTMLDOMNode_QueryInterface(HTMLDOMNODE(&This->element.node), riid, ppv);
54 }
55
56 static ULONG WINAPI HTMLInputElement_AddRef(IHTMLInputElement *iface)
57 {
58     HTMLInputElement *This = HTMLINPUT_THIS(iface);
59
60     return IHTMLDOMNode_AddRef(HTMLDOMNODE(&This->element.node));
61 }
62
63 static ULONG WINAPI HTMLInputElement_Release(IHTMLInputElement *iface)
64 {
65     HTMLInputElement *This = HTMLINPUT_THIS(iface);
66
67     return IHTMLDOMNode_Release(HTMLDOMNODE(&This->element.node));
68 }
69
70 static HRESULT WINAPI HTMLInputElement_GetTypeInfoCount(IHTMLInputElement *iface, UINT *pctinfo)
71 {
72     HTMLInputElement *This = HTMLINPUT_THIS(iface);
73
74     return IDispatchEx_GetTypeInfoCount(DISPATCHEX(&This->element.node.dispex), pctinfo);
75 }
76
77 static HRESULT WINAPI HTMLInputElement_GetTypeInfo(IHTMLInputElement *iface, UINT iTInfo,
78                                               LCID lcid, ITypeInfo **ppTInfo)
79 {
80     HTMLInputElement *This = HTMLINPUT_THIS(iface);
81
82     return IDispatchEx_GetTypeInfo(DISPATCHEX(&This->element.node.dispex), iTInfo, lcid, ppTInfo);
83 }
84
85 static HRESULT WINAPI HTMLInputElement_GetIDsOfNames(IHTMLInputElement *iface, REFIID riid,
86                                                 LPOLESTR *rgszNames, UINT cNames,
87                                                 LCID lcid, DISPID *rgDispId)
88 {
89     HTMLInputElement *This = HTMLINPUT_THIS(iface);
90
91     return IDispatchEx_GetIDsOfNames(DISPATCHEX(&This->element.node.dispex), riid, rgszNames,
92             cNames, lcid, rgDispId);
93 }
94
95 static HRESULT WINAPI HTMLInputElement_Invoke(IHTMLInputElement *iface, DISPID dispIdMember,
96                             REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
97                             VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
98 {
99     HTMLInputElement *This = HTMLINPUT_THIS(iface);
100
101     return IDispatchEx_Invoke(DISPATCHEX(&This->element.node.dispex), dispIdMember, riid, lcid, wFlags,
102             pDispParams, pVarResult, pExcepInfo, puArgErr);
103 }
104
105 static HRESULT WINAPI HTMLInputElement_put_type(IHTMLInputElement *iface, BSTR v)
106 {
107     HTMLInputElement *This = HTMLINPUT_THIS(iface);
108     FIXME("(%p)->(%s)\n", This, debugstr_w(v));
109     return E_NOTIMPL;
110 }
111
112 static HRESULT WINAPI HTMLInputElement_get_type(IHTMLInputElement *iface, BSTR *p)
113 {
114     HTMLInputElement *This = HTMLINPUT_THIS(iface);
115     nsAString type_str;
116     const PRUnichar *type;
117     nsresult nsres;
118
119     TRACE("(%p)->(%p)\n", This, p);
120
121     nsAString_Init(&type_str, NULL);
122     nsres = nsIDOMHTMLInputElement_GetType(This->nsinput, &type_str);
123
124     if(NS_SUCCEEDED(nsres)) {
125         nsAString_GetData(&type_str, &type);
126         *p = SysAllocString(type);
127     }else {
128         ERR("GetType failed: %08x\n", nsres);
129     }
130
131     nsAString_Finish(&type_str);
132
133     TRACE("type=%s\n", debugstr_w(*p));
134     return S_OK;
135 }
136
137 static HRESULT WINAPI HTMLInputElement_put_value(IHTMLInputElement *iface, BSTR v)
138 {
139     HTMLInputElement *This = HTMLINPUT_THIS(iface);
140     nsAString val_str;
141     nsresult nsres;
142
143     TRACE("(%p)->(%s)\n", This, debugstr_w(v));
144
145     nsAString_Init(&val_str, v);
146     nsres = nsIDOMHTMLInputElement_SetValue(This->nsinput, &val_str);
147     nsAString_Finish(&val_str);
148     if(NS_FAILED(nsres))
149         ERR("SetValue failed: %08x\n", nsres);
150
151     return S_OK;
152 }
153
154 static HRESULT WINAPI HTMLInputElement_get_value(IHTMLInputElement *iface, BSTR *p)
155 {
156     HTMLInputElement *This = HTMLINPUT_THIS(iface);
157     nsAString value_str;
158     const PRUnichar *value = NULL;
159     nsresult nsres;
160
161     TRACE("(%p)->(%p)\n", This, p);
162
163     nsAString_Init(&value_str, NULL);
164
165     nsres = nsIDOMHTMLInputElement_GetValue(This->nsinput, &value_str);
166     if(NS_SUCCEEDED(nsres)) {
167         nsAString_GetData(&value_str, &value);
168         *p = SysAllocString(value);
169     }else {
170         ERR("GetValue failed: %08x\n", nsres);
171     }
172
173     nsAString_Finish(&value_str);
174
175     TRACE("value=%s\n", debugstr_w(*p));
176     return S_OK;
177 }
178
179 static HRESULT WINAPI HTMLInputElement_put_name(IHTMLInputElement *iface, BSTR v)
180 {
181     HTMLInputElement *This = HTMLINPUT_THIS(iface);
182     FIXME("(%p)->(%s)\n", This, debugstr_w(v));
183     return E_NOTIMPL;
184 }
185
186 static HRESULT WINAPI HTMLInputElement_get_name(IHTMLInputElement *iface, BSTR *p)
187 {
188     HTMLInputElement *This = HTMLINPUT_THIS(iface);
189     nsAString name_str;
190     const PRUnichar *name;
191     nsresult nsres;
192
193     TRACE("(%p)->(%p)\n", This, p);
194
195     nsAString_Init(&name_str, NULL);
196
197     nsres = nsIDOMHTMLInputElement_GetName(This->nsinput, &name_str);
198     if(NS_SUCCEEDED(nsres)) {
199         nsAString_GetData(&name_str, &name);
200         *p = SysAllocString(name);
201     }else {
202         ERR("GetName failed: %08x\n", nsres);
203         return E_FAIL;
204     }
205
206     nsAString_Finish(&name_str);
207
208     TRACE("name=%s\n", debugstr_w(*p));
209     return S_OK;
210 }
211
212 static HRESULT WINAPI HTMLInputElement_put_status(IHTMLInputElement *iface, VARIANT_BOOL v)
213 {
214     HTMLInputElement *This = HTMLINPUT_THIS(iface);
215     FIXME("(%p)->(%x)\n", This, v);
216     return E_NOTIMPL;
217 }
218
219 static HRESULT WINAPI HTMLInputElement_get_status(IHTMLInputElement *iface, VARIANT_BOOL *p)
220 {
221     HTMLInputElement *This = HTMLINPUT_THIS(iface);
222     FIXME("(%p)->(%p)\n", This, p);
223     return E_NOTIMPL;
224 }
225
226 static HRESULT WINAPI HTMLInputElement_put_disabled(IHTMLInputElement *iface, VARIANT_BOOL v)
227 {
228     HTMLInputElement *This = HTMLINPUT_THIS(iface);
229     nsresult nsres;
230
231     TRACE("(%p)->(%x)\n", This, v);
232
233     nsres = nsIDOMHTMLInputElement_SetDisabled(This->nsinput, v != VARIANT_FALSE);
234     if(NS_FAILED(nsres))
235         ERR("SetDisabled failed: %08x\n", nsres);
236
237     return S_OK;
238 }
239
240 static HRESULT WINAPI HTMLInputElement_get_disabled(IHTMLInputElement *iface, VARIANT_BOOL *p)
241 {
242     HTMLInputElement *This = HTMLINPUT_THIS(iface);
243     PRBool disabled = FALSE;
244
245     TRACE("(%p)->(%p)\n", This, p);
246
247     nsIDOMHTMLInputElement_GetDisabled(This->nsinput, &disabled);
248
249     *p = disabled ? VARIANT_TRUE : VARIANT_FALSE;
250     return S_OK;
251 }
252
253 static HRESULT WINAPI HTMLInputElement_get_form(IHTMLInputElement *iface, IHTMLFormElement **p)
254 {
255     HTMLInputElement *This = HTMLINPUT_THIS(iface);
256     FIXME("(%p)->(%p)\n", This, p);
257     return E_NOTIMPL;
258 }
259
260 static HRESULT WINAPI HTMLInputElement_put_size(IHTMLInputElement *iface, long v)
261 {
262     HTMLInputElement *This = HTMLINPUT_THIS(iface);
263     FIXME("(%p)->(%ld)\n", This, v);
264     return E_NOTIMPL;
265 }
266
267 static HRESULT WINAPI HTMLInputElement_get_size(IHTMLInputElement *iface, long *p)
268 {
269     HTMLInputElement *This = HTMLINPUT_THIS(iface);
270     FIXME("(%p)->(%p)\n", This, p);
271     return E_NOTIMPL;
272 }
273
274 static HRESULT WINAPI HTMLInputElement_put_maxLength(IHTMLInputElement *iface, long v)
275 {
276     HTMLInputElement *This = HTMLINPUT_THIS(iface);
277     FIXME("(%p)->(%ld)\n", This, v);
278     return E_NOTIMPL;
279 }
280
281 static HRESULT WINAPI HTMLInputElement_get_maxLength(IHTMLInputElement *iface, long *p)
282 {
283     HTMLInputElement *This = HTMLINPUT_THIS(iface);
284     FIXME("(%p)->(%p)\n", This, p);
285     return E_NOTIMPL;
286 }
287
288 static HRESULT WINAPI HTMLInputElement_select(IHTMLInputElement *iface)
289 {
290     HTMLInputElement *This = HTMLINPUT_THIS(iface);
291     nsresult nsres;
292
293     TRACE("(%p)\n", This);
294
295     nsres = nsIDOMHTMLInputElement_Select(This->nsinput);
296     if(NS_FAILED(nsres)) {
297         ERR("Select failed: %08x\n", nsres);
298         return E_FAIL;
299     }
300
301     return S_OK;
302 }
303
304 static HRESULT WINAPI HTMLInputElement_put_onchange(IHTMLInputElement *iface, VARIANT v)
305 {
306     HTMLInputElement *This = HTMLINPUT_THIS(iface);
307     FIXME("(%p)->()\n", This);
308     return E_NOTIMPL;
309 }
310
311 static HRESULT WINAPI HTMLInputElement_get_onchange(IHTMLInputElement *iface, VARIANT *p)
312 {
313     HTMLInputElement *This = HTMLINPUT_THIS(iface);
314     FIXME("(%p)->(%p)\n", This, p);
315     return E_NOTIMPL;
316 }
317
318 static HRESULT WINAPI HTMLInputElement_put_onselect(IHTMLInputElement *iface, VARIANT v)
319 {
320     HTMLInputElement *This = HTMLINPUT_THIS(iface);
321     FIXME("(%p)->()\n", This);
322     return E_NOTIMPL;
323 }
324
325 static HRESULT WINAPI HTMLInputElement_get_onselect(IHTMLInputElement *iface, VARIANT *p)
326 {
327     HTMLInputElement *This = HTMLINPUT_THIS(iface);
328     FIXME("(%p)->(%p)\n", This, p);
329     return E_NOTIMPL;
330 }
331
332 static HRESULT WINAPI HTMLInputElement_put_defaultValue(IHTMLInputElement *iface, BSTR v)
333 {
334     HTMLInputElement *This = HTMLINPUT_THIS(iface);
335     FIXME("(%p)->(%s)\n", This, debugstr_w(v));
336     return E_NOTIMPL;
337 }
338
339 static HRESULT WINAPI HTMLInputElement_get_defaultValue(IHTMLInputElement *iface, BSTR *p)
340 {
341     HTMLInputElement *This = HTMLINPUT_THIS(iface);
342     FIXME("(%p)->(%p)\n", This, p);
343     return E_NOTIMPL;
344 }
345
346 static HRESULT WINAPI HTMLInputElement_put_readOnly(IHTMLInputElement *iface, VARIANT_BOOL v)
347 {
348     HTMLInputElement *This = HTMLINPUT_THIS(iface);
349     FIXME("(%p)->(%x)\n", This, v);
350     return E_NOTIMPL;
351 }
352
353 static HRESULT WINAPI HTMLInputElement_get_readOnly(IHTMLInputElement *iface, VARIANT_BOOL *p)
354 {
355     HTMLInputElement *This = HTMLINPUT_THIS(iface);
356     FIXME("(%p)->(%p)\n", This, p);
357     return E_NOTIMPL;
358 }
359
360 static HRESULT WINAPI HTMLInputElement_createTextRange(IHTMLInputElement *iface, IHTMLTxtRange **range)
361 {
362     HTMLInputElement *This = HTMLINPUT_THIS(iface);
363     FIXME("(%p)->(%p)\n", This, range);
364     return E_NOTIMPL;
365 }
366
367 static HRESULT WINAPI HTMLInputElement_put_indeterminate(IHTMLInputElement *iface, VARIANT_BOOL v)
368 {
369     HTMLInputElement *This = HTMLINPUT_THIS(iface);
370     FIXME("(%p)->(%x)\n", This, v);
371     return E_NOTIMPL;
372 }
373
374 static HRESULT WINAPI HTMLInputElement_get_indeterminate(IHTMLInputElement *iface, VARIANT_BOOL *p)
375 {
376     HTMLInputElement *This = HTMLINPUT_THIS(iface);
377     FIXME("(%p)->(%p)\n", This, p);
378     return E_NOTIMPL;
379 }
380
381 static HRESULT WINAPI HTMLInputElement_put_defaultChecked(IHTMLInputElement *iface, VARIANT_BOOL v)
382 {
383     HTMLInputElement *This = HTMLINPUT_THIS(iface);
384     FIXME("(%p)->(%x)\n", This, v);
385     return E_NOTIMPL;
386 }
387
388 static HRESULT WINAPI HTMLInputElement_get_defaultChecked(IHTMLInputElement *iface, VARIANT_BOOL *p)
389 {
390     HTMLInputElement *This = HTMLINPUT_THIS(iface);
391     FIXME("(%p)->(%p)\n", This, p);
392     return E_NOTIMPL;
393 }
394
395 static HRESULT WINAPI HTMLInputElement_put_checked(IHTMLInputElement *iface, VARIANT_BOOL v)
396 {
397     HTMLInputElement *This = HTMLINPUT_THIS(iface);
398     FIXME("(%p)->(%x)\n", This, v);
399     return E_NOTIMPL;
400 }
401
402 static HRESULT WINAPI HTMLInputElement_get_checked(IHTMLInputElement *iface, VARIANT_BOOL *p)
403 {
404     HTMLInputElement *This = HTMLINPUT_THIS(iface);
405     PRBool checked;
406     nsresult nsres;
407
408     TRACE("(%p)->(%p)\n", This, p);
409
410     nsres = nsIDOMHTMLInputElement_GetChecked(This->nsinput, &checked);
411     if(NS_FAILED(nsres)) {
412         ERR("GetChecked failed: %08x\n", nsres);
413         return E_FAIL;
414     }
415
416     *p = checked ? VARIANT_TRUE : VARIANT_FALSE;
417     TRACE("checked=%x\n", *p);
418     return S_OK;
419 }
420
421 static HRESULT WINAPI HTMLInputElement_put_border(IHTMLInputElement *iface, VARIANT v)
422 {
423     HTMLInputElement *This = HTMLINPUT_THIS(iface);
424     FIXME("(%p)->()\n", This);
425     return E_NOTIMPL;
426 }
427
428 static HRESULT WINAPI HTMLInputElement_get_border(IHTMLInputElement *iface, VARIANT *p)
429 {
430     HTMLInputElement *This = HTMLINPUT_THIS(iface);
431     FIXME("(%p)->(%p)\n", This, p);
432     return E_NOTIMPL;
433 }
434
435 static HRESULT WINAPI HTMLInputElement_put_vspace(IHTMLInputElement *iface, long v)
436 {
437     HTMLInputElement *This = HTMLINPUT_THIS(iface);
438     FIXME("(%p)->(%ld)\n", This, v);
439     return E_NOTIMPL;
440 }
441
442 static HRESULT WINAPI HTMLInputElement_get_vspace(IHTMLInputElement *iface, long *p)
443 {
444     HTMLInputElement *This = HTMLINPUT_THIS(iface);
445     FIXME("(%p)->(%p)\n", This, p);
446     return E_NOTIMPL;
447 }
448
449 static HRESULT WINAPI HTMLInputElement_put_hspace(IHTMLInputElement *iface, long v)
450 {
451     HTMLInputElement *This = HTMLINPUT_THIS(iface);
452     FIXME("(%p)->(%ld)\n", This, v);
453     return E_NOTIMPL;
454 }
455
456 static HRESULT WINAPI HTMLInputElement_get_hspace(IHTMLInputElement *iface, long *p)
457 {
458     HTMLInputElement *This = HTMLINPUT_THIS(iface);
459     FIXME("(%p)->(%p)\n", This, p);
460     return E_NOTIMPL;
461 }
462
463 static HRESULT WINAPI HTMLInputElement_put_alt(IHTMLInputElement *iface, BSTR v)
464 {
465     HTMLInputElement *This = HTMLINPUT_THIS(iface);
466     FIXME("(%p)->(%s)\n", This, debugstr_w(v));
467     return E_NOTIMPL;
468 }
469
470 static HRESULT WINAPI HTMLInputElement_get_alt(IHTMLInputElement *iface, BSTR *p)
471 {
472     HTMLInputElement *This = HTMLINPUT_THIS(iface);
473     FIXME("(%p)->(%p)\n", This, p);
474     return E_NOTIMPL;
475 }
476
477 static HRESULT WINAPI HTMLInputElement_put_src(IHTMLInputElement *iface, BSTR v)
478 {
479     HTMLInputElement *This = HTMLINPUT_THIS(iface);
480     FIXME("(%p)->(%s)\n", This, debugstr_w(v));
481     return E_NOTIMPL;
482 }
483
484 static HRESULT WINAPI HTMLInputElement_get_src(IHTMLInputElement *iface, BSTR *p)
485 {
486     HTMLInputElement *This = HTMLINPUT_THIS(iface);
487     FIXME("(%p)->(%p)\n", This, p);
488     return E_NOTIMPL;
489 }
490
491 static HRESULT WINAPI HTMLInputElement_put_lowsrc(IHTMLInputElement *iface, BSTR v)
492 {
493     HTMLInputElement *This = HTMLINPUT_THIS(iface);
494     FIXME("(%p)->(%s)\n", This, debugstr_w(v));
495     return E_NOTIMPL;
496 }
497
498 static HRESULT WINAPI HTMLInputElement_get_lowsrc(IHTMLInputElement *iface, BSTR *p)
499 {
500     HTMLInputElement *This = HTMLINPUT_THIS(iface);
501     FIXME("(%p)->(%p)\n", This, p);
502     return E_NOTIMPL;
503 }
504
505 static HRESULT WINAPI HTMLInputElement_put_vrml(IHTMLInputElement *iface, BSTR v)
506 {
507     HTMLInputElement *This = HTMLINPUT_THIS(iface);
508     FIXME("(%p)->(%s)\n", This, debugstr_w(v));
509     return E_NOTIMPL;
510 }
511
512 static HRESULT WINAPI HTMLInputElement_get_vrml(IHTMLInputElement *iface, BSTR *p)
513 {
514     HTMLInputElement *This = HTMLINPUT_THIS(iface);
515     FIXME("(%p)->(%p)\n", This, p);
516     return E_NOTIMPL;
517 }
518
519 static HRESULT WINAPI HTMLInputElement_put_dynsrc(IHTMLInputElement *iface, BSTR v)
520 {
521     HTMLInputElement *This = HTMLINPUT_THIS(iface);
522     FIXME("(%p)->(%s)\n", This, debugstr_w(v));
523     return E_NOTIMPL;
524 }
525
526 static HRESULT WINAPI HTMLInputElement_get_dynsrc(IHTMLInputElement *iface, BSTR *p)
527 {
528     HTMLInputElement *This = HTMLINPUT_THIS(iface);
529     FIXME("(%p)->(%p)\n", This, p);
530     return E_NOTIMPL;
531 }
532
533 static HRESULT WINAPI HTMLInputElement_get_readyState(IHTMLInputElement *iface, BSTR *p)
534 {
535     HTMLInputElement *This = HTMLINPUT_THIS(iface);
536     FIXME("(%p)->(%p)\n", This, p);
537     return E_NOTIMPL;
538 }
539
540 static HRESULT WINAPI HTMLInputElement_get_complete(IHTMLInputElement *iface, VARIANT_BOOL *p)
541 {
542     HTMLInputElement *This = HTMLINPUT_THIS(iface);
543     FIXME("(%p)->(%p)\n", This, p);
544     return E_NOTIMPL;
545 }
546
547 static HRESULT WINAPI HTMLInputElement_put_loop(IHTMLInputElement *iface, VARIANT v)
548 {
549     HTMLInputElement *This = HTMLINPUT_THIS(iface);
550     FIXME("(%p)->()\n", This);
551     return E_NOTIMPL;
552 }
553
554 static HRESULT WINAPI HTMLInputElement_get_loop(IHTMLInputElement *iface, VARIANT *p)
555 {
556     HTMLInputElement *This = HTMLINPUT_THIS(iface);
557     FIXME("(%p)->(%p)\n", This, p);
558     return E_NOTIMPL;
559 }
560
561 static HRESULT WINAPI HTMLInputElement_put_align(IHTMLInputElement *iface, BSTR v)
562 {
563     HTMLInputElement *This = HTMLINPUT_THIS(iface);
564     FIXME("(%p)->(%s)\n", This, debugstr_w(v));
565     return E_NOTIMPL;
566 }
567
568 static HRESULT WINAPI HTMLInputElement_get_align(IHTMLInputElement *iface, BSTR *p)
569 {
570     HTMLInputElement *This = HTMLINPUT_THIS(iface);
571     FIXME("(%p)->(%p)\n", This, p);
572     return E_NOTIMPL;
573 }
574
575 static HRESULT WINAPI HTMLInputElement_put_onload(IHTMLInputElement *iface, VARIANT v)
576 {
577     HTMLInputElement *This = HTMLINPUT_THIS(iface);
578     FIXME("(%p)->()\n", This);
579     return E_NOTIMPL;
580 }
581
582 static HRESULT WINAPI HTMLInputElement_get_onload(IHTMLInputElement *iface, VARIANT *p)
583 {
584     HTMLInputElement *This = HTMLINPUT_THIS(iface);
585     FIXME("(%p)->(%p)\n", This, p);
586     return E_NOTIMPL;
587 }
588
589 static HRESULT WINAPI HTMLInputElement_put_onerror(IHTMLInputElement *iface, VARIANT v)
590 {
591     HTMLInputElement *This = HTMLINPUT_THIS(iface);
592     FIXME("(%p)->()\n", This);
593     return E_NOTIMPL;
594 }
595
596 static HRESULT WINAPI HTMLInputElement_get_onerror(IHTMLInputElement *iface, VARIANT *p)
597 {
598     HTMLInputElement *This = HTMLINPUT_THIS(iface);
599     FIXME("(%p)->(%p)\n", This, p);
600     return E_NOTIMPL;
601 }
602
603 static HRESULT WINAPI HTMLInputElement_put_onabort(IHTMLInputElement *iface, VARIANT v)
604 {
605     HTMLInputElement *This = HTMLINPUT_THIS(iface);
606     FIXME("(%p)->()\n", This);
607     return E_NOTIMPL;
608 }
609
610 static HRESULT WINAPI HTMLInputElement_get_onabort(IHTMLInputElement *iface, VARIANT *p)
611 {
612     HTMLInputElement *This = HTMLINPUT_THIS(iface);
613     FIXME("(%p)->(%p)\n", This, p);
614     return E_NOTIMPL;
615 }
616
617 static HRESULT WINAPI HTMLInputElement_put_width(IHTMLInputElement *iface, long v)
618 {
619     HTMLInputElement *This = HTMLINPUT_THIS(iface);
620     FIXME("(%p)->(%ld)\n", This, v);
621     return E_NOTIMPL;
622 }
623
624 static HRESULT WINAPI HTMLInputElement_get_width(IHTMLInputElement *iface, long *p)
625 {
626     HTMLInputElement *This = HTMLINPUT_THIS(iface);
627     FIXME("(%p)->(%p)\n", This, p);
628     return E_NOTIMPL;
629 }
630
631 static HRESULT WINAPI HTMLInputElement_put_height(IHTMLInputElement *iface, long v)
632 {
633     HTMLInputElement *This = HTMLINPUT_THIS(iface);
634     FIXME("(%p)->(%ld)\n", This, v);
635     return E_NOTIMPL;
636 }
637
638 static HRESULT WINAPI HTMLInputElement_get_height(IHTMLInputElement *iface, long *p)
639 {
640     HTMLInputElement *This = HTMLINPUT_THIS(iface);
641     FIXME("(%p)->(%p)\n", This, p);
642     return E_NOTIMPL;
643 }
644
645 static HRESULT WINAPI HTMLInputElement_put_start(IHTMLInputElement *iface, BSTR v)
646 {
647     HTMLInputElement *This = HTMLINPUT_THIS(iface);
648     FIXME("(%p)->(%s)\n", This, debugstr_w(v));
649     return E_NOTIMPL;
650 }
651
652 static HRESULT WINAPI HTMLInputElement_get_start(IHTMLInputElement *iface, BSTR *p)
653 {
654     HTMLInputElement *This = HTMLINPUT_THIS(iface);
655     FIXME("(%p)->(%p)\n", This, p);
656     return E_NOTIMPL;
657 }
658
659 #undef HTMLINPUT_THIS
660
661 static const IHTMLInputElementVtbl HTMLInputElementVtbl = {
662     HTMLInputElement_QueryInterface,
663     HTMLInputElement_AddRef,
664     HTMLInputElement_Release,
665     HTMLInputElement_GetTypeInfoCount,
666     HTMLInputElement_GetTypeInfo,
667     HTMLInputElement_GetIDsOfNames,
668     HTMLInputElement_Invoke,
669     HTMLInputElement_put_type,
670     HTMLInputElement_get_type,
671     HTMLInputElement_put_value,
672     HTMLInputElement_get_value,
673     HTMLInputElement_put_name,
674     HTMLInputElement_get_name,
675     HTMLInputElement_put_status,
676     HTMLInputElement_get_status,
677     HTMLInputElement_put_disabled,
678     HTMLInputElement_get_disabled,
679     HTMLInputElement_get_form,
680     HTMLInputElement_put_size,
681     HTMLInputElement_get_size,
682     HTMLInputElement_put_maxLength,
683     HTMLInputElement_get_maxLength,
684     HTMLInputElement_select,
685     HTMLInputElement_put_onchange,
686     HTMLInputElement_get_onchange,
687     HTMLInputElement_put_onselect,
688     HTMLInputElement_get_onselect,
689     HTMLInputElement_put_defaultValue,
690     HTMLInputElement_get_defaultValue,
691     HTMLInputElement_put_readOnly,
692     HTMLInputElement_get_readOnly,
693     HTMLInputElement_createTextRange,
694     HTMLInputElement_put_indeterminate,
695     HTMLInputElement_get_indeterminate,
696     HTMLInputElement_put_defaultChecked,
697     HTMLInputElement_get_defaultChecked,
698     HTMLInputElement_put_checked,
699     HTMLInputElement_get_checked,
700     HTMLInputElement_put_border,
701     HTMLInputElement_get_border,
702     HTMLInputElement_put_vspace,
703     HTMLInputElement_get_vspace,
704     HTMLInputElement_put_hspace,
705     HTMLInputElement_get_hspace,
706     HTMLInputElement_put_alt,
707     HTMLInputElement_get_alt,
708     HTMLInputElement_put_src,
709     HTMLInputElement_get_src,
710     HTMLInputElement_put_lowsrc,
711     HTMLInputElement_get_lowsrc,
712     HTMLInputElement_put_vrml,
713     HTMLInputElement_get_vrml,
714     HTMLInputElement_put_dynsrc,
715     HTMLInputElement_get_dynsrc,
716     HTMLInputElement_get_readyState,
717     HTMLInputElement_get_complete,
718     HTMLInputElement_put_loop,
719     HTMLInputElement_get_loop,
720     HTMLInputElement_put_align,
721     HTMLInputElement_get_align,
722     HTMLInputElement_put_onload,
723     HTMLInputElement_get_onload,
724     HTMLInputElement_put_onerror,
725     HTMLInputElement_get_onerror,
726     HTMLInputElement_put_onabort,
727     HTMLInputElement_get_onabort,
728     HTMLInputElement_put_width,
729     HTMLInputElement_get_width,
730     HTMLInputElement_put_height,
731     HTMLInputElement_get_height,
732     HTMLInputElement_put_start,
733     HTMLInputElement_get_start
734 };
735
736 #define HTMLINPUTTEXT_THIS(iface) DEFINE_THIS(HTMLInputElement, HTMLInputTextElement, iface)
737
738 static HRESULT WINAPI HTMLInputTextElement_QueryInterface(IHTMLInputTextElement *iface,
739         REFIID riid, void **ppv)
740 {
741     HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
742
743     return IHTMLDOMNode_QueryInterface(HTMLDOMNODE(&This->element.node), riid, ppv);
744 }
745
746 static ULONG WINAPI HTMLInputTextElement_AddRef(IHTMLInputTextElement *iface)
747 {
748     HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
749
750     return IHTMLDOMNode_AddRef(HTMLDOMNODE(&This->element.node));
751 }
752
753 static ULONG WINAPI HTMLInputTextElement_Release(IHTMLInputTextElement *iface)
754 {
755     HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
756
757     return IHTMLDOMNode_Release(HTMLDOMNODE(&This->element.node));
758 }
759
760 static HRESULT WINAPI HTMLInputTextElement_GetTypeInfoCount(IHTMLInputTextElement *iface, UINT *pctinfo)
761 {
762     HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
763     return IDispatchEx_GetTypeInfoCount(DISPATCHEX(&This->element.node.dispex), pctinfo);
764 }
765
766 static HRESULT WINAPI HTMLInputTextElement_GetTypeInfo(IHTMLInputTextElement *iface, UINT iTInfo,
767         LCID lcid, ITypeInfo **ppTInfo)
768 {
769     HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
770     return IDispatchEx_GetTypeInfo(DISPATCHEX(&This->element.node.dispex), iTInfo, lcid, ppTInfo);
771 }
772
773 static HRESULT WINAPI HTMLInputTextElement_GetIDsOfNames(IHTMLInputTextElement *iface, REFIID riid,
774         LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
775 {
776     HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
777     return IDispatchEx_GetIDsOfNames(DISPATCHEX(&This->element.node.dispex), riid, rgszNames, cNames, lcid, rgDispId);
778 }
779
780 static HRESULT WINAPI HTMLInputTextElement_Invoke(IHTMLInputTextElement *iface, DISPID dispIdMember,
781                             REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
782                             VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
783 {
784     HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
785     return IDispatchEx_Invoke(DISPATCHEX(&This->element.node.dispex), dispIdMember, riid, lcid, wFlags, pDispParams,
786             pVarResult, pExcepInfo, puArgErr);
787 }
788
789 static HRESULT WINAPI HTMLInputTextElement_get_type(IHTMLInputTextElement *iface, BSTR *p)
790 {
791     HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
792
793     TRACE("(%p)->(%p)\n", This, p);
794
795     return IHTMLInputElement_get_type(HTMLINPUT(This), p);
796 }
797
798 static HRESULT WINAPI HTMLInputTextElement_put_value(IHTMLInputTextElement *iface, BSTR v)
799 {
800     HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
801
802     TRACE("(%p)->(%s)\n", This, debugstr_w(v));
803
804     return IHTMLInputElement_put_value(HTMLINPUT(This), v);
805 }
806
807 static HRESULT WINAPI HTMLInputTextElement_get_value(IHTMLInputTextElement *iface, BSTR *p)
808 {
809     HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
810
811     TRACE("(%p)->(%p)\n", This, p);
812
813     return IHTMLInputTextElement_get_value(HTMLINPUT(This), p);
814 }
815
816 static HRESULT WINAPI HTMLInputTextElement_put_name(IHTMLInputTextElement *iface, BSTR v)
817 {
818     HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
819
820     TRACE("(%p)->(%s)\n", This, debugstr_w(v));
821
822     return IHTMLInputElement_put_name(HTMLINPUT(This), v);
823 }
824
825 static HRESULT WINAPI HTMLInputTextElement_get_name(IHTMLInputTextElement *iface, BSTR *p)
826 {
827     HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
828
829     TRACE("(%p)->(%p)\n", This, p);
830
831     return IHTMLInputElement_get_name(HTMLINPUT(This), p);
832 }
833
834 static HRESULT WINAPI HTMLInputTextElement_put_status(IHTMLInputTextElement *iface, VARIANT v)
835 {
836     HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
837     FIXME("(%p)->(v)\n", This);
838     return E_NOTIMPL;
839 }
840
841 static HRESULT WINAPI HTMLInputTextElement_get_status(IHTMLInputTextElement *iface, VARIANT *p)
842 {
843     HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
844     TRACE("(%p)->(v)\n", This);
845     return E_NOTIMPL;
846 }
847
848 static HRESULT WINAPI HTMLInputTextElement_put_disabled(IHTMLInputTextElement *iface, VARIANT_BOOL v)
849 {
850     HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
851
852     TRACE("(%p)->(%x)\n", This, v);
853
854     return IHTMLInputElement_put_disabled(HTMLINPUT(This), v);
855 }
856
857 static HRESULT WINAPI HTMLInputTextElement_get_disabled(IHTMLInputTextElement *iface, VARIANT_BOOL *p)
858 {
859     HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
860
861     TRACE("(%p)->(%p)\n", This, p);
862
863     return IHTMLInputElement_get_disabled(HTMLINPUT(This), p);
864 }
865
866 static HRESULT WINAPI HTMLInputTextElement_get_form(IHTMLInputTextElement *iface, IHTMLFormElement **p)
867 {
868     HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
869
870     TRACE("(%p)->(%p)\n", This, p);
871
872     return IHTMLInputElement_get_form(HTMLINPUT(This), p);
873 }
874
875 static HRESULT WINAPI HTMLInputTextElement_put_defaultValue(IHTMLInputTextElement *iface, BSTR v)
876 {
877     HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
878
879     TRACE("(%p)->(%s)\n", This, debugstr_w(v));
880
881     return IHTMLInputElement_put_defaultValue(HTMLINPUT(This), v);
882 }
883
884 static HRESULT WINAPI HTMLInputTextElement_get_defaultValue(IHTMLInputTextElement *iface, BSTR *p)
885 {
886     HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
887
888     TRACE("(%p)->(%p)\n", This, p);
889
890     return IHTMLInputElement_get_defaultValue(HTMLINPUT(This), p);
891 }
892
893 static HRESULT WINAPI HTMLInputTextElement_put_size(IHTMLInputTextElement *iface, long v)
894 {
895     HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
896
897     TRACE("(%p)->(%ld)\n", This, v);
898
899     return IHTMLInputElement_put_size(HTMLINPUT(This), v);
900 }
901
902 static HRESULT WINAPI HTMLInputTextElement_get_size(IHTMLInputTextElement *iface, long *p)
903 {
904     HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
905
906     TRACE("(%p)->(%p)\n", This, p);
907
908     return IHTMLInputElement_get_size(HTMLINPUT(This), p);
909 }
910
911 static HRESULT WINAPI HTMLInputTextElement_put_maxLength(IHTMLInputTextElement *iface, long v)
912 {
913     HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
914
915     TRACE("(%p)->(%ld)\n", This, v);
916
917     return IHTMLInputElement_put_maxLength(HTMLINPUT(This), v);
918 }
919
920 static HRESULT WINAPI HTMLInputTextElement_get_maxLength(IHTMLInputTextElement *iface, long *p)
921 {
922     HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
923
924     TRACE("(%p)->(%p)\n", This, p);
925
926     return IHTMLInputElement_get_maxLength(HTMLINPUT(This), p);
927 }
928
929 static HRESULT WINAPI HTMLInputTextElement_select(IHTMLInputTextElement *iface)
930 {
931     HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
932
933     TRACE("(%p)\n", This);
934
935     return IHTMLInputElement_select(HTMLINPUT(This));
936 }
937
938 static HRESULT WINAPI HTMLInputTextElement_put_onchange(IHTMLInputTextElement *iface, VARIANT v)
939 {
940     HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
941
942     TRACE("(%p)->()\n", This);
943
944     return IHTMLInputElement_put_onchange(HTMLINPUT(This), v);
945 }
946
947 static HRESULT WINAPI HTMLInputTextElement_get_onchange(IHTMLInputTextElement *iface, VARIANT *p)
948 {
949     HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
950
951     TRACE("(%p)->(%p)\n", This, p);
952
953     return IHTMLInputElement_get_onchange(HTMLINPUT(This), p);
954 }
955
956 static HRESULT WINAPI HTMLInputTextElement_put_onselect(IHTMLInputTextElement *iface, VARIANT v)
957 {
958     HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
959
960     TRACE("(%p)->()\n", This);
961
962     return IHTMLInputElement_put_onselect(HTMLINPUT(This), v);
963 }
964
965 static HRESULT WINAPI HTMLInputTextElement_get_onselect(IHTMLInputTextElement *iface, VARIANT *p)
966 {
967     HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
968
969     TRACE("(%p)->(%p)\n", This, p);
970
971     return IHTMLInputElement_get_onselect(HTMLINPUT(This), p);
972 }
973
974 static HRESULT WINAPI HTMLInputTextElement_put_readOnly(IHTMLInputTextElement *iface, VARIANT_BOOL v)
975 {
976     HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
977
978     TRACE("(%p)->(%x)\n", This, v);
979
980     return IHTMLInputElement_put_readOnly(HTMLINPUT(This), v);
981 }
982
983 static HRESULT WINAPI HTMLInputTextElement_get_readOnly(IHTMLInputTextElement *iface, VARIANT_BOOL *p)
984 {
985     HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
986
987     TRACE("(%p)->(%p)\n", This, p);
988
989     return IHTMLInputElement_get_readOnly(HTMLINPUT(This), p);
990 }
991
992 static HRESULT WINAPI HTMLInputTextElement_createTextRange(IHTMLInputTextElement *iface, IHTMLTxtRange **range)
993 {
994     HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
995
996     TRACE("(%p)->(%p)\n", This, range);
997
998     return IHTMLInputElement_createTextRange(HTMLINPUT(This), range);
999 }
1000
1001 #undef HTMLINPUT_THIS
1002
1003 static const IHTMLInputTextElementVtbl HTMLInputTextElementVtbl = {
1004     HTMLInputTextElement_QueryInterface,
1005     HTMLInputTextElement_AddRef,
1006     HTMLInputTextElement_Release,
1007     HTMLInputTextElement_GetTypeInfoCount,
1008     HTMLInputTextElement_GetTypeInfo,
1009     HTMLInputTextElement_GetIDsOfNames,
1010     HTMLInputTextElement_Invoke,
1011     HTMLInputTextElement_get_type,
1012     HTMLInputTextElement_put_value,
1013     HTMLInputTextElement_get_value,
1014     HTMLInputTextElement_put_name,
1015     HTMLInputTextElement_get_name,
1016     HTMLInputTextElement_put_status,
1017     HTMLInputTextElement_get_status,
1018     HTMLInputTextElement_put_disabled,
1019     HTMLInputTextElement_get_disabled,
1020     HTMLInputTextElement_get_form,
1021     HTMLInputTextElement_put_defaultValue,
1022     HTMLInputTextElement_get_defaultValue,
1023     HTMLInputTextElement_put_size,
1024     HTMLInputTextElement_get_size,
1025     HTMLInputTextElement_put_maxLength,
1026     HTMLInputTextElement_get_maxLength,
1027     HTMLInputTextElement_select,
1028     HTMLInputTextElement_put_onchange,
1029     HTMLInputTextElement_get_onchange,
1030     HTMLInputTextElement_put_onselect,
1031     HTMLInputTextElement_get_onselect,
1032     HTMLInputTextElement_put_readOnly,
1033     HTMLInputTextElement_get_readOnly,
1034     HTMLInputTextElement_createTextRange
1035 };
1036
1037 #define HTMLINPUT_NODE_THIS(iface) DEFINE_THIS2(HTMLInputElement, element.node, iface)
1038
1039 static HRESULT HTMLInputElement_QI(HTMLDOMNode *iface, REFIID riid, void **ppv)
1040 {
1041     HTMLInputElement *This = HTMLINPUT_NODE_THIS(iface);
1042
1043     *ppv = NULL;
1044
1045     if(IsEqualGUID(&IID_IUnknown, riid)) {
1046         TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv);
1047         *ppv = HTMLINPUT(This);
1048     }else if(IsEqualGUID(&IID_IDispatch, riid)) {
1049         TRACE("(%p)->(IID_IDispatch %p)\n", This, ppv);
1050         *ppv = HTMLINPUT(This);
1051     }else if(IsEqualGUID(&IID_IHTMLInputElement, riid)) {
1052         TRACE("(%p)->(IID_IHTMLInputElement %p)\n", This, ppv);
1053         *ppv = HTMLINPUT(This);
1054     }else if(IsEqualGUID(&IID_IHTMLInputTextElement, riid)) {
1055         TRACE("(%p)->(IID_IHTMLInputTextElement %p)\n", This, ppv);
1056         *ppv = HTMLINPUT(This);
1057     }
1058
1059     if(*ppv) {
1060         IUnknown_AddRef((IUnknown*)*ppv);
1061         return S_OK;
1062     }
1063
1064     return HTMLElement_QI(&This->element.node, riid, ppv);
1065 }
1066
1067 static void HTMLInputElement_destructor(HTMLDOMNode *iface)
1068 {
1069     HTMLInputElement *This = HTMLINPUT_NODE_THIS(iface);
1070
1071     nsIDOMHTMLInputElement_Release(This->nsinput);
1072
1073     HTMLElement_destructor(&This->element.node);
1074 }
1075
1076 static HRESULT HTMLInputElementImpl_put_disabled(HTMLDOMNode *iface, VARIANT_BOOL v)
1077 {
1078     HTMLInputElement *This = HTMLINPUT_NODE_THIS(iface);
1079     return IHTMLInputElement_put_disabled(HTMLINPUT(This), v);
1080 }
1081
1082 static HRESULT HTMLInputElementImpl_get_disabled(HTMLDOMNode *iface, VARIANT_BOOL *p)
1083 {
1084     HTMLInputElement *This = HTMLINPUT_NODE_THIS(iface);
1085     return IHTMLInputElement_get_disabled(HTMLINPUT(This), p);
1086 }
1087
1088 #undef HTMLINPUT_NODE_THIS
1089
1090 static const NodeImplVtbl HTMLInputElementImplVtbl = {
1091     HTMLInputElement_QI,
1092     HTMLInputElement_destructor,
1093     HTMLInputElementImpl_put_disabled,
1094     HTMLInputElementImpl_get_disabled,
1095 };
1096
1097 static const tid_t HTMLInputElement_iface_tids[] = {
1098     IHTMLDOMNode_tid,
1099     IHTMLDOMNode2_tid,
1100     IHTMLElement_tid,
1101     IHTMLElement2_tid,
1102     IHTMLElement3_tid,
1103     IHTMLInputElement_tid,
1104     0
1105 };
1106 static dispex_static_data_t HTMLInputElement_dispex = {
1107     NULL,
1108     DispHTMLInputElement_tid,
1109     NULL,
1110     HTMLInputElement_iface_tids
1111 };
1112
1113 HTMLElement *HTMLInputElement_Create(nsIDOMHTMLElement *nselem)
1114 {
1115     HTMLInputElement *ret = heap_alloc_zero(sizeof(HTMLInputElement));
1116     nsresult nsres;
1117
1118     ret->lpHTMLInputElementVtbl = &HTMLInputElementVtbl;
1119     ret->element.node.vtbl = &HTMLInputElementImplVtbl;
1120
1121     init_dispex(&ret->element.node.dispex, (IUnknown*)HTMLINPUT(ret), &HTMLInputElement_dispex);
1122     HTMLElement_Init(&ret->element);
1123
1124     nsres = nsIDOMHTMLElement_QueryInterface(nselem, &IID_nsIDOMHTMLInputElement,
1125                                              (void**)&ret->nsinput);
1126     if(NS_FAILED(nsres))
1127         ERR("Could not get nsIDOMHTMLInputElement interface: %08x\n", nsres);
1128
1129     return &ret->element;
1130 }