Jactry Zeng : riched20: Return E_INVALIDARG for empty ppSel in ITextDocument::GetSelection.
Alexandre Julliard
julliard at winehq.org
Wed Mar 26 14:34:12 CDT 2014
Module: wine
Branch: master
Commit: c5bd5236b924e4e21c85aa3262cbe49339b893ed
URL: http://source.winehq.org/git/wine.git/?a=commit;h=c5bd5236b924e4e21c85aa3262cbe49339b893ed
Author: Jactry Zeng <jactry92 at gmail.com>
Date: Tue Mar 25 23:53:59 2014 +0800
riched20: Return E_INVALIDARG for empty ppSel in ITextDocument::GetSelection.
---
dlls/riched20/richole.c | 3 +++
dlls/riched20/tests/richole.c | 3 +++
2 files changed, 6 insertions(+)
diff --git a/dlls/riched20/richole.c b/dlls/riched20/richole.c
index 6805873..bec228e 100644
--- a/dlls/riched20/richole.c
+++ b/dlls/riched20/richole.c
@@ -515,6 +515,9 @@ ITextDocument_fnGetSelection(ITextDocument* me, ITextSelection** ppSel)
{
IRichEditOleImpl *This = impl_from_ITextDocument(me);
TRACE("(%p)\n", me);
+
+ if(!ppSel)
+ return E_INVALIDARG;
*ppSel = &This->txtSel->ITextSelection_iface;
ITextSelection_AddRef(*ppSel);
return S_OK;
diff --git a/dlls/riched20/tests/richole.c b/dlls/riched20/tests/richole.c
index 5bfb999..5a3ffbe 100644
--- a/dlls/riched20/tests/richole.c
+++ b/dlls/riched20/tests/richole.c
@@ -117,6 +117,9 @@ static void test_Interfaces(void)
ok(hres == S_OK, "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);
punk = NULL;
More information about the wine-cvs
mailing list