Rob Shearman : ole32: Check the input hwnd is valid in RevokeDragDrop.
Alexandre Julliard
julliard at wine.codeweavers.com
Thu Apr 5 06:42:54 CDT 2007
Module: wine
Branch: master
Commit: 47432cba4515098c1a18f039a46c944107de6eac
URL: http://source.winehq.org/git/wine.git/?a=commit;h=47432cba4515098c1a18f039a46c944107de6eac
Author: Rob Shearman <rob at codeweavers.com>
Date: Thu Apr 5 11:33:16 2007 +0100
ole32: Check the input hwnd is valid in RevokeDragDrop.
---
dlls/ole32/ole2.c | 9 +++++++++
dlls/ole32/tests/dragdrop.c | 1 -
2 files changed, 9 insertions(+), 1 deletions(-)
diff --git a/dlls/ole32/ole2.c b/dlls/ole32/ole2.c
index c300f68..1f2c301 100644
--- a/dlls/ole32/ole2.c
+++ b/dlls/ole32/ole2.c
@@ -299,7 +299,10 @@ HRESULT WINAPI RegisterDragDrop(
return E_INVALIDARG;
if (!IsWindow(hwnd))
+ {
+ ERR("invalid hwnd %p\n", hwnd);
return DRAGDROP_E_INVALIDHWND;
+ }
/*
* First, check if the window is already registered.
@@ -341,6 +344,12 @@ HRESULT WINAPI RevokeDragDrop(
TRACE("(%p)\n", hwnd);
+ if (!IsWindow(hwnd))
+ {
+ ERR("invalid hwnd %p\n", hwnd);
+ return DRAGDROP_E_INVALIDHWND;
+ }
+
/*
* First, check if the window is already registered.
*/
diff --git a/dlls/ole32/tests/dragdrop.c b/dlls/ole32/tests/dragdrop.c
index 05d80d0..6401c11 100644
--- a/dlls/ole32/tests/dragdrop.c
+++ b/dlls/ole32/tests/dragdrop.c
@@ -145,6 +145,5 @@ START_TEST(dragdrop)
ok(droptarget_release_called == 1, "DropTarget_Release should have been called once, not %d times\n", droptarget_release_called);
hr = RevokeDragDrop(NULL);
- todo_wine
ok(hr == DRAGDROP_E_INVALIDHWND, "RevokeDragDrop with NULL hwnd should return DRAGDROP_E_INVALIDHWND instead of 0x%08x\n", hr);
}
More information about the wine-cvs
mailing list