Module: wine
Branch: master
Commit: c10d9d102c21a4c01f47afb5e8748a85338bdae4
URL: https://source.winehq.org/git/wine.git/?a=commit;h=c10d9d102c21a4c01f47afb5…
Author: Francois Gouget <fgouget(a)free.fr>
Date: Wed Sep 1 09:30:08 2021 +0200
shell32: Fix a couple of ASCII / ANSI mixups in comments.
Signed-off-by: Francois Gouget <fgouget(a)free.fr>
Signed-off-by: Alexandre Julliard <julliard(a)winehq.org>
---
dlls/shell32/shelllink.c | 2 +-
dlls/shell32/shellord.c | 2 +-
dlls/shell32/shlfileop.c | 4 ++--
3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/dlls/shell32/shelllink.c b/dlls/shell32/shelllink.c
index 2353ac3e56e..1a8eca3abe4 100644
--- a/dlls/shell32/shelllink.c
+++ b/dlls/shell32/shelllink.c
@@ -680,7 +680,7 @@ static HRESULT Stream_LoadLocation( IStream *stm,
*
* 0 Length of the block (4 bytes, usually 0x314)
* 4 tag (dword)
- * 8 string data in ASCII
+ * 8 string data in ANSI
* 8+0x104 string data in UNICODE
*
* In the original Win32 implementation the buffers are not initialized
diff --git a/dlls/shell32/shellord.c b/dlls/shell32/shellord.c
index e1262accdd8..639576ca50d 100644
--- a/dlls/shell32/shellord.c
+++ b/dlls/shell32/shellord.c
@@ -1,6 +1,6 @@
/*
* The parameters of many functions changes between different OS versions
- * (NT uses Unicode strings, 95 uses ASCII strings)
+ * (NT uses Unicode strings, 95 uses ANSI strings)
*
* Copyright 1997 Marcus Meissner
* 1998 Jürgen Schmied
diff --git a/dlls/shell32/shlfileop.c b/dlls/shell32/shlfileop.c
index 3726c61dfaa..ed66a1a555c 100644
--- a/dlls/shell32/shlfileop.c
+++ b/dlls/shell32/shlfileop.c
@@ -819,9 +819,9 @@ static DWORD SHFindAttrW(LPCWSTR pName, BOOL fileOnly)
*
* SHNameTranslate HelperFunction for SHFileOperationA
*
- * Translates a list of 0 terminated ASCII strings into Unicode. If *wString
+ * Translates a list of 0 terminated ANSI strings into Unicode. If *wString
* is NULL, only the necessary size of the string is determined and returned,
- * otherwise the ASCII strings are copied into it and the buffer is increased
+ * otherwise the ANSI strings are copied into it and the buffer is increased
* to point to the location after the final 0 termination char.
*/
static DWORD SHNameTranslate(LPWSTR* wString, LPCWSTR* pWToFrom, BOOL more)
Module: wine
Branch: master
Commit: ab6edd0932c5f43abf9a6df1b55c67ab423a6353
URL: https://source.winehq.org/git/wine.git/?a=commit;h=ab6edd0932c5f43abf9a6df1…
Author: Francois Gouget <fgouget(a)codeweavers.com>
Date: Wed Sep 1 08:52:19 2021 +0200
advapi32/tests: Fix some Perflib subkey tests.
Some languages don't have a subkey (e.g. German), and for others the
subkey is the full language id rather than the primary language id (e.g.
Portuguese).
Furthermore there should be a CurrentLanguage key with localized values.
Signed-off-by: Francois Gouget <fgouget(a)codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard(a)winehq.org>
---
dlls/advapi32/tests/registry.c | 64 +++++++++++++++++++++++++++++++++++++-----
1 file changed, 57 insertions(+), 7 deletions(-)
diff --git a/dlls/advapi32/tests/registry.c b/dlls/advapi32/tests/registry.c
index 5ed220095bb..b6f906fd689 100644
--- a/dlls/advapi32/tests/registry.c
+++ b/dlls/advapi32/tests/registry.c
@@ -3929,10 +3929,11 @@ static void test_perflib_key(void)
HKEY perflib_key, key, key2;
OBJECT_ATTRIBUTES attr;
UNICODE_STRING string;
- char lang_name[4];
+ char lang_name[5];
+ const char *knames[2] = {"009", "CurrentLanguage"};
char *buffer;
DWORD size;
- LONG ret;
+ LONG ret, l;
ret = RegOpenKeyExA(HKEY_LOCAL_MACHINE,
"Software\\Microsoft\\Windows NT\\CurrentVersion\\Perflib", 0, KEY_READ, &perflib_key);
@@ -4027,21 +4028,70 @@ static void test_perflib_key(void)
else
ok(!ret, "got %#x\n", ret);
- /* multilingual support was not really completely thought through */
+ for (l = 0; l < ARRAY_SIZE(knames); l++)
+ {
+ winetest_push_context("%d", l);
+ todo_wine_if(l == 1) {
+ ret = RegOpenKeyExA(perflib_key, knames[l], 0, KEY_READ, &key);
+ ok(!ret, "got %u\n", ret);
+ if (is_special_key(key))
+ {
+ size = buffer_size;
+ ret = RegQueryValueExA(key, "counter", NULL, NULL, (BYTE *)buffer, &size);
+ ok(!ret, "got %u\n", ret);
+ if (!ret)
+ {
+ char *str;
+ int c = 0;
+ for (str = buffer; *str; str += strlen(str) + 1)
+ c++;
+ /* Note that the two keys may not have the same number of
+ * entries if they are in different languages.
+ */
+ ok(c >= 2 && (c % 2) == 0, "%d is not a valid number of entries in %s\n", c, knames[l]);
+ trace("%s has %d entries\n", knames[l], c);
+ }
+ }
+ else
+ {
+ /* Windows 7 does not always return a special key for 009
+ * when running without elevated privileges.
+ */
+ ok(broken(l == 0), "expected a special handle, got %p\n", key);
+ }
+
+ ret = RegCloseKey(key);
+ ok(!ret, "got %u\n", ret);
+ }
+ winetest_pop_context();
+ }
- sprintf(lang_name, "%03x", primary_lang);
- if (primary_lang != LANG_ENGLISH)
+ /* multilingual support was not really completely thought through */
+ switch (primary_lang)
+ {
+ case LANG_PORTUGUESE:
+ case LANG_CHINESE:
+ sprintf(lang_name, "%04x", GetUserDefaultLangID());
+ break;
+ default:
+ sprintf(lang_name, "%03x", primary_lang);
+ break;
+ }
+ if (primary_lang != LANG_ENGLISH &&
+ !RegOpenKeyExA(perflib_key, lang_name, 0, KEY_READ, &key))
{
- ret = RegOpenKeyExA(perflib_key, lang_name, 0, KEY_READ, &key);
- todo_wine ok(!ret, "got %u\n", ret);
ok(!is_special_key(key), "expected a normal handle, got %p\n", key);
+ size = buffer_size;
ret = RegQueryValueExA(key, "counter", NULL, NULL, (BYTE *)buffer, &size);
todo_wine ok(ret == ERROR_FILE_NOT_FOUND, "got %u\n", ret);
ret = RegCloseKey(key);
todo_wine ok(!ret, "got %u\n", ret);
}
+ /* else some languages don't have their own key. The keys are not really
+ * usable anyway so assume it does not really matter.
+ */
ret = RegCloseKey(perflib_key);
ok(!ret, "got %u\n", ret);
Module: wine
Branch: master
Commit: 53a0d57aff628c73e8da2dbaba0d3c59b0424987
URL: https://source.winehq.org/git/wine.git/?a=commit;h=53a0d57aff628c73e8da2dba…
Author: Zhiyi Zhang <zzhang(a)codeweavers.com>
Date: Wed Sep 1 14:38:03 2021 +0800
winecfg: Use OpenThemeDataForDpi() to create a theme handle not associated to a window.
If a window is not passed to OpenThemeData(), OpenThemeData() assumes the DPI is 96 according to
tests. And GetThemePartSize() should select theme parts according to the DPI stored in theme
handles rather than using GDI device contexts. Thus, OpenThemeDataForDpi() should be used in place
of OpenThemeData() when DPI is not 96 and theme handles shouldn't be associated with a window.
Signed-off-by: Zhiyi Zhang <zzhang(a)codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard(a)winehq.org>
---
programs/winecfg/theme.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/programs/winecfg/theme.c b/programs/winecfg/theme.c
index e204a911516..b3a3eeed3ba 100644
--- a/programs/winecfg/theme.c
+++ b/programs/winecfg/theme.c
@@ -1090,7 +1090,7 @@ static void on_draw_item(HWND hDlg, WPARAM wParam, LPARAM lParam)
HTHEME theme;
RECT buttonrect;
- theme = OpenThemeData(NULL, WC_BUTTONW);
+ theme = OpenThemeDataForDpi(NULL, WC_BUTTONW, GetDpiForWindow(hDlg));
if (theme) {
MARGINS margins;
Module: wine
Branch: master
Commit: 8aed2ec3b9eccdbdd77aef669acb6f445d178214
URL: https://source.winehq.org/git/wine.git/?a=commit;h=8aed2ec3b9eccdbdd77aef66…
Author: Zhiyi Zhang <zzhang(a)codeweavers.com>
Date: Wed Sep 1 14:37:54 2021 +0800
uxtheme: Use OpenThemeDataForDpi() to create a theme handle not associated to a window.
If a window is not passed to OpenThemeData(), OpenThemeData() assumes the DPI is 96 according to
tests. And GetThemePartSize() should select theme parts according to the DPI stored in theme
handles rather than using GDI device contexts. Thus, OpenThemeDataForDpi() should be used in place
of OpenThemeData() when DPI is not 96 and theme handles shouldn't be associated with a window.
Signed-off-by: Zhiyi Zhang <zzhang(a)codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard(a)winehq.org>
---
dlls/uxtheme/scrollbar.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/dlls/uxtheme/scrollbar.c b/dlls/uxtheme/scrollbar.c
index a9d5a83f2bb..0e42de7d77f 100644
--- a/dlls/uxtheme/scrollbar.c
+++ b/dlls/uxtheme/scrollbar.c
@@ -41,7 +41,11 @@ void WINAPI UXTHEME_ScrollBarDraw(HWND hwnd, HDC dc, INT bar, enum SCROLL_HITTES
HTHEME theme;
DWORD style;
- theme = bar == SB_CTL ? GetWindowTheme(hwnd) : OpenThemeData(NULL, WC_SCROLLBARW);
+ if (bar == SB_CTL)
+ theme = GetWindowTheme(hwnd);
+ else
+ theme = OpenThemeDataForDpi(NULL, WC_SCROLLBARW, GetDpiForWindow(hwnd));
+
if (!theme)
{
user_api.pScrollBarDraw(hwnd, dc, bar, hit_test, tracking_info, draw_arrows, draw_interior,