The drag and drop helpers are mainly used for providing visual feedback for drag and drop operations. While they do not actually influence the dragging process, some applications may expect it to succeed before initiating dragging. If the functions are not implemented, however, then dragging may fail.
This patch set contains tests for basic functionality of the functions involved. It does not account for displaying the drag-image, it just tests for enough functionality to create a basic implementation and allow dragging operations to carry on. Drag-image handling will be added later.
The patch set contains only the tests. The implementation will be added in a separate MR.
-- v2: shell32/tests: Add tests for drag and drop helpers shell32/tests: Add, initialize and release new variables shell32/tests: add mock IDataObject instances
From: Tarcísio Ladeia de Oliveirawyrquill@gmail.com
Used by IDragSourceHelper2::SetFlags(). There does not seem to be a named constant for 0x0, but it seems to be the default state.
Signed-off-by: Tarcísio Ladeia de Oliveira wyrquill@gmail.com --- include/shobjidl.idl | 5 +++++ 1 file changed, 5 insertions(+)
diff --git a/include/shobjidl.idl b/include/shobjidl.idl index 065e0c8c528..86923a691d1 100644 --- a/include/shobjidl.idl +++ b/include/shobjidl.idl @@ -1642,6 +1642,11 @@ interface IDragSourceHelper : IUnknown ] interface IDragSourceHelper2 : IDragSourceHelper { + typedef enum + { + DSH_ALLOWDROPDESCRIPTIONTEXT = 0x01 + } DSH_FLAGS; + HRESULT SetFlags([in] DWORD dwFlags); }
From: Tarcísio Ladeia de Oliveirawyrquill@gmail.com
Used by IDragSourceHelper::InitializeFromWindow().
Signed-off-by: Tarcísio Ladeia de Oliveira wyrquill@gmail.com --- include/shlobj.h | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+)
diff --git a/include/shlobj.h b/include/shlobj.h index feee6cd9b98..3d093de1a24 100644 --- a/include/shlobj.h +++ b/include/shlobj.h @@ -1892,6 +1892,27 @@ BOOL WINAPI DAD_DragLeave(void); BOOL WINAPI DAD_AutoScroll(HWND,AUTO_SCROLL_DATA*,LPPOINT); HRESULT WINAPI SHDoDragDrop(HWND,IDataObject*,IDropSource*,DWORD,LPDWORD);
+/**************************************************************************** + * IDragSourceHelper interface + */ + +#define DI_GETDRAGIMAGEA "ShellGetDragImage" + +/* DATAOBJECT_InitShellIDList*/ +#define CFSTR_SHELLIDLISTA "Shell IDList Array" /* CF_IDLIST */ + +#if defined(__GNUC__) +# define DI_GETDRAGIMAGEW \ + (const WCHAR []){'S','h','e','l','l','G','e','t','D','r','a','g','I','m','a','g','e',0}; +#elif defined(_MSC_VER) +# define DI_GETDRAGIMAGEW L"ShellGetDragImage" +#else +static const WCHAR DI_GETDRAGIMAGEW[] = + {'S','h','e','l','l','G','e','t','D','r','a','g','I','m','a','g','e',0}; +#endif + +#define DI_GETDRAGIMAGE WINELIB_NAME_AW(DI_GETDRAGIMAGE) + /**************************************************************************** * Internet shortcut properties */
From: Tarcísio Ladeia de Oliveirawyrquill@gmail.com
The drag and drop helpers require the use of IDataObject with GetData() and SetData() implemented, being able to store "arbitrary private formats". Currently implements the interface with those functions being either empty or not implemented.
Signed-off-by: Tarcísio Ladeia de Oliveira wyrquill@gmail.com --- dlls/shell32/tests/shellole.c | 171 ++++++++++++++++++++++++++++++++++ 1 file changed, 171 insertions(+)
diff --git a/dlls/shell32/tests/shellole.c b/dlls/shell32/tests/shellole.c index 4864d35ea9a..75d475b2c29 100644 --- a/dlls/shell32/tests/shellole.c +++ b/dlls/shell32/tests/shellole.c @@ -1018,6 +1018,169 @@ static void test_SHCreateSessionKey(void) } }
+/** + * DRAG AND DROP HELPERS + */ + +static HRESULT WINAPI DataObject_QueryInterface( + IDataObject *iface, + REFIID riid, + void **pObj) +{ + if (IsEqualIID(riid, &IID_IUnknown) || + IsEqualIID(riid, &IID_IDataObject)) + { + *pObj = iface; + IDataObject_AddRef(iface); + return S_OK; + } + + trace("DataObject_QueryInterface: %s\n", wine_dbgstr_guid(riid)); + return E_NOINTERFACE; +} + +static ULONG WINAPI DataObject_AddRef(IDataObject *iface) +{ + return 2; +} + +static ULONG WINAPI DataObject_Release(IDataObject *iface) +{ + return 1; +} + +static HRESULT WINAPI DataObject_GetData_empty( + IDataObject *iface, + FORMATETC *pformatetcIn, + STGMEDIUM *pmedium) +{ + return S_OK; +} + +static HRESULT WINAPI DataObject_SetData_empty( + IDataObject *iface, + FORMATETC *pformatetc, + STGMEDIUM *pmedium, + BOOL fRelease) +{ + return S_OK; +} + +static HRESULT WINAPI DataObject_GetData_notimpl( + IDataObject *iface, + FORMATETC *pformatetcIn, + STGMEDIUM *pmedium) +{ + return E_NOTIMPL; +} + +static HRESULT WINAPI DataObject_SetData_notimpl( + IDataObject *iface, + FORMATETC *pformatetc, + STGMEDIUM *pmedium, + BOOL fRelease) +{ + return E_NOTIMPL; +} + +static HRESULT WINAPI DataObject_GetDataHere( + IDataObject *iface, + FORMATETC *pformatetc, + STGMEDIUM *pmedium) +{ + ok(0, "unexpected call\n"); + return E_NOTIMPL; +} + +static HRESULT WINAPI DataObject_QueryGetData( + IDataObject *iface, + FORMATETC *pformatetc) +{ + ok(0, "unexpected call\n"); + return E_NOTIMPL; +} + +static HRESULT WINAPI DataObject_GetCanonicalFormatEtc( + IDataObject *iface, + FORMATETC *pformatetcIn, + FORMATETC *pformatetcOut) +{ + ok(0, "unexpected call\n"); + return E_NOTIMPL; +} + +static HRESULT WINAPI DataObject_EnumFormatEtc( + IDataObject *iface, + DWORD dwDirection, + IEnumFORMATETC **ppenumFormatEtc) +{ + ok(0, "unexpected call\n"); + return E_NOTIMPL; +} + +static HRESULT WINAPI DataObject_DAdvise( + IDataObject *iface, + FORMATETC *pformatetc, + DWORD advf, + IAdviseSink *pAdvSink, + DWORD *pdwConnection) +{ + ok(0, "unexpected call\n"); + return E_NOTIMPL; +} + +static HRESULT WINAPI DataObject_DUnadvise( + IDataObject *iface, + DWORD dwConnection) +{ + ok(0, "unexpected call\n"); + return E_NOTIMPL; +} + +static HRESULT WINAPI DataObject_EnumDAdvise( + IDataObject *iface, + IEnumSTATDATA **ppenumAdvise) +{ + ok(0, "unexpected call\n"); + return E_NOTIMPL; +} + +static const IDataObjectVtbl dataobject_vtbl = +{ + DataObject_QueryInterface, + DataObject_AddRef, + DataObject_Release, + DataObject_GetData_empty, + DataObject_GetDataHere, + DataObject_QueryGetData, + DataObject_GetCanonicalFormatEtc, + DataObject_SetData_empty, + DataObject_EnumFormatEtc, + DataObject_DAdvise, + DataObject_DUnadvise, + DataObject_EnumDAdvise +}; + +static const IDataObjectVtbl dataobject_vtbl_notimpl = +{ + DataObject_QueryInterface, + DataObject_AddRef, + DataObject_Release, + DataObject_GetData_notimpl, + DataObject_GetDataHere, + DataObject_QueryGetData, + DataObject_GetCanonicalFormatEtc, + DataObject_SetData_notimpl, + DataObject_EnumFormatEtc, + DataObject_DAdvise, + DataObject_DUnadvise, + DataObject_EnumDAdvise +}; + +static IDataObject data_object = { &dataobject_vtbl }; + +static IDataObject data_object_notimpl = { &dataobject_vtbl_notimpl }; + static void test_dragdrophelper(void) { IDragSourceHelper *dragsource; @@ -1031,6 +1194,14 @@ static void test_dragdrophelper(void) ok(hr == S_OK, "QI failed, %#lx\n", hr); IDragSourceHelper_Release(dragsource);
+ /* Temporary (remove warnings from commit) */ + + hr = data_object.lpVtbl->GetData(&data_object, NULL, NULL); + ok(hr == S_OK, "GetData failed, %lx\n", hr); + + hr = data_object_notimpl.lpVtbl->GetData(&data_object_notimpl, NULL, NULL); + ok(hr == E_NOTIMPL, "GetData should not be implemented, but got %lx\n", hr); + IDropTargetHelper_Release(target); }
From: Tarcísio Ladeia de Oliveirawyrquill@gmail.com
Add new variables to be used as function parameters in the tests. They consist on the SHDRAGIMAGE instance, used for initialization, the bitmap it requires, as well as a window (for InitializeFromWindow()), IDragSourceHelper2 pointer, POINT instance, among others.
Release the dynamically allocated variables as soon as possible (as in the case of the device contexts used) or at the end of the test.
Signed-off-by: Tarcísio Ladeia de Oliveira wyrquill@gmail.com --- dlls/shell32/tests/shellole.c | 98 +++++++++++++++++++++++++++++++++-- 1 file changed, 95 insertions(+), 3 deletions(-)
diff --git a/dlls/shell32/tests/shellole.c b/dlls/shell32/tests/shellole.c index 75d475b2c29..a83ddbd8f5d 100644 --- a/dlls/shell32/tests/shellole.c +++ b/dlls/shell32/tests/shellole.c @@ -1181,18 +1181,99 @@ static IDataObject data_object = { &dataobject_vtbl };
static IDataObject data_object_notimpl = { &dataobject_vtbl_notimpl };
+static SHDRAGIMAGE drag_image; + +static LRESULT WINAPI drag_helper_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) +{ + const UINT di_msg = RegisterWindowMessageA(DI_GETDRAGIMAGEA); + + if (msg == di_msg) + { + SHDRAGIMAGE* tmp = (SHDRAGIMAGE*)lparam; + *tmp = drag_image; + return 0; + } + + return DefWindowProcA(hwnd, msg, wparam, lparam); +} + static void test_dragdrophelper(void) { IDragSourceHelper *dragsource; + IDragSourceHelper2 *dragsource2; IDropTargetHelper *target; + WNDCLASSA cls; + HWND hwnd_target; + HDC dc, comp_dc; + RECT rect; + HBITMAP bitmap, b_old; + HBRUSH brush; + SHDRAGIMAGE di_empty; HRESULT hr;
+ /* Initialize variables and window */ + + memset(&cls, 0, sizeof(cls)); + cls.lpfnWndProc = drag_helper_proc; + cls.hInstance = GetModuleHandleA(NULL); + cls.lpszClassName = "drag helper test"; + RegisterClassA(&cls); + + hwnd_target = CreateWindowA("drag helper test", NULL, 0, 0, 200, 200, 0, + NULL, 0, NULL, 0); + ok(hwnd_target != NULL, "CreateWindow failed: %lx\n", GetLastError()); + + dc = GetDC(hwnd_target); + ok(dc != NULL, "Failed to get device context\n"); + + comp_dc = CreateCompatibleDC(dc); + ok(comp_dc != NULL, "Failed to create compatible device context\n"); + + memset(&di_empty, 0, sizeof(di_empty)); + + drag_image.sizeDragImage.cx = 4; + drag_image.sizeDragImage.cy = 4; + drag_image.ptOffset.x = 4; + drag_image.ptOffset.y = 4; + drag_image.crColorKey = 0x00000000; + drag_image.hbmpDragImage = 0; + bitmap = CreateCompatibleBitmap(dc, 4, 4); + ok(bitmap != NULL, "Failed to create bitmap\n"); + + b_old = (HBITMAP)SelectObject(comp_dc, bitmap); + ok(b_old != NULL && b_old != HGDI_ERROR, "Failed to select object: %p\n", b_old); + + brush = CreateSolidBrush(0x00000000); + ok(brush != NULL, "Failed to create black brush: %p", brush); + + rect.left = rect.top = 0; + rect.right = 4; + rect.bottom = 4; + hr = FillRect(comp_dc, &rect, brush); + ok(hr != 0, "Failed to fill black rect."); + + DeleteObject(brush); + rect.right = 2; + rect.bottom = 2; + brush = CreateSolidBrush(0x000000FF); + ok(brush != NULL, "Failed to create red brush: %p", brush); + hr = FillRect(comp_dc, &rect, brush); + ok(hr != 0, "Failed to fill red rect."); + DeleteObject(brush); + + SelectObject(comp_dc, b_old); + + ReleaseDC(hwnd_target, dc); + DeleteDC(comp_dc); + hr = CoCreateInstance(&CLSID_DragDropHelper, NULL, CLSCTX_INPROC_SERVER, &IID_IDropTargetHelper, (void **)&target); - ok(hr == S_OK, "Failed to create IDropTargetHelper, %#lx\n", hr); + ok(hr == S_OK, "Failed to create IDropTargetHelper, 0x%lx\n", hr);
hr = IDropTargetHelper_QueryInterface(target, &IID_IDragSourceHelper, (void **)&dragsource); - ok(hr == S_OK, "QI failed, %#lx\n", hr); - IDragSourceHelper_Release(dragsource); + ok(hr == S_OK, "QI failed, 0x%lx\n", hr); + + hr = IDropTargetHelper_QueryInterface(target, &IID_IDragSourceHelper, (void **)&dragsource2); + ok(hr == S_OK, "QI 2 failed, 0x%lx\n", hr);
/* Temporary (remove warnings from commit) */
@@ -1202,7 +1283,18 @@ static void test_dragdrophelper(void) hr = data_object_notimpl.lpVtbl->GetData(&data_object_notimpl, NULL, NULL); ok(hr == E_NOTIMPL, "GetData should not be implemented, but got %lx\n", hr);
+ /* Clean up */ + + IDragSourceHelper2_Release(dragsource2); + + IDragSourceHelper_Release(dragsource); + IDropTargetHelper_Release(target); + + DeleteObject(bitmap); + + DestroyWindow(hwnd_target); + UnregisterClassA("drag helper test", GetModuleHandleA(NULL)); }
START_TEST(shellole)
From: Tarcísio Ladeia de Oliveirawyrquill@gmail.com
Add tests for many possible situations in which the functions defined by helper interfaces may be used. No tests for rendering the drag image itself are currently being done. The objective is to allow for a minimal implementation which could allow dragging to succeed, as there are situations in which the application tests for success from the drag and drop helpers before attempting the dragging operation.
Signed-off-by: Tarcísio Ladeia de Oliveira wyrquill@gmail.com --- dlls/shell32/tests/shellole.c | 285 +++++++++++++++++++++++++++++++++- 1 file changed, 280 insertions(+), 5 deletions(-)
diff --git a/dlls/shell32/tests/shellole.c b/dlls/shell32/tests/shellole.c index a83ddbd8f5d..d25643c25b7 100644 --- a/dlls/shell32/tests/shellole.c +++ b/dlls/shell32/tests/shellole.c @@ -1209,9 +1209,13 @@ static void test_dragdrophelper(void) HBITMAP bitmap, b_old; HBRUSH brush; SHDRAGIMAGE di_empty; + POINT pt; + DWORD i; HRESULT hr;
/* Initialize variables and window */ + pt.x = 50; + pt.y = 50;
memset(&cls, 0, sizeof(cls)); cls.lpfnWndProc = drag_helper_proc; @@ -1275,13 +1279,284 @@ static void test_dragdrophelper(void) hr = IDropTargetHelper_QueryInterface(target, &IID_IDragSourceHelper, (void **)&dragsource2); ok(hr == S_OK, "QI 2 failed, 0x%lx\n", hr);
- /* Temporary (remove warnings from commit) */ + /* No initialization */
- hr = data_object.lpVtbl->GetData(&data_object, NULL, NULL); - ok(hr == S_OK, "GetData failed, %lx\n", hr); + todo_wine + { + hr = IDropTargetHelper_DragEnter(target, hwnd_target, &data_object, &pt, DROPEFFECT_MOVE); + ok(hr == E_FAIL, + "Drag enter should have failed with 0x%lx, returned 0x%lx\n", + E_FAIL, hr); + + hr = IDropTargetHelper_DragEnter(target, hwnd_target, NULL, &pt, DROPEFFECT_MOVE); + ok(hr == S_OK, "Drag enter failed, 0x%lx\n", hr); + + /* Inverse process */ + + hr = IDropTargetHelper_Drop(target, &data_object, &pt, DROPEFFECT_MOVE); + ok(hr == S_OK, "Drop failed, 0x%lx\n", hr); + + hr = IDropTargetHelper_DragOver(target, &pt, DROPEFFECT_MOVE); + ok(hr == S_OK, "Drag over failed, 0x%lx\n", hr); + + hr = IDropTargetHelper_DragEnter(target, hwnd_target, &data_object, &pt, DROPEFFECT_MOVE); + ok(hr == E_FAIL, + "Drag enter should have failed with 0x%lx, returned 0x%lx\n", + E_FAIL, hr); + } + + /* Test arguments */ + + hr = IDragSourceHelper2_InitializeFromBitmap(dragsource2, &drag_image, &data_object_notimpl); + ok(hr == E_NOTIMPL, + "Initialization from bitmap should have failed with 0x%lx, returned 0x%lx\n", + E_NOTIMPL, hr); + + todo_wine + { + hr = IDragSourceHelper2_InitializeFromBitmap(dragsource2, NULL, &data_object); + ok(hr == E_INVALIDARG, + "Initialization from bitmap should have failed with 0x%lx, returned 0x%lx\n", + E_INVALIDARG, hr); + + drag_image.hbmpDragImage = bitmap; + hr = IDragSourceHelper2_InitializeFromBitmap(dragsource2, &drag_image, NULL); + ok(hr == E_INVALIDARG, + "Initialization from bitmap should have failed with 0x%lx, returned 0x%lx\n", + E_INVALIDARG, hr); + + drag_image.hbmpDragImage = 0; + hr = IDragSourceHelper2_InitializeFromBitmap(dragsource2, &drag_image, &data_object); + ok(hr == S_OK, "Initialization from bitmap failed, 0x%lx\n", hr); + + hr = IDropTargetHelper_DragLeave(target); + ok(hr == S_OK, "Leave failed, 0x%lx\n", hr); + drag_image.hbmpDragImage = bitmap; + } + + todo_wine + { + hr = IDragSourceHelper2_InitializeFromWindow(dragsource2, hwnd_target, &pt, &data_object_notimpl); + ok(hr == S_OK, "Initialization from window failed, 0x%lx\n", hr); + + hr = IDropTargetHelper_DragLeave(target); + ok(hr == S_OK, "Leave failed, 0x%lx\n", hr); + + hr = IDragSourceHelper2_InitializeFromWindow(dragsource2, NULL, &pt, &data_object); + ok(hr == S_OK, "Initialization from window failed, 0x%lx\n", hr); + + hr = IDropTargetHelper_DragLeave(target); + ok(hr == S_OK, "Leave failed, 0x%lx\n", hr); + + hr = IDragSourceHelper2_InitializeFromWindow(dragsource2, hwnd_target, NULL, &data_object); + ok(hr == S_OK, "Initialization from window failed, 0x%lx\n", hr); + + hr = IDropTargetHelper_DragLeave(target); + ok(hr == S_OK, "Leave failed, 0x%lx\n", hr); + + hr = IDragSourceHelper2_InitializeFromWindow(dragsource2, hwnd_target, &pt, NULL); + ok(hr == E_INVALIDARG, + "Initialization from window should have failed with 0x%lx, returned 0x%lx\n", + E_INVALIDARG, hr); + + hr = IDropTargetHelper_DragLeave(target); + ok(hr == S_OK, "Leave failed, 0x%lx\n", hr); + + drag_image.hbmpDragImage = 0; + hr = IDragSourceHelper2_InitializeFromWindow(dragsource2, hwnd_target, &pt, &data_object); + ok(hr == S_OK, "Initialization from window failed, 0x%lx\n", hr); + + hr = IDropTargetHelper_DragLeave(target); + ok(hr == S_OK, "Leave failed, 0x%lx\n", hr); + + drag_image.hbmpDragImage = bitmap; + } + + hr = IDropTargetHelper_DragEnter(target, hwnd_target, &data_object_notimpl, &pt, DROPEFFECT_MOVE); + ok(hr == E_NOTIMPL, "Drag enter failed, 0x%lx\n", hr); + + todo_wine + { + hr = IDropTargetHelper_DragEnter(target, NULL, &data_object, &pt, DROPEFFECT_MOVE); + ok(hr == E_FAIL, + "Drag enter should have failed with 0x%lx, returned 0x%lx\n", + E_FAIL, hr); + + hr = IDropTargetHelper_DragEnter(target, hwnd_target, NULL, &pt, DROPEFFECT_MOVE); + ok(hr == S_OK, "Drag enter failed, 0x%lx\n", hr); + + hr = IDropTargetHelper_DragEnter(target, hwnd_target, &data_object, NULL, DROPEFFECT_MOVE); + ok(hr == E_INVALIDARG, + "Drag enter should have failed with 0x%lx, returned 0x%lx\n", + E_INVALIDARG, hr); + + hr = IDropTargetHelper_DragOver(target, NULL, DROPEFFECT_MOVE); + ok(hr == E_INVALIDARG, + "Drag over should have failed with 0x%lx, returned 0x%lx\n", + E_INVALIDARG, hr); + + hr = IDropTargetHelper_Drop(target, NULL, &pt, DROPEFFECT_MOVE); + ok(hr == S_OK, "Drop failed, 0x%lx\n", hr); + + hr = IDropTargetHelper_Drop(target, &data_object, NULL, DROPEFFECT_MOVE); + ok(hr == S_OK, "Drop failed, 0x%lx\n", hr); + + hr = IDropTargetHelper_DragLeave(target); + ok(hr == S_OK, "Leave failed, 0x%lx\n", hr); + + hr = IDragSourceHelper2_InitializeFromBitmap(dragsource2, &di_empty, &data_object); + ok(hr == S_OK, "Initialization from bitmap failed, 0x%lx\n", hr); + + hr = IDropTargetHelper_DragLeave(target); + ok(hr == S_OK, "Leave failed, 0x%lx\n", hr); + } + + + /* Test dragging bitmap. */ + + hr = IDragSourceHelper2_SetFlags(dragsource2, DSH_ALLOWDROPDESCRIPTIONTEXT); + ok(hr == S_OK, "Flag setting failed, 0x%lx\n", hr); + + drag_image.hbmpDragImage = bitmap; + + todo_wine + { + hr = IDragSourceHelper2_InitializeFromBitmap(dragsource2, &drag_image, &data_object); + ok(hr == S_OK, "Initialization from bitmap failed, 0x%lx\n", hr); + + hr = IDropTargetHelper_DragEnter(target, hwnd_target, &data_object, &pt, DROPEFFECT_MOVE); + ok(hr == S_OK, "Drag enter failed, 0x%lx\n", hr); + + hr = IDropTargetHelper_DragOver(target, &pt, DROPEFFECT_MOVE); + ok(hr == S_OK, "Drag over failed, 0x%lx\n", hr); + + hr = IDropTargetHelper_Drop(target, &data_object, &pt, DROPEFFECT_MOVE); + ok(hr == S_OK, "Drop failed, 0x%lx\n", hr); + + /* Try again, without reinitializing */
- hr = data_object_notimpl.lpVtbl->GetData(&data_object_notimpl, NULL, NULL); - ok(hr == E_NOTIMPL, "GetData should not be implemented, but got %lx\n", hr); + hr = IDropTargetHelper_DragEnter(target, hwnd_target, &data_object, &pt, DROPEFFECT_MOVE); + ok(hr == E_FAIL, + "Drag enter should have failed with 0x%lx, returned 0x%lx\n", + E_FAIL, hr); + + hr = IDropTargetHelper_DragOver(target, &pt, DROPEFFECT_MOVE); + ok(hr == S_OK, "Drag over failed, 0x%lx\n", hr); + + hr = IDropTargetHelper_Drop(target, &data_object, &pt, DROPEFFECT_MOVE); + ok(hr == S_OK, "Drop failed, 0x%lx\n", hr); + + /* Test dragging bitmap from window. */ + + hr = IDragSourceHelper2_InitializeFromWindow(dragsource2, hwnd_target, &pt, &data_object); + ok(hr == S_OK, "Initialization from bitmap failed, 0x%lx\n", hr); + + hr = IDropTargetHelper_DragEnter(target, hwnd_target, &data_object, &pt, DROPEFFECT_MOVE); + ok(hr == S_OK, "Drag enter failed, 0x%lx\n", hr); + + hr = IDropTargetHelper_DragOver(target, &pt, DROPEFFECT_MOVE); + ok(hr == S_OK, "Drag over failed, 0x%lx\n", hr); + + hr = IDropTargetHelper_Drop(target, &data_object, &pt, DROPEFFECT_MOVE); + ok(hr == S_OK, "Drop failed, 0x%lx\n", hr); + + /* Test cancelling drag. */ + + hr = IDragSourceHelper2_InitializeFromBitmap(dragsource2, &drag_image, &data_object); + ok(hr == S_OK, "Initialization from bitmap failed, 0x%lx\n", hr); + + hr = IDropTargetHelper_DragEnter(target, hwnd_target, &data_object, &pt, DROPEFFECT_MOVE); + ok(hr == S_OK, "Drag enter failed, 0x%lx\n", hr); + + hr = IDropTargetHelper_DragOver(target, &pt, DROPEFFECT_MOVE); + ok(hr == S_OK, "Drag over failed, 0x%lx\n", hr); + + hr = IDropTargetHelper_DragLeave(target); + ok(hr == S_OK, "Leave failed, 0x%lx\n", hr); + } + + /* No description text. */ + + hr = IDragSourceHelper2_SetFlags(dragsource2, 0x0); + ok(hr == S_OK, "Flag setting failed, 0x%lx\n", hr); + + todo_wine + { + hr = IDragSourceHelper2_InitializeFromBitmap(dragsource2, &drag_image, &data_object); + ok(hr == S_OK, "Initialization from bitmap failed, 0x%lx\n", hr); + + hr = IDropTargetHelper_DragEnter(target, hwnd_target, &data_object, &pt, DROPEFFECT_MOVE); + ok(hr == S_OK, "Drag enter failed, 0x%lx\n", hr); + + hr = IDropTargetHelper_DragOver(target, &pt, DROPEFFECT_MOVE); + ok(hr == S_OK, "Drag over failed, 0x%lx\n", hr); + + hr = IDropTargetHelper_DragLeave(target); + ok(hr == S_OK, "Leave failed, 0x%lx\n", hr); + } + + /* Not visible. */ + + hr = IDragSourceHelper2_SetFlags(dragsource2, 0x0); + ok(hr == S_OK, "Flag setting failed, 0x%lx\n", hr); + + todo_wine + { + hr = IDragSourceHelper2_InitializeFromBitmap(dragsource2, &drag_image, &data_object); + ok(hr == S_OK, "Initialization from bitmap failed, 0x%lx\n", hr); + } + + hr = IDropTargetHelper_Show(target, 0); + ok(hr == S_OK, "Hide failed.\n"); + + todo_wine + { + hr = IDropTargetHelper_DragEnter(target, hwnd_target, &data_object, &pt, DROPEFFECT_MOVE); + ok(hr == S_OK, "Drag enter failed, 0x%lx\n", hr); + + hr = IDropTargetHelper_DragOver(target, &pt, DROPEFFECT_MOVE); + ok(hr == S_OK, "Drag over failed, 0x%lx\n", hr); + + hr = IDropTargetHelper_DragLeave(target); + ok(hr == S_OK, "Leave failed, 0x%lx\n", hr); + + /* Test invalid effects */ + for (i = 0; i < 20; ++i) + { + hr = IDragSourceHelper2_InitializeFromBitmap(dragsource2, &drag_image, &data_object); + ok(hr == S_OK, "Initialization from bitmap failed, 0x%lx\n", hr); + + hr = IDropTargetHelper_DragEnter(target, hwnd_target, &data_object, &pt, i); + ok(hr == S_OK, "Drag enter failed, effect: 0x%lx, error 0x%lx\n", i, hr); + + hr = IDropTargetHelper_DragOver(target, &pt, i); + ok(hr == S_OK, "Drag over failed, 0x%lx\n", hr); + + hr = IDropTargetHelper_DragLeave(target); + ok(hr == S_OK, "Leave failed, 0x%lx\n", hr); + } + for (i = 0; i < 20; ++i) + { + hr = IDragSourceHelper2_InitializeFromBitmap(dragsource2, &drag_image, &data_object); + ok(hr == S_OK, "Initialization from bitmap failed, 0x%lx\n", hr); + + hr = IDropTargetHelper_DragEnter(target, hwnd_target, &data_object, &pt, i | DROPEFFECT_SCROLL); + ok(hr == S_OK, "Drag enter failed, 0x%lx\n", hr); + + hr = IDropTargetHelper_DragOver(target, &pt, i | DROPEFFECT_SCROLL); + ok(hr == S_OK, "Drag over failed, 0x%lx\n", hr); + + hr = IDropTargetHelper_DragLeave(target); + ok(hr == S_OK, "Leave failed, 0x%lx\n", hr); + } + } + + /* Test invalid flags */ + for (i = 0; i < 20; ++i) + { + hr = IDragSourceHelper2_SetFlags(dragsource2, i); + ok(hr == S_OK, "Flag setting failed, flag: 0x%lx, error: 0x%lx\n", i, hr); + }
/* Clean up */
Hi,
It looks like your patch introduced the new failures shown below. Please investigate and fix them before resubmitting your patch. If they are not new, fixing them anyway would help a lot. Otherwise please ask for the known failures list to be updated.
The tests also ran into some preexisting test failures. If you know how to fix them that would be helpful. See the TestBot job for the details:
The full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=126187
Your paranoid android.
=== debian11 (32 bit report) ===
Report validation errors: advapi32:security has no test summary line (early exit of the main process?) advapi32:security has unaccounted for todo messages
=== debian11 (build log) ===
01d8:err:winediag:d3d_device_create The application wants to create a Direct3D device, but the current DirectDrawRenderer does not support this. 01d8:err:winediag:d3d_device_create The application wants to create a Direct3D device, but the current DirectDrawRenderer does not support this. 01d8:err:winediag:d3d_device_create The application wants to create a Direct3D device, but the current DirectDrawRenderer does not support this.
v2: Fix pipeline build