Jinoh Kang : shell32: Return stub bitmap in IShellItemImageFactory::GetImage.
Alexandre Julliard
julliard at winehq.org
Mon Jul 18 15:47:02 CDT 2022
Module: wine
Branch: master
Commit: 16d785d41608ba6ca6e73d4255154ceed0647ac2
URL: https://gitlab.winehq.org/wine/wine/-/commit/16d785d41608ba6ca6e73d4255154ceed0647ac2
Author: Jinoh Kang <jinoh.kang.kr at gmail.com>
Date: Fri Jul 15 01:59:58 2022 +0900
shell32: Return stub bitmap in IShellItemImageFactory::GetImage.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=52673
---
dlls/shell32/shellitem.c | 17 +++++++++++++++--
dlls/shell32/tests/shlfolder.c | 1 -
2 files changed, 15 insertions(+), 3 deletions(-)
diff --git a/dlls/shell32/shellitem.c b/dlls/shell32/shellitem.c
index 3e8bd24a429..a6d4ee9ef07 100644
--- a/dlls/shell32/shellitem.c
+++ b/dlls/shell32/shellitem.c
@@ -569,13 +569,26 @@ static HRESULT WINAPI ShellItem_IShellItemImageFactory_GetImage(IShellItemImageF
SIZE size, SIIGBF flags, HBITMAP *phbm)
{
ShellItem *This = impl_from_IShellItemImageFactory(iface);
+ static const BITMAPINFOHEADER dummy_bmi_header = {
+ .biSize = sizeof(dummy_bmi_header),
+ .biWidth = 1,
+ .biHeight = 1,
+ .biPlanes = 1,
+ .biBitCount = 32,
+ .biCompression = BI_RGB
+ };
static int once;
if (!once++)
FIXME("%p ({%lu, %lu} %d %p): stub\n", This, size.cx, size.cy, flags, phbm);
- *phbm = NULL;
- return E_NOTIMPL;
+ if (!(*phbm = CreateDIBSection(NULL, (const BITMAPINFO *)&dummy_bmi_header,
+ DIB_RGB_COLORS, NULL, NULL, 0)))
+ {
+ return E_OUTOFMEMORY;
+ }
+
+ return S_OK;
}
static const IShellItemImageFactoryVtbl ShellItem_IShellItemImageFactory_Vtbl = {
diff --git a/dlls/shell32/tests/shlfolder.c b/dlls/shell32/tests/shlfolder.c
index 267c81a0ec5..02a5c0dfb2d 100644
--- a/dlls/shell32/tests/shlfolder.c
+++ b/dlls/shell32/tests/shlfolder.c
@@ -4487,7 +4487,6 @@ static void test_IShellItemImageFactory(void)
ret = IShellItemImageFactory_GetImage(siif, size, SIIGBF_BIGGERSIZEOK, &hbm);
IShellItemImageFactory_Release(siif);
- todo_wine
ok(ret == S_OK, "GetImage returned %lx\n", ret);
ok(FAILED(ret) == !hbm, "result = %lx but bitmap = %p\n", ret, hbm);
More information about the wine-cvs
mailing list