Alexandre Julliard : usp10/tests: Load GetGlyphIndicesW dynamically.

Alexandre Julliard julliard at winehq.org
Fri May 27 11:03:39 CDT 2011


Module: wine
Branch: master
Commit: 76319e3a8d670bde417365722629b344fa7fb76a
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=76319e3a8d670bde417365722629b344fa7fb76a

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Fri May 27 12:19:35 2011 +0200

usp10/tests: Load GetGlyphIndicesW dynamically.

---

 dlls/usp10/tests/usp10.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/dlls/usp10/tests/usp10.c b/dlls/usp10/tests/usp10.c
index bfb2b5c..6b7ed18 100644
--- a/dlls/usp10/tests/usp10.c
+++ b/dlls/usp10/tests/usp10.c
@@ -55,6 +55,8 @@ static HRESULT (WINAPI *pScriptItemizeOpenType)( const WCHAR *pwcInChars, int cI
 
 static HRESULT (WINAPI *pScriptShapeOpenType)( HDC hdc, SCRIPT_CACHE *psc, SCRIPT_ANALYSIS *psa, OPENTYPE_TAG tagScript, OPENTYPE_TAG tagLangSys, int *rcRangeChars, TEXTRANGE_PROPERTIES **rpRangeProperties, int cRanges, const WCHAR *pwcChars, int cChars, int cMaxGlyphs, WORD *pwLogClust, SCRIPT_CHARPROP *pCharProps, WORD *pwOutGlyphs, SCRIPT_GLYPHPROP *pOutGlyphProps, int *pcGlyphs);
 
+static DWORD (WINAPI *pGetGlyphIndicesW)(HDC hdc, LPCWSTR lpstr, INT count, LPWORD pgi, DWORD flags);
+
 static inline void _test_items_ok(LPCWSTR string, DWORD cchString,
                          SCRIPT_CONTROL *Control, SCRIPT_STATE *State,
                          DWORD nItems, const itemTest* items, BOOL nItemsToDo,
@@ -216,6 +218,7 @@ static void test_ScriptItemize( void )
     ok (usp10 != 0,"Unable to LoadLibrary on usp10.dll\n");
     pScriptItemizeOpenType = (void*)GetProcAddress(usp10, "ScriptItemizeOpenType");
     pScriptShapeOpenType = (void*)GetProcAddress(usp10, "ScriptShapeOpenType");
+    pGetGlyphIndicesW = (void*)GetProcAddress(GetModuleHandleA("gdi32.dll"), "GetGlyphIndicesW");
 
     memset(&Control, 0, sizeof(Control));
     memset(&State, 0, sizeof(State));
@@ -493,7 +496,7 @@ static int _find_font_for_range(HDC hdc, const CHAR *recommended, BYTE range, co
         WORD glyph = 0;
 
         *origFont = SelectObject(hdc,*hfont);
-        if (GetGlyphIndicesW(hdc, &check, 1, &glyph, 0) == GDI_ERROR || glyph ==0)
+        if (pGetGlyphIndicesW && (pGetGlyphIndicesW(hdc, &check, 1, &glyph, 0) == GDI_ERROR || glyph ==0))
         {
             winetest_trace("    Font fails to contain required glyphs\n");
             SelectObject(hdc,*origFont);




More information about the wine-cvs mailing list