https://git.reactos.org/?p=reactos.git;a=commitdiff;h=c00d41d91c181746563e6…
commit c00d41d91c181746563e689d3390228f703053f5
Author: Doug Lyons <douglyons(a)douglyons.com>
AuthorDate: Sun Nov 26 09:26:05 2023 -0600
Commit: GitHub <noreply(a)github.com>
CommitDate: Sun Nov 26 15:26:05 2023 +0000
[USER32_APITEST] Add test for bad 'Icon Groups' but good 'Icons' such
as F1'97 (#6020)
Add test for bad 'Icon Groups' but good 'Icons' such as created
by old versions of Watcom C/C++
That icon shows fine in Windows Explorer WinXP/Win2K3,
but does not show in WinVista/Win7 anymore.
A very special corner case.
We will commit the proposed fix shortly after committing the new test.
---
modules/rostests/apitests/user32/PrivateExtractIcons.c | 12 ++++++++++--
modules/rostests/apitests/user32/cpimg2e.exe | Bin 0 -> 38400 bytes
modules/rostests/apitests/user32/resource.h | 1 +
modules/rostests/apitests/user32/user32_apitest.rc | 1 +
4 files changed, 12 insertions(+), 2 deletions(-)
diff --git a/modules/rostests/apitests/user32/PrivateExtractIcons.c
b/modules/rostests/apitests/user32/PrivateExtractIcons.c
index 85edab85a16..aff24a195ed 100644
--- a/modules/rostests/apitests/user32/PrivateExtractIcons.c
+++ b/modules/rostests/apitests/user32/PrivateExtractIcons.c
@@ -27,8 +27,9 @@ BOOL ResourceToFile(INT i, PCWSTR FileName)
if (FileExists(FileName))
{
- skip("'%S' already exists. Exiting now\n", FileName);
- return FALSE;
+ /* We should only be using %temp% paths, so deleting here should be OK */
+ printf("Deleting '%S' that already exists.\n", FileName);
+ DeleteFileW(FileName);
}
hRes = FindResourceW(NULL, MAKEINTRESOURCEW(i), MAKEINTRESOURCEW(RT_RCDATA));
@@ -90,6 +91,12 @@ static struct
/* Icon group file containing one PNG icon and one normal icon */
{L"%temp%\\ROS.ico", 1, 1, TRUE},
+
+ /* Executable file with bad 'Icon Group' but good 'Icons'.
+ * Windows explorer shows the program's icon correctly in WinXP/Win2K3
+ * but Windows 7 shows only a default icon. This is analogous
+ * to EXE's generated by older Watcom C/C++ versions. */
+ {L"%temp%\\cpimg2e.exe", 1, 1, TRUE},
};
static struct
@@ -100,6 +107,7 @@ static struct
{
{L"%temp%\\ROS.ico", IDR_ICONS_PNG},
{L"%temp%\\sysicon.ico", IDR_ICONS_NORMAL},
+ {L"%temp%\\cpimg2e.exe", IDR_EXE_NORMAL}
};
START_TEST(PrivateExtractIcons)
diff --git a/modules/rostests/apitests/user32/cpimg2e.exe
b/modules/rostests/apitests/user32/cpimg2e.exe
new file mode 100644
index 00000000000..db9d844a615
Binary files /dev/null and b/modules/rostests/apitests/user32/cpimg2e.exe differ
diff --git a/modules/rostests/apitests/user32/resource.h
b/modules/rostests/apitests/user32/resource.h
index ac91b1b51be..33972fde705 100644
--- a/modules/rostests/apitests/user32/resource.h
+++ b/modules/rostests/apitests/user32/resource.h
@@ -3,3 +3,4 @@
#define IDR_ICONS_PNG 2000
#define IDR_ICONS_NORMAL 2001
+#define IDR_EXE_NORMAL 2002
diff --git a/modules/rostests/apitests/user32/user32_apitest.rc
b/modules/rostests/apitests/user32/user32_apitest.rc
index 370c3aaa721..155390fc217 100644
--- a/modules/rostests/apitests/user32/user32_apitest.rc
+++ b/modules/rostests/apitests/user32/user32_apitest.rc
@@ -10,6 +10,7 @@ TESTCURSOR CURSOR "test.cur"
IDR_ICONS_PNG RCDATA "ROS.ico"
IDR_ICONS_NORMAL RCDATA "sysicon.ico"
+IDR_EXE_NORMAL RCDATA "cpimg2e.exe"
TESTDIALOG DIALOG 0,0, 200,200
CLASS "TestDialogClass"