riched20: Return E_INVALIDARG for empty ppSel in ITextDocument::GetSelection.

This commit is contained in:
Jactry Zeng 2014-03-25 23:53:59 +08:00 committed by Alexandre Julliard
parent 946378a1b2
commit c5bd5236b9
2 changed files with 6 additions and 0 deletions

View File

@ -515,6 +515,9 @@ ITextDocument_fnGetSelection(ITextDocument* me, ITextSelection** ppSel)
{ {
IRichEditOleImpl *This = impl_from_ITextDocument(me); IRichEditOleImpl *This = impl_from_ITextDocument(me);
TRACE("(%p)\n", me); TRACE("(%p)\n", me);
if(!ppSel)
return E_INVALIDARG;
*ppSel = &This->txtSel->ITextSelection_iface; *ppSel = &This->txtSel->ITextSelection_iface;
ITextSelection_AddRef(*ppSel); ITextSelection_AddRef(*ppSel);
return S_OK; return S_OK;

View File

@ -117,6 +117,9 @@ static void test_Interfaces(void)
ok(hres == S_OK, "IRichEditOle_QueryInterface\n"); ok(hres == S_OK, "IRichEditOle_QueryInterface\n");
ok(txtDoc != NULL, "IRichEditOle_QueryInterface\n"); ok(txtDoc != NULL, "IRichEditOle_QueryInterface\n");
hres = ITextDocument_GetSelection(txtDoc, NULL);
ok(hres == E_INVALIDARG, "ITextDocument_GetSelection: 0x%x\n", hres);
ITextDocument_GetSelection(txtDoc, &txtSel); ITextDocument_GetSelection(txtDoc, &txtSel);
punk = NULL; punk = NULL;