diff --git a/modules/rostests/apitests/comctl32/CMakeLists.txt b/modules/rostests/apitests/comctl32/CMakeLists.txt index 2198b4d9fe7..97a1744a4c4 100644 --- a/modules/rostests/apitests/comctl32/CMakeLists.txt +++ b/modules/rostests/apitests/comctl32/CMakeLists.txt @@ -1,7 +1,19 @@ -add_executable(comctl32_apitest button.c imagelist.c propsheet.c toolbar.c testlist.c ../include/msgtrace.c comctl32_apitest.rc) +list(APPEND SOURCE + ../include/msgtrace.c + button.c + imagelist.c + propsheet.c + testlist.c + toolbar.c + tooltip.c) + +add_executable(comctl32_apitest + ${SOURCE} + comctl32_apitest.rc) + target_link_libraries(comctl32_apitest wine) set_module_type(comctl32_apitest win32cui) -add_importlibs(comctl32_apitest uxtheme comctl32 user32 gdi32 msvcrt kernel32 ntdll) +add_importlibs(comctl32_apitest uxtheme comctl32 user32 gdi32 version msvcrt kernel32 ntdll) add_rostests_file(TARGET comctl32_apitest) add_rostests_file(FILE "${CMAKE_CURRENT_SOURCE_DIR}/comctl32v5.manifest") diff --git a/modules/rostests/apitests/comctl32/testlist.c b/modules/rostests/apitests/comctl32/testlist.c index f914fc51593..3fb14477f34 100644 --- a/modules/rostests/apitests/comctl32/testlist.c +++ b/modules/rostests/apitests/comctl32/testlist.c @@ -5,6 +5,7 @@ extern void func_button(void); extern void func_ImageListApi(void); extern void func_propsheet(void); extern void func_toolbar(void); +extern void func_tooltip(void); const struct test winetest_testlist[] = { @@ -12,5 +13,6 @@ const struct test winetest_testlist[] = { "ImageListApi", func_ImageListApi }, { "propsheetv6", func_propsheet }, { "toolbarv6", func_toolbar }, + { "tooltipv6", func_tooltip }, { 0, 0 } }; diff --git a/modules/rostests/apitests/comctl32/tooltip.c b/modules/rostests/apitests/comctl32/tooltip.c new file mode 100644 index 00000000000..d92ce4cade2 --- /dev/null +++ b/modules/rostests/apitests/comctl32/tooltip.c @@ -0,0 +1,67 @@ +/* + * PROJECT: ReactOS API Tests + * LICENSE: LGPL-2.1-or-later (https://spdx.org/licenses/LGPL-2.1-or-later) + * PURPOSE: Unit tests for the comctl32 tooltips + * COPYRIGHT: Copyright 2025 Dmitry Borisov + */ + +/* INCLUDES *******************************************************************/ + +#include "wine/test.h" + +#include + +/* FUNCTIONS ******************************************************************/ + +static +VOID +TestDllProductVersion(VOID) +{ + HANDLE hAppHeap = GetProcessHeap(); + DWORD dwInfoSize; + LPVOID lpData; + VS_FIXEDFILEINFO* pInfo; + UINT uInfoLen; + + dwInfoSize = GetFileVersionInfoSizeW(L"comctl32.dll", NULL); + if (dwInfoSize == 0) + { + skip("GetModuleFileNameW failed\n"); + return; + } + + lpData = HeapAlloc(hAppHeap, 0, dwInfoSize); + if (!lpData) + { + skip("No memory\n"); + return; + } + + if (!GetFileVersionInfoW(L"comctl32.dll", 0, dwInfoSize, lpData)) + { + skip("Unable to retrieve the file version information\n"); + goto Cleanup; + } + + if (!VerQueryValueW(lpData, L"\\", (LPVOID *)&pInfo, &uInfoLen) || uInfoLen == 0) + { + skip("Unable to retrieve the root block\n"); + goto Cleanup; + } + + /* + * SIV 5.80 expects that the "product version" string of the comctl32.dll file + * will have the "file version" format. This value is used to determine + * whether tooltip support is available. + */ + ok(pInfo->dwProductVersionMS >= MAKELONG(5, 0), + "Unknown comctl32.dll version %lx\n", pInfo->dwProductVersionMS); + +Cleanup: + HeapFree(hAppHeap, 0, lpData); +} + +START_TEST(tooltip) +{ + TestDllProductVersion(); +}