Wine-Devel
By thread
wine-devel@list.winehq.org
By month
Messages by month
- ----- 2026 -----
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2005 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2004 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2003 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2002 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2001 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
June 2022
- 68 participants
- 3274 messages
[PATCH v3 3/7] d3dx10: Add support for ID3DX10ThreadPump parameter in D3DX10GetImageInfoFromFileW.
by Piotr Caban
From: Piotr Caban <piotr(a)codeweavers.com>
Signed-off-by: Piotr Caban <piotr(a)codeweavers.com>
---
dlls/d3dx10_43/texture.c | 31 ++++++++++++++++++++++++-------
1 file changed, 24 insertions(+), 7 deletions(-)
diff --git a/dlls/d3dx10_43/texture.c b/dlls/d3dx10_43/texture.c
index c018487ae7a..3ee1eaba624 100644
--- a/dlls/d3dx10_43/texture.c
+++ b/dlls/d3dx10_43/texture.c
@@ -332,17 +332,34 @@ HRESULT WINAPI D3DX10GetImageInfoFromFileW(const WCHAR *src_file, ID3DX10ThreadP
if (!src_file)
return E_FAIL;
- if (FAILED((hr = load_file(src_file, &buffer, &size))))
+ if (pump)
{
- if (result)
- *result = hr;
+ ID3DX10DataProcessor *processor;
+ ID3DX10DataLoader *loader;
+
+ if (FAILED((hr = D3DX10CreateAsyncFileLoaderW(src_file, &loader))))
+ return hr;
+ if (FAILED((hr = D3DX10CreateAsyncTextureInfoProcessor(info, &processor))))
+ {
+ ID3DX10DataLoader_Destroy(loader);
+ return hr;
+ }
+ hr = ID3DX10ThreadPump_AddWorkItem(pump, loader, processor, result, NULL);
+ if (FAILED(hr))
+ {
+ ID3DX10DataLoader_Destroy(loader);
+ ID3DX10DataProcessor_Destroy(processor);
+ }
return hr;
}
- hr = D3DX10GetImageInfoFromMemory(buffer, size, pump, info, result);
-
- free(buffer);
-
+ if (SUCCEEDED((hr = load_file(src_file, &buffer, &size))))
+ {
+ hr = get_image_info(buffer, size, info);
+ free(buffer);
+ }
+ if (result)
+ *result = hr;
return hr;
}
--
GitLab
https://gitlab.winehq.org/wine/wine/-/merge_requests/205
June 10, 2022
[PATCH v3 2/7] d3dx10/tests: Add D3DX10GetImageInfoFromMemory HRESULT argument tests.
by Piotr Caban
From: Piotr Caban <piotr(a)codeweavers.com>
Signed-off-by: Piotr Caban <piotr(a)codeweavers.com>
---
dlls/d3dx10_43/tests/d3dx10.c | 66 ++++++++++++++++++++++++++---------
1 file changed, 49 insertions(+), 17 deletions(-)
diff --git a/dlls/d3dx10_43/tests/d3dx10.c b/dlls/d3dx10_43/tests/d3dx10.c
index a817f346676..fe7a118cec9 100644
--- a/dlls/d3dx10_43/tests/d3dx10.c
+++ b/dlls/d3dx10_43/tests/d3dx10.c
@@ -1922,53 +1922,73 @@ static void test_get_image_info(void)
WCHAR path[MAX_PATH];
unsigned int i;
DWORD dword;
- HRESULT hr;
+ HRESULT hr, hr2;
CoInitialize(NULL);
- hr = D3DX10GetImageInfoFromMemory(test_image[0].data, 0, NULL, &image_info, NULL);
+ hr2 = 0xdeadbeef;
+ hr = D3DX10GetImageInfoFromMemory(test_image[0].data, 0, NULL, &image_info, &hr2);
ok(hr == E_FAIL, "Got unexpected hr %#x.\n", hr);
- hr = D3DX10GetImageInfoFromMemory(NULL, test_image[0].size, NULL, &image_info, NULL);
+ ok(hr == hr2, "Got unexpected hr2 %#x.\n", hr2);
+ hr2 = 0xdeadbeef;
+ hr = D3DX10GetImageInfoFromMemory(NULL, test_image[0].size, NULL, &image_info, &hr2);
ok(hr == E_FAIL, "Got unexpected hr %#x.\n", hr);
- hr = D3DX10GetImageInfoFromMemory(&dword, sizeof(dword), NULL, &image_info, NULL);
+ ok(hr2 == 0xdeadbeef, "Got unexpected hr2 %#x.\n", hr2);
+ hr2 = 0xdeadbeef;
+ hr = D3DX10GetImageInfoFromMemory(&dword, sizeof(dword), NULL, &image_info, &hr2);
ok(hr == E_FAIL, "Got unexpected hr %#x.\n", hr);
+ ok(hr == hr2, "Got unexpected hr2 %#x.\n", hr2);
for (i = 0; i < ARRAY_SIZE(test_image); ++i)
{
winetest_push_context("Test %u", i);
- hr = D3DX10GetImageInfoFromMemory(test_image[i].data, test_image[i].size, NULL, &image_info, NULL);
+ hr2 = 0xdeadbeef;
+ hr = D3DX10GetImageInfoFromMemory(test_image[i].data, test_image[i].size, NULL, &image_info, &hr2);
ok(hr == S_OK || broken(hr == E_FAIL && test_image[i].expected_info.ImageFileFormat == D3DX10_IFF_WMP),
"Got unexpected hr %#x.\n", hr);
+ ok(hr == hr2, "Got unexpected hr2 %#x.\n", hr2);
if (hr == S_OK)
check_image_info(&image_info, test_image + i, __LINE__);
winetest_pop_context();
}
- hr = D3DX10GetImageInfoFromFileW(NULL, NULL, &image_info, NULL);
+ hr2 = 0xdeadbeef;
+ hr = D3DX10GetImageInfoFromFileW(NULL, NULL, &image_info, &hr2);
ok(hr == E_FAIL, "Got unexpected hr %#x.\n", hr);
- hr = D3DX10GetImageInfoFromFileW(L"deadbeaf", NULL, &image_info, NULL);
+ ok(hr2 == 0xdeadbeef, "Got unexpected hr2 %#x.\n", hr2);
+ hr2 = 0xdeadbeef;
+ hr = D3DX10GetImageInfoFromFileW(L"deadbeaf", NULL, &image_info, &hr2);
ok(hr == D3D10_ERROR_FILE_NOT_FOUND, "Got unexpected hr %#x.\n", hr);
- hr = D3DX10GetImageInfoFromFileA(NULL, NULL, &image_info, NULL);
+ ok(hr == hr2, "Got unexpected hr2 %#x.\n", hr2);
+ hr2 = 0xdeadbeef;
+ hr = D3DX10GetImageInfoFromFileA(NULL, NULL, &image_info, &hr2);
ok(hr == E_FAIL, "Got unexpected hr %#x.\n", hr);
- hr = D3DX10GetImageInfoFromFileA("deadbeaf", NULL, &image_info, NULL);
+ ok(hr2 == 0xdeadbeef, "Got unexpected hr2 %#x.\n", hr2);
+ hr2 = 0xdeadbeef;
+ hr = D3DX10GetImageInfoFromFileA("deadbeaf", NULL, &image_info, &hr2);
ok(hr == D3D10_ERROR_FILE_NOT_FOUND, "Got unexpected hr %#x.\n", hr);
+ ok(hr == hr2, "Got unexpected hr2 %#x.\n", hr2);
for (i = 0; i < ARRAY_SIZE(test_image); ++i)
{
winetest_push_context("Test %u", i);
create_file(test_filename, test_image[i].data, test_image[i].size, path);
- hr = D3DX10GetImageInfoFromFileW(path, NULL, &image_info, NULL);
+ hr2 = 0xdeadbeef;
+ hr = D3DX10GetImageInfoFromFileW(path, NULL, &image_info, &hr2);
ok(hr == S_OK || broken(hr == E_FAIL && test_image[i].expected_info.ImageFileFormat == D3DX10_IFF_WMP),
"Got unexpected hr %#x.\n", hr);
+ ok(hr == hr2, "Got unexpected hr2 %#x.\n", hr2);
if (hr == S_OK)
check_image_info(&image_info, test_image + i, __LINE__);
- hr = D3DX10GetImageInfoFromFileA(get_str_a(path), NULL, &image_info, NULL);
+ hr2 = 0xdeadbeef;
+ hr = D3DX10GetImageInfoFromFileA(get_str_a(path), NULL, &image_info, &hr2);
ok(hr == S_OK || broken(hr == E_FAIL && test_image[i].expected_info.ImageFileFormat == D3DX10_IFF_WMP),
"Got unexpected hr %#x.\n", hr);
+ ok(hr == hr2, "Got unexpected hr2 %#x.\n", hr2);
if (hr == S_OK)
check_image_info(&image_info, test_image + i, __LINE__);
@@ -1979,31 +1999,43 @@ static void test_get_image_info(void)
/* D3DX10GetImageInfoFromResource tests */
- hr = D3DX10GetImageInfoFromResourceW(NULL, NULL, NULL, &image_info, NULL);
+ hr2 = 0xdeadbeef;
+ hr = D3DX10GetImageInfoFromResourceW(NULL, NULL, NULL, &image_info, &hr2);
ok(hr == D3DX10_ERR_INVALID_DATA, "Got unexpected hr %#x.\n", hr);
- hr = D3DX10GetImageInfoFromResourceW(NULL, L"deadbeaf", NULL, &image_info, NULL);
+ ok(hr2 == 0xdeadbeef, "Got unexpected hr2 %#x.\n", hr2);
+ hr2 = 0xdeadbeef;
+ hr = D3DX10GetImageInfoFromResourceW(NULL, L"deadbeaf", NULL, &image_info, &hr2);
ok(hr == D3DX10_ERR_INVALID_DATA, "Got unexpected hr %#x.\n", hr);
- hr = D3DX10GetImageInfoFromResourceA(NULL, NULL, NULL, &image_info, NULL);
+ ok(hr2 == 0xdeadbeef, "Got unexpected hr2 %#x.\n", hr2);
+ hr2 = 0xdeadbeef;
+ hr = D3DX10GetImageInfoFromResourceA(NULL, NULL, NULL, &image_info, &hr2);
ok(hr == D3DX10_ERR_INVALID_DATA, "Got unexpected hr %#x.\n", hr);
- hr = D3DX10GetImageInfoFromResourceA(NULL, "deadbeaf", NULL, &image_info, NULL);
+ ok(hr2 == 0xdeadbeef, "Got unexpected hr2 %#x.\n", hr2);
+ hr2 = 0xdeadbeef;
+ hr = D3DX10GetImageInfoFromResourceA(NULL, "deadbeaf", NULL, &image_info, &hr2);
ok(hr == D3DX10_ERR_INVALID_DATA, "Got unexpected hr %#x.\n", hr);
+ ok(hr2 == 0xdeadbeef, "Got unexpected hr2 %#x.\n", hr2);
for (i = 0; i < ARRAY_SIZE(test_image); ++i)
{
winetest_push_context("Test %u", i);
resource_module = create_resource_module(test_resource_name, test_image[i].data, test_image[i].size);
- hr = D3DX10GetImageInfoFromResourceW(resource_module, test_resource_name, NULL, &image_info, NULL);
+ hr2 = 0xdeadbeef;
+ hr = D3DX10GetImageInfoFromResourceW(resource_module, test_resource_name, NULL, &image_info, &hr2);
ok(hr == S_OK || broken(hr == E_FAIL && test_image[i].expected_info.ImageFileFormat == D3DX10_IFF_WMP)
|| broken(hr == D3DX10_ERR_INVALID_DATA) /* Vista */,
"Got unexpected hr %#x.\n", hr);
+ ok(hr == hr2, "Got unexpected hr2 %#x.\n", hr2);
if (hr == S_OK)
check_image_info(&image_info, test_image + i, __LINE__);
- hr = D3DX10GetImageInfoFromResourceA(resource_module, get_str_a(test_resource_name), NULL, &image_info, NULL);
+ hr2 = 0xdeadbeef;
+ hr = D3DX10GetImageInfoFromResourceA(resource_module, get_str_a(test_resource_name), NULL, &image_info, &hr2);
ok(hr == S_OK || broken(hr == E_FAIL && test_image[i].expected_info.ImageFileFormat == D3DX10_IFF_WMP)
|| broken(hr == D3DX10_ERR_INVALID_DATA) /* Vista */,
"Got unexpected hr %#x.\n", hr);
+ ok(hr == hr2, "Got unexpected hr2 %#x.\n", hr2);
if (hr == S_OK)
check_image_info(&image_info, test_image + i, __LINE__);
--
GitLab
https://gitlab.winehq.org/wine/wine/-/merge_requests/205
June 10, 2022
[PATCH v3 1/7] d3dx10: Don't ignore HRESULT parameter in D3DX10GetImageInfoFrom* functions.
by Piotr Caban
From: Piotr Caban <piotr(a)codeweavers.com>
Signed-off-by: Piotr Caban <piotr(a)codeweavers.com>
---
dlls/d3dx10_43/texture.c | 27 ++++++++++++++-------------
1 file changed, 14 insertions(+), 13 deletions(-)
diff --git a/dlls/d3dx10_43/texture.c b/dlls/d3dx10_43/texture.c
index 3930df3677f..c018487ae7a 100644
--- a/dlls/d3dx10_43/texture.c
+++ b/dlls/d3dx10_43/texture.c
@@ -301,7 +301,7 @@ HRESULT WINAPI D3DX10GetImageInfoFromFileA(const char *src_file, ID3DX10ThreadPu
TRACE("src_file %s, pump %p, info %p, result %p.\n", debugstr_a(src_file), pump, info, result);
- if (!src_file || !info)
+ if (!src_file)
return E_FAIL;
str_len = MultiByteToWideChar(CP_ACP, 0, src_file, -1, NULL, 0);
@@ -329,11 +329,15 @@ HRESULT WINAPI D3DX10GetImageInfoFromFileW(const WCHAR *src_file, ID3DX10ThreadP
TRACE("src_file %s, pump %p, info %p, result %p.\n", debugstr_w(src_file), pump, info, result);
- if (!src_file || !info)
+ if (!src_file)
return E_FAIL;
if (FAILED((hr = load_file(src_file, &buffer, &size))))
+ {
+ if (result)
+ *result = hr;
return hr;
+ }
hr = D3DX10GetImageInfoFromMemory(buffer, size, pump, info, result);
@@ -352,11 +356,7 @@ HRESULT WINAPI D3DX10GetImageInfoFromResourceA(HMODULE module, const char *resou
TRACE("module %p, resource %s, pump %p, info %p, result %p.\n",
module, debugstr_a(resource), pump, info, result);
- if (!resource || !info)
- return D3DX10_ERR_INVALID_DATA;
-
- hr = load_resourceA(module, resource, &buffer, &size);
- if (FAILED(hr))
+ if (FAILED((hr = load_resourceA(module, resource, &buffer, &size))))
return hr;
return D3DX10GetImageInfoFromMemory(buffer, size, pump, info, result);
@@ -372,11 +372,7 @@ HRESULT WINAPI D3DX10GetImageInfoFromResourceW(HMODULE module, const WCHAR *reso
TRACE("module %p, resource %s, pump %p, info %p, result %p.\n",
module, debugstr_w(resource), pump, info, result);
- if (!resource || !info)
- return D3DX10_ERR_INVALID_DATA;
-
- hr = load_resourceW(module, resource, &buffer, &size);
- if (FAILED(hr))
+ if (FAILED((hr = load_resourceW(module, resource, &buffer, &size))))
return hr;
return D3DX10GetImageInfoFromMemory(buffer, size, pump, info, result);
@@ -480,6 +476,8 @@ end:
HRESULT WINAPI D3DX10GetImageInfoFromMemory(const void *src_data, SIZE_T src_data_size, ID3DX10ThreadPump *pump,
D3DX10_IMAGE_INFO *img_info, HRESULT *result)
{
+ HRESULT hr;
+
TRACE("src_data %p, src_data_size %Iu, pump %p, img_info %p, hresult %p.\n",
src_data, src_data_size, pump, img_info, result);
@@ -488,7 +486,10 @@ HRESULT WINAPI D3DX10GetImageInfoFromMemory(const void *src_data, SIZE_T src_dat
if (pump)
FIXME("Thread pump is not supported yet.\n");
- return get_image_info(src_data, src_data_size, img_info);
+ hr = get_image_info(src_data, src_data_size, img_info);
+ if (result)
+ *result = hr;
+ return hr;
}
HRESULT WINAPI D3DX10CreateTextureFromFileA(ID3D10Device *device, const char *src_file,
--
GitLab
https://gitlab.winehq.org/wine/wine/-/merge_requests/205
June 10, 2022
[PATCH v3 0/7] MR205: Add support for HRESULT and ID3DX10ThreadPump parameters in D3DX10GetImageInfo functions
by Piotr Caban (ï¼ piotr)
--
v3: d3dx10/tests: Add D3DX10GetImageInfoFromMemory thread pump tests.
https://gitlab.winehq.org/wine/wine/-/merge_requests/205
June 10, 2022
Re: [PATCH] comctl32: Add partial support for LVM_SETBKIMAGE.
by Zhiyi Zhang
Let's use "comctl32/listview: Add partial support for LVM_SETBKIMAGE." for the subject.
On 4/22/22 21:29, Dmitry Timoshkov wrote:
> Signed-off-by: Dmitry Timoshkov <dmitry(a)baikal.ru>
> ---
> dlls/comctl32/listview.c | 65 ++++++++++++++++++++++++++++++++++++----
> 1 file changed, 59 insertions(+), 6 deletions(-)
>
> diff --git a/dlls/comctl32/listview.c b/dlls/comctl32/listview.c
> index 730bf4aaddd..3ca76c2ef05 100644
> --- a/dlls/comctl32/listview.c
> +++ b/dlls/comctl32/listview.c
> @@ -91,7 +91,7 @@
> *
> * Messages:
> * -- LVM_ENABLEGROUPVIEW
> - * -- LVM_GETBKIMAGE, LVM_SETBKIMAGE
> + * -- LVM_GETBKIMAGE
> * -- LVM_GETGROUPINFO, LVM_SETGROUPINFO
> * -- LVM_GETGROUPMETRICS, LVM_SETGROUPMETRICS
> * -- LVM_GETINSERTMARK, LVM_SETINSERTMARK
> @@ -297,6 +297,7 @@ typedef struct tagLISTVIEW_INFO
> COLORREF clrBk;
> COLORREF clrText;
> COLORREF clrTextBk;
> + HBITMAP hBkBitmap;
>
> /* font */
> HFONT hDefaultFont;
> @@ -4567,11 +4568,30 @@ static INT LISTVIEW_GetTopIndex(const LISTVIEW_INFO *infoPtr)
> */
> static inline BOOL LISTVIEW_FillBkgnd(const LISTVIEW_INFO *infoPtr, HDC hdc, const RECT *lprcBox)
> {
Let's remove inline.
> - if (!infoPtr->hBkBrush) return FALSE;
> + if (infoPtr->hBkBitmap)
> + {
> + HDC hdc_src = CreateCompatibleDC(hdc);
> +
> + TRACE("(hdc=%p, lprcBox=%s, hBkBitmap=%p)\n", hdc, wine_dbgstr_rect(lprcBox), infoPtr->hBkBitmap);
> +
> + SelectObject(hdc_src, infoPtr->hBkBitmap);
> + BitBlt(hdc, lprcBox->left, lprcBox->top,
> + lprcBox->right - lprcBox->left,
> + lprcBox->bottom - lprcBox->top,
> + hdc_src, lprcBox->left, lprcBox->top, SRCCOPY);
A bit of inconsistent styling. Let's wrap the parameters for BitBlt() at 100 characters.
> +
> + DeleteDC(hdc_src);
>
> - TRACE("(hdc=%p, lprcBox=%s, hBkBrush=%p)\n", hdc, wine_dbgstr_rect(lprcBox), infoPtr->hBkBrush);
> + return TRUE;
> + }
This is not an either or relation. The background brush is used to fill background if present. Then the background image is painted
on top of that if present.
> + else if (infoPtr->hBkBrush)
> + {
> + TRACE("(hdc=%p, lprcBox=%s, hBkBrush=%p)\n", hdc, wine_dbgstr_rect(lprcBox), infoPtr->hBkBrush);
>
> - return FillRect(hdc, lprcBox, infoPtr->hBkBrush);
> + return FillRect(hdc, lprcBox, infoPtr->hBkBrush);
> + }
> +
> + return FALSE;
> }
>
> /* Draw main item or subitem */
> @@ -8028,7 +8048,37 @@ static BOOL LISTVIEW_SetBkColor(LISTVIEW_INFO *infoPtr, COLORREF color)
> return TRUE;
> }
>
> -/* LISTVIEW_SetBkImage */
> +static BOOL LISTVIEW_SetBkImage(LISTVIEW_INFO *infoPtr, const LVBKIMAGEW *image, BOOL isW)
> +{
> + TRACE("%08lx,%p,%p,%u,%d,%d\n", image->ulFlags, image->hbm, image->pszImage,
> + image->cchImageMax, image->xOffsetPercent, image->yOffsetPercent);
Add a space after comma.
> +
> + if (image->ulFlags & ~LVBKIF_SOURCE_MASK)
> + FIXME("not supported flags %08lx\n", image->ulFlags & ~LVBKIF_SOURCE_MASK);
> +
> + if (image->xOffsetPercent || image->yOffsetPercent)
> + FIXME("not supported offset %d,%d\n", image->xOffsetPercent, image->yOffsetPercent);
> +
> + switch (image->ulFlags & LVBKIF_SOURCE_MASK)
> + {
> + case LVBKIF_SOURCE_NONE:
> + if (infoPtr->hBkBitmap) DeleteObject(infoPtr->hBkBitmap);
> + infoPtr->hBkBitmap = 0;
> + return TRUE;
This is supposed to return FALSE.
> +
> + case LVBKIF_SOURCE_HBITMAP:
> + if (infoPtr->hBkBitmap) DeleteObject(infoPtr->hBkBitmap);
> + infoPtr->hBkBitmap = image->hbm;
> + InvalidateRect(infoPtr->hwndSelf, NULL, TRUE);
I don't think the InvalidateRect() is needed.
Also, I found LVM_SETBKIMAGE is acting a bit weird on Windows. For example, if a LVM_SETBKIMAGE message trying to set a bitmap
is sent the second time. The second message returns FALSE and the background image gets reset to none(from LVM_GETBKIMAGE). I don't know if we should
implement such a behavior but I would be more comfortable with some tests.
> + return TRUE;
> +
> + case LVBKIF_SOURCE_URL:
> + FIXME("LVBKIF_SOURCE_URL: %s\n", isW ? debugstr_w(image->pszImage) : debugstr_a((LPCSTR)image->pszImage));
> + break;
> + }
> +
> + return FALSE;
> +}
>
> /*** Helper for {Insert,Set}ColumnT *only* */
> static void column_fill_hditem(const LISTVIEW_INFO *infoPtr, HDITEMW *lphdi, INT nColumn,
> @@ -10406,6 +10456,7 @@ static LRESULT LISTVIEW_NCDestroy(LISTVIEW_INFO *infoPtr)
> infoPtr->hFont = 0;
> if (infoPtr->hDefaultFont) DeleteObject(infoPtr->hDefaultFont);
> if (infoPtr->clrBk != CLR_NONE) DeleteObject(infoPtr->hBkBrush);
> + if (infoPtr->hBkBitmap) DeleteObject(infoPtr->hBkBitmap);
>
> SetWindowLongPtrW(infoPtr->hwndSelf, 0, 0);
>
> @@ -11554,7 +11605,9 @@ LISTVIEW_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
> case LVM_SETBKCOLOR:
> return LISTVIEW_SetBkColor(infoPtr, (COLORREF)lParam);
>
> - /* case LVM_SETBKIMAGE: */
> + case LVM_SETBKIMAGEA:
> + case LVM_SETBKIMAGEW:
> + return LISTVIEW_SetBkImage(infoPtr, (LVBKIMAGEW *)lParam, uMsg == LVM_SETBKIMAGEW);
>
> case LVM_SETCALLBACKMASK:
> infoPtr->uCallbackMask = (UINT)wParam;
June 10, 2022
[PATCH v6 resend 5/5] winusb: Update spec file.
by Mohamad Al-Jaf
File version: 10.0.19041.1 (Windows 10).
Signed-off-by: Mohamad Al-Jaf <mohamadaljaf(a)gmail.com>
---
dlls/winusb/winusb.spec | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/dlls/winusb/winusb.spec b/dlls/winusb/winusb.spec
index a0b57d58096..648ddf0a4f5 100644
--- a/dlls/winusb/winusb.spec
+++ b/dlls/winusb/winusb.spec
@@ -1,9 +1,13 @@
@ stub WinUsb_AbortPipe
+@ stub WinUsb_AbortPipeAsync
@ stub WinUsb_ControlTransfer
@ stub WinUsb_FlushPipe
@ stdcall WinUsb_Free(ptr)
+@ stub WinUsb_GetAdjustedFrameNumber
@ stub WinUsb_GetAssociatedInterface
@ stub WinUsb_GetCurrentAlternateSetting
+@ stub WinUsb_GetCurrentFrameNumber
+@ stub WinUsb_GetCurrentFrameNumberAndQpc
@ stub WinUsb_GetDescriptor
@ stub WinUsb_GetOverlappedResult
@ stub WinUsb_GetPipePolicy
@@ -14,9 +18,20 @@
@ stub WinUsb_QueryDeviceInformation
@ stub WinUsb_QueryInterfaceSettings
@ stub WinUsb_QueryPipe
+@ stub WinUsb_QueryPipeEx
+@ stub WinUsb_ReadIsochPipe
+@ stub WinUsb_ReadIsochPipeAsap
@ stub WinUsb_ReadPipe
+@ stub WinUsb_RegisterIsochBuffer
@ stub WinUsb_ResetPipe
+@ stub WinUsb_ResetPipeAsync
@ stub WinUsb_SetCurrentAlternateSetting
+@ stub WinUsb_SetCurrentAlternateSettingAsync
@ stub WinUsb_SetPipePolicy
@ stub WinUsb_SetPowerPolicy
+@ stub WinUsb_StartTrackingForTimeSync
+@ stub WinUsb_StopTrackingForTimeSync
+@ stub WinUsb_UnregisterIsochBuffer
+@ stub WinUsb_WriteIsochPipe
+@ stub WinUsb_WriteIsochPipeAsap
@ stub WinUsb_WritePipe
--
2.36.0
June 10, 2022
[PATCH v6 resend 4/5] winusb: Add WinUsb_Free stub.
by Mohamad Al-Jaf
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=52677
Signed-off-by: Mohamad Al-Jaf <mohamadaljaf(a)gmail.com>
---
v6: - Include headers for ddk/winusbio.h dependent functions.
---
dlls/winusb/Makefile.in | 5 +++++
dlls/winusb/main.c | 41 +++++++++++++++++++++++++++++++++++++++++
dlls/winusb/winusb.spec | 2 +-
3 files changed, 47 insertions(+), 1 deletion(-)
create mode 100644 dlls/winusb/main.c
diff --git a/dlls/winusb/Makefile.in b/dlls/winusb/Makefile.in
index c8cab4dbed9..b6f01a1346c 100644
--- a/dlls/winusb/Makefile.in
+++ b/dlls/winusb/Makefile.in
@@ -1 +1,6 @@
MODULE = winusb.dll
+
+EXTRADLLFLAGS = -Wb,--prefer-native
+
+C_SRCS = \
+ main.c
diff --git a/dlls/winusb/main.c b/dlls/winusb/main.c
new file mode 100644
index 00000000000..8513adf0b52
--- /dev/null
+++ b/dlls/winusb/main.c
@@ -0,0 +1,41 @@
+/*
+ * Copyright (C) 2022 Mohamad Al-Jaf
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#include <stdarg.h>
+
+#include "ntstatus.h"
+#define WIN32_NO_STATUS
+#include "windef.h"
+#include "winbase.h"
+#include "winternl.h"
+#include "ddk/wdm.h"
+#include "ddk/usb.h"
+#include "winusb.h"
+
+#include "wine/debug.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(winusb);
+
+/***********************************************************************
+ * WinUsb_Free (winusb.@)
+ */
+BOOL WINAPI WinUsb_Free(WINUSB_INTERFACE_HANDLE handle)
+{
+ FIXME( "(%p) - stub\n", handle );
+ return TRUE;
+}
diff --git a/dlls/winusb/winusb.spec b/dlls/winusb/winusb.spec
index 09371e9ee46..a0b57d58096 100644
--- a/dlls/winusb/winusb.spec
+++ b/dlls/winusb/winusb.spec
@@ -1,7 +1,7 @@
@ stub WinUsb_AbortPipe
@ stub WinUsb_ControlTransfer
@ stub WinUsb_FlushPipe
-@ stub WinUsb_Free
+@ stdcall WinUsb_Free(ptr)
@ stub WinUsb_GetAssociatedInterface
@ stub WinUsb_GetCurrentAlternateSetting
@ stub WinUsb_GetDescriptor
--
2.36.0
June 10, 2022
[PATCH v6 resend 3/5] include/ddk: Add some USB request flags.
by Mohamad Al-Jaf
Signed-off-by: Mohamad Al-Jaf <mohamadaljaf(a)gmail.com>
---
include/ddk/usb100.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/include/ddk/usb100.h b/include/ddk/usb100.h
index 7ec74933d0f..0942c8f615a 100644
--- a/include/ddk/usb100.h
+++ b/include/ddk/usb100.h
@@ -28,6 +28,18 @@
#define USB_CONFIG_POWER_DESCRIPTOR_TYPE 0x07
#define USB_INTERFACE_POWER_DESCRIPTOR_TYPE 0x08
+#define USB_REQUEST_GET_STATUS 0x00
+#define USB_REQUEST_CLEAR_FEATURE 0x01
+#define USB_REQUEST_SET_FEATURE 0x03
+#define USB_REQUEST_SET_ADDRESS 0x05
+#define USB_REQUEST_GET_DESCRIPTOR 0x06
+#define USB_REQUEST_SET_DESCRIPTOR 0x07
+#define USB_REQUEST_GET_CONFIGURATION 0x08
+#define USB_REQUEST_SET_CONFIGURATION 0x09
+#define USB_REQUEST_GET_INTERFACE 0x0A
+#define USB_REQUEST_SET_INTERFACE 0x0B
+#define USB_REQUEST_SYNC_FRAME 0x0C
+
#include <pshpack1.h>
typedef struct _USB_DEVICE_DESCRIPTOR {
--
2.36.0
June 10, 2022
[PATCH v6 resend 2/5] include: Add winusb.h file.
by Mohamad Al-Jaf
Signed-off-by: Mohamad Al-Jaf <mohamadaljaf(a)gmail.com>
---
v6: - Add ddk/winusbio dependent prototypes.
---
include/Makefile.in | 1 +
include/winusb.h | 101 ++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 102 insertions(+)
create mode 100644 include/winusb.h
diff --git a/include/Makefile.in b/include/Makefile.in
index 58bf7db1e13..89356d2a6ee 100644
--- a/include/Makefile.in
+++ b/include/Makefile.in
@@ -845,6 +845,7 @@ SOURCES = \
wintabx.h \
winternl.h \
wintrust.h \
+ winusb.h \
winuser.h \
winuser.rh \
winver.h \
diff --git a/include/winusb.h b/include/winusb.h
new file mode 100644
index 00000000000..d30c83db85c
--- /dev/null
+++ b/include/winusb.h
@@ -0,0 +1,101 @@
+/*
+ * Copyright (C) 2022 Mohamad Al-Jaf
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#ifndef _WINUSB_H_
+#define _WINUSB_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include "ddk/winusbio.h"
+
+typedef PVOID WINUSB_INTERFACE_HANDLE, *PWINUSB_INTERFACE_HANDLE;
+typedef PVOID WINUSB_ISOCH_BUFFER_HANDLE, *PWINUSB_ISOCH_BUFFER_HANDLE;
+
+typedef struct _WINUSB_SETUP_PACKET {
+ UCHAR RequestType;
+ UCHAR Request;
+ USHORT Value;
+ USHORT Index;
+ USHORT Length;
+} WINUSB_SETUP_PACKET, *PWINUSB_SETUP_PACKET;
+
+typedef struct _USB_START_TRACKING_FOR_TIME_SYNC_INFORMATION {
+ HANDLE TimeTrackingHandle;
+ BOOLEAN IsStartupDelayTolerable;
+} USB_START_TRACKING_FOR_TIME_SYNC_INFORMATION, *PUSB_START_TRACKING_FOR_TIME_SYNC_INFORMATION;
+
+typedef struct _USB_STOP_TRACKING_FOR_TIME_SYNC_INFORMATION {
+ HANDLE TimeTrackingHandle;
+} USB_STOP_TRACKING_FOR_TIME_SYNC_INFORMATION, *PUSB_STOP_TRACKING_FOR_TIME_SYNC_INFORMATION;
+
+typedef struct _USB_FRAME_NUMBER_AND_QPC_FOR_TIME_SYNC_INFORMATION {
+ HANDLE TimeTrackingHandle;
+ ULONG InputFrameNumber;
+ ULONG InputMicroFrameNumber;
+ LARGE_INTEGER QueryPerformanceCounterAtInputFrameOrMicroFrame;
+ LARGE_INTEGER QueryPerformanceCounterFrequency;
+ ULONG PredictedAccuracyInMicroSeconds;
+ ULONG CurrentGenerationID;
+ LARGE_INTEGER CurrentQueryPerformanceCounter;
+ ULONG CurrentHardwareFrameNumber;
+ ULONG CurrentHardwareMicroFrameNumber;
+ ULONG CurrentUSBFrameNumber;
+} USB_FRAME_NUMBER_AND_QPC_FOR_TIME_SYNC_INFORMATION, *PUSB_FRAME_NUMBER_AND_QPC_FOR_TIME_SYNC_INFORMATION;
+
+BOOL WINAPI WinUsb_AbortPipe(WINUSB_INTERFACE_HANDLE,UCHAR);
+BOOL WINAPI WinUsb_ControlTransfer(WINUSB_INTERFACE_HANDLE,WINUSB_SETUP_PACKET,PUCHAR,ULONG,PULONG,LPOVERLAPPED);
+BOOL WINAPI WinUsb_FlushPipe(WINUSB_INTERFACE_HANDLE,UCHAR);
+BOOL WINAPI WinUsb_Free(WINUSB_INTERFACE_HANDLE);
+BOOL WINAPI WinUsb_GetAdjustedFrameNumber(PULONG,LARGE_INTEGER);
+BOOL WINAPI WinUsb_GetAssociatedInterface(WINUSB_INTERFACE_HANDLE,UCHAR,PWINUSB_INTERFACE_HANDLE);
+BOOL WINAPI WinUsb_GetCurrentAlternateSetting(WINUSB_INTERFACE_HANDLE,PUCHAR);
+BOOL WINAPI WinUsb_GetCurrentFrameNumber(WINUSB_INTERFACE_HANDLE,PULONG,LARGE_INTEGER*);
+BOOL WINAPI WinUsb_GetCurrentFrameNumberAndQpc(WINUSB_INTERFACE_HANDLE,PUSB_FRAME_NUMBER_AND_QPC_FOR_TIME_SYNC_INFORMATION);
+BOOL WINAPI WinUsb_GetDescriptor(WINUSB_INTERFACE_HANDLE,UCHAR,UCHAR,USHORT,PUCHAR,ULONG,PULONG);
+BOOL WINAPI WinUsb_GetOverlappedResult(WINUSB_INTERFACE_HANDLE,LPOVERLAPPED,LPDWORD,BOOL);
+BOOL WINAPI WinUsb_GetPipePolicy(WINUSB_INTERFACE_HANDLE,UCHAR,ULONG,PULONG,PVOID);
+BOOL WINAPI WinUsb_GetPowerPolicy(WINUSB_INTERFACE_HANDLE,ULONG,PULONG,PVOID);
+BOOL WINAPI WinUsb_Initialize(HANDLE,PWINUSB_INTERFACE_HANDLE);
+PUSB_INTERFACE_DESCRIPTOR WINAPI WinUsb_ParseConfigurationDescriptor(PUSB_CONFIGURATION_DESCRIPTOR,PVOID,LONG,LONG,LONG,LONG,LONG);
+PUSB_COMMON_DESCRIPTOR WINAPI WinUsb_ParseDescriptors(PVOID,ULONG,PVOID,LONG);
+BOOL WINAPI WinUsb_QueryDeviceInformation(WINUSB_INTERFACE_HANDLE,ULONG,PULONG,PVOID);
+BOOL WINAPI WinUsb_QueryInterfaceSettings(WINUSB_INTERFACE_HANDLE,UCHAR,PUSB_INTERFACE_DESCRIPTOR);
+BOOL WINAPI WinUsb_QueryPipe(WINUSB_INTERFACE_HANDLE,UCHAR,UCHAR,PWINUSB_PIPE_INFORMATION);
+BOOL WINAPI WinUsb_QueryPipeEx(WINUSB_INTERFACE_HANDLE,UCHAR,UCHAR,PWINUSB_PIPE_INFORMATION_EX);
+BOOL WINAPI WinUsb_ReadIsochPipe(WINUSB_ISOCH_BUFFER_HANDLE,ULONG,ULONG,PULONG,ULONG,PUSBD_ISO_PACKET_DESCRIPTOR,LPOVERLAPPED);
+BOOL WINAPI WinUsb_ReadIsochPipeAsap(WINUSB_ISOCH_BUFFER_HANDLE,ULONG,ULONG,BOOL,ULONG,PUSBD_ISO_PACKET_DESCRIPTOR,LPOVERLAPPED);
+BOOL WINAPI WinUsb_ReadPipe(WINUSB_INTERFACE_HANDLE,UCHAR,PUCHAR,ULONG,PULONG,LPOVERLAPPED);
+BOOL WINAPI WinUsb_RegisterIsochBuffer(WINUSB_INTERFACE_HANDLE,UCHAR,PUCHAR,ULONG,PWINUSB_ISOCH_BUFFER_HANDLE);
+BOOL WINAPI WinUsb_ResetPipe(WINUSB_INTERFACE_HANDLE,UCHAR);
+BOOL WINAPI WinUsb_SetCurrentAlternateSetting(WINUSB_INTERFACE_HANDLE,UCHAR);
+BOOL WINAPI WinUsb_SetPipePolicy(WINUSB_INTERFACE_HANDLE,UCHAR,ULONG,ULONG,PVOID);
+BOOL WINAPI WinUsb_SetPowerPolicy(WINUSB_INTERFACE_HANDLE,ULONG,ULONG,PVOID);
+BOOL WINAPI WinUsb_StartTrackingForTimeSync(WINUSB_INTERFACE_HANDLE,PUSB_START_TRACKING_FOR_TIME_SYNC_INFORMATION);
+BOOL WINAPI WinUsb_StopTrackingForTimeSync(WINUSB_INTERFACE_HANDLE,PUSB_STOP_TRACKING_FOR_TIME_SYNC_INFORMATION);
+BOOL WINAPI WinUsb_UnregisterIsochBuffer(WINUSB_ISOCH_BUFFER_HANDLE);
+BOOL WINAPI WinUsb_WriteIsochPipe(WINUSB_ISOCH_BUFFER_HANDLE,ULONG,ULONG,PULONG,LPOVERLAPPED);
+BOOL WINAPI WinUsb_WriteIsochPipeAsap(WINUSB_ISOCH_BUFFER_HANDLE,ULONG,ULONG,BOOL,LPOVERLAPPED);
+BOOL WINAPI WinUsb_WritePipe(WINUSB_INTERFACE_HANDLE,UCHAR,PUCHAR,ULONG,PULONG,LPOVERLAPPED);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _WINUSB_H_ */
--
2.36.0
June 10, 2022
[PATCH v6 resend 1/5] include/ddk: Add winusbio.h file.
by Mohamad Al-Jaf
Needed by winusb.h.
Signed-off-by: Mohamad Al-Jaf <mohamadaljaf(a)gmail.com>
---
include/Makefile.in | 1 +
include/ddk/winusbio.h | 66 ++++++++++++++++++++++++++++++++++++++++++
2 files changed, 67 insertions(+)
create mode 100644 include/ddk/winusbio.h
diff --git a/include/Makefile.in b/include/Makefile.in
index f3e62c4bb5a..58bf7db1e13 100644
--- a/include/Makefile.in
+++ b/include/Makefile.in
@@ -211,6 +211,7 @@ SOURCES = \
ddk/wdm.h \
ddk/winddiui.h \
ddk/winsplp.h \
+ ddk/winusbio.h \
ddk/wsk.h \
ddraw.h \
ddrawgdi.h \
diff --git a/include/ddk/winusbio.h b/include/ddk/winusbio.h
new file mode 100644
index 00000000000..14d8230d87f
--- /dev/null
+++ b/include/ddk/winusbio.h
@@ -0,0 +1,66 @@
+/*
+ * Copyright (C) 2022 Mohamad Al-Jaf
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#ifndef _WINUSBIO_H_
+#define _WINUSBIO_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+DEFINE_GUID(WinUSB_TestGuid, 0XDA812BFF, 0X12C3, 0X46A2, 0X8E, 0X2B, 0XDB, 0XD3, 0XB7, 0X83, 0X4C, 0X43);
+
+#define SHORT_PACKET_TERMINATE 0x01
+#define AUTO_CLEAR_STALL 0x02
+#define PIPE_TRANSFER_TIMEOUT 0x03
+#define IGNORE_SHORT_PACKETS 0x04
+#define ALLOW_PARTIAL_READS 0x05
+#define AUTO_FLUSH 0x06
+#define RAW_IO 0x07
+#define MAXIMUM_TRANSFER_SIZE 0x08
+#define RESET_PIPE_ON_RESUME 0x09
+
+typedef struct _WINUSB_PIPE_INFORMATION {
+ USBD_PIPE_TYPE PipeType;
+ UCHAR PipeId;
+ USHORT MaximumPacketSize;
+ UCHAR Interval;
+} WINUSB_PIPE_INFORMATION, *PWINUSB_PIPE_INFORMATION;
+
+#define AUTO_SUSPEND 0x81
+#define SUSPEND_DELAY 0x83
+
+#define DEVICE_SPEED 0x01
+
+#define LowSpeed 0x01
+#define FullSpeed 0x02
+#define HighSpeed 0x03
+
+typedef struct _WINUSB_PIPE_INFORMATION_EX {
+ USBD_PIPE_TYPE PipeType;
+ UCHAR PipeId;
+ USHORT MaximumPacketSize;
+ UCHAR Interval;
+ ULONG MaximumBytesPerInterval;
+} WINUSB_PIPE_INFORMATION_EX, *PWINUSB_PIPE_INFORMATION_EX;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _WINUSBIO_H_ */
--
2.36.0
June 10, 2022