ReactOS 0.4.16-dev-981-g80eb313
txtsrv.c
Go to the documentation of this file.
1/*
2 * Unit test suite for windowless rich edit controls
3 *
4 * Copyright 2008 Maarten Lankhorst
5 * Copyright 2008 Austin Lund
6 * Copyright 2008 Dylan Smith
7 *
8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation; either
11 * version 2.1 of the License, or (at your option) any later version.
12 *
13 * This library is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
17 *
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with this library; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
21 */
22
23#define COBJMACROS
24#define CONST_VTABLE
25
26#include <stdio.h>
27#include <stdarg.h>
28#include <windef.h>
29#include <winbase.h>
30#include <objbase.h>
31#include <richedit.h>
32#include <tom.h>
33#include <richole.h>
34#include <initguid.h>
35#include <imm.h>
36#include <textserv.h>
37#include <wine/test.h>
38#include <oleauto.h>
39#include <limits.h>
40
46
47/* Define C Macros for ITextServices calls. */
48
49/* Use a special table for x86 machines to convert the thiscall
50 * calling convention. This isn't needed on other platforms. */
51#if defined(__i386__) && !defined(__MINGW32__) && (!defined(_MSC_VER) || !defined(__clang__))
52static ITextServicesVtbl itextServicesStdcallVtbl;
53#define TXTSERV_VTABLE(This) (&itextServicesStdcallVtbl)
54#else /* __i386__ */
55#define TXTSERV_VTABLE(This) (This)->lpVtbl
56#endif /* __i386__ */
57
58#define ITextServices_TxSendMessage(This,a,b,c,d) TXTSERV_VTABLE(This)->TxSendMessage(This,a,b,c,d)
59#define ITextServices_TxDraw(This,a,b,c,d,e,f,g,h,i,j,k,l) TXTSERV_VTABLE(This)->TxDraw(This,a,b,c,d,e,f,g,h,i,j,k,l)
60#define ITextServices_TxGetHScroll(This,a,b,c,d,e) TXTSERV_VTABLE(This)->TxGetHScroll(This,a,b,c,d,e)
61#define ITextServices_TxGetVScroll(This,a,b,c,d,e) TXTSERV_VTABLE(This)->TxGetVScroll(This,a,b,c,d,e)
62#define ITextServices_OnTxSetCursor(This,a,b,c,d,e,f,g,h,i) TXTSERV_VTABLE(This)->OnTxSetCursor(This,a,b,c,d,e,f,g,h,i)
63#define ITextServices_TxQueryHitPoint(This,a,b,c,d,e,f,g,h,i,j) TXTSERV_VTABLE(This)->TxQueryHitPoint(This,a,b,c,d,e,f,g,h,i,j)
64#define ITextServices_OnTxInPlaceActivate(This,a) TXTSERV_VTABLE(This)->OnTxInPlaceActivate(This,a)
65#define ITextServices_OnTxInPlaceDeactivate(This) TXTSERV_VTABLE(This)->OnTxInPlaceDeactivate(This)
66#define ITextServices_OnTxUIActivate(This) TXTSERV_VTABLE(This)->OnTxUIActivate(This)
67#define ITextServices_OnTxUIDeactivate(This) TXTSERV_VTABLE(This)->OnTxUIDeactivate(This)
68#define ITextServices_TxGetText(This,a) TXTSERV_VTABLE(This)->TxGetText(This,a)
69#define ITextServices_TxSetText(This,a) TXTSERV_VTABLE(This)->TxSetText(This,a)
70#define ITextServices_TxGetCurTargetX(This,a) TXTSERV_VTABLE(This)->TxGetCurTargetX(This,a)
71#define ITextServices_TxGetBaseLinePos(This,a) TXTSERV_VTABLE(This)->TxGetBaseLinePos(This,a)
72#define ITextServices_TxGetNaturalSize(This,a,b,c,d,e,f,g,h) TXTSERV_VTABLE(This)->TxGetNaturalSize(This,a,b,c,d,e,f,g,h)
73#define ITextServices_TxGetDropTarget(This,a) TXTSERV_VTABLE(This)->TxGetDropTarget(This,a)
74#define ITextServices_OnTxPropertyBitsChange(This,a,b) TXTSERV_VTABLE(This)->OnTxPropertyBitsChange(This,a,b)
75#define ITextServices_TxGetCachedSize(This,a,b) TXTSERV_VTABLE(This)->TxGetCachedSize(This,a,b)
76
77/* Set the WINETEST_DEBUG environment variable to be greater than 1 for verbose
78 * function call traces of ITextHost. */
79#define TRACECALL if(winetest_debug > 1) trace
80
81/************************************************************************/
82/* ITextHost implementation for conformance testing. */
83
84typedef struct ITextHostTestImpl
85{
86 ITextHost ITextHost_iface;
93
94static inline ITextHostTestImpl *impl_from_ITextHost(ITextHost *iface)
95{
96 return CONTAINING_RECORD(iface, ITextHostTestImpl, ITextHost_iface);
97}
98
99static const WCHAR lorem[] = L"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. "
100 "Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. "
101 "Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. "
102 "Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.";
103
105 REFIID riid,
107{
109
111 *ppvObject = &This->ITextHost_iface;
112 ITextHost_AddRef((ITextHost *)*ppvObject);
113 return S_OK;
114 }
115
116 return E_NOINTERFACE;
117}
118
119static ULONG WINAPI ITextHostImpl_AddRef(ITextHost *iface)
120{
122 ULONG refCount = InterlockedIncrement(&This->refCount);
123 return refCount;
124}
125
126static ULONG WINAPI ITextHostImpl_Release(ITextHost *iface)
127{
129 ULONG refCount = InterlockedDecrement(&This->refCount);
130
131 if (!refCount)
132 {
134 return 0;
135 } else {
136 return refCount;
137 }
138}
139
140static HDC __thiscall ITextHostImpl_TxGetDC(ITextHost *iface)
141{
143 TRACECALL("Call to TxGetDC(%p)\n", This);
144 if (This->window) return GetDC( This->window );
145 return NULL;
146}
147
149{
151 TRACECALL("Call to TxReleaseDC(%p)\n", This);
152 if (This->window) return ReleaseDC( This->window, hdc );
153 return 0;
154}
155
156static BOOL __thiscall ITextHostImpl_TxShowScrollBar(ITextHost *iface, INT fnBar, BOOL fShow)
157{
159 TRACECALL("Call to TxShowScrollBar(%p, fnBar=%d, fShow=%d)\n",
160 This, fnBar, fShow);
161 return FALSE;
162}
163
164static BOOL __thiscall ITextHostImpl_TxEnableScrollBar(ITextHost *iface, INT fuSBFlags, INT fuArrowflags)
165{
167 TRACECALL("Call to TxEnableScrollBar(%p, fuSBFlags=%d, fuArrowflags=%d)\n",
168 This, fuSBFlags, fuArrowflags);
169 return FALSE;
170}
171
172static BOOL __thiscall ITextHostImpl_TxSetScrollRange(ITextHost *iface, INT fnBar, LONG nMinPos,
173 INT nMaxPos, BOOL fRedraw)
174{
176 TRACECALL("Call to TxSetScrollRange(%p, fnBar=%d, nMinPos=%d, nMaxPos=%d, fRedraw=%d)\n",
177 This, fnBar, nMinPos, nMaxPos, fRedraw);
178 return FALSE;
179}
180
181static BOOL __thiscall ITextHostImpl_TxSetScrollPos(ITextHost *iface, INT fnBar, INT nPos, BOOL fRedraw)
182{
184 TRACECALL("Call to TxSetScrollPos(%p, fnBar=%d, nPos=%d, fRedraw=%d)\n",
185 This, fnBar, nPos, fRedraw);
186 return FALSE;
187}
188
189static void __thiscall ITextHostImpl_TxInvalidateRect(ITextHost *iface, LPCRECT prc, BOOL fMode)
190{
192 TRACECALL("Call to TxInvalidateRect(%p, prc=%p, fMode=%d)\n",
193 This, prc, fMode);
194}
195
196static void __thiscall ITextHostImpl_TxViewChange(ITextHost *iface, BOOL fUpdate)
197{
199 TRACECALL("Call to TxViewChange(%p, fUpdate=%d)\n",
200 This, fUpdate);
201}
202
203static BOOL __thiscall ITextHostImpl_TxCreateCaret(ITextHost *iface, HBITMAP hbmp, INT xWidth, INT yHeight)
204{
206 TRACECALL("Call to TxCreateCaret(%p, nbmp=%p, xWidth=%d, yHeight=%d)\n",
207 This, hbmp, xWidth, yHeight);
208 return FALSE;
209}
210
211static BOOL __thiscall ITextHostImpl_TxShowCaret(ITextHost *iface, BOOL fShow)
212{
214 TRACECALL("Call to TxShowCaret(%p, fShow=%d)\n",
215 This, fShow);
216 return FALSE;
217}
218
220{
222 TRACECALL("Call to TxSetCaretPos(%p, x=%d, y=%d)\n", This, x, y);
223 return FALSE;
224}
225
226static BOOL __thiscall ITextHostImpl_TxSetTimer(ITextHost *iface, UINT idTimer, UINT uTimeout)
227{
229 TRACECALL("Call to TxSetTimer(%p, idTimer=%u, uTimeout=%u)\n",
230 This, idTimer, uTimeout);
231 return FALSE;
232}
233
234static void __thiscall ITextHostImpl_TxKillTimer(ITextHost *iface, UINT idTimer)
235{
237 TRACECALL("Call to TxKillTimer(%p, idTimer=%u)\n", This, idTimer);
238}
239
240static void __thiscall ITextHostImpl_TxScrollWindowEx(ITextHost *iface, INT dx, INT dy, LPCRECT lprcScroll,
241 LPCRECT lprcClip, HRGN hRgnUpdate, LPRECT lprcUpdate,
242 UINT fuScroll)
243{
245 TRACECALL("Call to TxScrollWindowEx(%p, %d, %d, %p, %p, %p, %p, %d)\n",
246 This, dx, dy, lprcScroll, lprcClip, hRgnUpdate, lprcUpdate, fuScroll);
247}
248
249static void __thiscall ITextHostImpl_TxSetCapture(ITextHost *iface, BOOL fCapture)
250{
252 TRACECALL("Call to TxSetCapture(%p, fCapture=%d)\n", This, fCapture);
253}
254
255static void __thiscall ITextHostImpl_TxSetFocus(ITextHost *iface)
256{
258 TRACECALL("Call to TxSetFocus(%p)\n", This);
259}
260
261static void __thiscall ITextHostImpl_TxSetCursor(ITextHost *iface, HCURSOR hcur, BOOL fText)
262{
264 TRACECALL("Call to TxSetCursor(%p, hcur=%p, fText=%d)\n",
265 This, hcur, fText);
266}
267
269{
271 TRACECALL("Call to TxScreenToClient(%p, lppt=%p)\n", This, lppt);
272 return FALSE;
273}
274
276{
278 TRACECALL("Call to TxClientToScreen(%p, lppt=%p)\n", This, lppt);
279 return FALSE;
280}
281
282static HRESULT __thiscall ITextHostImpl_TxActivate(ITextHost *iface, LONG *plOldState)
283{
285 TRACECALL("Call to TxActivate(%p, plOldState=%p)\n", This, plOldState);
286 return E_NOTIMPL;
287}
288
289static HRESULT __thiscall ITextHostImpl_TxDeactivate(ITextHost *iface, LONG lNewState)
290{
292 TRACECALL("Call to TxDeactivate(%p, lNewState=%d)\n", This, lNewState);
293 return E_NOTIMPL;
294}
295
297{
299 TRACECALL("Call to TxGetClientRect(%p, prc=%p)\n", This, prc);
300 *prc = This->client_rect;
301 return S_OK;
302}
303
305{
307 TRACECALL("Call to TxGetViewInset(%p, prc=%p)\n", This, prc);
308 return E_NOTIMPL;
309}
310
311static HRESULT __thiscall ITextHostImpl_TxGetCharFormat(ITextHost *iface, const CHARFORMATW **ppCF)
312{
314 TRACECALL("Call to TxGetCharFormat(%p, ppCF=%p)\n", This, ppCF);
315 *ppCF = (CHARFORMATW *)&This->char_format;
316 return S_OK;
317}
318
319static HRESULT __thiscall ITextHostImpl_TxGetParaFormat(ITextHost *iface, const PARAFORMAT **ppPF)
320{
322 TRACECALL("Call to TxGetParaFormat(%p, ppPF=%p)\n", This, ppPF);
323 return E_NOTIMPL;
324}
325
326static COLORREF __thiscall ITextHostImpl_TxGetSysColor(ITextHost *iface, int nIndex)
327{
329 TRACECALL("Call to TxGetSysColor(%p, nIndex=%d)\n", This, nIndex);
330 return E_NOTIMPL;
331}
332
334{
336 TRACECALL("Call to TxGetBackStyle(%p, pStyle=%p)\n", This, pStyle);
337 return E_NOTIMPL;
338}
339
340static HRESULT __thiscall ITextHostImpl_TxGetMaxLength(ITextHost *iface, DWORD *pLength)
341{
343 TRACECALL("Call to TxGetMaxLength(%p, pLength=%p)\n", This, pLength);
344 return E_NOTIMPL;
345}
346
347static HRESULT __thiscall ITextHostImpl_TxGetScrollBars(ITextHost *iface, DWORD *scrollbars)
348{
350 TRACECALL("Call to TxGetScrollBars(%p, scrollbars=%p)\n", This, scrollbars);
351 *scrollbars = This->scrollbars;
352 return S_OK;
353}
354
356{
358 TRACECALL("Call to TxGetPasswordChar(%p, pch=%p)\n", This, pch);
359 return E_NOTIMPL;
360}
361
363{
365 TRACECALL("Call to TxGetAcceleratorPos(%p, pch=%p)\n", This, pch);
366 return E_NOTIMPL;
367}
368
369static HRESULT __thiscall ITextHostImpl_TxGetExtent(ITextHost *iface, LPSIZEL lpExtent)
370{
372 TRACECALL("Call to TxGetExtent(%p, lpExtent=%p)\n", This, lpExtent);
373 return E_NOTIMPL;
374}
375
377{
379 TRACECALL("Call to OnTxCharFormatChange(%p, pcf=%p)\n", This, pcf);
380 return E_NOTIMPL;
381}
382
384{
386 TRACECALL("Call to OnTxParaFormatChange(%p, ppf=%p)\n", This, ppf);
387 return E_NOTIMPL;
388}
389
390/* This must return S_OK for the native ITextServices object to
391 initialize. */
392static HRESULT __thiscall ITextHostImpl_TxGetPropertyBits(ITextHost *iface, DWORD dwMask, DWORD *pdwBits)
393{
395 TRACECALL("Call to TxGetPropertyBits(%p, dwMask=0x%08x, pdwBits=%p)\n",
396 This, dwMask, pdwBits);
397 *pdwBits = This->props & dwMask;
398 return S_OK;
399}
400
402static int en_update_sent;
403static HRESULT __thiscall ITextHostImpl_TxNotify( ITextHost *iface, DWORD code, void *data )
404{
406 TRACECALL( "Call to TxNotify(%p, code = %#x, data = %p)\n", This, code, data );
407 switch (code)
408 {
409 case EN_VSCROLL:
411 ok( !data, "got %p\n", data );
412 break;
413 case EN_UPDATE:
415 ok( !data, "got %p\n", data );
416 break;
417 }
418 return S_OK;
419}
420
422{
424 TRACECALL("Call to TxImmGetContext(%p)\n", This);
425 return 0;
426}
427
428static void __thiscall ITextHostImpl_TxImmReleaseContext(ITextHost *iface, HIMC himc)
429{
431 TRACECALL("Call to TxImmReleaseContext(%p, himc=%p)\n", This, himc);
432}
433
434/* This function must set the variable pointed to by *lSelBarWidth.
435 Otherwise an uninitialized value will be used to calculate
436 positions and sizes even if E_NOTIMPL is returned. */
437static HRESULT __thiscall ITextHostImpl_TxGetSelectionBarWidth(ITextHost *iface, LONG *lSelBarWidth)
438{
440 TRACECALL("Call to TxGetSelectionBarWidth(%p, lSelBarWidth=%p)\n",
441 This, lSelBarWidth);
442 *lSelBarWidth = 0;
443 return E_NOTIMPL;
444}
445
446static ITextHostVtbl itextHostVtbl = {
489};
490
491static void *wrapperCodeMem = NULL;
492
493#include "pshpack1.h"
494
495/* Code structure for x86 byte code */
496typedef struct
497{
498 BYTE pop_eax; /* popl %eax */
499 BYTE push_ecx; /* pushl %ecx */
500 BYTE push_eax; /* pushl %eax */
501 BYTE jmp_func; /* jmp $func */
504
505typedef struct
506{
507 BYTE pop_eax; /* popl %eax */
508 BYTE pop_ecx; /* popl %ecx */
509 BYTE push_eax; /* pushl %eax */
510 BYTE mov_vtable_eax[2]; /* movl (%ecx), %eax */
511 BYTE jmp_eax[2]; /* jmp *$vtablefunc_offset(%eax) */
514
515#include "poppack.h"
516
517static void setup_thiscall_wrappers(void)
518{
519#if defined(__i386__) && !defined(__MINGW32__) && (!defined(_MSC_VER) || !defined(__clang__))
520 void** pVtable;
521 void** pVtableEnd;
524
526 (sizeof(ITextHostVtbl)/sizeof(void*) - 3)
528 +(sizeof(ITextServicesVtbl)/sizeof(void*) - 3)
532
533 /* Wrap all ITextHostImpl methods with code to perform a thiscall to
534 * stdcall conversion. The thiscall calling convention places the This
535 * pointer in ecx on the x86 platform, and the stdcall calling convention
536 * pushes the This pointer on the stack as the first argument.
537 *
538 * The byte code does the conversion then jumps to the real function.
539 *
540 * Each wrapper needs to be modified so that the function to jump to is
541 * modified in the byte code. */
542
543 /* Skip QueryInterface, AddRef, and Release native actually
544 * defined them with the stdcall calling convention. */
545 pVtable = (void**)&itextHostVtbl + 3;
546 pVtableEnd = (void**)(&itextHostVtbl + 1);
547 while (pVtable != pVtableEnd) {
548 /* write byte code to executable memory */
549 thunk->pop_eax = 0x58; /* popl %eax */
550 thunk->push_ecx = 0x51; /* pushl %ecx */
551 thunk->push_eax = 0x50; /* pushl %eax */
552 thunk->jmp_func = 0xe9; /* jmp $func */
553 /* The address needs to be relative to the end of the jump instructions. */
554 thunk->func = (char*)*pVtable - (char*)(&thunk->func + 1);
555 *pVtable = thunk;
556 pVtable++;
557 thunk++;
558 }
559
560 /* Setup an ITextServices standard call vtable that will call the
561 * native thiscall vtable when the methods are called. */
562
563 /* QueryInterface, AddRef, and Release should be called directly on the
564 * real vtable since they use the stdcall calling convention. */
566 pVtable = (void**)&itextServicesStdcallVtbl + 3;
567 pVtableEnd = (void**)(&itextServicesStdcallVtbl + 1);
568 while (pVtable != pVtableEnd) {
569 /* write byte code to executable memory */
570 thunk2->pop_eax = 0x58; /* popl %eax */
571 thunk2->pop_ecx = 0x59; /* popl %ecx */
572 thunk2->push_eax = 0x50; /* pushl %eax */
573 thunk2->mov_vtable_eax[0] = 0x8b; /* movl (%ecx), %eax */
574 thunk2->mov_vtable_eax[1] = 0x01;
575 thunk2->jmp_eax[0] = 0xff; /* jmp *$vtablefunc_offset(%eax) */
576 thunk2->jmp_eax[1] = 0xa0;
577 thunk2->vtablefunc_offset = (char*)pVtable - (char*)&itextServicesStdcallVtbl;
578 *pVtable = thunk2;
579 pVtable++;
580 thunk2++;
581 }
582#endif /* __i386__ */
583}
584
585static void hf_to_cf(HFONT hf, CHARFORMAT2W *cf)
586{
587 LOGFONTW lf;
588
589 GetObjectW(hf, sizeof(lf), &lf);
590 lstrcpyW(cf->szFaceName, lf.lfFaceName);
591 cf->yHeight = MulDiv(abs(lf.lfHeight), 1440, GetDeviceCaps(GetDC(NULL), LOGPIXELSY));
592 if (lf.lfWeight > FW_NORMAL) cf->dwEffects |= CFE_BOLD;
593 if (lf.lfItalic) cf->dwEffects |= CFE_ITALIC;
594 if (lf.lfUnderline) cf->dwEffects |= CFE_UNDERLINE;
595 if (lf.lfStrikeOut) cf->dwEffects |= CFE_SUBSCRIPT;
596 cf->bPitchAndFamily = lf.lfPitchAndFamily;
597 cf->bCharSet = lf.lfCharSet;
598}
599
600/*************************************************************************/
601/* Conformance test functions. */
602
603/* Initialize the test texthost structure */
604static BOOL init_texthost(ITextServices **txtserv, ITextHost **ret)
605{
606 ITextHostTestImpl *dummyTextHost;
607 IUnknown *init;
609 HFONT hf;
610
611 dummyTextHost = CoTaskMemAlloc(sizeof(*dummyTextHost));
612 if (dummyTextHost == NULL) {
613 win_skip("Insufficient memory to create ITextHost interface\n");
614 return FALSE;
615 }
616 dummyTextHost->ITextHost_iface.lpVtbl = &itextHostVtbl;
617 dummyTextHost->refCount = 1;
618 dummyTextHost->window = NULL;
619 SetRectEmpty( &dummyTextHost->client_rect );
620 memset(&dummyTextHost->char_format, 0, sizeof(dummyTextHost->char_format));
621 dummyTextHost->char_format.cbSize = sizeof(dummyTextHost->char_format);
622 dummyTextHost->char_format.dwMask = CFM_ALL2;
623 dummyTextHost->scrollbars = 0;
624 dummyTextHost->props = 0;
626 hf_to_cf(hf, &dummyTextHost->char_format);
627
628 /* MSDN states that an IUnknown object is returned by
629 CreateTextServices which is then queried to obtain a
630 ITextServices object. */
631 result = pCreateTextServices(NULL, &dummyTextHost->ITextHost_iface, &init);
632 ok(result == S_OK, "Did not return S_OK when created (result = %x)\n", result);
633 ok(dummyTextHost->refCount == 1, "host ref %d\n", dummyTextHost->refCount);
634 if (result != S_OK) {
635 CoTaskMemFree(dummyTextHost);
636 win_skip("CreateTextServices failed.\n");
637 return FALSE;
638 }
639
640 result = IUnknown_QueryInterface(init, pIID_ITextServices, (void**)txtserv);
641 ok((result == S_OK) && (*txtserv != NULL), "Querying interface failed (result = %x, txtserv = %p)\n", result, *txtserv);
642 IUnknown_Release(init);
643 if (!((result == S_OK) && (*txtserv != NULL))) {
644 CoTaskMemFree(dummyTextHost);
645 win_skip("Could not retrieve ITextServices interface\n");
646 return FALSE;
647 }
648
649 *ret = &dummyTextHost->ITextHost_iface;
650 return TRUE;
651}
652
653static void fill_reobject_struct(REOBJECT *reobj, LONG cp, LPOLEOBJECT poleobj,
654 LPSTORAGE pstg, LPOLECLIENTSITE polesite, LONG sizel_cx,
655 LONG sizel_cy, DWORD aspect, DWORD flags, DWORD user)
656{
657 reobj->cbStruct = sizeof(*reobj);
658 reobj->clsid = CLSID_NULL;
659 reobj->cp = cp;
660 reobj->poleobj = poleobj;
661 reobj->pstg = pstg;
662 reobj->polesite = polesite;
663 reobj->sizel.cx = sizel_cx;
664 reobj->sizel.cy = sizel_cy;
665 reobj->dvaspect = aspect;
666 reobj->dwFlags = flags;
667 reobj->dwUser = user;
668}
669
670static void test_TxGetText(void)
671{
672 const WCHAR *expected_string;
673 IOleClientSite *clientsite;
674 ITextServices *txtserv;
675 IRichEditOle *reole;
676 REOBJECT reobject;
677 ITextHost *host;
679 BSTR rettext;
680
681 if (!init_texthost(&txtserv, &host))
682 return;
683
684 hres = ITextServices_TxGetText(txtserv, &rettext);
685 ok(hres == S_OK, "ITextServices_TxGetText failed (result = %x)\n", hres);
686 SysFreeString(rettext);
687
688 hres = ITextServices_TxSetText(txtserv, L"abcdefg");
689 ok(hres == S_OK, "Got hres: %#x.\n", hres);
690 hres = ITextServices_QueryInterface(txtserv, &IID_IRichEditOle, (void **)&reole);
691 ok(hres == S_OK, "Got hres: %#x.\n", hres);
692 hres = IRichEditOle_GetClientSite(reole, &clientsite);
693 ok(hres == S_OK, "Got hres: %#x.\n", hres);
694 expected_string = L"abc\xfffc""defg";
695 fill_reobject_struct(&reobject, 3, NULL, NULL, clientsite, 10, 10, DVASPECT_CONTENT, 0, 1);
696 hres = IRichEditOle_InsertObject(reole, &reobject);
697 ok(hres == S_OK, "Got hres: %#x.\n", hres);
698 hres = ITextServices_TxGetText(txtserv, &rettext);
699 ok(hres == S_OK, "Got hres: %#x.\n", hres);
700 ok(lstrlenW(rettext) == lstrlenW(expected_string), "Got wrong length: %d.\n", lstrlenW(rettext));
701 todo_wine ok(!lstrcmpW(rettext, expected_string), "Got wrong content: %s.\n", debugstr_w(rettext));
702 SysFreeString(rettext);
703 IOleClientSite_Release(clientsite);
704 IRichEditOle_Release(reole);
705
706 ITextServices_Release(txtserv);
707 ITextHost_Release(host);
708}
709
710static void test_TxSetText(void)
711{
712 ITextServices *txtserv;
713 ITextHost *host;
715 BSTR rettext;
716 WCHAR settext[] = {'T','e','s','t',0};
717
718 if (!init_texthost(&txtserv, &host))
719 return;
720
721 hres = ITextServices_TxSetText(txtserv, settext);
722 ok(hres == S_OK, "ITextServices_TxSetText failed (result = %x)\n", hres);
723
724 hres = ITextServices_TxGetText(txtserv, &rettext);
725 ok(hres == S_OK, "ITextServices_TxGetText failed (result = %x)\n", hres);
726
727 ok(SysStringLen(rettext) == 4,
728 "String returned of wrong length (expected 4, got %d)\n", SysStringLen(rettext));
729 ok(memcmp(rettext,settext,SysStringByteLen(rettext)) == 0,
730 "String returned differs\n");
731
732 SysFreeString(rettext);
733
734 /* Null-pointer should behave the same as empty-string */
735
736 hres = ITextServices_TxSetText(txtserv, 0);
737 ok(hres == S_OK, "ITextServices_TxSetText failed (result = %x)\n", hres);
738
739 hres = ITextServices_TxGetText(txtserv, &rettext);
740 ok(hres == S_OK, "ITextServices_TxGetText failed (result = %x)\n", hres);
741 ok(SysStringLen(rettext) == 0,
742 "String returned of wrong length (expected 0, got %d)\n", SysStringLen(rettext));
743
744 SysFreeString(rettext);
745 ITextServices_Release(txtserv);
746 ITextHost_Release(host);
747}
748
749#define CHECK_TXGETNATURALSIZE(res,width,height,hdc,rect,string) \
750 _check_txgetnaturalsize(res, width, height, hdc, rect, string, __LINE__)
752{
754 LONG expected_width, expected_height;
755
757 expected_width = expected_rect.right - expected_rect.left;
758 expected_height = expected_rect.bottom - expected_rect.top;
759 ok_(__FILE__,line)(res == S_OK, "ITextServices_TxGetNaturalSize failed: 0x%08x.\n", res);
760 todo_wine ok_(__FILE__,line)(width >= expected_width && width <= expected_width + 1,
761 "got wrong width: %d, expected: %d {+1}.\n", width, expected_width);
762 ok_(__FILE__,line)(height == expected_height, "got wrong height: %d, expected: %d.\n",
763 height, expected_height);
764}
765
766static void test_TxGetNaturalSize(void)
767{
768 ITextServices *txtserv;
769 ITextHost *host;
772 static const WCHAR test_text[] = L"TestSomeText";
774 HDC hdcDraw;
775 HWND hwnd;
776 RECT rect;
778 LRESULT lresult;
779 HFONT hf;
780
781 if (!init_texthost(&txtserv, &host))
782 return;
783
784 hwnd = CreateWindowExA(0, "static", NULL, WS_POPUP | WS_VISIBLE,
785 0, 0, 100, 100, 0, 0, 0, NULL);
786 hdcDraw = GetDC(hwnd);
787 SetMapMode(hdcDraw,MM_TEXT);
789
790 memset(&cf, 0, sizeof(cf));
791 cf.cbSize = sizeof(cf);
792 cf.dwMask = CFM_ALL2;
794 hf_to_cf(hf, &cf);
796 ok(result == S_OK, "ITextServices_TxSendMessage failed: 0x%08x.\n", result);
797 SelectObject(hdcDraw, hf);
798
799 result = ITextServices_TxSetText(txtserv, test_text);
800 ok(result == S_OK, "ITextServices_TxSetText failed: 0x%08x.\n", result);
801
802 extent.cx = -1; extent.cy = -1;
803 width = rect.right - rect.left;
804 height = 0;
805 result = ITextServices_TxGetNaturalSize(txtserv, DVASPECT_CONTENT, hdcDraw, NULL, NULL,
807 CHECK_TXGETNATURALSIZE(result, width, height, hdcDraw, rect, test_text);
808
809 ReleaseDC(hwnd, hdcDraw);
811 ITextServices_Release(txtserv);
812 ITextHost_Release(host);
813}
814
815static void test_TxDraw(void)
816{
817 ITextServices *txtserv;
818 ITextHost *host;
819 HRESULT hr;
820 RECT client = {0, 0, 100, 100};
821 ITextHostTestImpl *host_impl;
822 HDC hdc;
823
824 if (!init_texthost(&txtserv, &host))
825 return;
826
827 host_impl = impl_from_ITextHost( host );
828 host_impl->window = CreateWindowExA( 0, "static", NULL, WS_POPUP | WS_VISIBLE,
829 0, 0, 400, 400, 0, 0, 0, NULL );
830 host_impl->client_rect = client;
833 host_impl->props );
834 hdc = GetDC( host_impl->window );
835
836 hr = ITextServices_TxDraw( txtserv, DVASPECT_CONTENT, 0, NULL, NULL, NULL, NULL, NULL, NULL,
838 ok( hr == E_INVALIDARG, "got %08x\n", hr );
839 hr = ITextServices_TxDraw( txtserv, DVASPECT_CONTENT, 0, NULL, NULL, hdc, NULL, NULL, NULL,
841 ok( hr == E_INVALIDARG, "got %08x\n", hr );
842 hr = ITextServices_TxDraw( txtserv, DVASPECT_CONTENT, 0, NULL, NULL, NULL, NULL, (RECTL *)&client, NULL,
844 ok( hr == E_FAIL, "got %08x\n", hr );
845 hr = ITextServices_TxDraw( txtserv, DVASPECT_CONTENT, 0, NULL, NULL, hdc, NULL, (RECTL *)&client, NULL,
847 ok( hr == S_OK, "got %08x\n", hr );
848 hr = ITextServices_TxDraw( txtserv, DVASPECT_CONTENT, 0, NULL, NULL, hdc, NULL, (RECTL *)&client, NULL,
849 NULL, NULL, 0, TXTVIEW_ACTIVE );
850 ok( hr == S_OK, "got %08x\n", hr );
851
853 ok( hr == S_OK, "got %08x\n", hr );
854
855 hr = ITextServices_TxDraw( txtserv, DVASPECT_CONTENT, 0, NULL, NULL, NULL, NULL, NULL, NULL,
857 ok( hr == S_OK, "got %08x\n", hr );
858
860
861 ReleaseDC( host_impl->window, hdc );
862 ITextServices_Release(txtserv);
863 DestroyWindow( host_impl->window );
864 ITextHost_Release(host);
865}
866
867DEFINE_GUID(expected_iid_itextservices, 0x8d33f740, 0xcf58, 0x11ce, 0xa8, 0x9d, 0x00, 0xaa, 0x00, 0x6c, 0xad, 0xc5);
868DEFINE_GUID(expected_iid_itexthost, 0x13e670f4,0x1a5a,0x11cf,0xab,0xeb,0x00,0xaa,0x00,0xb6,0x5e,0xa1);
869DEFINE_GUID(expected_iid_itexthost2, 0x13e670f5,0x1a5a,0x11cf,0xab,0xeb,0x00,0xaa,0x00,0xb6,0x5e,0xa1);
870
871static void test_IIDs(void)
872{
873 ok(IsEqualIID(pIID_ITextServices, &expected_iid_itextservices),
874 "unexpected value for IID_ITextServices: %s\n", wine_dbgstr_guid(pIID_ITextServices));
875 ok(IsEqualIID(pIID_ITextHost, &expected_iid_itexthost),
876 "unexpected value for IID_ITextHost: %s\n", wine_dbgstr_guid(pIID_ITextHost));
877 ok(IsEqualIID(pIID_ITextHost2, &expected_iid_itexthost2),
878 "unexpected value for IID_ITextHost2: %s\n", wine_dbgstr_guid(pIID_ITextHost2));
879}
880
881/* Outer IUnknown for COM aggregation tests */
882struct unk_impl {
884 LONG ref;
886};
887
888static inline struct unk_impl *impl_from_IUnknown(IUnknown *iface)
889{
890 return CONTAINING_RECORD(iface, struct unk_impl, IUnknown_iface);
891}
892
894{
895 struct unk_impl *This = impl_from_IUnknown(iface);
896
897 return IUnknown_QueryInterface(This->inner_unk, riid, ppv);
898}
899
901{
902 struct unk_impl *This = impl_from_IUnknown(iface);
903
904 return InterlockedIncrement(&This->ref);
905}
906
908{
909 struct unk_impl *This = impl_from_IUnknown(iface);
910
911 return InterlockedDecrement(&This->ref);
912}
913
914static const IUnknownVtbl unk_vtbl =
915{
919};
920
921static void test_COM(void)
922{
923 struct unk_impl unk_obj = {{&unk_vtbl}, 19, NULL};
924 struct ITextHostTestImpl texthost = {{&itextHostVtbl}, 1};
925 ITextServices *textsrv;
926 ULONG refcount;
927 HRESULT hr;
928
929 /* COM aggregation */
931 &unk_obj.inner_unk);
932 ok(hr == S_OK, "CreateTextServices failed: %08x\n", hr);
933 hr = IUnknown_QueryInterface(unk_obj.inner_unk, pIID_ITextServices, (void**)&textsrv);
934 ok(hr == S_OK, "QueryInterface for IID_ITextServices failed: %08x\n", hr);
935 refcount = ITextServices_AddRef(textsrv);
936 ok(refcount == unk_obj.ref, "CreateTextServices just pretends to support COM aggregation\n");
937 refcount = ITextServices_Release(textsrv);
938 ok(refcount == unk_obj.ref, "CreateTextServices just pretends to support COM aggregation\n");
939 refcount = ITextServices_Release(textsrv);
940 ok(refcount == 19, "Refcount should be back at 19 but is %u\n", refcount);
941
942 IUnknown_Release(unk_obj.inner_unk);
943}
944
946{
947 IUnknown_AddRef(iface);
948 return IUnknown_Release(iface);
949}
950
951static void test_QueryInterface(void)
952{
953 ITextServices *txtserv;
954 ITextHost *host;
956 IRichEditOle *reole, *txtsrv_reole;
957 ITextDocument *txtdoc, *txtsrv_txtdoc;
958 ITextDocument2Old *txtdoc2old, *txtsrv_txtdoc2old;
959 IUnknown *unk, *unk2;
960 ULONG refcount;
961
962 if(!init_texthost(&txtserv, &host))
963 return;
964
965 refcount = get_refcount((IUnknown *)txtserv);
966 ok(refcount == 1, "got wrong ref count: %d\n", refcount);
967
968 /* IID_IRichEditOle */
969 hres = ITextServices_QueryInterface(txtserv, &IID_IRichEditOle, (void **)&txtsrv_reole);
970 ok(hres == S_OK, "ITextServices_QueryInterface: 0x%08x\n", hres);
971 refcount = get_refcount((IUnknown *)txtserv);
972 ok(refcount == 2, "got wrong ref count: %d\n", refcount);
973 refcount = get_refcount((IUnknown *)txtsrv_reole);
974 ok(refcount == 2, "got wrong ref count: %d\n", refcount);
975
976 hres = ITextServices_QueryInterface( txtserv, &IID_IUnknown, (void **)&unk );
977 ok( hres == S_OK, "got 0x%08x\n", hres );
978 hres = IRichEditOle_QueryInterface( txtsrv_reole, &IID_IUnknown, (void **)&unk2 );
979 ok( hres == S_OK, "got 0x%08x\n", hres );
980 ok( unk == unk2, "unknowns differ\n" );
981 IUnknown_Release( unk2 );
982 IUnknown_Release( unk );
983
984 hres = IRichEditOle_QueryInterface(txtsrv_reole, &IID_ITextDocument, (void **)&txtdoc);
985 ok(hres == S_OK, "IRichEditOle_QueryInterface: 0x%08x\n", hres);
986 refcount = get_refcount((IUnknown *)txtserv);
987 ok(refcount == 3, "got wrong ref count: %d\n", refcount);
988 refcount = get_refcount((IUnknown *)txtsrv_reole);
989 ok(refcount == 3, "got wrong ref count: %d\n", refcount);
990
991 ITextDocument_Release(txtdoc);
992 refcount = get_refcount((IUnknown *)txtserv);
993 ok(refcount == 2, "got wrong ref count: %d\n", refcount);
994
995 hres = IRichEditOle_QueryInterface(txtsrv_reole, &IID_ITextDocument2Old, (void **)&txtdoc2old);
996 ok(hres == S_OK, "IRichEditOle_QueryInterface: 0x%08x\n", hres);
997 refcount = get_refcount((IUnknown *)txtserv);
998 ok(refcount == 3, "got wrong ref count: %d\n", refcount);
999 refcount = get_refcount((IUnknown *)txtsrv_reole);
1000 ok(refcount == 3, "got wrong ref count: %d\n", refcount);
1001
1002 ITextDocument2Old_Release(txtdoc2old);
1003 refcount = get_refcount((IUnknown *)txtserv);
1004 ok(refcount == 2, "got wrong ref count: %d\n", refcount);
1005 IRichEditOle_Release(txtsrv_reole);
1006 refcount = get_refcount((IUnknown *)txtserv);
1007 ok(refcount == 1, "got wrong ref count: %d\n", refcount);
1008
1009 /* IID_ITextDocument */
1010 hres = ITextServices_QueryInterface(txtserv, &IID_ITextDocument, (void **)&txtsrv_txtdoc);
1011 ok(hres == S_OK, "ITextServices_QueryInterface: 0x%08x\n", hres);
1012 refcount = get_refcount((IUnknown *)txtserv);
1013 ok(refcount == 2, "got wrong ref count: %d\n", refcount);
1014 refcount = get_refcount((IUnknown *)txtsrv_txtdoc);
1015 ok(refcount == 2, "got wrong ref count: %d\n", refcount);
1016
1017 hres = ITextDocument_QueryInterface(txtsrv_txtdoc, &IID_IRichEditOle, (void **)&reole);
1018 ok(hres == S_OK, "ITextDocument_QueryInterface: 0x%08x\n", hres);
1019 refcount = get_refcount((IUnknown *)txtserv);
1020 ok(refcount == 3, "got wrong ref count: %d\n", refcount);
1021 refcount = get_refcount((IUnknown *)txtsrv_txtdoc);
1022 ok(refcount == 3, "got wrong ref count: %d\n", refcount);
1023
1024 IRichEditOle_Release(reole);
1025 refcount = get_refcount((IUnknown *)txtserv);
1026 ok(refcount == 2, "got wrong ref count: %d\n", refcount);
1027 ITextDocument_Release(txtsrv_txtdoc);
1028 refcount = get_refcount((IUnknown *)txtserv);
1029 ok(refcount == 1, "got wrong ref count: %d\n", refcount);
1030
1031 /* ITextDocument2Old */
1032 hres = ITextServices_QueryInterface(txtserv, &IID_ITextDocument2Old, (void **)&txtsrv_txtdoc2old);
1033 ok(hres == S_OK, "ITextServices_QueryInterface: 0x%08x\n", hres);
1034 refcount = get_refcount((IUnknown *)txtserv);
1035 ok(refcount == 2, "got wrong ref count: %d\n", refcount);
1036 refcount = get_refcount((IUnknown *)txtsrv_txtdoc2old);
1037 ok(refcount == 2, "got wrong ref count: %d\n", refcount);
1038
1039 hres = ITextDocument2Old_QueryInterface(txtsrv_txtdoc2old, &IID_IRichEditOle, (void **)&reole);
1040 ok(hres == S_OK, "ITextDocument2Old_QueryInterface: 0x%08x\n", hres);
1041 refcount = get_refcount((IUnknown *)txtserv);
1042 ok(refcount == 3, "got wrong ref count: %d\n", refcount);
1043 refcount = get_refcount((IUnknown *)txtsrv_txtdoc2old);
1044 ok(refcount == 3, "got wrong ref count: %d\n", refcount);
1045
1046 IRichEditOle_Release(reole);
1047 refcount = get_refcount((IUnknown *)txtserv);
1048 ok(refcount == 2, "got wrong ref count: %d\n", refcount);
1049 ITextDocument2Old_Release(txtsrv_txtdoc2old);
1050 refcount = get_refcount((IUnknown *)txtserv);
1051 ok(refcount == 1, "got wrong ref count: %d\n", refcount);
1052
1053 ITextServices_Release(txtserv);
1054 ITextHost_Release(host);
1055}
1056
1057static void test_default_format(void)
1058{
1059 ITextServices *txtserv;
1060 ITextHost *host;
1062 LRESULT lresult;
1063 CHARFORMAT2W cf2;
1064 const CHARFORMATW *host_cf;
1065 DWORD expected_effects;
1066
1067 if (!init_texthost(&txtserv, &host))
1068 return;
1069
1070 cf2.cbSize = sizeof(CHARFORMAT2W);
1072 ok(result == S_OK, "ITextServices_TxSendMessage failed: 0x%08x.\n", result);
1073
1075 ok(!lstrcmpW(host_cf->szFaceName, cf2.szFaceName), "got wrong font name: %s.\n", wine_dbgstr_w(cf2.szFaceName));
1076 ok(cf2.yHeight == host_cf->yHeight, "got wrong yHeight: %d, expected %d.\n", cf2.yHeight, host_cf->yHeight);
1077 expected_effects = (cf2.dwEffects & ~(CFE_AUTOCOLOR | CFE_AUTOBACKCOLOR));
1078 ok(host_cf->dwEffects == expected_effects, "got wrong dwEffects: %x, expected %x.\n", cf2.dwEffects, expected_effects);
1079 ok(cf2.bPitchAndFamily == host_cf->bPitchAndFamily, "got wrong bPitchAndFamily: %x, expected %x.\n",
1080 cf2.bPitchAndFamily, host_cf->bPitchAndFamily);
1081 ok(cf2.bCharSet == host_cf->bCharSet, "got wrong bCharSet: %x, expected %x.\n", cf2.bCharSet, host_cf->bCharSet);
1082
1083 ITextServices_Release(txtserv);
1084 ITextHost_Release(host);
1085}
1086
1087static void test_TxGetScroll(void)
1088{
1089 ITextServices *txtserv;
1090 ITextHost *host;
1091 HRESULT ret;
1092 LONG min_pos, max_pos, pos, page;
1093 BOOL enabled;
1094 ITextHostTestImpl *host_impl;
1095 RECT client = {0, 0, 100, 100};
1096
1097 if (!init_texthost(&txtserv, &host))
1098 return;
1099
1100 host_impl = impl_from_ITextHost( host );
1101
1103 ok(ret == S_OK, "ITextServices_TxGetHScroll failed: 0x%08x.\n", ret);
1104
1106 ok(ret == S_OK, "ITextServices_TxGetVScroll failed: 0x%08x.\n", ret);
1107
1108 ret = ITextServices_TxGetVScroll( txtserv, &min_pos, &max_pos, &pos, &page, &enabled );
1109 ok( ret == S_OK, "ITextServices_TxGetHScroll failed: 0x%08x.\n", ret );
1110 ok( min_pos == 0, "got %d\n", min_pos );
1111 ok( max_pos == 0, "got %d\n", max_pos );
1112 ok( pos == 0, "got %d\n", pos );
1113 ok( page == 0, "got %d\n", page );
1114 ok( !enabled, "got %d\n", enabled );
1115
1116 host_impl->scrollbars = WS_VSCROLL;
1119
1120 host_impl->window = CreateWindowExA( 0, "static", NULL, WS_POPUP | WS_VISIBLE,
1121 0, 0, 400, 400, 0, 0, 0, NULL );
1122 host_impl->client_rect = client;
1124 ok( ret == S_OK, "got 0x%08x.\n", ret );
1125
1126 ret = ITextServices_TxGetVScroll( txtserv, &min_pos, &max_pos, &pos, &page, &enabled );
1127 ok( ret == S_OK, "ITextServices_TxGetHScroll failed: 0x%08x.\n", ret );
1128 ok( min_pos == 0, "got %d\n", min_pos );
1130 ok( max_pos == 0, "got %d\n", max_pos );
1131 ok( pos == 0, "got %d\n", pos );
1132 ok( page == client.bottom, "got %d\n", page );
1133 ok( !enabled, "got %d\n", enabled );
1134
1135 ret = ITextServices_TxSetText( txtserv, lorem );
1136 ok( ret == S_OK, "got 0x%08x.\n", ret );
1137
1138 ret = ITextServices_TxGetVScroll( txtserv, &min_pos, &max_pos, &pos, &page, &enabled );
1139 ok( ret == S_OK, "ITextServices_TxGetHScroll failed: 0x%08x.\n", ret );
1140 ok( min_pos == 0, "got %d\n", min_pos );
1141 ok( max_pos > client.bottom, "got %d\n", max_pos );
1142 ok( pos == 0, "got %d\n", pos );
1143 ok( page == client.bottom, "got %d\n", page );
1144 ok( enabled, "got %d\n", enabled );
1145
1148 ITextServices_TxSetText( txtserv, L"short" );
1149
1150 ret = ITextServices_TxGetVScroll( txtserv, &min_pos, &max_pos, &pos, &page, &enabled );
1151 ok( ret == S_OK, "ITextServices_TxGetHScroll failed: 0x%08x.\n", ret );
1152 ok( min_pos == 0, "got %d\n", min_pos );
1154 ok( max_pos == 0, "got %d\n", max_pos );
1155 ok( pos == 0, "got %d\n", pos );
1156 ok( page == client.bottom, "got %d\n", page );
1157 ok( !enabled, "got %d\n", enabled );
1158
1159 DestroyWindow( host_impl->window );
1160 ITextServices_Release(txtserv);
1161 ITextHost_Release(host);
1162}
1163
1164static void test_notifications( void )
1165{
1166 ITextServices *txtserv;
1167 ITextHost *host;
1168 LRESULT res;
1169 HRESULT hr;
1170 RECT client = { 0, 0, 100, 100 };
1171 ITextHostTestImpl *host_impl;
1172
1173 init_texthost( &txtserv, &host );
1174 host_impl = impl_from_ITextHost( host );
1175
1176 host_impl->scrollbars = WS_VSCROLL;
1179
1180 ITextServices_TxSetText( txtserv, lorem );
1181
1182 host_impl->window = CreateWindowExA( 0, "static", NULL, WS_POPUP | WS_VISIBLE,
1183 0, 0, 400, 400, 0, 0, 0, NULL );
1184 host_impl->client_rect = client;
1186 ok( hr == S_OK, "got 0x%08x.\n", hr );
1187
1189 ok( hr == S_OK, "got %08x\n", hr );
1190
1191 /* check EN_VSCROLL notification is sent */
1192 en_vscroll_sent = 0;
1194 ok( hr == S_OK, "got %08x\n", hr );
1195 ok( en_vscroll_sent == 1, "got %d\n", en_vscroll_sent );
1196
1198 ok( hr == S_OK, "got %08x\n", hr );
1199 ok( en_vscroll_sent == 2, "got %d\n", en_vscroll_sent );
1200
1201 /* but not when the thumb is moved */
1203 ok( hr == S_OK, "got %08x\n", hr );
1205 ok( hr == S_OK, "got %08x\n", hr );
1206 ok( en_vscroll_sent == 2, "got %d\n", en_vscroll_sent );
1207
1208 /* EN_UPDATE is sent by TxDraw() */
1209 en_update_sent = 0;
1210 hr = ITextServices_TxDraw( txtserv, DVASPECT_CONTENT, 0, NULL, NULL, NULL, NULL, NULL, NULL,
1211 NULL, NULL, 0, TXTVIEW_ACTIVE );
1212 ok( hr == S_OK, "got %08x\n", hr );
1213 ok( en_update_sent == 1, "got %d\n", en_update_sent );
1214
1215 DestroyWindow( host_impl->window );
1216 ITextServices_Release( txtserv );
1217 ITextHost_Release( host );
1218}
1219
1220START_TEST( txtsrv )
1221{
1222 ITextServices *txtserv;
1223 ITextHost *host;
1224
1226
1227 /* Must explicitly LoadLibrary(). The test has no references to functions in
1228 * RICHED20.DLL, so the linker doesn't actually link to it. */
1229 hmoduleRichEdit = LoadLibraryA("riched20.dll");
1230 ok(hmoduleRichEdit != NULL, "error: %d\n", (int) GetLastError());
1231
1232 pIID_ITextServices = (IID*)GetProcAddress(hmoduleRichEdit, "IID_ITextServices");
1233 pIID_ITextHost = (IID*)GetProcAddress(hmoduleRichEdit, "IID_ITextHost");
1234 pIID_ITextHost2 = (IID*)GetProcAddress(hmoduleRichEdit, "IID_ITextHost2");
1235 pCreateTextServices = (void*)GetProcAddress(hmoduleRichEdit, "CreateTextServices");
1236
1237 test_IIDs();
1238 test_COM();
1239
1240 if (init_texthost(&txtserv, &host))
1241 {
1242 ITextServices_Release(txtserv);
1243 ITextHost_Release(host);
1244
1248 test_TxDraw();
1253 }
1255}
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
Definition: utclib.c:112
#define InterlockedIncrement
Definition: armddk.h:53
#define InterlockedDecrement
Definition: armddk.h:52
#define ok(value,...)
Definition: atltest.h:57
#define START_TEST(x)
Definition: atltest.h:75
#define ok_(x1, x2)
Definition: atltest.h:61
void user(int argc, const char *argv[])
Definition: cmds.c:1350
const GUID IID_IUnknown
HBITMAP hbmp
#define E_INVALIDARG
Definition: ddrawi.h:101
#define E_NOTIMPL
Definition: ddrawi.h:99
#define E_FAIL
Definition: ddrawi.h:102
DWORD HIMC
Definition: dimm.idl:75
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define GetProcAddress(x, y)
Definition: compat.h:753
OLECHAR * BSTR
Definition: compat.h:2293
#define lstrcpyW
Definition: compat.h:749
#define lstrlenW
Definition: compat.h:750
HINSTANCE WINAPI DECLSPEC_HOTPATCH LoadLibraryA(LPCSTR lpLibFileName)
Definition: loader.c:111
int WINAPI lstrcmpW(LPCWSTR str1, LPCWSTR str2)
Definition: locale.c:4243
static struct text_services * impl_from_IUnknown(IUnknown *iface)
Definition: txtsrv.c:36
#define ITextServices_TxSetText(This, a)
Definition: editor.h:419
#define ITextServices_TxDraw(This, a, b, c, d, e, f, g, h, i, j, k, l)
Definition: editor.h:409
#define ITextServices_OnTxInPlaceDeactivate(This)
Definition: editor.h:415
#define ITextServices_TxSendMessage(This, a, b, c, d)
Definition: editor.h:408
#define ITextServices_OnTxInPlaceActivate(This, a)
Definition: editor.h:414
#define ITextServices_TxGetHScroll(This, a, b, c, d, e)
Definition: editor.h:410
#define ITextServices_TxGetVScroll(This, a, b, c, d, e)
Definition: editor.h:411
#define ITextServices_OnTxPropertyBitsChange(This, a, b)
Definition: editor.h:424
#define ITextServices_TxGetText(This, a)
Definition: editor.h:418
#define ITextServices_TxGetNaturalSize(This, a, b, c, d, e, f, g, h)
Definition: editor.h:422
#define abs(i)
Definition: fconv.c:206
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
GLint GLint GLsizei GLsizei height
Definition: gl.h:1546
GLint GLint GLsizei width
Definition: gl.h:1546
GLenum GLenum GLsizei const GLuint GLboolean enabled
Definition: glext.h:7750
GLuint res
Definition: glext.h:9613
GLbitfield flags
Definition: glext.h:7161
GLuint64EXT * result
Definition: glext.h:11304
VOID WINAPI CoTaskMemFree(LPVOID ptr)
Definition: ifs.c:442
LPVOID WINAPI CoTaskMemAlloc(SIZE_T size)
Definition: ifs.c:426
REFIID riid
Definition: atlbase.h:39
REFIID LPVOID * ppv
Definition: atlbase.h:39
#define S_OK
Definition: intsafe.h:52
#define debugstr_w
Definition: kernel32.h:32
#define wine_dbgstr_w
Definition: kernel32.h:34
GLint dy
Definition: linetemp.h:97
GLint dx
Definition: linetemp.h:97
POINT cp
Definition: magnifier.c:59
#define pch(ap)
Definition: match.c:418
HDC hdc
Definition: main.c:9
static HBITMAP
Definition: button.c:44
static HDC
Definition: imagelist.c:88
static DWORD *static HFONT(WINAPI *pCreateFontIndirectExA)(const ENUMLOGFONTEXDVA *)
HRESULT hres
Definition: protocol.c:465
#define todo_wine
Definition: custom.c:89
#define __thiscall
Definition: cpp.c:43
static IID * pIID_ITextServices
Definition: txtsrv.c:42
static HRESULT __thiscall ITextHostImpl_TxGetMaxLength(ITextHost *iface, DWORD *pLength)
Definition: txtsrv.c:340
static HRESULT __thiscall ITextHostImpl_TxGetViewInset(ITextHost *iface, LPRECT prc)
Definition: txtsrv.c:304
static HRESULT __thiscall ITextHostImpl_OnTxCharFormatChange(ITextHost *iface, const CHARFORMATW *pcf)
Definition: txtsrv.c:376
#define CHECK_TXGETNATURALSIZE(res, width, height, hdc, rect, string)
Definition: txtsrv.c:749
static COLORREF __thiscall ITextHostImpl_TxGetSysColor(ITextHost *iface, int nIndex)
Definition: txtsrv.c:326
static void test_TxGetNaturalSize(void)
Definition: txtsrv.c:766
static void fill_reobject_struct(REOBJECT *reobj, LONG cp, LPOLEOBJECT poleobj, LPSTORAGE pstg, LPOLECLIENTSITE polesite, LONG sizel_cx, LONG sizel_cy, DWORD aspect, DWORD flags, DWORD user)
Definition: txtsrv.c:653
static INT __thiscall ITextHostImpl_TxReleaseDC(ITextHost *iface, HDC hdc)
Definition: txtsrv.c:148
static BOOL __thiscall ITextHostImpl_TxScreenToClient(ITextHost *iface, LPPOINT lppt)
Definition: txtsrv.c:268
static HRESULT __thiscall ITextHostImpl_TxGetExtent(ITextHost *iface, LPSIZEL lpExtent)
Definition: txtsrv.c:369
static void test_notifications(void)
Definition: txtsrv.c:1164
static IID * pIID_ITextHost
Definition: txtsrv.c:43
static HRESULT __thiscall ITextHostImpl_TxGetPropertyBits(ITextHost *iface, DWORD dwMask, DWORD *pdwBits)
Definition: txtsrv.c:392
static HRESULT __thiscall ITextHostImpl_TxGetPasswordChar(ITextHost *iface, WCHAR *pch)
Definition: txtsrv.c:355
static HMODULE hmoduleRichEdit
Definition: txtsrv.c:41
static HRESULT __thiscall ITextHostImpl_TxDeactivate(ITextHost *iface, LONG lNewState)
Definition: txtsrv.c:289
static const WCHAR lorem[]
Definition: txtsrv.c:99
static HRESULT __thiscall ITextHostImpl_TxActivate(ITextHost *iface, LONG *plOldState)
Definition: txtsrv.c:282
static BOOL __thiscall ITextHostImpl_TxShowScrollBar(ITextHost *iface, INT fnBar, BOOL fShow)
Definition: txtsrv.c:156
static void __thiscall ITextHostImpl_TxSetCapture(ITextHost *iface, BOOL fCapture)
Definition: txtsrv.c:249
static BOOL init_texthost(ITextServices **txtserv, ITextHost **ret)
Definition: txtsrv.c:604
static BOOL __thiscall ITextHostImpl_TxClientToScreen(ITextHost *iface, LPPOINT lppt)
Definition: txtsrv.c:275
static int en_update_sent
Definition: txtsrv.c:402
static HIMC __thiscall ITextHostImpl_TxImmGetContext(ITextHost *iface)
Definition: txtsrv.c:421
static BOOL __thiscall ITextHostImpl_TxCreateCaret(ITextHost *iface, HBITMAP hbmp, INT xWidth, INT yHeight)
Definition: txtsrv.c:203
static BOOL __thiscall ITextHostImpl_TxSetScrollPos(ITextHost *iface, INT fnBar, INT nPos, BOOL fRedraw)
Definition: txtsrv.c:181
static HRESULT __thiscall ITextHostImpl_TxGetBackStyle(ITextHost *iface, TXTBACKSTYLE *pStyle)
Definition: txtsrv.c:333
static ULONG WINAPI unk_Release(IUnknown *iface)
Definition: txtsrv.c:907
static ULONG WINAPI ITextHostImpl_Release(ITextHost *iface)
Definition: txtsrv.c:126
static void test_TxSetText(void)
Definition: txtsrv.c:710
static HRESULT WINAPI unk_QueryInterface(IUnknown *iface, REFIID riid, void **ppv)
Definition: txtsrv.c:893
static HRESULT __thiscall ITextHostImpl_TxGetAcceleratorPos(ITextHost *iface, LONG *pch)
Definition: txtsrv.c:362
static void setup_thiscall_wrappers(void)
Definition: txtsrv.c:517
static HDC __thiscall ITextHostImpl_TxGetDC(ITextHost *iface)
Definition: txtsrv.c:140
static BOOL __thiscall ITextHostImpl_TxSetTimer(ITextHost *iface, UINT idTimer, UINT uTimeout)
Definition: txtsrv.c:226
static HRESULT __thiscall ITextHostImpl_TxGetParaFormat(ITextHost *iface, const PARAFORMAT **ppPF)
Definition: txtsrv.c:319
static void test_QueryInterface(void)
Definition: txtsrv.c:951
static void __thiscall ITextHostImpl_TxImmReleaseContext(ITextHost *iface, HIMC himc)
Definition: txtsrv.c:428
static void __thiscall ITextHostImpl_TxKillTimer(ITextHost *iface, UINT idTimer)
Definition: txtsrv.c:234
static void test_TxGetText(void)
Definition: txtsrv.c:670
static void test_TxDraw(void)
Definition: txtsrv.c:815
static HRESULT __thiscall ITextHostImpl_TxGetSelectionBarWidth(ITextHost *iface, LONG *lSelBarWidth)
Definition: txtsrv.c:437
static void hf_to_cf(HFONT hf, CHARFORMAT2W *cf)
Definition: txtsrv.c:585
static ITextHostTestImpl * impl_from_ITextHost(ITextHost *iface)
Definition: txtsrv.c:94
static ULONG WINAPI unk_AddRef(IUnknown *iface)
Definition: txtsrv.c:900
static BOOL __thiscall ITextHostImpl_TxEnableScrollBar(ITextHost *iface, INT fuSBFlags, INT fuArrowflags)
Definition: txtsrv.c:164
static HRESULT __thiscall ITextHostImpl_TxGetScrollBars(ITextHost *iface, DWORD *scrollbars)
Definition: txtsrv.c:347
static int en_vscroll_sent
Definition: txtsrv.c:401
static BOOL __thiscall ITextHostImpl_TxSetCaretPos(ITextHost *iface, INT x, INT y)
Definition: txtsrv.c:219
#define TRACECALL
Definition: txtsrv.c:79
static void test_TxGetScroll(void)
Definition: txtsrv.c:1087
static HRESULT __thiscall ITextHostImpl_TxGetCharFormat(ITextHost *iface, const CHARFORMATW **ppCF)
Definition: txtsrv.c:311
static HRESULT __thiscall ITextHostImpl_TxGetClientRect(ITextHost *iface, LPRECT prc)
Definition: txtsrv.c:296
static const IUnknownVtbl unk_vtbl
Definition: txtsrv.c:914
static HRESULT __thiscall ITextHostImpl_OnTxParaFormatChange(ITextHost *iface, const PARAFORMAT *ppf)
Definition: txtsrv.c:383
static BOOL __thiscall ITextHostImpl_TxSetScrollRange(ITextHost *iface, INT fnBar, LONG nMinPos, INT nMaxPos, BOOL fRedraw)
Definition: txtsrv.c:172
static HRESULT WINAPI ITextHostImpl_QueryInterface(ITextHost *iface, REFIID riid, LPVOID *ppvObject)
Definition: txtsrv.c:104
static void * wrapperCodeMem
Definition: txtsrv.c:491
static ULONG WINAPI ITextHostImpl_AddRef(ITextHost *iface)
Definition: txtsrv.c:119
static void __thiscall ITextHostImpl_TxSetCursor(ITextHost *iface, HCURSOR hcur, BOOL fText)
Definition: txtsrv.c:261
static void __thiscall ITextHostImpl_TxInvalidateRect(ITextHost *iface, LPCRECT prc, BOOL fMode)
Definition: txtsrv.c:189
static BOOL __thiscall ITextHostImpl_TxShowCaret(ITextHost *iface, BOOL fShow)
Definition: txtsrv.c:211
static void __thiscall ITextHostImpl_TxScrollWindowEx(ITextHost *iface, INT dx, INT dy, LPCRECT lprcScroll, LPCRECT lprcClip, HRGN hRgnUpdate, LPRECT lprcUpdate, UINT fuScroll)
Definition: txtsrv.c:240
static void test_default_format(void)
Definition: txtsrv.c:1057
static void __thiscall ITextHostImpl_TxViewChange(ITextHost *iface, BOOL fUpdate)
Definition: txtsrv.c:196
static void _check_txgetnaturalsize(HRESULT res, LONG width, LONG height, HDC hdc, RECT rect, LPCWSTR string, int line)
Definition: txtsrv.c:751
static HRESULT __thiscall ITextHostImpl_TxNotify(ITextHost *iface, DWORD code, void *data)
Definition: txtsrv.c:403
static PCreateTextServices pCreateTextServices
Definition: txtsrv.c:45
static void __thiscall ITextHostImpl_TxSetFocus(ITextHost *iface)
Definition: txtsrv.c:255
static IID * pIID_ITextHost2
Definition: txtsrv.c:44
static ITextHostVtbl itextHostVtbl
Definition: txtsrv.c:446
static void test_IIDs(void)
Definition: txtsrv.c:871
static void test_COM(void)
Definition: txtsrv.c:921
static ULONG get_refcount(IUnknown *iface)
Definition: txtsrv.c:945
static RECT expected_rect
Definition: win.c:5821
INT WINAPI MulDiv(INT nNumber, INT nNumerator, INT nDenominator)
Definition: muldiv.c:25
unsigned int UINT
Definition: ndis.h:50
#define MEM_RELEASE
Definition: nt_native.h:1316
#define MEM_COMMIT
Definition: nt_native.h:1313
#define PAGE_EXECUTE_READWRITE
Definition: nt_native.h:1308
_Out_ LPRECT prc
Definition: ntgdi.h:1658
INT WINAPI DrawTextW(HDC hdc, LPCWSTR str, INT count, LPRECT rect, UINT flags)
Definition: defwnd.c:16
#define L(x)
Definition: ntvdm.h:50
interface IStorage * LPSTORAGE
Definition: objfwd.h:30
UINT WINAPI SysStringByteLen(BSTR str)
Definition: oleaut.c:215
UINT WINAPI SysStringLen(BSTR str)
Definition: oleaut.c:196
void WINAPI DECLSPEC_HOTPATCH SysFreeString(BSTR str)
Definition: oleaut.c:271
#define WS_POPUP
Definition: pedump.c:616
#define WS_VSCROLL
Definition: pedump.c:627
#define WS_VISIBLE
Definition: pedump.c:620
long LONG
Definition: pedump.c:60
#define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8)
Definition: guiddef.h:68
#define CLSID_NULL
Definition: guiddef.h:99
#define IsEqualIID(riid1, riid2)
Definition: guiddef.h:95
#define REFIID
Definition: guiddef.h:118
#define CFE_BOLD
Definition: richedit.h:406
#define ENM_SCROLL
Definition: richedit.h:470
#define CFE_AUTOCOLOR
Definition: richedit.h:414
#define EM_SETEVENTMASK
Definition: richedit.h:102
#define CFE_ITALIC
Definition: richedit.h:407
#define SCF_DEFAULT
Definition: richedit.h:234
#define EM_GETCHARFORMAT
Definition: richedit.h:91
#define EM_SETCHARFORMAT
Definition: richedit.h:101
#define CFE_UNDERLINE
Definition: richedit.h:408
#define CFE_SUBSCRIPT
Definition: richedit.h:412
#define ES_DISABLENOSCROLL
Definition: richedit.h:224
#define CFM_ALL2
Definition: richedit.h:393
#define CFE_AUTOBACKCOLOR
Definition: richedit.h:425
struct _charformat2w CHARFORMAT2W
static __inline const char * wine_dbgstr_guid(const GUID *id)
Definition: debug.h:197
#define win_skip
Definition: test.h:164
#define memset(x, y, z)
Definition: compat.h:39
static FILE * client
Definition: client.c:41
HRESULT hr
Definition: shlfolder.c:183
& rect
Definition: startmenu.cpp:1413
DWORD scrollbars
Definition: txtsrv.c:91
CHARFORMAT2W char_format
Definition: txtsrv.c:90
ITextHost ITextHost_iface
Definition: txtsrv.c:86
RECT client_rect
Definition: txtsrv.c:89
BYTE lfStrikeOut
Definition: dimm.idl:66
BYTE lfItalic
Definition: dimm.idl:64
LONG lfHeight
Definition: dimm.idl:59
LONG lfWeight
Definition: dimm.idl:63
WCHAR lfFaceName[LF_FACESIZE]
Definition: dimm.idl:72
BYTE lfUnderline
Definition: dimm.idl:65
BYTE lfCharSet
Definition: dimm.idl:67
BYTE lfPitchAndFamily
Definition: dimm.idl:71
LONG cx
Definition: kdterminal.h:27
LONG cy
Definition: kdterminal.h:28
BYTE bCharSet
Definition: richedit.h:311
DWORD dwMask
Definition: richedit.h:306
WCHAR szFaceName[LF_FACESIZE]
Definition: richedit.h:313
DWORD dwEffects
Definition: richedit.h:307
LONG yHeight
Definition: richedit.h:308
BYTE bPitchAndFamily
Definition: richedit.h:312
LONG yHeight
Definition: richedit.h:271
WCHAR szFaceName[LF_FACESIZE]
Definition: richedit.h:276
DWORD dwEffects
Definition: richedit.h:270
BYTE bCharSet
Definition: richedit.h:274
BYTE bPitchAndFamily
Definition: richedit.h:275
DWORD dwUser
Definition: richole.idl:67
CLSID clsid
Definition: richole.idl:60
DWORD dwFlags
Definition: richole.idl:66
LPSTORAGE pstg
Definition: richole.idl:62
LPOLEOBJECT poleobj
Definition: richole.idl:61
DWORD dvaspect
Definition: richole.idl:65
LPOLECLIENTSITE polesite
Definition: richole.idl:63
DWORD cbStruct
Definition: richole.idl:58
LONG cp
Definition: richole.idl:59
SIZEL sizel
Definition: richole.idl:64
Definition: inflate.c:139
Definition: txthost.c:37
Definition: parser.c:49
Definition: module.h:576
LONG right
Definition: windef.h:308
LONG bottom
Definition: windef.h:309
LONG top
Definition: windef.h:307
LONG left
Definition: windef.h:306
Definition: cproxy.c:248
Definition: api.c:544
IUnknown IUnknown_iface
Definition: api.c:545
IUnknown * inner_unk
Definition: api.c:547
LONG ref
Definition: api.c:546
@ TXTNS_FITTOCONTENT
Definition: textserv.h:176
#define TXTBIT_WORDWRAP
Definition: textserv.h:195
#define TXTBIT_CLIENTRECTCHANGE
Definition: textserv.h:205
#define TXTBIT_MULTILINE
Definition: textserv.h:186
enum _TXTBACKSTYLE TXTBACKSTYLE
#define TXTBIT_SCROLLBARCHANGE
Definition: textserv.h:201
#define TXTBIT_RICHTEXT
Definition: textserv.h:185
@ TXTVIEW_INACTIVE
Definition: textserv.h:182
@ TXTVIEW_ACTIVE
Definition: textserv.h:181
HRESULT(WINAPI * PCreateTextServices)(IUnknown *, ITextHost *, IUnknown **)
Definition: textserv.h:448
int32_t INT
Definition: typedefs.h:58
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260
uint32_t ULONG
Definition: typedefs.h:59
int ret
LPVOID NTAPI VirtualAlloc(IN LPVOID lpAddress, IN SIZE_T dwSize, IN DWORD flAllocationType, IN DWORD flProtect)
Definition: virtmem.c:65
BOOL NTAPI VirtualFree(IN LPVOID lpAddress, IN SIZE_T dwSize, IN DWORD dwFreeType)
Definition: virtmem.c:119
DWORD WINAPI GetLastError(void)
Definition: except.c:1042
_In_ void _In_ PCCERT_CONTEXT _In_opt_ LPFILETIME _In_ DWORD _In_ DWORD _Outptr_opt_ void ** ppvObject
Definition: wincrypt.h:6082
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023
LONG_PTR LPARAM
Definition: windef.h:208
LONG_PTR LRESULT
Definition: windef.h:209
DWORD COLORREF
Definition: windef.h:300
HICON HCURSOR
Definition: windef.h:299
#define WINAPI
Definition: msvc.h:6
#define E_NOINTERFACE
Definition: winerror.h:2364
int WINAPI SetMapMode(_In_ HDC, _In_ int)
HGDIOBJ WINAPI GetStockObject(_In_ int)
int WINAPI GetObjectW(_In_ HANDLE h, _In_ int c, _Out_writes_bytes_opt_(c) LPVOID pv)
int WINAPI GetDeviceCaps(_In_opt_ HDC, _In_ int)
#define LOGPIXELSY
Definition: wingdi.h:719
#define DEFAULT_GUI_FONT
Definition: wingdi.h:909
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
Definition: dc.c:1546
#define MM_TEXT
Definition: wingdi.h:873
#define FW_NORMAL
Definition: wingdi.h:373
static int init
Definition: wintirpc.c:33
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
#define MAKEWPARAM(l, h)
Definition: winuser.h:4020
#define SB_THUMBTRACK
Definition: winuser.h:573
HWND WINAPI CreateWindowExA(_In_ DWORD dwExStyle, _In_opt_ LPCSTR lpClassName, _In_opt_ LPCSTR lpWindowName, _In_ DWORD dwStyle, _In_ int X, _In_ int Y, _In_ int nWidth, _In_ int nHeight, _In_opt_ HWND hWndParent, _In_opt_ HMENU hMenu, _In_opt_ HINSTANCE hInstance, _In_opt_ LPVOID lpParam)
#define WM_VSCROLL
Definition: winuser.h:1755
#define EN_UPDATE
Definition: winuser.h:2039
#define SB_BOTTOM
Definition: winuser.h:577
#define DT_NOCLIP
Definition: winuser.h:536
#define DT_LEFT
Definition: winuser.h:534
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
#define DT_WORDBREAK
Definition: winuser.h:544
HDC WINAPI GetDC(_In_opt_ HWND)
#define SB_LINEDOWN
Definition: winuser.h:565
BOOL WINAPI SetRectEmpty(_Out_ LPRECT)
#define EN_VSCROLL
Definition: winuser.h:2040
#define DT_CALCRECT
Definition: winuser.h:526
#define DT_EDITCONTROL
Definition: winuser.h:528
BOOL WINAPI DestroyWindow(_In_ HWND)
#define SB_THUMBPOSITION
Definition: winuser.h:572
__wchar_t WCHAR
Definition: xmlstorage.h:180
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
unsigned char BYTE
Definition: xxhash.c:193