-- v3: comctl32: Remove v6 only exports. comctl32: Remove syslink from comctl32 v5. comctl32: Remove taskdialog from comctl32 v5. comctl32/tests: Test v6 only exports. comctl32: Remove user32 control copies in comctl32 v5. comctl32/tests: Add RegisterClassNameW() tests.
From: Zhiyi Zhang zzhang@codeweavers.com
--- dlls/comctl32/tests/misc.c | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+)
diff --git a/dlls/comctl32/tests/misc.c b/dlls/comctl32/tests/misc.c index a3583ad6f96..4d74c401e1a 100644 --- a/dlls/comctl32/tests/misc.c +++ b/dlls/comctl32/tests/misc.c @@ -39,6 +39,7 @@ static INT (WINAPI * pStr_GetPtrW)(LPCWSTR, LPWSTR, INT); static BOOL (WINAPI * pStr_SetPtrW)(LPWSTR, LPCWSTR);
static HRESULT (WINAPI *pDllGetVersion)(DLLVERSIONINFO *); +static BOOL (WINAPI *pRegisterClassNameW)(const WCHAR *class_name); static BOOL (WINAPI *pSetWindowSubclass)(HWND, SUBCLASSPROC, UINT_PTR, DWORD_PTR); static BOOL (WINAPI *pRemoveWindowSubclass)(HWND, SUBCLASSPROC, UINT_PTR); static LRESULT (WINAPI *pDefSubclassProc)(HWND, UINT, WPARAM, LPARAM); @@ -95,6 +96,7 @@ static BOOL InitFunctionPtrs(void) COMCTL32_GET_PROC(236, Str_SetPtrW)
pDllGetVersion = (void *)GetProcAddress(hComctl32, "DllGetVersion"); + pRegisterClassNameW = (void *)GetProcAddress(hComctl32, "RegisterClassNameW");
return TRUE; } @@ -113,6 +115,7 @@ static BOOL init_functions_v6(void) COMCTL32_GET_PROC(413, DefSubclassProc)
pDllGetVersion = (void *)GetProcAddress(hComctl32, "DllGetVersion"); + pRegisterClassNameW = (void *)GetProcAddress(hComctl32, "RegisterClassNameW");
return TRUE; } @@ -1302,6 +1305,35 @@ static void test_version(BOOL v6) ok(info.dwMajorVersion == (v6 ? 6 : 5), "Got unexpected major version %lu.\n", info.dwMajorVersion); }
+static void test_RegisterClassNameW(BOOL v6) +{ + static const WCHAR *class_names[] = + { + L"Button", + L"ComboBox", + L"ComboLBox", + L"Edit", + L"ListBox", + L"Static", + }; + unsigned int i; + BOOL ret; + + winetest_push_context("v%d", v6 ? 6 : 5); + + for (i = 0; i < ARRAY_SIZE(class_names); i++) + { + ret = pRegisterClassNameW(class_names[i]); + if (v6) + ok(ret, "RegisterClassNameW %s failed, error %lu.\n", wine_dbgstr_w(class_names[i]), GetLastError()); + else + todo_wine + ok(!ret, "RegisterClassNameW %s succeeded.\n", wine_dbgstr_w(class_names[i])); + } + + winetest_pop_context(); +} + START_TEST(misc) { ULONG_PTR ctx_cookie; @@ -1317,6 +1349,7 @@ START_TEST(misc) test_WM_STYLECHANGED(); test_WM_SETFONT(); test_version(FALSE); + test_RegisterClassNameW(FALSE);
FreeLibrary(hComctl32);
@@ -1334,6 +1367,7 @@ START_TEST(misc) test_WM_STYLECHANGED(); test_WM_SETFONT(); test_version(TRUE); + test_RegisterClassNameW(TRUE);
unload_v6_module(ctx_cookie, hCtx); FreeLibrary(hComctl32);
From: Zhiyi Zhang zzhang@codeweavers.com
--- dlls/comctl32/Makefile.in | 5 ----- dlls/comctl32/commctrl.c | 5 ++++- dlls/comctl32/tests/misc.c | 1 - 3 files changed, 4 insertions(+), 7 deletions(-)
diff --git a/dlls/comctl32/Makefile.in b/dlls/comctl32/Makefile.in index 94259580946..bc17cd94199 100644 --- a/dlls/comctl32/Makefile.in +++ b/dlls/comctl32/Makefile.in @@ -6,8 +6,6 @@ DELAYIMPORTS = oleacc winmm uxtheme
SOURCES = \ animate.c \ - button.c \ - combo.c \ comboex.c \ comctl32.rc \ commctrl.c \ @@ -15,7 +13,6 @@ SOURCES = \ dpa.c \ draglist.c \ dsa.c \ - edit.c \ flatsb.c \ header.c \ hotkey.c \ @@ -31,7 +28,6 @@ SOURCES = \ idc_movebutton.svg \ imagelist.c \ ipaddress.c \ - listbox.c \ listview.c \ monthcal.c \ nativefont.c \ @@ -40,7 +36,6 @@ SOURCES = \ propsheet.c \ rebar.c \ smoothscroll.c \ - static.c \ status.c \ string.c \ syslink.c \ diff --git a/dlls/comctl32/commctrl.c b/dlls/comctl32/commctrl.c index 6097b1a9735..d39bc2e22e3 100644 --- a/dlls/comctl32/commctrl.c +++ b/dlls/comctl32/commctrl.c @@ -68,7 +68,6 @@ #include "winerror.h" #include "winreg.h" #include "comctl32.h" -#include "uxtheme.h" #include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(commctrl); @@ -94,6 +93,7 @@ static const WCHAR strCC32SubclassInfo[] = L"CC32SubclassInfo";
static void unregister_versioned_classes(void) { +#if __WINE_COMCTL32_VERSION == 6 #define VERSION "6.0.2600.2982!" static const char *classes[] = { @@ -110,10 +110,12 @@ static void unregister_versioned_classes(void) UnregisterClassA(classes[i], NULL);
#undef VERSION +#endif /* __WINE_COMCTL32_VERSION == 6 */ }
BOOL WINAPI RegisterClassNameW(const WCHAR *class) { +#if __WINE_COMCTL32_VERSION == 6 static const struct { const WCHAR nameW[16]; @@ -142,6 +144,7 @@ BOOL WINAPI RegisterClassNameW(const WCHAR *class) if (res < 0) max = pos - 1; else min = pos + 1; } +#endif /* __WINE_COMCTL32_VERSION == 6 */
return FALSE; } diff --git a/dlls/comctl32/tests/misc.c b/dlls/comctl32/tests/misc.c index 4d74c401e1a..1f803b3cf59 100644 --- a/dlls/comctl32/tests/misc.c +++ b/dlls/comctl32/tests/misc.c @@ -1327,7 +1327,6 @@ static void test_RegisterClassNameW(BOOL v6) if (v6) ok(ret, "RegisterClassNameW %s failed, error %lu.\n", wine_dbgstr_w(class_names[i]), GetLastError()); else - todo_wine ok(!ret, "RegisterClassNameW %s succeeded.\n", wine_dbgstr_w(class_names[i])); }
From: Zhiyi Zhang zzhang@codeweavers.com
--- dlls/comctl32/tests/misc.c | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+)
diff --git a/dlls/comctl32/tests/misc.c b/dlls/comctl32/tests/misc.c index 1f803b3cf59..b9eeab1ef59 100644 --- a/dlls/comctl32/tests/misc.c +++ b/dlls/comctl32/tests/misc.c @@ -1295,14 +1295,44 @@ static void test_WM_SETFONT(void)
static void test_version(BOOL v6) { + static const char *v6_only_exports[] = + { + "DllInstall", + "DrawShadowText", + "DPA_GetSize", + "DSA_Clone", + "DSA_GetSize", + "GetWindowSubclass", + "HIMAGELIST_QueryInterface", + "ImageList_CoCreateInstance", + "ImageList_WriteEx", + "LoadIconMetric", + "LoadIconWithScaleDown", + "TaskDialog", + "TaskDialogIndirect", + }; DLLVERSIONINFO info; + HMODULE module; + unsigned int i; HRESULT hr; + void *proc;
info.cbSize = sizeof(info); hr = pDllGetVersion(&info); ok(hr == S_OK, "DllGetVersion failed, hr %#lx.\n", hr);
ok(info.dwMajorVersion == (v6 ? 6 : 5), "Got unexpected major version %lu.\n", info.dwMajorVersion); + + module = GetModuleHandleW(L"comctl32.dll"); + for (i = 0; i < ARRAY_SIZE(v6_only_exports); i++) + { + proc = GetProcAddress(module, v6_only_exports[i]); + if (v6) + ok(!!proc, "Get %s failed.\n", v6_only_exports[i]); + else + todo_wine + ok(!proc, "Get %s succeeded.\n", v6_only_exports[i]); + } }
static void test_RegisterClassNameW(BOOL v6)
From: Zhiyi Zhang zzhang@codeweavers.com
--- dlls/comctl32/Makefile.in | 1 - dlls/comctl32/comctl32.spec | 2 -- dlls/comctl32/tests/misc.c | 2 +- 3 files changed, 1 insertion(+), 4 deletions(-)
diff --git a/dlls/comctl32/Makefile.in b/dlls/comctl32/Makefile.in index bc17cd94199..a61bdfc1e47 100644 --- a/dlls/comctl32/Makefile.in +++ b/dlls/comctl32/Makefile.in @@ -40,7 +40,6 @@ SOURCES = \ string.c \ syslink.c \ tab.c \ - taskdialog.c \ toolbar.c \ tooltips.c \ trackbar.c \ diff --git a/dlls/comctl32/comctl32.spec b/dlls/comctl32/comctl32.spec index 73f25906205..8091ca489b5 100644 --- a/dlls/comctl32/comctl32.spec +++ b/dlls/comctl32/comctl32.spec @@ -61,8 +61,6 @@ 340 stdcall -ordinal DPA_CreateEx(long long) 341 stdcall -noname SendNotify(long long long ptr) 342 stdcall -noname SendNotifyEx(long long long ptr long) -344 stdcall -ordinal TaskDialog(long long wstr wstr wstr long wstr ptr) -345 stdcall -ordinal TaskDialogIndirect(ptr ptr ptr ptr) 350 stdcall -noname -private StrChrA(str long) kernelbase.StrChrA 351 stdcall -noname -private StrRChrA(str str long) kernelbase.StrRChrA 352 stdcall -noname -private StrCmpNA(str str long) kernelbase.StrCmpNA diff --git a/dlls/comctl32/tests/misc.c b/dlls/comctl32/tests/misc.c index b9eeab1ef59..8a2b2ca9f76 100644 --- a/dlls/comctl32/tests/misc.c +++ b/dlls/comctl32/tests/misc.c @@ -1330,7 +1330,7 @@ static void test_version(BOOL v6) if (v6) ok(!!proc, "Get %s failed.\n", v6_only_exports[i]); else - todo_wine + todo_wine_if(!strstr(v6_only_exports[i], "TaskDialog")) ok(!proc, "Get %s succeeded.\n", v6_only_exports[i]); } }
From: Zhiyi Zhang zzhang@codeweavers.com
test_comctl32_classes() in comctl32 tests shows that syslink is not available in comctl32 v5. The syslink test in the test_comctl32_classes() in user32 tests is removed in this commit because it's not being tested properly. The broken() call at class.c#L1329 is hiding the failure on Windows. --- dlls/comctl32/Makefile.in | 1 - dlls/comctl32/comctl32.h | 2 ++ dlls/comctl32/commctrl.c | 4 ++++ dlls/comctl32/tests/misc.c | 2 -- dlls/user32/tests/class.c | 1 - 5 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/dlls/comctl32/Makefile.in b/dlls/comctl32/Makefile.in index a61bdfc1e47..d041f09cf32 100644 --- a/dlls/comctl32/Makefile.in +++ b/dlls/comctl32/Makefile.in @@ -38,7 +38,6 @@ SOURCES = \ smoothscroll.c \ status.c \ string.c \ - syslink.c \ tab.c \ toolbar.c \ tooltips.c \ diff --git a/dlls/comctl32/comctl32.h b/dlls/comctl32/comctl32.h index a9a0b44fcd1..069a4a1dc6f 100644 --- a/dlls/comctl32/comctl32.h +++ b/dlls/comctl32/comctl32.h @@ -267,7 +267,9 @@ extern void REBAR_Unregister(void); extern void STATIC_Register(void); extern void STATUS_Register(void); extern void STATUS_Unregister(void); +#if __WINE_COMCTL32_VERSION == 6 extern void SYSLINK_Register(void); +#endif extern void SYSLINK_Unregister(void); extern void TAB_Register(void); extern void TAB_Unregister(void); diff --git a/dlls/comctl32/commctrl.c b/dlls/comctl32/commctrl.c index d39bc2e22e3..74f70a5c82b 100644 --- a/dlls/comctl32/commctrl.c +++ b/dlls/comctl32/commctrl.c @@ -200,7 +200,9 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) PROGRESS_Register (); REBAR_Register (); STATUS_Register (); +#if __WINE_COMCTL32_VERSION == 6 SYSLINK_Register (); +#endif TAB_Register (); TOOLBAR_Register (); TOOLTIPS_Register (); @@ -227,7 +229,9 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) PROGRESS_Unregister (); REBAR_Unregister (); STATUS_Unregister (); +#if __WINE_COMCTL32_VERSION == 6 SYSLINK_Unregister (); +#endif TAB_Unregister (); TOOLBAR_Unregister (); TOOLTIPS_Unregister (); diff --git a/dlls/comctl32/tests/misc.c b/dlls/comctl32/tests/misc.c index 8a2b2ca9f76..bb82277b575 100644 --- a/dlls/comctl32/tests/misc.c +++ b/dlls/comctl32/tests/misc.c @@ -404,9 +404,7 @@ static void check_class( const char *name, int must_exist, UINT style, UINT igno HWND hwnd; DWORD objid;
- todo_wine_if(!strcmp(name, "SysLink") && !must_exist && !v6) ok( must_exist, "System class %s should %sexist\n", name, must_exist ? "" : "NOT " ); - if (!must_exist) return;
todo_wine_if(!strcmp(name, "ScrollBar") || (!strcmp(name, "tooltips_class32") && v6)) ok( !(~wc.style & style & ~ignore), "System class %s is missing bits %x (%08x/%08x)\n", diff --git a/dlls/user32/tests/class.c b/dlls/user32/tests/class.c index 92e07e44bdf..fd4ea848deb 100644 --- a/dlls/user32/tests/class.c +++ b/dlls/user32/tests/class.c @@ -1368,7 +1368,6 @@ static void test_comctl32_classes(void) PROGRESS_CLASSA, REBARCLASSNAMEA, STATUSCLASSNAMEA, - "SysLink", WC_TABCONTROLA, TOOLBARCLASSNAMEA, TOOLTIPS_CLASSA,
From: Zhiyi Zhang zzhang@codeweavers.com
HIMAGELIST_QueryInterface() is needed in SHGetImageList(). Leave it for now. --- dlls/comctl32/comctl32.spec | 11 +---------- dlls/comctl32/commctrl.c | 4 ++++ dlls/comctl32/dpa.c | 2 ++ dlls/comctl32/dsa.c | 2 ++ dlls/comctl32/imagelist.c | 4 ++++ dlls/comctl32/tests/misc.c | 2 +- 6 files changed, 14 insertions(+), 11 deletions(-)
diff --git a/dlls/comctl32/comctl32.spec b/dlls/comctl32/comctl32.spec index 8091ca489b5..e0f74791b24 100644 --- a/dlls/comctl32/comctl32.spec +++ b/dlls/comctl32/comctl32.spec @@ -87,8 +87,6 @@ 375 stdcall -noname -private StrCSpnIW(wstr wstr) kernelbase.StrCSpnIW 376 stdcall -noname -private IntlStrEqWorkerA(long str str long) 377 stdcall -noname -private IntlStrEqWorkerW(long wstr wstr long) -380 stdcall -ordinal LoadIconMetric(ptr wstr long ptr) -381 stdcall -ordinal LoadIconWithScaleDown(ptr wstr long long ptr) 382 stdcall -noname SmoothScrollWindow(ptr) 383 stub -noname DoReaderMode 384 stdcall -noname SetPathWordBreakProc(ptr long) @@ -104,7 +102,7 @@ 403 stdcall -ordinal EnumMRUListW(long long ptr long) 404 stdcall -noname CreateMRUListLazyW(ptr long long long) 410 stdcall -ordinal SetWindowSubclass(long ptr long long) -411 stdcall -ordinal GetWindowSubclass(long ptr long ptr) +411 stdcall -noname GetWindowSubclass(long ptr long ptr) 412 stdcall -ordinal RemoveWindowSubclass(long ptr long) 413 stdcall -ordinal DefSubclassProc(long long long long) 414 stdcall -noname MirrorIcon(ptr ptr) @@ -126,13 +124,8 @@ @ stdcall CreateToolbarEx(long long long long long long ptr long long long long long long) @ stdcall DestroyPropertySheetPage(long) @ stdcall -private DllGetVersion(ptr) -@ stdcall -private DllInstall(long wstr) -@ stdcall -ret64 DPA_GetSize(ptr) -@ stdcall DrawShadowText(long wstr long ptr long long long long long) @ stdcall DrawStatusText(long ptr ptr long) DrawStatusTextA @ stdcall DrawStatusTextW(long ptr wstr long) -@ stdcall DSA_Clone(ptr) -@ stdcall -ret64 DSA_GetSize(ptr) @ stdcall FlatSB_EnableScrollBar (long long long) @ stdcall FlatSB_GetScrollInfo (long long ptr) @ stdcall FlatSB_GetScrollPos (long long) @@ -149,7 +142,6 @@ @ stdcall ImageList_AddIcon(ptr long) @ stdcall ImageList_AddMasked(ptr long long) @ stdcall ImageList_BeginDrag(ptr long long long) -@ stdcall ImageList_CoCreateInstance(ptr ptr ptr ptr) @ stdcall ImageList_Copy(ptr long ptr long long) @ stdcall ImageList_Create(long long long long long) @ stdcall ImageList_Destroy(ptr) @@ -186,7 +178,6 @@ @ stdcall ImageList_SetImageCount(ptr long) @ stdcall ImageList_SetOverlayImage(ptr long long) @ stdcall ImageList_Write(ptr ptr) -@ stdcall ImageList_WriteEx(ptr long ptr) @ stdcall InitCommonControlsEx(ptr) @ stdcall InitMUILanguage(long) @ stdcall InitializeFlatSB(long) diff --git a/dlls/comctl32/commctrl.c b/dlls/comctl32/commctrl.c index 74f70a5c82b..cd5df530aa7 100644 --- a/dlls/comctl32/commctrl.c +++ b/dlls/comctl32/commctrl.c @@ -950,6 +950,7 @@ CreateToolbar (HWND hwnd, DWORD style, UINT wID, INT nBitmaps, }
+#if __WINE_COMCTL32_VERSION == 6 /*********************************************************************** * DllInstall (COMCTL32.@) * @@ -964,6 +965,7 @@ HRESULT WINAPI DllInstall(BOOL bInstall, LPCWSTR cmdline) TRACE("(%u, %s): stub\n", bInstall, debugstr_w(cmdline)); return S_OK; } +#endif /* __WINE_COMCTL32_VERSION == 6 */
/*********************************************************************** * _TrackMouseEvent [COMCTL32.@] @@ -1623,6 +1625,7 @@ LRESULT WINAPI SetPathWordBreakProc(HWND hwnd, BOOL bSet) (LPARAM)(bSet ? PathWordBreakProc : NULL)); }
+#if __WINE_COMCTL32_VERSION == 6 /*********************************************************************** * DrawShadowText [COMCTL32.@] * @@ -1704,6 +1707,7 @@ HRESULT WINAPI LoadIconMetric(HINSTANCE hinst, const WCHAR *name, int size, HICO
return LoadIconWithScaleDown(hinst, name, cx, cy, icon); } +#endif /* __WINE_COMCTL32_VERSION == 6 */
static const WCHAR strMRUList[] = L"MRUList";
diff --git a/dlls/comctl32/dpa.c b/dlls/comctl32/dpa.c index 22a3f8c451d..4ef16d39977 100644 --- a/dlls/comctl32/dpa.c +++ b/dlls/comctl32/dpa.c @@ -1005,6 +1005,7 @@ void WINAPI DPA_DestroyCallback (HDPA hdpa, PFNDPAENUMCALLBACK enumProc, DPA_Destroy (hdpa); }
+#if __WINE_COMCTL32_VERSION == 6 /************************************************************************** * DPA_GetSize [COMCTL32.@] * @@ -1024,3 +1025,4 @@ ULONGLONG WINAPI DPA_GetSize(HDPA hdpa)
return sizeof(DPA) + hdpa->nMaxCount*sizeof(PVOID); } +#endif /* __WINE_COMCTL32_VERSION == 6 */ diff --git a/dlls/comctl32/dsa.c b/dlls/comctl32/dsa.c index d5e82343fbd..03652a3fcc3 100644 --- a/dlls/comctl32/dsa.c +++ b/dlls/comctl32/dsa.c @@ -438,6 +438,7 @@ void WINAPI DSA_DestroyCallback (HDSA hdsa, PFNDSAENUMCALLBACK enumProc, DSA_Destroy (hdsa); }
+#if __WINE_COMCTL32_VERSION == 6 /************************************************************************** * DSA_Clone [COMCTL32.@] * @@ -493,3 +494,4 @@ ULONGLONG WINAPI DSA_GetSize(HDSA hdsa)
return sizeof(*hdsa) + (ULONGLONG)hdsa->nMaxCount*hdsa->nItemSize; } +#endif /* __WINE_COMCTL32_VERSION == 6 */ diff --git a/dlls/comctl32/imagelist.c b/dlls/comctl32/imagelist.c index ebb84b9af01..493aebd0b45 100644 --- a/dlls/comctl32/imagelist.c +++ b/dlls/comctl32/imagelist.c @@ -2970,6 +2970,7 @@ failed: return result; }
+#if __WINE_COMCTL32_VERSION == 6 /************************************************************************* * ImageList_WriteEx [COMCTL32.@] */ @@ -2978,6 +2979,7 @@ HRESULT WINAPI ImageList_WriteEx(HIMAGELIST himl, DWORD flags, IStream *pstm) FIXME("%p %#lx %p: semi-stub\n", himl, flags, pstm); return ImageList_Write(himl, pstm) ? S_OK : E_FAIL; } +#endif /* __WINE_COMCTL32_VERSION == 6 */
/************************************************************************* * ImageList_Write [COMCTL32.@] @@ -3123,6 +3125,7 @@ ImageList_SetColorTable(HIMAGELIST himl, UINT uStartIndex, UINT cEntries, const return SetDIBColorTable(himl->hdcImage, uStartIndex, cEntries, prgb); }
+#if __WINE_COMCTL32_VERSION == 6 /************************************************************************* * ImageList_CoCreateInstance [COMCTL32.@] * @@ -3148,6 +3151,7 @@ ImageList_CoCreateInstance (REFCLSID rclsid, const IUnknown *punkOuter, REFIID r
return ImageListImpl_CreateInstance(punkOuter, riid, ppv); } +#endif /* __WINE_COMCTL32_VERSION == 6 */
/************************************************************************* diff --git a/dlls/comctl32/tests/misc.c b/dlls/comctl32/tests/misc.c index bb82277b575..4bcfe1d1d4e 100644 --- a/dlls/comctl32/tests/misc.c +++ b/dlls/comctl32/tests/misc.c @@ -1328,7 +1328,7 @@ static void test_version(BOOL v6) if (v6) ok(!!proc, "Get %s failed.\n", v6_only_exports[i]); else - todo_wine_if(!strstr(v6_only_exports[i], "TaskDialog")) + todo_wine_if(!strcmp(v6_only_exports[i], "HIMAGELIST_QueryInterface")) ok(!proc, "Get %s succeeded.\n", v6_only_exports[i]); } }
Vijay Kiran Kamuju (@infyquest) commented about dlls/comctl32/comctl32.h:
extern void STATIC_Register(void); extern void STATUS_Register(void); extern void STATUS_Unregister(void); +#if __WINE_COMCTL32_VERSION == 6 extern void SYSLINK_Register(void); +#endif extern void SYSLINK_Unregister(void);
Shouldn't we also put the unregister under the version define, as we are doing it in the other parts of the code