From 0ba307d25227fc36fe6476ba4ec3f8d141b449a4 Mon Sep 17 00:00:00 2001 From: Jeff Latimer Date: Thu, 16 Feb 2006 12:06:18 +0100 Subject: [PATCH] usp10: Implement ScriptGetProperties. --- dlls/usp10/tests/usp10.c | 11 +++++------ dlls/usp10/usp10.c | 37 +++++++++++++++++++++++++++++++++++-- 2 files changed, 40 insertions(+), 8 deletions(-) diff --git a/dlls/usp10/tests/usp10.c b/dlls/usp10/tests/usp10.c index 683f9383701..83c297aadf4 100644 --- a/dlls/usp10/tests/usp10.c +++ b/dlls/usp10/tests/usp10.c @@ -79,12 +79,11 @@ START_TEST(usp10) * by checking a known value in the table */ hr = ScriptGetProperties(&ppSp, &iMaxProps); trace("number of script properties %d\n", iMaxProps); - todo_wine { - ok (iMaxProps > 0, "Number of scripts returned should not be 0\n"); - if (iMaxProps > 0) - ok( ppSp[5]->langid == 9, "Langid[5] not = to 9\n"); /* Check a known value to ensure */ - /* ptrs work */ - } + ok (iMaxProps > 0, "Number of scripts returned should not be 0\n"); + if (iMaxProps > 0) + ok( ppSp[5]->langid == 9, "Langid[5] not = to 9\n"); /* Check a known value to ensure */ + /* ptrs work */ + /* This set of tests are to check that the various edits in ScriptIemize work */ cInChars = 5; /* Length of test without NULL */ diff --git a/dlls/usp10/usp10.c b/dlls/usp10/usp10.c index 6fe2f6ce59f..dd2686757f0 100644 --- a/dlls/usp10/usp10.c +++ b/dlls/usp10/usp10.c @@ -39,6 +39,35 @@ WINE_DEFAULT_DEBUG_CHANNEL(uniscribe); +#define MAX_SCRIPTS 8 + +/* Set up a default for ScriptGetProperties */ +static const SCRIPT_PROPERTIES Default_Script_0 = {0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0}; +static const SCRIPT_PROPERTIES Default_Script_1 = {0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0}; +static const SCRIPT_PROPERTIES Default_Script_2 = {0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0}; +static const SCRIPT_PROPERTIES Default_Script_3 = {9, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0}; +static const SCRIPT_PROPERTIES Default_Script_4 = {9, 1, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0}; +static const SCRIPT_PROPERTIES Default_Script_5 = {9, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 1, 0, 0}; +static const SCRIPT_PROPERTIES Default_Script_6 = {9, 1, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 1, 0, 0}; +static const SCRIPT_PROPERTIES Default_Script_7 = {8, 0, 0, 0, 0, 161, 0, 0, + 0, 0, 0, 0, 0, 0, 0}; +static const SCRIPT_PROPERTIES *Global_Script[MAX_SCRIPTS] = + {&Default_Script_0, + &Default_Script_1, + &Default_Script_2, + &Default_Script_3, + &Default_Script_4, + &Default_Script_5, + &Default_Script_6, + &Default_Script_7}; + BOOL WINAPI DllMain(HINSTANCE hInstDLL, DWORD fdwReason, LPVOID lpv) { switch(fdwReason) { @@ -69,9 +98,13 @@ HRESULT WINAPI ScriptFreeCache(SCRIPT_CACHE *psc) */ HRESULT WINAPI ScriptGetProperties(const SCRIPT_PROPERTIES ***ppSp, int *piNumScripts) { - FIXME("%p,%p\n",ppSp,piNumScripts); + TRACE("%p,%p\n",ppSp, piNumScripts); - if (piNumScripts) *piNumScripts = 0; +/* Set up a sensible default and intialise pointers */ + *piNumScripts = MAX_SCRIPTS; + *ppSp = Global_Script; + TRACE("ppSp:%p, *ppSp:%p, **ppSp:%p, %d\n", ppSp, *ppSp, **ppSp, + *piNumScripts); return 0; }