winehq.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
January
2003
December
November
October
September
August
July
June
May
April
March
February
January
2002
December
November
October
September
August
July
June
May
April
March
February
January
2001
December
November
October
September
August
July
June
May
April
March
February
List overview
wine-commits
March 2023
----- 2025 -----
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
January 2004
----- 2003 -----
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
----- 2002 -----
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
----- 2001 -----
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
wine-commits@winehq.org
1 participants
910 discussions
Start a n
N
ew thread
Rémi Bernon : imm32/tests: Check current keyboard layout during ime calls.
by Alexandre Julliard
28 Mar '23
28 Mar '23
Module: wine Branch: master Commit: ca97db75d12d4853285f94cd151759bbd845ef1f URL:
https://gitlab.winehq.org/wine/wine/-/commit/ca97db75d12d4853285f94cd151759…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Mon Mar 27 14:50:20 2023 +0200 imm32/tests: Check current keyboard layout during ime calls. --- dlls/imm32/tests/imm32.c | 65 +++++++++++++++++++++++++++++++++++------------- 1 file changed, 48 insertions(+), 17 deletions(-) diff --git a/dlls/imm32/tests/imm32.c b/dlls/imm32/tests/imm32.c index 4be94595bca..2eea7f0d8c5 100644 --- a/dlls/imm32/tests/imm32.c +++ b/dlls/imm32/tests/imm32.c @@ -2489,6 +2489,11 @@ static BOOL todo_IME_DLL_PROCESS_DETACH; DEFINE_EXPECT( IME_DLL_PROCESS_DETACH ); static IMEINFO ime_info; +static UINT ime_count; +static WCHAR ime_path[MAX_PATH]; +static HIMC default_himc; +static HKL default_hkl; +static HKL expect_ime = (HKL)(int)0xe020047f; enum ime_function { @@ -2498,8 +2503,9 @@ enum ime_function struct ime_call { - enum ime_function func; + HKL hkl; HIMC himc; + enum ime_function func; union { @@ -2526,6 +2532,7 @@ static void ok_call_( const char *file, int line, const struct ime_call *expecte if ((ret = expected->func - received->func)) goto done; if ((ret = (UINT_PTR)expected->himc - (UINT_PTR)received->himc)) goto done; + if ((ret = (UINT)(UINT_PTR)expected->hkl - (UINT)(UINT_PTR)received->hkl)) goto done; switch (expected->func) { case IME_SELECT: @@ -2543,12 +2550,12 @@ done: { case IME_SELECT: todo_wine_if( expected->todo ) - ok_(file, line)( !ret, "got IME_SELECT himc %p, select %u\n", received->himc, received->select ); + ok_(file, line)( !ret, "got hkl %p, himc %p, IME_SELECT select %u\n", received->hkl, received->himc, received->select ); return; case IME_NOTIFY: todo_wine_if( expected->todo ) - ok_(file, line)( !ret, "got IME_NOTIFY himc %p, action %#x, index %#x, value %#x\n", - received->himc, received->notify.action, received->notify.index, + ok_(file, line)( !ret, "got hkl %p, himc %p, IME_NOTIFY action %#x, index %#x, value %#x\n", + received->hkl, received->himc, received->notify.action, received->notify.index, received->notify.value ); return; } @@ -2557,12 +2564,12 @@ done: { case IME_SELECT: todo_wine_if( expected->todo ) - ok_(file, line)( !ret, "IME_SELECT himc %p, select %u\n", expected->himc, expected->select ); + ok_(file, line)( !ret, "hkl %p, himc %p, IME_SELECT select %u\n", expected->hkl, expected->himc, expected->select ); break; case IME_NOTIFY: todo_wine_if( expected->todo ) - ok_(file, line)( !ret, "IME_NOTIFY himc %p, action %#x, index %#x, value %#x\n", - expected->himc, expected->notify.action, expected->notify.index, + ok_(file, line)( !ret, "hkl %p, himc %p, IME_NOTIFY action %#x, index %#x, value %#x\n", + expected->hkl, expected->himc, expected->notify.action, expected->notify.index, expected->notify.value ); break; } @@ -2638,6 +2645,7 @@ static UINT WINAPI ime_ImeEnumRegisterWord( REGISTERWORDENUMPROCW proc, const WC ime_trace( "proc %p, reading %s, style %lu, string %s, data %p\n", proc, debugstr_w(reading), style, debugstr_w(string), data ); + ok_eq( default_hkl, GetKeyboardLayout( 0 ), HKL, "%p" ); CHECK_EXPECT( ImeEnumRegisterWord ); if (!style) @@ -2666,6 +2674,7 @@ static LRESULT WINAPI ime_ImeEscape( HIMC himc, UINT escape, void *data ) { ime_trace( "himc %p, escape %#x, data %p\n", himc, escape, data ); + ok_eq( default_hkl, GetKeyboardLayout( 0 ), HKL, "%p" ); CHECK_EXPECT( ImeEscape ); switch (escape) @@ -2709,6 +2718,7 @@ static UINT WINAPI ime_ImeGetRegisterWordStyle( UINT item, STYLEBUFW *style ) { ime_trace( "item %u, style %p\n", item, style ); + ok_eq( default_hkl, GetKeyboardLayout( 0 ), HKL, "%p" ); CHECK_EXPECT( ImeGetRegisterWordStyle ); if (!style) @@ -2755,6 +2765,7 @@ static BOOL WINAPI ime_ImeProcessKey( HIMC himc, UINT vkey, LPARAM key_data, BYT { ime_trace( "himc %p, vkey %u, key_data %#Ix, key_state %p\n", himc, vkey, key_data, key_state ); + ok_eq( default_hkl, GetKeyboardLayout( 0 ), HKL, "%p" ); ok( 0, "unexpected call\n" ); return FALSE; } @@ -2763,6 +2774,7 @@ static BOOL WINAPI ime_ImeRegisterWord( const WCHAR *reading, DWORD style, const { ime_trace( "reading %s, style %lu, string %s\n", debugstr_w(reading), style, debugstr_w(string) ); + ok_eq( default_hkl, GetKeyboardLayout( 0 ), HKL, "%p" ); CHECK_EXPECT( ImeRegisterWord ); if (style) ok_eq( 0xdeadbeef, style, UINT, "%#x" ); @@ -2782,7 +2794,11 @@ static BOOL WINAPI ime_ImeRegisterWord( const WCHAR *reading, DWORD style, const static BOOL WINAPI ime_ImeSelect( HIMC himc, BOOL select ) { - struct ime_call call = {.func = IME_SELECT, .himc = himc, .select = select}; + struct ime_call call = + { + .hkl = GetKeyboardLayout( 0 ), .himc = himc, + .func = IME_SELECT, .select = select + }; ime_trace( "himc %p, select %d\n", himc, select ); ime_calls[ime_call_count++] = call; return TRUE; @@ -2816,6 +2832,7 @@ static BOOL WINAPI ime_ImeUnregisterWord( const WCHAR *reading, DWORD style, con { ime_trace( "reading %s, style %lu, string %s\n", debugstr_w(reading), style, debugstr_w(string) ); + ok_eq( default_hkl, GetKeyboardLayout( 0 ), HKL, "%p" ); CHECK_EXPECT( ImeUnregisterWord ); if (style) ok_eq( 0xdeadbeef, style, UINT, "%#x" ); @@ -2835,7 +2852,11 @@ static BOOL WINAPI ime_ImeUnregisterWord( const WCHAR *reading, DWORD style, con static BOOL WINAPI ime_NotifyIME( HIMC himc, DWORD action, DWORD index, DWORD value ) { - struct ime_call call = {.func = IME_NOTIFY, .himc = himc, .notify = {.action = action, .index = index, .value = value}}; + struct ime_call call = + { + .hkl = GetKeyboardLayout( 0 ), .himc = himc, + .func = IME_NOTIFY, .notify = {.action = action, .index = index, .value = value} + }; ime_trace( "himc %p, action %#lx, index %lu, value %lu\n", himc, action, index, value ); ime_calls[ime_call_count++] = call; return FALSE; @@ -2886,10 +2907,6 @@ static struct ime_functions ime_functions = ime_DllMain, }; -static UINT ime_count; -static WCHAR ime_path[MAX_PATH]; -static HIMC default_himc; - static HKL ime_install(void) { WCHAR buffer[MAX_PATH]; @@ -2930,7 +2947,7 @@ static HKL ime_install(void) "MoveFileW failed, error %lu\n", GetLastError() ); hkl = ImmInstallIMEW( ime_path, L"WineTest IME" ); - ok( hkl == (HKL)(int)0xe020047f, "ImmInstallIMEW returned %p, error %lu\n", hkl, GetLastError() ); + ok( hkl == expect_ime, "ImmInstallIMEW returned %p, error %lu\n", hkl, GetLastError() ); swprintf( buffer, ARRAY_SIZE(buffer), L"System\\CurrentControlSet\\Control\\Keyboard Layouts\\%08x", hkl ); ret = RegOpenKeyW( HKEY_LOCAL_MACHINE, buffer, &hkey ); @@ -3776,13 +3793,25 @@ static void test_ImmActivateLayout(void) { const struct ime_call activate_seq[] = { - {.func = IME_SELECT, .himc = default_himc, .select = 1, .todo = TRUE}, + { + .hkl = expect_ime, .himc = default_himc, + .func = IME_SELECT, .select = 1, + .todo = TRUE, + }, {0}, }; const struct ime_call deactivate_seq[] = { - {.func = IME_NOTIFY, .himc = default_himc, .notify = {.action = NI_COMPOSITIONSTR, .index = CPS_CANCEL, .value = 0}, .todo = TRUE}, - {.func = IME_SELECT, .himc = default_himc, .select = 0, .todo = TRUE}, + { + .hkl = expect_ime, .himc = default_himc, + .func = IME_NOTIFY, .notify = {.action = NI_COMPOSITIONSTR, .index = CPS_CANCEL, .value = 0}, + .todo = TRUE, + }, + { + .hkl = default_hkl, .himc = default_himc, + .func = IME_SELECT, .select = 0, + .todo = TRUE, + }, {0}, }; HKL hkl, old_hkl = GetKeyboardLayout( 0 ); @@ -3846,6 +3875,8 @@ cleanup: START_TEST(imm32) { + default_hkl = GetKeyboardLayout( 0 ); + if (!is_ime_enabled()) { win_skip("IME support not implemented\n");
1
0
0
0
Rémi Bernon : imm32: Use installed IME language for the created HKL.
by Alexandre Julliard
28 Mar '23
28 Mar '23
Module: wine Branch: master Commit: db5cf9a5e12b6e8f664f54a626f4cf6efc2bfbf3 URL:
https://gitlab.winehq.org/wine/wine/-/commit/db5cf9a5e12b6e8f664f54a626f4cf…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Mon Mar 27 14:45:42 2023 +0200 imm32: Use installed IME language for the created HKL. --- dlls/imm32/Makefile.in | 2 +- dlls/imm32/imm.c | 26 ++++++++++++++++++++++---- dlls/imm32/tests/imm32.c | 1 - 3 files changed, 23 insertions(+), 6 deletions(-) diff --git a/dlls/imm32/Makefile.in b/dlls/imm32/Makefile.in index 29de6063792..b4e3039849e 100644 --- a/dlls/imm32/Makefile.in +++ b/dlls/imm32/Makefile.in @@ -1,6 +1,6 @@ MODULE = imm32.dll IMPORTLIB = imm32 -IMPORTS = user32 gdi32 advapi32 win32u +IMPORTS = user32 gdi32 advapi32 kernelbase win32u DELAYIMPORTS = ole32 C_SRCS = \ diff --git a/dlls/imm32/imm.c b/dlls/imm32/imm.c index 1b8caf90c1c..e600156f504 100644 --- a/dlls/imm32/imm.c +++ b/dlls/imm32/imm.c @@ -2012,13 +2012,31 @@ HKL WINAPI ImmInstallIMEA( const char *filenameA, const char *descriptionA ) return hkl; } +static LCID get_ime_file_lang( const WCHAR *filename ) +{ + DWORD *languages; + LCID lcid = 0; + void *info; + UINT len; + + if (!(len = GetFileVersionInfoSizeW( filename, NULL ))) return 0; + if (!(info = malloc( len ))) goto done; + if (!GetFileVersionInfoW( filename, 0, len, info )) goto done; + if (!VerQueryValueW( info, L"\\VarFileInfo\\Translation", (void **)&languages, &len ) || !len) goto done; + lcid = languages[0]; + +done: + free( info ); + return lcid; +} + /*********************************************************************** * ImmInstallIMEW (IMM32.@) */ HKL WINAPI ImmInstallIMEW( const WCHAR *filename, const WCHAR *description ) { WCHAR path[ARRAY_SIZE(layouts_formatW)+8], buffer[MAX_PATH]; - LCID lcid = GetUserDefaultLCID(); + LCID lcid; WORD count = 0x20; const WCHAR *tmp; DWORD length; @@ -2027,7 +2045,7 @@ HKL WINAPI ImmInstallIMEW( const WCHAR *filename, const WCHAR *description ) TRACE( "filename %s, description %s\n", debugstr_w(filename), debugstr_w(description) ); - if (!filename || !description) + if (!filename || !description || !(lcid = get_ime_file_lang( filename ))) { SetLastError( ERROR_INVALID_PARAMETER ); return 0; @@ -2037,8 +2055,8 @@ HKL WINAPI ImmInstallIMEW( const WCHAR *filename, const WCHAR *description ) { DWORD disposition = 0; - hkl = (HKL)MAKELPARAM( lcid, 0xe000 | count ); - swprintf( path, ARRAY_SIZE(path), layouts_formatW, (ULONG_PTR)hkl); + hkl = (HKL)(UINT_PTR)MAKELONG( lcid, 0xe000 | count ); + swprintf( path, ARRAY_SIZE(path), layouts_formatW, (ULONG)(ULONG_PTR)hkl); if (!RegCreateKeyExW( HKEY_LOCAL_MACHINE, path, 0, NULL, 0, KEY_WRITE, NULL, &hkey, &disposition )) { diff --git a/dlls/imm32/tests/imm32.c b/dlls/imm32/tests/imm32.c index 06880d4c62c..4be94595bca 100644 --- a/dlls/imm32/tests/imm32.c +++ b/dlls/imm32/tests/imm32.c @@ -2930,7 +2930,6 @@ static HKL ime_install(void) "MoveFileW failed, error %lu\n", GetLastError() ); hkl = ImmInstallIMEW( ime_path, L"WineTest IME" ); - todo_wine ok( hkl == (HKL)(int)0xe020047f, "ImmInstallIMEW returned %p, error %lu\n", hkl, GetLastError() ); swprintf( buffer, ARRAY_SIZE(buffer), L"System\\CurrentControlSet\\Control\\Keyboard Layouts\\%08x", hkl );
1
0
0
0
Rémi Bernon : win32u: Allow LANG_INVARIANT in NtUserActivateKeyboardLayout.
by Alexandre Julliard
28 Mar '23
28 Mar '23
Module: wine Branch: master Commit: 4571456e703b944cdb7bc193ddb26da63635ff6e URL:
https://gitlab.winehq.org/wine/wine/-/commit/4571456e703b944cdb7bc193ddb26d…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Mon Mar 27 14:45:00 2023 +0200 win32u: Allow LANG_INVARIANT in NtUserActivateKeyboardLayout. --- dlls/win32u/input.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dlls/win32u/input.c b/dlls/win32u/input.c index a49376d96a9..34f6727d66e 100644 --- a/dlls/win32u/input.c +++ b/dlls/win32u/input.c @@ -1207,7 +1207,8 @@ HKL WINAPI NtUserActivateKeyboardLayout( HKL layout, UINT flags ) return 0; } - if (NtQueryDefaultLocale( TRUE, &locale ) || LOWORD(layout) != locale) + if (LOWORD(layout) != MAKELANGID(LANG_INVARIANT, SUBLANG_DEFAULT) && + (NtQueryDefaultLocale( TRUE, &locale ) || LOWORD(layout) != locale)) { RtlSetLastWin32Error( ERROR_CALL_NOT_IMPLEMENTED ); FIXME_(keyboard)( "Changing user locale is not supported\n" );
1
0
0
0
Alex Henrie : wldap32: Stub out setting LDAP_OPT_REFERRAL_HOP_LIMIT.
by Alexandre Julliard
28 Mar '23
28 Mar '23
Module: wine Branch: master Commit: d8e6a29d989a2241dbf13fd9aca27a0691989bab URL:
https://gitlab.winehq.org/wine/wine/-/commit/d8e6a29d989a2241dbf13fd9aca27a…
Author: Alex Henrie <alexhenrie24(a)gmail.com> Date: Mon Mar 27 20:39:17 2023 -0600 wldap32: Stub out setting LDAP_OPT_REFERRAL_HOP_LIMIT. Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=54727
--- dlls/wldap32/option.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/dlls/wldap32/option.c b/dlls/wldap32/option.c index 38ede5557d2..2a2b7e9a517 100644 --- a/dlls/wldap32/option.c +++ b/dlls/wldap32/option.c @@ -290,6 +290,7 @@ ULONG CDECL ldap_set_optionA( LDAP *ld, int option, void *value ) case WLDAP32_LDAP_OPT_ERROR_NUMBER: case WLDAP32_LDAP_OPT_PROTOCOL_VERSION: case WLDAP32_LDAP_OPT_REFERRALS: + case WLDAP32_LDAP_OPT_REFERRAL_HOP_LIMIT: case WLDAP32_LDAP_OPT_SIZELIMIT: case WLDAP32_LDAP_OPT_SSL: case WLDAP32_LDAP_OPT_TIMELIMIT: @@ -325,7 +326,6 @@ ULONG CDECL ldap_set_optionA( LDAP *ld, int option, void *value ) case WLDAP32_LDAP_OPT_PROMPT_CREDENTIALS: case WLDAP32_LDAP_OPT_REF_DEREF_CONN_PER_MSG: case WLDAP32_LDAP_OPT_REFERRAL_CALLBACK: - case WLDAP32_LDAP_OPT_REFERRAL_HOP_LIMIT: case WLDAP32_LDAP_OPT_ROOTDSE_CACHE: case WLDAP32_LDAP_OPT_SASL_METHOD: case WLDAP32_LDAP_OPT_SECURITY_CONTEXT: @@ -439,6 +439,10 @@ ULONG CDECL ldap_set_optionW( LDAP *ld, int option, void *value ) } return map_error( ldap_set_option( CTX(ld), option, value ) ); } + case WLDAP32_LDAP_OPT_REFERRAL_HOP_LIMIT: + FIXME( "ignoring referral hop limit\n" ); + return WLDAP32_LDAP_SUCCESS; + case WLDAP32_LDAP_OPT_DEREF: case WLDAP32_LDAP_OPT_DESC: case WLDAP32_LDAP_OPT_ERROR_NUMBER: @@ -507,7 +511,6 @@ ULONG CDECL ldap_set_optionW( LDAP *ld, int option, void *value ) case WLDAP32_LDAP_OPT_PROMPT_CREDENTIALS: case WLDAP32_LDAP_OPT_REF_DEREF_CONN_PER_MSG: case WLDAP32_LDAP_OPT_REFERRAL_CALLBACK: - case WLDAP32_LDAP_OPT_REFERRAL_HOP_LIMIT: case WLDAP32_LDAP_OPT_ROOTDSE_CACHE: case WLDAP32_LDAP_OPT_SASL_METHOD: case WLDAP32_LDAP_OPT_SECURITY_CONTEXT:
1
0
0
0
Francois Gouget : taskschd/tests: Deleting tasks & folders requires elevated privileges on Windows 7.
by Alexandre Julliard
28 Mar '23
28 Mar '23
Module: wine Branch: master Commit: 490e36c807f0bfbdcb80387bd23cf0164372781e URL:
https://gitlab.winehq.org/wine/wine/-/commit/490e36c807f0bfbdcb80387bd23cf0…
Author: Francois Gouget <fgouget(a)codeweavers.com> Date: Fri Mar 24 20:16:33 2023 +0100 taskschd/tests: Deleting tasks & folders requires elevated privileges on Windows 7. This means skipping any test that requires creating a folder as the test would be unable to clean up after itself. Add a test to show that there is the same issue with tasks by creating one in the root folder. Wine-Bug:
https://bugs.winehq.org//show_bug.cgi?id=54106
--- dlls/taskschd/tests/Makefile.in | 2 +- dlls/taskschd/tests/scheduler.c | 42 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 43 insertions(+), 1 deletion(-) diff --git a/dlls/taskschd/tests/Makefile.in b/dlls/taskschd/tests/Makefile.in index 63424dab5b0..41898c12f3e 100644 --- a/dlls/taskschd/tests/Makefile.in +++ b/dlls/taskschd/tests/Makefile.in @@ -1,5 +1,5 @@ TESTDLL = taskschd.dll -IMPORTS = oleaut32 ole32 +IMPORTS = advapi32 oleaut32 ole32 C_SRCS = \ scheduler.c diff --git a/dlls/taskschd/tests/scheduler.c b/dlls/taskschd/tests/scheduler.c index 7f2c547a83d..6db3a86ba8a 100644 --- a/dlls/taskschd/tests/scheduler.c +++ b/dlls/taskschd/tests/scheduler.c @@ -22,6 +22,7 @@ #define COBJMACROS #include "windef.h" +#include "winternl.h" #include "winbase.h" #include "initguid.h" #include "objbase.h" @@ -45,6 +46,21 @@ static BOOL is_process_elevated(void) return FALSE; } +static BOOL check_win_version(int min_major, int min_minor) +{ + HMODULE hntdll = GetModuleHandleA("ntdll.dll"); + NTSTATUS (WINAPI *pRtlGetVersion)(RTL_OSVERSIONINFOEXW *); + RTL_OSVERSIONINFOEXW rtlver; + + rtlver.dwOSVersionInfoSize = sizeof(RTL_OSVERSIONINFOEXW); + pRtlGetVersion = (void *)GetProcAddress(hntdll, "RtlGetVersion"); + pRtlGetVersion(&rtlver); + return rtlver.dwMajorVersion > min_major || + (rtlver.dwMajorVersion == min_major && + rtlver.dwMinorVersion >= min_minor); +} +#define is_win8_plus() check_win_version(6, 2) + static void test_Connect(void) { WCHAR comp_name[MAX_COMPUTERNAME_LENGTH + 1]; @@ -222,6 +238,12 @@ static void test_GetFolder(void) todo_wine ok(hr == E_INVALIDARG, "expected E_INVALIDARG, got %#lx\n", hr); + if (!is_process_elevated() && !is_win8_plus()) + { + win_skip("Skipping CreateFolder tests because deleting folders requires elevated privileges on Windows 7\n"); + goto cleanup; + } + hr = ITaskFolder_CreateFolder(folder, Wine_Folder1_Folder2, v_null, &subfolder); ok(hr == S_OK, "CreateFolder error %#lx\n", hr); ITaskFolder_Release(subfolder); @@ -376,6 +398,7 @@ static void test_GetFolder(void) todo_wine ok(hr == HRESULT_FROM_WIN32(ERROR_INVALID_NAME), "expected ERROR_INVALID_NAME, got %#lx\n", hr); + cleanup: ITaskFolder_Release(folder); ITaskService_Release(service); } @@ -436,6 +459,12 @@ static void test_FolderCollection(void) VARIANT idx; static const int vt[] = { VT_I1, VT_I2, VT_I4, VT_I8, VT_UI1, VT_UI2, VT_UI4, VT_UI8, VT_INT, VT_UINT }; + if (!is_process_elevated() && !is_win8_plus()) + { + win_skip("Skipping ITaskFolderCollection tests because deleting folders requires elevated privileges on Windows 7\n"); + return; + } + hr = CoCreateInstance(&CLSID_TaskScheduler, NULL, CLSCTX_INPROC_SERVER, &IID_ITaskService, (void **)&service); if (hr != S_OK) { @@ -758,6 +787,12 @@ static void test_GetTask(void) IID iid; int i; + if (!is_process_elevated() && !is_win8_plus()) + { + win_skip("Skipping task creation tests because deleting anything requires elevated privileges on Windows 7\n"); + return; + } + hr = CoCreateInstance(&CLSID_TaskScheduler, NULL, CLSCTX_INPROC_SERVER, &IID_ITaskService, (void **)&service); if (hr != S_OK) { @@ -782,6 +817,13 @@ static void test_GetTask(void) ok(hr == HRESULT_FROM_WIN32(ERROR_PATH_NOT_FOUND) || hr == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND) /* win7 */, "expected ERROR_PATH_NOT_FOUND, got %#lx\n", hr); + hr = ITaskFolder_RegisterTask(root, Wine, xml1, TASK_CREATE, v_null, v_null, TASK_LOGON_NONE, v_null, NULL); + ok(hr == S_OK, "RegisterTask error %#lx\n", hr); + + /* Without elevated privileges this fails on Windows 7 */ + hr = ITaskFolder_DeleteTask(root, Wine, 0); + ok(hr == S_OK, "DeleteTask error %#lx\n", hr); + hr = ITaskFolder_CreateFolder(root, Wine, v_null, &folder); ok(hr == S_OK, "CreateFolder error %#lx\n", hr);
1
0
0
0
Francois Gouget : taskschd/tests: Elevated privileges are needed to connect using a hostname.
by Alexandre Julliard
28 Mar '23
28 Mar '23
Module: wine Branch: master Commit: b7afd8ba26155866adb3c766e6cb877f76742f2e URL:
https://gitlab.winehq.org/wine/wine/-/commit/b7afd8ba26155866adb3c766e6cb87…
Author: Francois Gouget <fgouget(a)codeweavers.com> Date: Fri Mar 24 20:12:54 2023 +0100 taskschd/tests: Elevated privileges are needed to connect using a hostname. Being in the administrator group is not sufficient. --- dlls/taskschd/tests/scheduler.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/dlls/taskschd/tests/scheduler.c b/dlls/taskschd/tests/scheduler.c index 58c02832bcc..7f2c547a83d 100644 --- a/dlls/taskschd/tests/scheduler.c +++ b/dlls/taskschd/tests/scheduler.c @@ -29,6 +29,22 @@ #include <wine/test.h> +static BOOL is_process_elevated(void) +{ + HANDLE token; + if (OpenProcessToken( GetCurrentProcess(), TOKEN_QUERY, &token )) + { + TOKEN_ELEVATION_TYPE type; + DWORD size; + BOOL ret; + + ret = GetTokenInformation( token, TokenElevationType, &type, sizeof(type), &size ); + CloseHandle( token ); + return (ret && type == TokenElevationTypeFull); + } + return FALSE; +} + static void test_Connect(void) { WCHAR comp_name[MAX_COMPUTERNAME_LENGTH + 1]; @@ -73,7 +89,8 @@ static void test_Connect(void) V_BSTR(&v_comp) = SysAllocString(comp_name); hr = ITaskService_Connect(service, v_comp, v_null, v_null, v_null); - ok(hr == S_OK || hr == E_ACCESSDENIED /* not an administrator */, "Connect error %#lx\n", hr); + ok(hr == S_OK || (hr == E_ACCESSDENIED && !is_process_elevated()), + "Connect error %#lx\n", hr); was_connected = hr == S_OK; SysFreeString(V_BSTR(&v_comp));
1
0
0
0
Francois Gouget : taskschd/tests: Use a winetest context in the scheduler loops.
by Alexandre Julliard
28 Mar '23
28 Mar '23
Module: wine Branch: master Commit: 27f378f071802af9b1a84f335229d0635c6c9d3c URL:
https://gitlab.winehq.org/wine/wine/-/commit/27f378f071802af9b1a84f335229d0…
Author: Francois Gouget <fgouget(a)codeweavers.com> Date: Fri Mar 24 20:19:06 2023 +0100 taskschd/tests: Use a winetest context in the scheduler loops. --- dlls/taskschd/tests/scheduler.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/dlls/taskschd/tests/scheduler.c b/dlls/taskschd/tests/scheduler.c index aa7b0754cb7..58c02832bcc 100644 --- a/dlls/taskschd/tests/scheduler.c +++ b/dlls/taskschd/tests/scheduler.c @@ -788,14 +788,16 @@ static void test_GetTask(void) for (i = 0; i < ARRAY_SIZE(create_new_task); i++) { + winetest_push_context("%d", i); hr = ITaskFolder_RegisterTask(root, Wine_Task1, xml1, create_new_task[i].flags, v_null, v_null, TASK_LOGON_NONE, v_null, &task1); - ok(hr == create_new_task[i].hr, "%d: expected %#lx, got %#lx\n", i, create_new_task[i].hr, hr); + ok(hr == create_new_task[i].hr, "expected %#lx, got %#lx\n", create_new_task[i].hr, hr); if (hr == S_OK) { hr = ITaskFolder_DeleteTask(root, Wine_Task1, 0); ok(hr == S_OK, "DeleteTask error %#lx\n", hr); IRegisteredTask_Release(task1); } + winetest_pop_context(); } hr = ITaskFolder_RegisterTask(root, Wine_Task1, NULL, TASK_CREATE, v_null, v_null, TASK_LOGON_NONE, v_null, NULL); @@ -1276,19 +1278,21 @@ static void test_daily_trigger(ITrigger *trigger) for (i = 0; i < ARRAY_SIZE(start_test); i++) { + winetest_push_context("%lu", i); start_boundary = SysAllocString(start_test[i].str); hr = IDailyTrigger_put_StartBoundary(daily_trigger, start_boundary); - ok(hr == start_test[i].hr, "%lu: got %08lx expected %08lx\n", i, hr, start_test[i].hr); + ok(hr == start_test[i].hr, "got %08lx expected %08lx\n", hr, start_test[i].hr); SysFreeString(start_boundary); if (hr == S_OK) { start_boundary = NULL; hr = IDailyTrigger_get_StartBoundary(daily_trigger, &start_boundary); - ok(hr == S_OK, "%lu: got %08lx\n", i, hr); + ok(hr == S_OK, "got %08lx\n", hr); ok(start_boundary != NULL, "start_boundary not set\n"); - ok(!lstrcmpW(start_boundary, start_test[i].str), "%lu: got %s\n", i, wine_dbgstr_w(start_boundary)); + ok(!lstrcmpW(start_boundary, start_test[i].str), "got %s\n", wine_dbgstr_w(start_boundary)); SysFreeString(start_boundary); } + winetest_pop_context(); } hr = IDailyTrigger_put_StartBoundary(daily_trigger, NULL);
1
0
0
0
Francois Gouget : taskschd/tests: Use wide character string literals in scheduler.c.
by Alexandre Julliard
28 Mar '23
28 Mar '23
Module: wine Branch: master Commit: afd9820f5689a64fbb3169e87b7108a8f1473f0c URL:
https://gitlab.winehq.org/wine/wine/-/commit/afd9820f5689a64fbb3169e87b7108…
Author: Francois Gouget <fgouget(a)codeweavers.com> Date: Fri Mar 24 20:05:19 2023 +0100 taskschd/tests: Use wide character string literals in scheduler.c. --- dlls/taskschd/tests/scheduler.c | 129 ++++++++++++++++------------------------ 1 file changed, 52 insertions(+), 77 deletions(-)
1
0
0
0
Francois Gouget : taskschd/tests: Store the xml definitions as wide string literals in scheduler.c.
by Alexandre Julliard
28 Mar '23
28 Mar '23
Module: wine Branch: master Commit: 58e0677d3312fd246f45618c1b02346c7fd7d252 URL:
https://gitlab.winehq.org/wine/wine/-/commit/58e0677d3312fd246f45618c1b0234…
Author: Francois Gouget <fgouget(a)codeweavers.com> Date: Fri Mar 24 19:54:20 2023 +0100 taskschd/tests: Store the xml definitions as wide string literals in scheduler.c. --- dlls/taskschd/tests/scheduler.c | 97 +++++++++++++++++------------------------ 1 file changed, 41 insertions(+), 56 deletions(-)
1
0
0
0
Francois Gouget : taskschd/tests: Use __HRESULT_FROM_WIN32() to initialize constants.
by Alexandre Julliard
28 Mar '23
28 Mar '23
Module: wine Branch: master Commit: 38fb5396d4d3b8e99037b708bb4eb17881af0bb8 URL:
https://gitlab.winehq.org/wine/wine/-/commit/38fb5396d4d3b8e99037b708bb4eb1…
Author: Francois Gouget <fgouget(a)codeweavers.com> Date: Fri Mar 24 18:31:23 2023 +0100 taskschd/tests: Use __HRESULT_FROM_WIN32() to initialize constants. It is a macro and thus constant unlike HRESULT_FROM_WIN32(). --- dlls/taskschd/tests/scheduler.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dlls/taskschd/tests/scheduler.c b/dlls/taskschd/tests/scheduler.c index 07ba0f4bd95..0c0c7f5be9b 100644 --- a/dlls/taskschd/tests/scheduler.c +++ b/dlls/taskschd/tests/scheduler.c @@ -722,7 +722,7 @@ static void test_GetTask(void) { { 0, S_OK }, { TASK_CREATE, S_OK }, - { TASK_UPDATE, 0x80070002 /* HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND) */ }, + { TASK_UPDATE, __HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND) }, { TASK_CREATE | TASK_UPDATE, S_OK } }; static const struct @@ -730,8 +730,8 @@ static void test_GetTask(void) DWORD flags, hr; } open_existing_task[] = { - { 0, 0x800700b7 /* HRESULT_FROM_WIN32(ERROR_ALREADY_EXISTS) */ }, - { TASK_CREATE, 0x800700b7 /* HRESULT_FROM_WIN32(ERROR_ALREADY_EXISTS) */ }, + { 0, __HRESULT_FROM_WIN32(ERROR_ALREADY_EXISTS) }, + { TASK_CREATE, __HRESULT_FROM_WIN32(ERROR_ALREADY_EXISTS) }, { TASK_UPDATE, S_OK }, { TASK_CREATE | TASK_UPDATE, S_OK } };
1
0
0
0
← Newer
1
...
11
12
13
14
15
16
17
...
91
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
Results per page:
10
25
50
100
200