usp10: Properly handle invalid arguments to ScriptBreak.
This commit is contained in:
parent
c110a55f12
commit
5bb7590fad
|
@ -2798,6 +2798,19 @@ static void test_ScriptBreak(void)
|
|||
hr = ScriptItemize(test, 3, 4, NULL, NULL, items, NULL);
|
||||
ok(!hr, "ScriptItemize should return S_OK not %08x\n", hr);
|
||||
|
||||
/*
|
||||
* This Test crashes pre Vista.
|
||||
|
||||
hr = ScriptBreak(test, 1, &items[0].a, NULL);
|
||||
ok(hr == E_INVALIDARG, "ScriptBreak should return E_INVALIDARG not %08x\n", hr);
|
||||
*/
|
||||
|
||||
hr = ScriptBreak(test, 0, &items[0].a, &la);
|
||||
ok(hr == E_FAIL || broken(hr == S_OK), "ScriptBreak should return E_FAIL not %08x\n", hr);
|
||||
|
||||
hr = ScriptBreak(test, -1, &items[0].a, &la);
|
||||
ok(hr == E_INVALIDARG || broken(hr == S_OK), "ScriptBreak should return E_INVALIDARG not %08x\n", hr);
|
||||
|
||||
memset(&la, 0, sizeof(la));
|
||||
hr = ScriptBreak(test, 1, &items[0].a, &la);
|
||||
ok(!hr, "ScriptBreak should return S_OK not %08x\n", hr);
|
||||
|
|
|
@ -2665,7 +2665,8 @@ HRESULT WINAPI ScriptBreak(const WCHAR *chars, int count, const SCRIPT_ANALYSIS
|
|||
{
|
||||
TRACE("(%s, %d, %p, %p)\n", debugstr_wn(chars, count), count, sa, la);
|
||||
|
||||
if (!la) return S_FALSE;
|
||||
if (count < 0 || !la) return E_INVALIDARG;
|
||||
if (count == 0) return E_FAIL;
|
||||
|
||||
BREAK_line(chars, count, sa, la);
|
||||
|
||||
|
|
Loading…
Reference in New Issue