From 422ca43d14a8617f1d9fe06f1ddb565a5fd09d1e Mon Sep 17 00:00:00 2001 From: Jeff Latimer Date: Tue, 6 Jun 2006 20:14:01 +1000 Subject: [PATCH] usp10: Update ScriptGetCMap to conform to Windows. --- dlls/usp10/tests/usp10.c | 13 ++++++++++--- dlls/usp10/usp10.c | 2 +- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/dlls/usp10/tests/usp10.c b/dlls/usp10/tests/usp10.c index a46f643b098..221f3a40a24 100644 --- a/dlls/usp10/tests/usp10.c +++ b/dlls/usp10/tests/usp10.c @@ -220,7 +220,7 @@ void test_ScriptGetCMap(unsigned short pwOutGlyphs[256]) int cInChars; int cChars; unsigned short pwOutGlyphs3[256]; - WCHAR TestItem1[6] = {'T', 'e', 's', 't', 0x0166, 0}; + WCHAR TestItem1[6] = {'T', 'e', 's', 't', 'a', 0}; DWORD dwFlags; int cnt; @@ -249,10 +249,17 @@ void test_ScriptGetCMap(unsigned short pwOutGlyphs[256]) /* Set psc to NULL, to be able to check if a pointer is returned in psc */ psc = NULL; hr = ScriptGetCMap(NULL, &psc, NULL, 0, 0, NULL); - ok( hr == E_INVALIDARG, "(NULL,&psc,NULL,0,0NULL), expected E_INVALIDARG, " - "got %08x\n", (unsigned int)hr); + ok( hr == E_PENDING, "(NULL,&psc,NULL,0,0NULL), expected E_PENDING, " + "got %08x\n", (unsigned int)hr); ok( psc == NULL, "Expected psc to be NULL, got %p\n", psc); + /* Set psc to NULL but add hdc, to be able to check if a pointer is returned in psc */ + psc = NULL; + hr = ScriptGetCMap(hdc, &psc, NULL, 0, 0, NULL); + ok( hr == S_OK, "ScriptGetCMap(NULL,&psc,NULL,0,0,NULL), expected S_OK, " + "got %08x\n", (unsigned int)hr); + ok( psc != NULL, "ScritpGetCMap expected psc to be not NULL\n"); + /* Set psc to NULL, to be able to check if a pointer is returned in psc */ psc = NULL; hr = ScriptGetCMap(NULL, &psc, TestItem1, cInChars, dwFlags, pwOutGlyphs3); diff --git a/dlls/usp10/usp10.c b/dlls/usp10/usp10.c index abd4952afd5..68e700e53fa 100644 --- a/dlls/usp10/usp10.c +++ b/dlls/usp10/usp10.c @@ -555,7 +555,7 @@ HRESULT WINAPI ScriptGetCMap(HDC hdc, SCRIPT_CACHE *psc, const WCHAR *pwcInChars FIXME("(%p,%p,%s,%d,0x%lx,%p): semi-stub\n", hdc, psc, debugstr_wn(pwcInChars,cChars), cChars, dwFlags, pwOutGlyphs); - if (!psc || !pwcInChars || !pwOutGlyphs) + if (!psc) return E_INVALIDARG; if (!hdc && !*psc) {