ole32: Check the input hwnd is valid in RevokeDragDrop.

This commit is contained in:
Rob Shearman 2007-04-05 11:33:16 +01:00 committed by Alexandre Julliard
parent 2d8ae2cf83
commit 47432cba45
2 changed files with 9 additions and 1 deletions

View File

@ -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.
*/

View File

@ -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);
}