Module: wine Branch: refs/heads/master Commit: 766530dfe8e7bec6ba73aab8e380b6cf3557a48c URL: http://source.winehq.org/git/?p=wine.git;a=commit;h=766530dfe8e7bec6ba73aab8...
Author: Eric Pouech eric.pouech@wanadoo.fr Date: Tue May 16 21:12:16 2006 +0200
usp10: Fix ScriptGetProperties so that first pointer can be NULL.
---
dlls/usp10/usp10.c | 15 +++++++++------ 1 files changed, 9 insertions(+), 6 deletions(-)
diff --git a/dlls/usp10/usp10.c b/dlls/usp10/usp10.c index 8fbad37..4b54959 100644 --- a/dlls/usp10/usp10.c +++ b/dlls/usp10/usp10.c @@ -109,13 +109,16 @@ HRESULT WINAPI ScriptFreeCache(SCRIPT_CA */ HRESULT WINAPI ScriptGetProperties(const SCRIPT_PROPERTIES ***ppSp, int *piNumScripts) { - TRACE("%p,%p\n",ppSp, piNumScripts); + TRACE("%p,%p\n", ppSp, piNumScripts);
-/* 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); + if (!ppSp && !piNumScripts) return E_INVALIDARG; + + /* Set up a sensible default and intialise pointers */ + if (piNumScripts) *piNumScripts = MAX_SCRIPTS; + if (ppSp) *ppSp = Global_Script; + TRACE("ppSp:%p, *ppSp:%p, **ppSp:%p, %d\n", + ppSp, ppSp ? *ppSp : NULL, (ppSp && *ppSp) ? **ppSp : NULL, + piNumScripts ? *piNumScripts : -1); return 0; }