From 67389533bcb46f5281d074bd115d5278c39340e0 Mon Sep 17 00:00:00 2001 From: Michael Stefaniuc Date: Wed, 28 Mar 2012 00:34:31 +0200 Subject: [PATCH] riched20/tests: Get the CreateTextServices() pointer only once. --- dlls/riched20/tests/txtsrv.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/dlls/riched20/tests/txtsrv.c b/dlls/riched20/tests/txtsrv.c index 8d126ea4a95..e55f5efdc09 100644 --- a/dlls/riched20/tests/txtsrv.c +++ b/dlls/riched20/tests/txtsrv.c @@ -38,6 +38,7 @@ static HMODULE hmoduleRichEdit; static IID *pIID_ITextServices; static IID *pIID_ITextHost; static IID *pIID_ITextHost2; +static PCreateTextServices pCreateTextServices; static const char *debugstr_guid(REFIID riid) { @@ -620,7 +621,6 @@ static BOOL init_texthost(void) { IUnknown *init; HRESULT result; - PCreateTextServices pCreateTextServices; dummyTextHost = CoTaskMemAlloc(sizeof(*dummyTextHost)); if (dummyTextHost == NULL) { @@ -633,7 +633,6 @@ static BOOL init_texthost(void) /* MSDN states that an IUnknown object is returned by CreateTextServices which is then queried to obtain a ITextServices object. */ - pCreateTextServices = (void*)GetProcAddress(hmoduleRichEdit, "CreateTextServices"); result = (*pCreateTextServices)(NULL, &dummyTextHost->ITextHost_iface, &init); ok(result == S_OK, "Did not return S_OK when created (result = %x)\n", result); if (result != S_OK) { @@ -825,6 +824,8 @@ START_TEST( txtsrv ) pIID_ITextServices = (IID*)GetProcAddress(hmoduleRichEdit, "IID_ITextServices"); pIID_ITextHost = (IID*)GetProcAddress(hmoduleRichEdit, "IID_ITextHost"); pIID_ITextHost2 = (IID*)GetProcAddress(hmoduleRichEdit, "IID_ITextHost2"); + pCreateTextServices = (void*)GetProcAddress(hmoduleRichEdit, "CreateTextServices"); + test_IIDs(); if (init_texthost()) -- 2.11.4.GIT