[PATCH] [USP10]: get prop
Eric Pouech
eric.pouech at wanadoo.fr
Tue May 16 14:12:16 CDT 2006
- fix ScriptGetProperties so that first pointer can be NULL
Windbg calls ScriptGetProperties with first pointer set to NULL
(in order to know the size to be passed later on)
A+
---
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;
}
More information about the wine-patches
mailing list