riched20/tests: Enable compilation with long types.

Signed-off-by: Eric Pouech <eric.pouech@gmail.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Eric Pouech 2022-03-04 09:25:02 +01:00 committed by Alexandre Julliard
parent 8b66db027d
commit 9e90cecdc6
4 changed files with 1141 additions and 1142 deletions

View file

@ -1,4 +1,3 @@
EXTRADEFS = -DWINE_NO_LONG_TYPES
TESTDLL = riched20.dll
IMPORTS = ole32 oleaut32 user32 gdi32

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -173,7 +173,7 @@ static BOOL __thiscall ITextHostImpl_TxSetScrollRange(ITextHost *iface, INT fnBa
INT nMaxPos, BOOL fRedraw)
{
ITextHostTestImpl *This = impl_from_ITextHost(iface);
TRACECALL("Call to TxSetScrollRange(%p, fnBar=%d, nMinPos=%d, nMaxPos=%d, fRedraw=%d)\n",
TRACECALL("Call to TxSetScrollRange(%p, fnBar=%d, nMinPos=%ld, nMaxPos=%d, fRedraw=%d)\n",
This, fnBar, nMinPos, nMaxPos, fRedraw);
return FALSE;
}
@ -289,7 +289,7 @@ static HRESULT __thiscall ITextHostImpl_TxActivate(ITextHost *iface, LONG *plOld
static HRESULT __thiscall ITextHostImpl_TxDeactivate(ITextHost *iface, LONG lNewState)
{
ITextHostTestImpl *This = impl_from_ITextHost(iface);
TRACECALL("Call to TxDeactivate(%p, lNewState=%d)\n", This, lNewState);
TRACECALL("Call to TxDeactivate(%p, lNewState=%ld)\n", This, lNewState);
return E_NOTIMPL;
}
@ -392,7 +392,7 @@ static HRESULT __thiscall ITextHostImpl_OnTxParaFormatChange(ITextHost *iface, c
static HRESULT __thiscall ITextHostImpl_TxGetPropertyBits(ITextHost *iface, DWORD dwMask, DWORD *pdwBits)
{
ITextHostTestImpl *This = impl_from_ITextHost(iface);
TRACECALL("Call to TxGetPropertyBits(%p, dwMask=0x%08x, pdwBits=%p)\n",
TRACECALL("Call to TxGetPropertyBits(%p, dwMask=0x%08lx, pdwBits=%p)\n",
This, dwMask, pdwBits);
*pdwBits = This->props & dwMask;
return S_OK;
@ -403,7 +403,7 @@ static int en_update_sent;
static HRESULT __thiscall ITextHostImpl_TxNotify( ITextHost *iface, DWORD code, void *data )
{
ITextHostTestImpl *This = impl_from_ITextHost(iface);
TRACECALL( "Call to TxNotify(%p, code = %#x, data = %p)\n", This, code, data );
TRACECALL( "Call to TxNotify(%p, code = %#lx, data = %p)\n", This, code, data );
switch (code)
{
case EN_VSCROLL:
@ -629,8 +629,8 @@ static BOOL init_texthost(ITextServices **txtserv, ITextHost **ret)
CreateTextServices which is then queried to obtain a
ITextServices object. */
result = pCreateTextServices(NULL, &dummyTextHost->ITextHost_iface, &init);
ok(result == S_OK, "Did not return S_OK when created (result = %x)\n", result);
ok(dummyTextHost->refCount == 1, "host ref %d\n", dummyTextHost->refCount);
ok(result == S_OK, "Did not return S_OK when created (result = %lx)\n", result);
ok(dummyTextHost->refCount == 1, "host ref %ld\n", dummyTextHost->refCount);
if (result != S_OK) {
CoTaskMemFree(dummyTextHost);
win_skip("CreateTextServices failed.\n");
@ -638,7 +638,7 @@ static BOOL init_texthost(ITextServices **txtserv, ITextHost **ret)
}
result = IUnknown_QueryInterface(init, pIID_ITextServices, (void**)txtserv);
ok((result == S_OK) && (*txtserv != NULL), "Querying interface failed (result = %x, txtserv = %p)\n", result, *txtserv);
ok((result == S_OK) && (*txtserv != NULL), "Querying interface failed (result = %lx, txtserv = %p)\n", result, *txtserv);
IUnknown_Release(init);
if (!((result == S_OK) && (*txtserv != NULL))) {
CoTaskMemFree(dummyTextHost);
@ -682,21 +682,21 @@ static void test_TxGetText(void)
return;
hres = ITextServices_TxGetText(txtserv, &rettext);
ok(hres == S_OK, "ITextServices_TxGetText failed (result = %x)\n", hres);
ok(hres == S_OK, "ITextServices_TxGetText failed (result = %lx)\n", hres);
SysFreeString(rettext);
hres = ITextServices_TxSetText(txtserv, L"abcdefg");
ok(hres == S_OK, "Got hres: %#x.\n", hres);
ok(hres == S_OK, "Got hres: %#lx.\n", hres);
hres = ITextServices_QueryInterface(txtserv, &IID_IRichEditOle, (void **)&reole);
ok(hres == S_OK, "Got hres: %#x.\n", hres);
ok(hres == S_OK, "Got hres: %#lx.\n", hres);
hres = IRichEditOle_GetClientSite(reole, &clientsite);
ok(hres == S_OK, "Got hres: %#x.\n", hres);
ok(hres == S_OK, "Got hres: %#lx.\n", hres);
expected_string = L"abc\xfffc""defg";
fill_reobject_struct(&reobject, 3, NULL, NULL, clientsite, 10, 10, DVASPECT_CONTENT, 0, 1);
hres = IRichEditOle_InsertObject(reole, &reobject);
ok(hres == S_OK, "Got hres: %#x.\n", hres);
ok(hres == S_OK, "Got hres: %#lx.\n", hres);
hres = ITextServices_TxGetText(txtserv, &rettext);
ok(hres == S_OK, "Got hres: %#x.\n", hres);
ok(hres == S_OK, "Got hres: %#lx.\n", hres);
ok(lstrlenW(rettext) == lstrlenW(expected_string), "Got wrong length: %d.\n", lstrlenW(rettext));
todo_wine ok(!lstrcmpW(rettext, expected_string), "Got wrong content: %s.\n", debugstr_w(rettext));
SysFreeString(rettext);
@ -719,10 +719,10 @@ static void test_TxSetText(void)
return;
hres = ITextServices_TxSetText(txtserv, settext);
ok(hres == S_OK, "ITextServices_TxSetText failed (result = %x)\n", hres);
ok(hres == S_OK, "ITextServices_TxSetText failed (result = %lx)\n", hres);
hres = ITextServices_TxGetText(txtserv, &rettext);
ok(hres == S_OK, "ITextServices_TxGetText failed (result = %x)\n", hres);
ok(hres == S_OK, "ITextServices_TxGetText failed (result = %lx)\n", hres);
ok(SysStringLen(rettext) == 4,
"String returned of wrong length (expected 4, got %d)\n", SysStringLen(rettext));
@ -734,10 +734,10 @@ static void test_TxSetText(void)
/* Null-pointer should behave the same as empty-string */
hres = ITextServices_TxSetText(txtserv, 0);
ok(hres == S_OK, "ITextServices_TxSetText failed (result = %x)\n", hres);
ok(hres == S_OK, "ITextServices_TxSetText failed (result = %lx)\n", hres);
hres = ITextServices_TxGetText(txtserv, &rettext);
ok(hres == S_OK, "ITextServices_TxGetText failed (result = %x)\n", hres);
ok(hres == S_OK, "ITextServices_TxGetText failed (result = %lx)\n", hres);
ok(SysStringLen(rettext) == 0,
"String returned of wrong length (expected 0, got %d)\n", SysStringLen(rettext));
@ -756,10 +756,10 @@ static void _check_txgetnaturalsize(HRESULT res, LONG width, LONG height, HDC hd
DrawTextW(hdc, string, -1, &expected_rect, DT_LEFT | DT_CALCRECT | DT_NOCLIP | DT_EDITCONTROL | DT_WORDBREAK);
expected_width = expected_rect.right - expected_rect.left;
expected_height = expected_rect.bottom - expected_rect.top;
ok_(__FILE__,line)(res == S_OK, "ITextServices_TxGetNaturalSize failed: 0x%08x.\n", res);
ok_(__FILE__,line)(res == S_OK, "ITextServices_TxGetNaturalSize failed: 0x%08lx.\n", res);
todo_wine ok_(__FILE__,line)(width >= expected_width && width <= expected_width + 1,
"got wrong width: %d, expected: %d {+1}.\n", width, expected_width);
ok_(__FILE__,line)(height == expected_height, "got wrong height: %d, expected: %d.\n",
"got wrong width: %ld, expected: %ld {+1}.\n", width, expected_width);
ok_(__FILE__,line)(height == expected_height, "got wrong height: %ld, expected: %ld.\n",
height, expected_height);
}
@ -793,11 +793,11 @@ static void test_TxGetNaturalSize(void)
hf = GetStockObject(DEFAULT_GUI_FONT);
hf_to_cf(hf, &cf);
result = ITextServices_TxSendMessage(txtserv, EM_SETCHARFORMAT, SCF_DEFAULT, (LPARAM)&cf, &lresult);
ok(result == S_OK, "ITextServices_TxSendMessage failed: 0x%08x.\n", result);
ok(result == S_OK, "ITextServices_TxSendMessage failed: 0x%08lx.\n", result);
SelectObject(hdcDraw, hf);
result = ITextServices_TxSetText(txtserv, test_text);
ok(result == S_OK, "ITextServices_TxSetText failed: 0x%08x.\n", result);
ok(result == S_OK, "ITextServices_TxSetText failed: 0x%08lx.\n", result);
extent.cx = -1; extent.cy = -1;
width = rect.right - rect.left;
@ -835,26 +835,26 @@ static void test_TxDraw(void)
hr = ITextServices_TxDraw( txtserv, DVASPECT_CONTENT, 0, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, 0, TXTVIEW_INACTIVE );
ok( hr == E_INVALIDARG, "got %08x\n", hr );
ok( hr == E_INVALIDARG, "got %08lx\n", hr );
hr = ITextServices_TxDraw( txtserv, DVASPECT_CONTENT, 0, NULL, NULL, hdc, NULL, NULL, NULL,
NULL, NULL, 0, TXTVIEW_INACTIVE );
ok( hr == E_INVALIDARG, "got %08x\n", hr );
ok( hr == E_INVALIDARG, "got %08lx\n", hr );
hr = ITextServices_TxDraw( txtserv, DVASPECT_CONTENT, 0, NULL, NULL, NULL, NULL, (RECTL *)&client, NULL,
NULL, NULL, 0, TXTVIEW_INACTIVE );
ok( hr == E_FAIL, "got %08x\n", hr );
ok( hr == E_FAIL, "got %08lx\n", hr );
hr = ITextServices_TxDraw( txtserv, DVASPECT_CONTENT, 0, NULL, NULL, hdc, NULL, (RECTL *)&client, NULL,
NULL, NULL, 0, TXTVIEW_INACTIVE );
ok( hr == S_OK, "got %08x\n", hr );
ok( hr == S_OK, "got %08lx\n", hr );
hr = ITextServices_TxDraw( txtserv, DVASPECT_CONTENT, 0, NULL, NULL, hdc, NULL, (RECTL *)&client, NULL,
NULL, NULL, 0, TXTVIEW_ACTIVE );
ok( hr == S_OK, "got %08x\n", hr );
ok( hr == S_OK, "got %08lx\n", hr );
hr = ITextServices_OnTxInPlaceActivate( txtserv, &client );
ok( hr == S_OK, "got %08x\n", hr );
ok( hr == S_OK, "got %08lx\n", hr );
hr = ITextServices_TxDraw( txtserv, DVASPECT_CONTENT, 0, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, 0, TXTVIEW_INACTIVE );
ok( hr == S_OK, "got %08x\n", hr );
ok( hr == S_OK, "got %08lx\n", hr );
hr = ITextServices_OnTxInPlaceDeactivate( txtserv );
@ -929,15 +929,15 @@ static void test_COM(void)
/* COM aggregation */
hr = pCreateTextServices(&unk_obj.IUnknown_iface, &texthost.ITextHost_iface,
&unk_obj.inner_unk);
ok(hr == S_OK, "CreateTextServices failed: %08x\n", hr);
ok(hr == S_OK, "CreateTextServices failed: %08lx\n", hr);
hr = IUnknown_QueryInterface(unk_obj.inner_unk, pIID_ITextServices, (void**)&textsrv);
ok(hr == S_OK, "QueryInterface for IID_ITextServices failed: %08x\n", hr);
ok(hr == S_OK, "QueryInterface for IID_ITextServices failed: %08lx\n", hr);
refcount = ITextServices_AddRef(textsrv);
ok(refcount == unk_obj.ref, "CreateTextServices just pretends to support COM aggregation\n");
refcount = ITextServices_Release(textsrv);
ok(refcount == unk_obj.ref, "CreateTextServices just pretends to support COM aggregation\n");
refcount = ITextServices_Release(textsrv);
ok(refcount == 19, "Refcount should be back at 19 but is %u\n", refcount);
ok(refcount == 19, "Refcount should be back at 19 but is %lu\n", refcount);
IUnknown_Release(unk_obj.inner_unk);
}
@ -963,92 +963,92 @@ static void test_QueryInterface(void)
return;
refcount = get_refcount((IUnknown *)txtserv);
ok(refcount == 1, "got wrong ref count: %d\n", refcount);
ok(refcount == 1, "got wrong ref count: %ld\n", refcount);
/* IID_IRichEditOle */
hres = ITextServices_QueryInterface(txtserv, &IID_IRichEditOle, (void **)&txtsrv_reole);
ok(hres == S_OK, "ITextServices_QueryInterface: 0x%08x\n", hres);
ok(hres == S_OK, "ITextServices_QueryInterface: 0x%08lx\n", hres);
refcount = get_refcount((IUnknown *)txtserv);
ok(refcount == 2, "got wrong ref count: %d\n", refcount);
ok(refcount == 2, "got wrong ref count: %ld\n", refcount);
refcount = get_refcount((IUnknown *)txtsrv_reole);
ok(refcount == 2, "got wrong ref count: %d\n", refcount);
ok(refcount == 2, "got wrong ref count: %ld\n", refcount);
hres = ITextServices_QueryInterface( txtserv, &IID_IUnknown, (void **)&unk );
ok( hres == S_OK, "got 0x%08x\n", hres );
ok( hres == S_OK, "got 0x%08lx\n", hres );
hres = IRichEditOle_QueryInterface( txtsrv_reole, &IID_IUnknown, (void **)&unk2 );
ok( hres == S_OK, "got 0x%08x\n", hres );
ok( hres == S_OK, "got 0x%08lx\n", hres );
ok( unk == unk2, "unknowns differ\n" );
IUnknown_Release( unk2 );
IUnknown_Release( unk );
hres = IRichEditOle_QueryInterface(txtsrv_reole, &IID_ITextDocument, (void **)&txtdoc);
ok(hres == S_OK, "IRichEditOle_QueryInterface: 0x%08x\n", hres);
ok(hres == S_OK, "IRichEditOle_QueryInterface: 0x%08lx\n", hres);
refcount = get_refcount((IUnknown *)txtserv);
ok(refcount == 3, "got wrong ref count: %d\n", refcount);
ok(refcount == 3, "got wrong ref count: %ld\n", refcount);
refcount = get_refcount((IUnknown *)txtsrv_reole);
ok(refcount == 3, "got wrong ref count: %d\n", refcount);
ok(refcount == 3, "got wrong ref count: %ld\n", refcount);
ITextDocument_Release(txtdoc);
refcount = get_refcount((IUnknown *)txtserv);
ok(refcount == 2, "got wrong ref count: %d\n", refcount);
ok(refcount == 2, "got wrong ref count: %ld\n", refcount);
hres = IRichEditOle_QueryInterface(txtsrv_reole, &IID_ITextDocument2Old, (void **)&txtdoc2old);
ok(hres == S_OK, "IRichEditOle_QueryInterface: 0x%08x\n", hres);
ok(hres == S_OK, "IRichEditOle_QueryInterface: 0x%08lx\n", hres);
refcount = get_refcount((IUnknown *)txtserv);
ok(refcount == 3, "got wrong ref count: %d\n", refcount);
ok(refcount == 3, "got wrong ref count: %ld\n", refcount);
refcount = get_refcount((IUnknown *)txtsrv_reole);
ok(refcount == 3, "got wrong ref count: %d\n", refcount);
ok(refcount == 3, "got wrong ref count: %ld\n", refcount);
ITextDocument2Old_Release(txtdoc2old);
refcount = get_refcount((IUnknown *)txtserv);
ok(refcount == 2, "got wrong ref count: %d\n", refcount);
ok(refcount == 2, "got wrong ref count: %ld\n", refcount);
IRichEditOle_Release(txtsrv_reole);
refcount = get_refcount((IUnknown *)txtserv);
ok(refcount == 1, "got wrong ref count: %d\n", refcount);
ok(refcount == 1, "got wrong ref count: %ld\n", refcount);
/* IID_ITextDocument */
hres = ITextServices_QueryInterface(txtserv, &IID_ITextDocument, (void **)&txtsrv_txtdoc);
ok(hres == S_OK, "ITextServices_QueryInterface: 0x%08x\n", hres);
ok(hres == S_OK, "ITextServices_QueryInterface: 0x%08lx\n", hres);
refcount = get_refcount((IUnknown *)txtserv);
ok(refcount == 2, "got wrong ref count: %d\n", refcount);
ok(refcount == 2, "got wrong ref count: %ld\n", refcount);
refcount = get_refcount((IUnknown *)txtsrv_txtdoc);
ok(refcount == 2, "got wrong ref count: %d\n", refcount);
ok(refcount == 2, "got wrong ref count: %ld\n", refcount);
hres = ITextDocument_QueryInterface(txtsrv_txtdoc, &IID_IRichEditOle, (void **)&reole);
ok(hres == S_OK, "ITextDocument_QueryInterface: 0x%08x\n", hres);
ok(hres == S_OK, "ITextDocument_QueryInterface: 0x%08lx\n", hres);
refcount = get_refcount((IUnknown *)txtserv);
ok(refcount == 3, "got wrong ref count: %d\n", refcount);
ok(refcount == 3, "got wrong ref count: %ld\n", refcount);
refcount = get_refcount((IUnknown *)txtsrv_txtdoc);
ok(refcount == 3, "got wrong ref count: %d\n", refcount);
ok(refcount == 3, "got wrong ref count: %ld\n", refcount);
IRichEditOle_Release(reole);
refcount = get_refcount((IUnknown *)txtserv);
ok(refcount == 2, "got wrong ref count: %d\n", refcount);
ok(refcount == 2, "got wrong ref count: %ld\n", refcount);
ITextDocument_Release(txtsrv_txtdoc);
refcount = get_refcount((IUnknown *)txtserv);
ok(refcount == 1, "got wrong ref count: %d\n", refcount);
ok(refcount == 1, "got wrong ref count: %ld\n", refcount);
/* ITextDocument2Old */
hres = ITextServices_QueryInterface(txtserv, &IID_ITextDocument2Old, (void **)&txtsrv_txtdoc2old);
ok(hres == S_OK, "ITextServices_QueryInterface: 0x%08x\n", hres);
ok(hres == S_OK, "ITextServices_QueryInterface: 0x%08lx\n", hres);
refcount = get_refcount((IUnknown *)txtserv);
ok(refcount == 2, "got wrong ref count: %d\n", refcount);
ok(refcount == 2, "got wrong ref count: %ld\n", refcount);
refcount = get_refcount((IUnknown *)txtsrv_txtdoc2old);
ok(refcount == 2, "got wrong ref count: %d\n", refcount);
ok(refcount == 2, "got wrong ref count: %ld\n", refcount);
hres = ITextDocument2Old_QueryInterface(txtsrv_txtdoc2old, &IID_IRichEditOle, (void **)&reole);
ok(hres == S_OK, "ITextDocument2Old_QueryInterface: 0x%08x\n", hres);
ok(hres == S_OK, "ITextDocument2Old_QueryInterface: 0x%08lx\n", hres);
refcount = get_refcount((IUnknown *)txtserv);
ok(refcount == 3, "got wrong ref count: %d\n", refcount);
ok(refcount == 3, "got wrong ref count: %ld\n", refcount);
refcount = get_refcount((IUnknown *)txtsrv_txtdoc2old);
ok(refcount == 3, "got wrong ref count: %d\n", refcount);
ok(refcount == 3, "got wrong ref count: %ld\n", refcount);
IRichEditOle_Release(reole);
refcount = get_refcount((IUnknown *)txtserv);
ok(refcount == 2, "got wrong ref count: %d\n", refcount);
ok(refcount == 2, "got wrong ref count: %ld\n", refcount);
ITextDocument2Old_Release(txtsrv_txtdoc2old);
refcount = get_refcount((IUnknown *)txtserv);
ok(refcount == 1, "got wrong ref count: %d\n", refcount);
ok(refcount == 1, "got wrong ref count: %ld\n", refcount);
ITextServices_Release(txtserv);
ITextHost_Release(host);
@ -1069,13 +1069,13 @@ static void test_default_format(void)
cf2.cbSize = sizeof(CHARFORMAT2W);
result = ITextServices_TxSendMessage(txtserv, EM_GETCHARFORMAT, SCF_DEFAULT, (LPARAM)&cf2, &lresult);
ok(result == S_OK, "ITextServices_TxSendMessage failed: 0x%08x.\n", result);
ok(result == S_OK, "ITextServices_TxSendMessage failed: 0x%08lx.\n", result);
ITextHostImpl_TxGetCharFormat(host, &host_cf);
ok(!lstrcmpW(host_cf->szFaceName, cf2.szFaceName), "got wrong font name: %s.\n", wine_dbgstr_w(cf2.szFaceName));
ok(cf2.yHeight == host_cf->yHeight, "got wrong yHeight: %d, expected %d.\n", cf2.yHeight, host_cf->yHeight);
ok(cf2.yHeight == host_cf->yHeight, "got wrong yHeight: %ld, expected %ld.\n", cf2.yHeight, host_cf->yHeight);
expected_effects = (cf2.dwEffects & ~(CFE_AUTOCOLOR | CFE_AUTOBACKCOLOR));
ok(host_cf->dwEffects == expected_effects, "got wrong dwEffects: %x, expected %x.\n", cf2.dwEffects, expected_effects);
ok(host_cf->dwEffects == expected_effects, "got wrong dwEffects: %lx, expected %lx.\n", cf2.dwEffects, expected_effects);
ok(cf2.bPitchAndFamily == host_cf->bPitchAndFamily, "got wrong bPitchAndFamily: %x, expected %x.\n",
cf2.bPitchAndFamily, host_cf->bPitchAndFamily);
ok(cf2.bCharSet == host_cf->bCharSet, "got wrong bCharSet: %x, expected %x.\n", cf2.bCharSet, host_cf->bCharSet);
@ -1100,17 +1100,17 @@ static void test_TxGetScroll(void)
host_impl = impl_from_ITextHost( host );
ret = ITextServices_TxGetHScroll(txtserv, NULL, NULL, NULL, NULL, NULL);
ok(ret == S_OK, "ITextServices_TxGetHScroll failed: 0x%08x.\n", ret);
ok(ret == S_OK, "ITextServices_TxGetHScroll failed: 0x%08lx.\n", ret);
ret = ITextServices_TxGetVScroll(txtserv, NULL, NULL, NULL, NULL, NULL);
ok(ret == S_OK, "ITextServices_TxGetVScroll failed: 0x%08x.\n", ret);
ok(ret == S_OK, "ITextServices_TxGetVScroll failed: 0x%08lx.\n", ret);
ret = ITextServices_TxGetVScroll( txtserv, &min_pos, &max_pos, &pos, &page, &enabled );
ok( ret == S_OK, "ITextServices_TxGetHScroll failed: 0x%08x.\n", ret );
ok( min_pos == 0, "got %d\n", min_pos );
ok( max_pos == 0, "got %d\n", max_pos );
ok( pos == 0, "got %d\n", pos );
ok( page == 0, "got %d\n", page );
ok( ret == S_OK, "ITextServices_TxGetHScroll failed: 0x%08lx.\n", ret );
ok( min_pos == 0, "got %ld\n", min_pos );
ok( max_pos == 0, "got %ld\n", max_pos );
ok( pos == 0, "got %ld\n", pos );
ok( page == 0, "got %ld\n", page );
ok( !enabled, "got %d\n", enabled );
host_impl->scrollbars = WS_VSCROLL;
@ -1121,26 +1121,26 @@ static void test_TxGetScroll(void)
0, 0, 400, 400, 0, 0, 0, NULL );
host_impl->client_rect = client;
ret = ITextServices_OnTxInPlaceActivate( txtserv, &client );
ok( ret == S_OK, "got 0x%08x.\n", ret );
ok( ret == S_OK, "got 0x%08lx.\n", ret );
ret = ITextServices_TxGetVScroll( txtserv, &min_pos, &max_pos, &pos, &page, &enabled );
ok( ret == S_OK, "ITextServices_TxGetHScroll failed: 0x%08x.\n", ret );
ok( min_pos == 0, "got %d\n", min_pos );
ok( ret == S_OK, "ITextServices_TxGetHScroll failed: 0x%08lx.\n", ret );
ok( min_pos == 0, "got %ld\n", min_pos );
todo_wine
ok( max_pos == 0, "got %d\n", max_pos );
ok( pos == 0, "got %d\n", pos );
ok( page == client.bottom, "got %d\n", page );
ok( max_pos == 0, "got %ld\n", max_pos );
ok( pos == 0, "got %ld\n", pos );
ok( page == client.bottom, "got %ld\n", page );
ok( !enabled, "got %d\n", enabled );
ret = ITextServices_TxSetText( txtserv, lorem );
ok( ret == S_OK, "got 0x%08x.\n", ret );
ok( ret == S_OK, "got 0x%08lx.\n", ret );
ret = ITextServices_TxGetVScroll( txtserv, &min_pos, &max_pos, &pos, &page, &enabled );
ok( ret == S_OK, "ITextServices_TxGetHScroll failed: 0x%08x.\n", ret );
ok( min_pos == 0, "got %d\n", min_pos );
ok( max_pos > client.bottom, "got %d\n", max_pos );
ok( pos == 0, "got %d\n", pos );
ok( page == client.bottom, "got %d\n", page );
ok( ret == S_OK, "ITextServices_TxGetHScroll failed: 0x%08lx.\n", ret );
ok( min_pos == 0, "got %ld\n", min_pos );
ok( max_pos > client.bottom, "got %ld\n", max_pos );
ok( pos == 0, "got %ld\n", pos );
ok( page == client.bottom, "got %ld\n", page );
ok( enabled, "got %d\n", enabled );
host_impl->scrollbars = WS_VSCROLL | ES_DISABLENOSCROLL;
@ -1148,12 +1148,12 @@ static void test_TxGetScroll(void)
ITextServices_TxSetText( txtserv, L"short" );
ret = ITextServices_TxGetVScroll( txtserv, &min_pos, &max_pos, &pos, &page, &enabled );
ok( ret == S_OK, "ITextServices_TxGetHScroll failed: 0x%08x.\n", ret );
ok( min_pos == 0, "got %d\n", min_pos );
ok( ret == S_OK, "ITextServices_TxGetHScroll failed: 0x%08lx.\n", ret );
ok( min_pos == 0, "got %ld\n", min_pos );
todo_wine
ok( max_pos == 0, "got %d\n", max_pos );
ok( pos == 0, "got %d\n", pos );
ok( page == client.bottom, "got %d\n", page );
ok( max_pos == 0, "got %ld\n", max_pos );
ok( pos == 0, "got %ld\n", pos );
ok( page == client.bottom, "got %ld\n", page );
ok( !enabled, "got %d\n", enabled );
DestroyWindow( host_impl->window );
@ -1183,33 +1183,33 @@ static void test_notifications( void )
0, 0, 400, 400, 0, 0, 0, NULL );
host_impl->client_rect = client;
hr = ITextServices_OnTxInPlaceActivate( txtserv, &client );
ok( hr == S_OK, "got 0x%08x.\n", hr );
ok( hr == S_OK, "got 0x%08lx.\n", hr );
hr = ITextServices_TxSendMessage( txtserv, EM_SETEVENTMASK, 0, ENM_SCROLL, &res );
ok( hr == S_OK, "got %08x\n", hr );
ok( hr == S_OK, "got %08lx\n", hr );
/* check EN_VSCROLL notification is sent */
en_vscroll_sent = 0;
hr = ITextServices_TxSendMessage( txtserv, WM_VSCROLL, SB_LINEDOWN, 0, &res );
ok( hr == S_OK, "got %08x\n", hr );
ok( hr == S_OK, "got %08lx\n", hr );
ok( en_vscroll_sent == 1, "got %d\n", en_vscroll_sent );
hr = ITextServices_TxSendMessage( txtserv, WM_VSCROLL, SB_BOTTOM, 0, &res );
ok( hr == S_OK, "got %08x\n", hr );
ok( hr == S_OK, "got %08lx\n", hr );
ok( en_vscroll_sent == 2, "got %d\n", en_vscroll_sent );
/* but not when the thumb is moved */
hr = ITextServices_TxSendMessage( txtserv, WM_VSCROLL, MAKEWPARAM( SB_THUMBTRACK, 0 ), 0, &res );
ok( hr == S_OK, "got %08x\n", hr );
ok( hr == S_OK, "got %08lx\n", hr );
hr = ITextServices_TxSendMessage( txtserv, WM_VSCROLL, MAKEWPARAM( SB_THUMBPOSITION, 0 ), 0, &res );
ok( hr == S_OK, "got %08x\n", hr );
ok( hr == S_OK, "got %08lx\n", hr );
ok( en_vscroll_sent == 2, "got %d\n", en_vscroll_sent );
/* EN_UPDATE is sent by TxDraw() */
en_update_sent = 0;
hr = ITextServices_TxDraw( txtserv, DVASPECT_CONTENT, 0, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, 0, TXTVIEW_ACTIVE );
ok( hr == S_OK, "got %08x\n", hr );
ok( hr == S_OK, "got %08lx\n", hr );
ok( en_update_sent == 1, "got %d\n", en_update_sent );
DestroyWindow( host_impl->window );