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
July
June
May
April
March
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
September 2016
----- 2025 -----
July 2025
June 2025
May 2025
April 2025
March 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
2 participants
430 discussions
Start a n
N
ew thread
Andrey Gusev : api-ms-win-eventing-controller-l1-1-0: Add dll.
by Alexandre Julliard
22 Sep '16
22 Sep '16
Module: wine Branch: master Commit: 2e6878aa05cb96c37e4268afd023a8ee557c3913 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=2e6878aa05cb96c37e4268afd…
Author: Andrey Gusev <andrey.goosev(a)gmail.com> Date: Thu Sep 22 13:26:54 2016 +0300 api-ms-win-eventing-controller-l1-1-0: Add dll. Signed-off-by: Andrey Gusev <andrey.goosev(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- configure | 2 ++ configure.ac | 1 + dlls/api-ms-win-eventing-controller-l1-1-0/Makefile.in | 1 + .../api-ms-win-eventing-controller-l1-1-0.spec | 11 +++++++++++ tools/make_specfiles | 1 + 5 files changed, 16 insertions(+) diff --git a/configure b/configure index e18b6d6..dbc520d 100755 --- a/configure +++ b/configure @@ -997,6 +997,7 @@ enable_api_ms_win_downlevel_user32_l1_1_0 enable_api_ms_win_downlevel_version_l1_1_0 enable_api_ms_win_eventing_classicprovider_l1_1_0 enable_api_ms_win_eventing_consumer_l1_1_0 +enable_api_ms_win_eventing_controller_l1_1_0 enable_api_ms_win_eventing_provider_l1_1_0 enable_api_ms_win_eventlog_legacy_l1_1_0 enable_api_ms_win_ntuser_dc_access_l1_1_0 @@ -17668,6 +17669,7 @@ wine_fn_config_dll api-ms-win-downlevel-user32-l1-1-0 enable_api_ms_win_downleve wine_fn_config_dll api-ms-win-downlevel-version-l1-1-0 enable_api_ms_win_downlevel_version_l1_1_0 wine_fn_config_dll api-ms-win-eventing-classicprovider-l1-1-0 enable_api_ms_win_eventing_classicprovider_l1_1_0 wine_fn_config_dll api-ms-win-eventing-consumer-l1-1-0 enable_api_ms_win_eventing_consumer_l1_1_0 +wine_fn_config_dll api-ms-win-eventing-controller-l1-1-0 enable_api_ms_win_eventing_controller_l1_1_0 wine_fn_config_dll api-ms-win-eventing-provider-l1-1-0 enable_api_ms_win_eventing_provider_l1_1_0 wine_fn_config_dll api-ms-win-eventlog-legacy-l1-1-0 enable_api_ms_win_eventlog_legacy_l1_1_0 wine_fn_config_dll api-ms-win-ntuser-dc-access-l1-1-0 enable_api_ms_win_ntuser_dc_access_l1_1_0 diff --git a/configure.ac b/configure.ac index 5894a04..23702d6 100644 --- a/configure.ac +++ b/configure.ac @@ -2773,6 +2773,7 @@ WINE_CONFIG_DLL(api-ms-win-downlevel-user32-l1-1-0) WINE_CONFIG_DLL(api-ms-win-downlevel-version-l1-1-0) WINE_CONFIG_DLL(api-ms-win-eventing-classicprovider-l1-1-0) WINE_CONFIG_DLL(api-ms-win-eventing-consumer-l1-1-0) +WINE_CONFIG_DLL(api-ms-win-eventing-controller-l1-1-0) WINE_CONFIG_DLL(api-ms-win-eventing-provider-l1-1-0) WINE_CONFIG_DLL(api-ms-win-eventlog-legacy-l1-1-0) WINE_CONFIG_DLL(api-ms-win-ntuser-dc-access-l1-1-0) diff --git a/dlls/api-ms-win-eventing-controller-l1-1-0/Makefile.in b/dlls/api-ms-win-eventing-controller-l1-1-0/Makefile.in new file mode 100644 index 0000000..06407e9 --- /dev/null +++ b/dlls/api-ms-win-eventing-controller-l1-1-0/Makefile.in @@ -0,0 +1 @@ +MODULE = api-ms-win-eventing-controller-l1-1-0.dll diff --git a/dlls/api-ms-win-eventing-controller-l1-1-0/api-ms-win-eventing-controller-l1-1-0.spec b/dlls/api-ms-win-eventing-controller-l1-1-0/api-ms-win-eventing-controller-l1-1-0.spec new file mode 100644 index 0000000..a418637 --- /dev/null +++ b/dlls/api-ms-win-eventing-controller-l1-1-0/api-ms-win-eventing-controller-l1-1-0.spec @@ -0,0 +1,11 @@ +@ stdcall ControlTraceW(int64 wstr ptr long) advapi32.ControlTraceW +@ stub EnableTraceEx2 +@ stub EnumerateTraceGuidsEx +@ stub EventAccessControl +@ stub EventAccessQuery +@ stub EventAccessRemove +@ stdcall QueryAllTracesW(ptr long ptr) advapi32.QueryAllTracesW +@ stdcall StartTraceW(ptr wstr ptr) advapi32.StartTraceW +@ stdcall StopTraceW(int64 wstr ptr) advapi32.StopTraceW +@ stub TraceQueryInformation +@ stub TraceSetInformation diff --git a/tools/make_specfiles b/tools/make_specfiles index a13f2ec..c12a3ae 100755 --- a/tools/make_specfiles +++ b/tools/make_specfiles @@ -115,6 +115,7 @@ my @dll_groups = "api-ms-win-core-registry-l1-1-0", "api-ms-win-eventing-classicprovider-l1-1-0", "api-ms-win-eventing-consumer-l1-1-0", + "api-ms-win-eventing-controller-l1-1-0", "api-ms-win-eventing-provider-l1-1-0", "api-ms-win-eventlog-legacy-l1-1-0", "api-ms-win-security-base-l1-2-0",
1
0
0
0
Andrey Gusev : api-ms-win-eventing-consumer-l1-1-0: Add dll.
by Alexandre Julliard
22 Sep '16
22 Sep '16
Module: wine Branch: master Commit: 7b80edaa2d72489a5fbafa1f138d0d8d06ea246c URL:
http://source.winehq.org/git/wine.git/?a=commit;h=7b80edaa2d72489a5fbafa1f1…
Author: Andrey Gusev <andrey.goosev(a)gmail.com> Date: Thu Sep 22 12:59:59 2016 +0300 api-ms-win-eventing-consumer-l1-1-0: Add dll. Signed-off-by: Andrey Gusev <andrey.goosev(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- configure | 2 ++ configure.ac | 1 + dlls/api-ms-win-eventing-consumer-l1-1-0/Makefile.in | 1 + .../api-ms-win-eventing-consumer-l1-1-0.spec | 3 +++ tools/make_specfiles | 1 + 5 files changed, 8 insertions(+) diff --git a/configure b/configure index 809116f..e18b6d6 100755 --- a/configure +++ b/configure @@ -996,6 +996,7 @@ enable_api_ms_win_downlevel_shlwapi_l2_1_0 enable_api_ms_win_downlevel_user32_l1_1_0 enable_api_ms_win_downlevel_version_l1_1_0 enable_api_ms_win_eventing_classicprovider_l1_1_0 +enable_api_ms_win_eventing_consumer_l1_1_0 enable_api_ms_win_eventing_provider_l1_1_0 enable_api_ms_win_eventlog_legacy_l1_1_0 enable_api_ms_win_ntuser_dc_access_l1_1_0 @@ -17666,6 +17667,7 @@ wine_fn_config_dll api-ms-win-downlevel-shlwapi-l2-1-0 enable_api_ms_win_downlev wine_fn_config_dll api-ms-win-downlevel-user32-l1-1-0 enable_api_ms_win_downlevel_user32_l1_1_0 wine_fn_config_dll api-ms-win-downlevel-version-l1-1-0 enable_api_ms_win_downlevel_version_l1_1_0 wine_fn_config_dll api-ms-win-eventing-classicprovider-l1-1-0 enable_api_ms_win_eventing_classicprovider_l1_1_0 +wine_fn_config_dll api-ms-win-eventing-consumer-l1-1-0 enable_api_ms_win_eventing_consumer_l1_1_0 wine_fn_config_dll api-ms-win-eventing-provider-l1-1-0 enable_api_ms_win_eventing_provider_l1_1_0 wine_fn_config_dll api-ms-win-eventlog-legacy-l1-1-0 enable_api_ms_win_eventlog_legacy_l1_1_0 wine_fn_config_dll api-ms-win-ntuser-dc-access-l1-1-0 enable_api_ms_win_ntuser_dc_access_l1_1_0 diff --git a/configure.ac b/configure.ac index 3433186..5894a04 100644 --- a/configure.ac +++ b/configure.ac @@ -2772,6 +2772,7 @@ WINE_CONFIG_DLL(api-ms-win-downlevel-shlwapi-l2-1-0) WINE_CONFIG_DLL(api-ms-win-downlevel-user32-l1-1-0) WINE_CONFIG_DLL(api-ms-win-downlevel-version-l1-1-0) WINE_CONFIG_DLL(api-ms-win-eventing-classicprovider-l1-1-0) +WINE_CONFIG_DLL(api-ms-win-eventing-consumer-l1-1-0) WINE_CONFIG_DLL(api-ms-win-eventing-provider-l1-1-0) WINE_CONFIG_DLL(api-ms-win-eventlog-legacy-l1-1-0) WINE_CONFIG_DLL(api-ms-win-ntuser-dc-access-l1-1-0) diff --git a/dlls/api-ms-win-eventing-consumer-l1-1-0/Makefile.in b/dlls/api-ms-win-eventing-consumer-l1-1-0/Makefile.in new file mode 100644 index 0000000..121a362 --- /dev/null +++ b/dlls/api-ms-win-eventing-consumer-l1-1-0/Makefile.in @@ -0,0 +1 @@ +MODULE = api-ms-win-eventing-consumer-l1-1-0.dll diff --git a/dlls/api-ms-win-eventing-consumer-l1-1-0/api-ms-win-eventing-consumer-l1-1-0.spec b/dlls/api-ms-win-eventing-consumer-l1-1-0/api-ms-win-eventing-consumer-l1-1-0.spec new file mode 100644 index 0000000..aa485d1 --- /dev/null +++ b/dlls/api-ms-win-eventing-consumer-l1-1-0/api-ms-win-eventing-consumer-l1-1-0.spec @@ -0,0 +1,3 @@ +@ stdcall CloseTrace(int64) advapi32.CloseTrace +@ stdcall -ret64 OpenTraceW(ptr) advapi32.OpenTraceW +@ stdcall ProcessTrace(ptr long ptr ptr) advapi32.ProcessTrace diff --git a/tools/make_specfiles b/tools/make_specfiles index 37af57f..a13f2ec 100755 --- a/tools/make_specfiles +++ b/tools/make_specfiles @@ -114,6 +114,7 @@ my @dll_groups = "api-ms-win-security-base-l1-1-0", "api-ms-win-core-registry-l1-1-0", "api-ms-win-eventing-classicprovider-l1-1-0", + "api-ms-win-eventing-consumer-l1-1-0", "api-ms-win-eventing-provider-l1-1-0", "api-ms-win-eventlog-legacy-l1-1-0", "api-ms-win-security-base-l1-2-0",
1
0
0
0
Huw Davies : user32: Implement OemKeyScan().
by Alexandre Julliard
22 Sep '16
22 Sep '16
Module: wine Branch: master Commit: b7c5ff05a72716d92dd2fa399f960d42b69fcb97 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=b7c5ff05a72716d92dd2fa399…
Author: Huw Davies <huw(a)codeweavers.com> Date: Thu Sep 22 11:12:38 2016 +0100 user32: Implement OemKeyScan(). Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/user32/input.c | 17 +++++++++++++++-- dlls/user32/tests/input.c | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 47 insertions(+), 2 deletions(-) diff --git a/dlls/user32/input.c b/dlls/user32/input.c index 63fae67..44b7e70 100644 --- a/dlls/user32/input.c +++ b/dlls/user32/input.c @@ -884,9 +884,22 @@ WORD WINAPI VkKeyScanExW(WCHAR cChar, HKL dwhkl) /********************************************************************** * OemKeyScan (USER32.@) */ -DWORD WINAPI OemKeyScan(WORD wOemChar) +DWORD WINAPI OemKeyScan( WORD oem ) { - return wOemChar; + WCHAR wchr; + DWORD vkey, scan; + char oem_char = LOBYTE( oem ); + + if (!OemToCharBuffW( &oem_char, &wchr, 1 )) + return -1; + + vkey = VkKeyScanW( wchr ); + scan = MapVirtualKeyW( LOBYTE( vkey ), MAPVK_VK_TO_VSC ); + if (!scan) return -1; + + vkey &= 0xff00; + vkey <<= 8; + return vkey | scan; } /****************************************************************************** diff --git a/dlls/user32/tests/input.c b/dlls/user32/tests/input.c index 1813367..8e89481 100644 --- a/dlls/user32/tests/input.c +++ b/dlls/user32/tests/input.c @@ -53,6 +53,7 @@ #include "windef.h" #include "winbase.h" #include "winuser.h" +#include "winnls.h" #include "wine/test.h" @@ -2493,6 +2494,36 @@ static void test_GetKeyState(void) CloseHandle(semaphores[1]); } +static void test_OemKeyScan(void) +{ + DWORD ret, expect, vkey, scan; + WCHAR oem, wchr; + char oem_char; + + for (oem = 0; oem < 0x200; oem++) + { + ret = OemKeyScan( oem ); + + oem_char = LOBYTE( oem ); + if (!OemToCharBuffW( &oem_char, &wchr, 1 )) + expect = -1; + else + { + vkey = VkKeyScanW( wchr ); + scan = MapVirtualKeyW( LOBYTE( vkey ), MAPVK_VK_TO_VSC ); + if (!scan) + expect = -1; + else + { + vkey &= 0xff00; + vkey <<= 8; + expect = vkey | scan; + } + } + ok( ret == expect, "%04x: got %08x expected %08x\n", oem, ret, expect ); + } +} + START_TEST(input) { init_function_pointers(); @@ -2516,6 +2547,7 @@ START_TEST(input) test_key_names(); test_attach_input(); test_GetKeyState(); + test_OemKeyScan(); if(pGetMouseMovePointsEx) test_GetMouseMovePointsEx();
1
0
0
0
Huw Davies : user32: Use MB_USEGLYPHCHARS in OemToCharBuffW().
by Alexandre Julliard
22 Sep '16
22 Sep '16
Module: wine Branch: master Commit: ddc165850147735f8958212337db47636b8f935f URL:
http://source.winehq.org/git/wine.git/?a=commit;h=ddc165850147735f895821233…
Author: Huw Davies <huw(a)codeweavers.com> Date: Thu Sep 22 11:12:37 2016 +0100 user32: Use MB_USEGLYPHCHARS in OemToCharBuffW(). OemToCharBuffA() is more complicated and looks like it will require a custom table, so that is left as is. Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/user32/lstr.c | 2 +- dlls/user32/tests/text.c | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/dlls/user32/lstr.c b/dlls/user32/lstr.c index 42e55c0..80a2cfb 100644 --- a/dlls/user32/lstr.c +++ b/dlls/user32/lstr.c @@ -218,7 +218,7 @@ BOOL WINAPI OemToCharBuffA( LPCSTR s, LPSTR d, DWORD len ) BOOL WINAPI OemToCharBuffW( LPCSTR s, LPWSTR d, DWORD len ) { if (!s || !d) return FALSE; - MultiByteToWideChar( CP_OEMCP, 0, s, len, d, len ); + MultiByteToWideChar( CP_OEMCP, MB_PRECOMPOSED | MB_USEGLYPHCHARS, s, len, d, len ); return TRUE; } diff --git a/dlls/user32/tests/text.c b/dlls/user32/tests/text.c index bebf6a0..3cc9571 100644 --- a/dlls/user32/tests/text.c +++ b/dlls/user32/tests/text.c @@ -26,6 +26,7 @@ #include "wingdi.h" #include "winuser.h" #include "winerror.h" +#include "winnls.h" #define MODIFIED(rect) (rect.left == 10 && rect.right != 100 && rect.top == 10 && rect.bottom != 100) #define EMPTY(rect) (rect.left == rect.right && rect.bottom == rect.top) @@ -746,6 +747,8 @@ static void test_CharToOem_OemToChar(void) }; BOOL ret; int i; + char oem; + WCHAR uni, expect; for (i = 0; i < sizeof(tests)/sizeof(tests[0]); i++) { @@ -807,6 +810,15 @@ static void test_CharToOem_OemToChar(void) ok(ret == tests[i].ret, "test %d: expected %d, got %d\n", i, tests[i].ret, ret); ok(!lstrcmpW(buf, expected), "test %d: got '%s'\n", i, wine_dbgstr_w(buf)); } + + for (i = 0; i < 0x100; i++) + { + oem = i; + ret = OemToCharBuffW( &oem, &uni, 1 ); + ok( ret, "%02x: returns FALSE\n", i ); + MultiByteToWideChar( CP_OEMCP, MB_PRECOMPOSED | MB_USEGLYPHCHARS, &oem, 1, &expect, 1 ); + ok( uni == expect, "%02x: got %04x expected %04x\n", i, uni, expect ); + } } START_TEST(text)
1
0
0
0
Alexandre Julliard : winex11: Get rid of support for reigstering Win32 formats without a corresponding atom.
by Alexandre Julliard
22 Sep '16
22 Sep '16
Module: wine Branch: master Commit: 4415406020440bb088ff76898d6f51bf1c6d8b6e URL:
http://source.winehq.org/git/wine.git/?a=commit;h=4415406020440bb088ff76898…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Thu Sep 22 15:28:13 2016 +0900 winex11: Get rid of support for reigstering Win32 formats without a corresponding atom. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/winex11.drv/clipboard.c | 105 +++---------------------------------------- 1 file changed, 6 insertions(+), 99 deletions(-) diff --git a/dlls/winex11.drv/clipboard.c b/dlls/winex11.drv/clipboard.c index caa0348..0850448 100644 --- a/dlls/winex11.drv/clipboard.c +++ b/dlls/winex11.drv/clipboard.c @@ -464,106 +464,18 @@ void X11DRV_InitClipboard(void) /************************************************************************** - * intern_atoms - * - * Intern atoms for formats that don't have one yet. - */ -static void intern_atoms(void) -{ - LPWINE_CLIPFORMAT format; - int i, count, len; - char **names; - Atom *atoms; - Display *display; - WCHAR buffer[256]; - - count = 0; - LIST_FOR_EACH_ENTRY( format, &format_list, WINE_CLIPFORMAT, entry ) - if (!format->atom) count++; - if (!count) return; - - display = thread_init_display(); - - names = HeapAlloc( GetProcessHeap(), 0, count * sizeof(*names) ); - atoms = HeapAlloc( GetProcessHeap(), 0, count * sizeof(*atoms) ); - - i = 0; - LIST_FOR_EACH_ENTRY( format, &format_list, WINE_CLIPFORMAT, entry ) - if (!format->atom) { - if (GetClipboardFormatNameW( format->id, buffer, 256 ) > 0) - { - /* use defined format name */ - len = WideCharToMultiByte(CP_UNIXCP, 0, buffer, -1, NULL, 0, NULL, NULL); - } - else - { - /* create a name in the same way as ntdll/atom.c:integral_atom_name - * which is normally used by GetClipboardFormatNameW - */ - static const WCHAR fmt[] = {'#','%','u',0}; - len = sprintfW(buffer, fmt, format->id) + 1; - } - names[i] = HeapAlloc(GetProcessHeap(), 0, len); - WideCharToMultiByte(CP_UNIXCP, 0, buffer, -1, names[i++], len, NULL, NULL); - } - - XInternAtoms( display, names, count, False, atoms ); - - i = 0; - LIST_FOR_EACH_ENTRY( format, &format_list, WINE_CLIPFORMAT, entry ) - if (!format->atom) { - HeapFree(GetProcessHeap(), 0, names[i]); - format->atom = atoms[i++]; - } - - HeapFree( GetProcessHeap(), 0, names ); - HeapFree( GetProcessHeap(), 0, atoms ); -} - - -/************************************************************************** - * register_format - * - * Register a custom X clipboard format. - */ -static struct clipboard_format *register_format( UINT id, Atom prop ) -{ - struct clipboard_format *format = find_win32_format( id ); - - if (format) return format; - - if (!(format = HeapAlloc( GetProcessHeap(), 0, sizeof(*format) ))) return NULL; - format->id = id; - format->atom = prop; - format->import = import_data; - format->export = export_data; - list_add_tail( &format_list, &format->entry ); - - TRACE( "Registering format %s atom %ld\n", debugstr_format(id), prop ); - return format; -} - - -/************************************************************************** * X11DRV_CLIPBOARD_LookupProperty */ static struct clipboard_format *X11DRV_CLIPBOARD_LookupProperty( struct clipboard_format *current, Atom prop ) { - for (;;) - { - struct list *ptr = current ? ¤t->entry : &format_list; - BOOL need_intern = FALSE; + struct list *ptr = current ? ¤t->entry : &format_list; - while ((ptr = list_next( &format_list, ptr ))) - { - struct clipboard_format *format = LIST_ENTRY( ptr, struct clipboard_format, entry ); - if (format->atom == prop) return format; - if (!format->atom) need_intern = TRUE; - } - if (!need_intern) return NULL; - intern_atoms(); - /* restart the search for the new atoms */ + while ((ptr = list_next( &format_list, ptr ))) + { + struct clipboard_format *format = LIST_ENTRY( ptr, struct clipboard_format, entry ); + if (format->atom == prop) return format; } + return NULL; } @@ -635,9 +547,6 @@ static BOOL X11DRV_CLIPBOARD_InsertClipboardData(UINT wFormatID, HANDLE hData, TRACE("format=%04x lpData=%p hData=%p lpFormat=%p override=%d\n", wFormatID, lpData, hData, lpFormat, override); - /* make sure the format exists */ - if (!lpFormat) register_format( wFormatID, 0 ); - if (lpData && !override) return TRUE; @@ -1851,8 +1760,6 @@ static BOOL export_targets( Display *display, Window win, Atom prop, Atom target UINT pos, count, *formats; Atom *targets; - intern_atoms(); - if (!(formats = get_clipboard_formats( &count ))) return FALSE; /* the builtin formats contain duplicates, so allocate some extra space */
1
0
0
0
Alexandre Julliard : winex11: Add helper functions to find and register X11 clipboard formats.
by Alexandre Julliard
22 Sep '16
22 Sep '16
Module: wine Branch: master Commit: 242673589b792f8eda1bf2d621000238e6d87ff2 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=242673589b792f8eda1bf2d62…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Thu Sep 22 15:04:33 2016 +0900 winex11: Add helper functions to find and register X11 clipboard formats. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/winex11.drv/clipboard.c | 135 +++++++++++++++++++++++-------------------- 1 file changed, 73 insertions(+), 62 deletions(-) diff --git a/dlls/winex11.drv/clipboard.c b/dlls/winex11.drv/clipboard.c index 34ca1bd..caa0348 100644 --- a/dlls/winex11.drv/clipboard.c +++ b/dlls/winex11.drv/clipboard.c @@ -305,6 +305,17 @@ static const char *debugstr_xatom( Atom atom ) } +static int is_atom_error( Display *display, XErrorEvent *event, void *arg ) +{ + return (event->error_code == BadAtom); +} + +static int is_window_error( Display *display, XErrorEvent *event, void *arg ) +{ + return (event->error_code == BadWindow); +} + + /************************************************************************** * find_win32_format */ @@ -319,6 +330,19 @@ static struct clipboard_format *find_win32_format( UINT id ) /************************************************************************** + * find_x11_format + */ +static struct clipboard_format *find_x11_format( Atom atom ) +{ + struct clipboard_format *format; + + LIST_FOR_EACH_ENTRY( format, &format_list, struct clipboard_format, entry ) + if (format->atom == atom) return format; + return NULL; +} + + +/************************************************************************** * register_formats */ static void register_formats( const UINT *ids, const Atom *atoms, unsigned int count ) @@ -374,6 +398,47 @@ static void register_win32_formats( const UINT *ids, UINT size ) /************************************************************************** + * register_x11_formats + * + * Register X11 atom formats the first time we encounter them. + */ +static void register_x11_formats( const Atom *atoms, UINT size ) +{ + Display *display = thread_display(); + unsigned int i, pos, count; + char *names[256]; + UINT ids[256]; + Atom new_atoms[256]; + WCHAR buffer[256]; + + while (size) + { + for (count = 0; count < 256 && size; atoms++, size--) + if (!find_x11_format( *atoms )) new_atoms[count++] = *atoms; + + if (!count) return; + + X11DRV_expect_error( display, is_atom_error, NULL ); + if (!XGetAtomNames( display, new_atoms, count, names )) count = 0; + if (X11DRV_check_error()) + { + WARN( "got some bad atoms, ignoring\n" ); + count = 0; + } + + for (i = pos = 0; i < count; i++) + { + if (MultiByteToWideChar( CP_UNIXCP, 0, names[i], -1, buffer, 256 ) && + (ids[pos] = RegisterClipboardFormatW( buffer ))) + new_atoms[pos++] = new_atoms[i]; + XFree( names[i] ); + } + register_formats( ids, new_atoms, pos ); + } +} + + +/************************************************************************** * X11DRV_InitClipboard */ void X11DRV_InitClipboard(void) @@ -1342,9 +1407,11 @@ void X11DRV_CLIPBOARD_ImportSelection( Display *display, Window win, Atom select HANDLE handle; struct clipboard_format *format; + register_x11_formats( targets, count ); + for (i = 0; i < count; i++) { - if (!(format = X11DRV_CLIPBOARD_LookupProperty( NULL, targets[i] ))) continue; + if (!(format = find_x11_format( targets[i] ))) continue; if (!format->id) continue; if (!(handle = import_selection( display, win, selection, format ))) continue; callback( targets[i], format->id, handle ); @@ -1898,16 +1965,6 @@ static BOOL export_multiple( Display *display, Window win, Atom prop, Atom targe } -static int is_atom_error( Display *display, XErrorEvent *event, void *arg ) -{ - return (event->error_code == BadAtom); -} - -static int is_window_error( Display *display, XErrorEvent *event, void *arg ) -{ - return (event->error_code == BadWindow); -} - /************************************************************************** * import_targets * @@ -1915,13 +1972,13 @@ static int is_window_error( Display *display, XErrorEvent *event, void *arg ) */ static HANDLE import_targets( Atom type, const void *data, size_t size ) { - UINT count = size / sizeof(Atom); + UINT i, count = size / sizeof(Atom); const Atom *properties = data; - UINT i, nb_atoms = 0; - Atom *atoms = NULL; if (type != XA_ATOM && type != x11drv_atom(TARGETS)) return 0; + register_x11_formats( properties, count ); + /* Cache these formats in the clipboard cache */ for (i = 0; i < count; i++) { @@ -1944,54 +2001,8 @@ static HANDLE import_targets( Atom type, const void *data, size_t size ) lpFormat = X11DRV_CLIPBOARD_LookupProperty(lpFormat, properties[i]); } } - else if (properties[i]) - { - /* add it to the list of atoms that we don't know about yet */ - if (!atoms) atoms = HeapAlloc( GetProcessHeap(), 0, - (count - i) * sizeof(*atoms) ); - if (atoms) atoms[nb_atoms++] = properties[i]; - } } - /* query all unknown atoms in one go */ - if (atoms) - { - char **names = HeapAlloc( GetProcessHeap(), 0, nb_atoms * sizeof(*names) ); - if (names) - { - Display *display = thread_display(); - - X11DRV_expect_error( display, is_atom_error, NULL ); - if (!XGetAtomNames( display, atoms, nb_atoms, names )) nb_atoms = 0; - if (X11DRV_check_error()) - { - WARN( "got some bad atoms, ignoring\n" ); - nb_atoms = 0; - } - for (i = 0; i < nb_atoms; i++) - { - WINE_CLIPFORMAT *lpFormat; - LPWSTR wname; - int len = MultiByteToWideChar(CP_UNIXCP, 0, names[i], -1, NULL, 0); - wname = HeapAlloc(GetProcessHeap(), 0, len*sizeof(WCHAR)); - MultiByteToWideChar(CP_UNIXCP, 0, names[i], -1, wname, len); - - lpFormat = register_format( RegisterClipboardFormatW(wname), atoms[i] ); - HeapFree(GetProcessHeap(), 0, wname); - if (!lpFormat) - { - ERR("Failed to register %s property. Type will not be cached.\n", names[i]); - continue; - } - TRACE( "property %s -> format %s\n", - debugstr_xatom( lpFormat->atom ), debugstr_format( lpFormat->id )); - X11DRV_CLIPBOARD_InsertClipboardData( lpFormat->id, 0, lpFormat, FALSE ); - } - for (i = 0; i < nb_atoms; i++) XFree( names[i] ); - HeapFree( GetProcessHeap(), 0, names ); - } - HeapFree( GetProcessHeap(), 0, atoms ); - } return (HANDLE)1; } @@ -2027,7 +2038,7 @@ static int X11DRV_CLIPBOARD_QueryAvailableData(Display *display) if ((use_primary_selection && XGetSelectionOwner(display,XA_PRIMARY)) || XGetSelectionOwner(display,x11drv_atom(CLIPBOARD))) { - struct clipboard_format *format = X11DRV_CLIPBOARD_LookupProperty( NULL, x11drv_atom(TARGETS) ); + struct clipboard_format *format = find_x11_format( x11drv_atom(TARGETS) ); assert( format ); if (use_primary_selection && import_selection( display, w, XA_PRIMARY, format )) @@ -2038,7 +2049,7 @@ static int X11DRV_CLIPBOARD_QueryAvailableData(Display *display) { HANDLE handle; - format = X11DRV_CLIPBOARD_LookupProperty( NULL, XA_STRING ); + format = find_x11_format( XA_STRING ); assert( format ); /* Selection Owner doesn't understand TARGETS, try retrieving XA_STRING */ if (use_primary_selection && (handle = import_selection( display, w, XA_PRIMARY, format )))
1
0
0
0
Alexandre Julliard : winex11: Add helper functions to find and register Win32 clipboard formats.
by Alexandre Julliard
22 Sep '16
22 Sep '16
Module: wine Branch: master Commit: f4f6353079fe16d164f207422573d3ef93f78177 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=f4f6353079fe16d164f207422…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Thu Sep 22 13:13:25 2016 +0900 winex11: Add helper functions to find and register Win32 clipboard formats. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/winex11.drv/clipboard.c | 76 +++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 72 insertions(+), 4 deletions(-) diff --git a/dlls/winex11.drv/clipboard.c b/dlls/winex11.drv/clipboard.c index d7480ae..34ca1bd 100644 --- a/dlls/winex11.drv/clipboard.c +++ b/dlls/winex11.drv/clipboard.c @@ -304,6 +304,75 @@ static const char *debugstr_xatom( Atom atom ) return ret; } + +/************************************************************************** + * find_win32_format + */ +static struct clipboard_format *find_win32_format( UINT id ) +{ + struct clipboard_format *format; + + LIST_FOR_EACH_ENTRY( format, &format_list, struct clipboard_format, entry ) + if (format->id == id) return format; + return NULL; +} + + +/************************************************************************** + * register_formats + */ +static void register_formats( const UINT *ids, const Atom *atoms, unsigned int count ) +{ + struct clipboard_format *formats; + unsigned int i; + + if (!(formats = HeapAlloc( GetProcessHeap(), 0, count * sizeof(*formats)))) return; + + for (i = 0; i < count; i++) + { + formats[i].id = ids[i]; + formats[i].atom = atoms[i]; + formats[i].import = import_data; + formats[i].export = export_data; + list_add_tail( &format_list, &formats[i].entry ); + TRACE( "registered %s atom %s\n", debugstr_format( ids[i] ), debugstr_xatom( atoms[i] )); + } +} + + +/************************************************************************** + * register_win32_formats + * + * Register Win32 clipboard formats the first time we encounter them. + */ +static void register_win32_formats( const UINT *ids, UINT size ) +{ + unsigned int count, len; + UINT new_ids[256]; + char *names[256]; + Atom atoms[256]; + WCHAR buffer[256]; + + while (size) + { + for (count = 0; count < 256 && size; ids++, size--) + { + if (find_win32_format( *ids )) continue; /* it already exists */ + if (!GetClipboardFormatNameW( *ids, buffer, 256 )) continue; /* not a named format */ + if (!(len = WideCharToMultiByte( CP_UNIXCP, 0, buffer, -1, NULL, 0, NULL, NULL ))) continue; + if (!(names[count] = HeapAlloc( GetProcessHeap(), 0, len ))) continue; + WideCharToMultiByte( CP_UNIXCP, 0, buffer, -1, names[count], len, NULL, NULL ); + new_ids[count++] = *ids; + } + if (!count) return; + + XInternAtoms( thread_display(), names, count, False, atoms ); + register_formats( new_ids, atoms, count ); + while (count) HeapFree( GetProcessHeap(), 0, names[--count] ); + } +} + + /************************************************************************** * X11DRV_InitClipboard */ @@ -394,11 +463,9 @@ static void intern_atoms(void) */ static struct clipboard_format *register_format( UINT id, Atom prop ) { - struct clipboard_format *format; + struct clipboard_format *format = find_win32_format( id ); - /* walk format chain to see if it's already registered */ - LIST_FOR_EACH_ENTRY( format, &format_list, struct clipboard_format, entry ) - if (format->id == id) return format; + if (format) return format; if (!(format = HeapAlloc( GetProcessHeap(), 0, sizeof(*format) ))) return NULL; format->id = id; @@ -1688,6 +1755,7 @@ static UINT *get_clipboard_formats( UINT *size ) HeapFree( GetProcessHeap(), 0, ids ); if (GetLastError() != ERROR_INSUFFICIENT_BUFFER) return NULL; } + register_win32_formats( ids, *size ); return ids; }
1
0
0
0
Alexandre Julliard : winex11: Support import multiple drag&drop properties in a single call.
by Alexandre Julliard
22 Sep '16
22 Sep '16
Module: wine Branch: master Commit: 80d02bc849e2a16bfda6fe3b7181c35511030d85 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=80d02bc849e2a16bfda6fe3b7…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Thu Sep 22 13:07:44 2016 +0900 winex11: Support import multiple drag&drop properties in a single call. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/winex11.drv/clipboard.c | 20 ++++++++++++++------ dlls/winex11.drv/x11drv.h | 5 +++-- dlls/winex11.drv/xdnd.c | 22 ++++------------------ 3 files changed, 21 insertions(+), 26 deletions(-) diff --git a/dlls/winex11.drv/clipboard.c b/dlls/winex11.drv/clipboard.c index 8457a03..d7480ae 100644 --- a/dlls/winex11.drv/clipboard.c +++ b/dlls/winex11.drv/clipboard.c @@ -1267,13 +1267,21 @@ static HANDLE import_selection( Display *display, Window win, Atom selection, * * Import the X selection into the clipboard format registered for the given X target. */ -HANDLE X11DRV_CLIPBOARD_ImportSelection( Display *display, Window win, Atom selection, - Atom target, UINT *windowsFormat ) +void X11DRV_CLIPBOARD_ImportSelection( Display *display, Window win, Atom selection, + Atom *targets, UINT count, + void (*callback)( Atom, UINT, HANDLE )) { - struct clipboard_format *format = X11DRV_CLIPBOARD_LookupProperty( NULL, target ); - if (!format) return 0; - *windowsFormat = format->id; - return import_selection( display, win, selection, format ); + UINT i; + HANDLE handle; + struct clipboard_format *format; + + for (i = 0; i < count; i++) + { + if (!(format = X11DRV_CLIPBOARD_LookupProperty( NULL, targets[i] ))) continue; + if (!format->id) continue; + if (!(handle = import_selection( display, win, selection, format ))) continue; + callback( targets[i], format->id, handle ); + } } diff --git a/dlls/winex11.drv/x11drv.h b/dlls/winex11.drv/x11drv.h index 48f3999..d88e65b 100644 --- a/dlls/winex11.drv/x11drv.h +++ b/dlls/winex11.drv/x11drv.h @@ -239,8 +239,9 @@ extern void X11DRV_XDND_EnterEvent( HWND hWnd, XClientMessageEvent *event ) DECL extern void X11DRV_XDND_PositionEvent( HWND hWnd, XClientMessageEvent *event ) DECLSPEC_HIDDEN; extern void X11DRV_XDND_DropEvent( HWND hWnd, XClientMessageEvent *event ) DECLSPEC_HIDDEN; extern void X11DRV_XDND_LeaveEvent( HWND hWnd, XClientMessageEvent *event ) DECLSPEC_HIDDEN; -extern HANDLE X11DRV_CLIPBOARD_ImportSelection( Display *display, Window win, Atom selection, - Atom target, UINT *windowsFormat ) DECLSPEC_HIDDEN; +extern void X11DRV_CLIPBOARD_ImportSelection( Display *display, Window win, Atom selection, + Atom *targets, UINT count, + void (*callback)( Atom, UINT, HANDLE )) DECLSPEC_HIDDEN; /************************************************************************** * X11 GDI driver diff --git a/dlls/winex11.drv/xdnd.c b/dlls/winex11.drv/xdnd.c index eb9b117..2ab28e4 100644 --- a/dlls/winex11.drv/xdnd.c +++ b/dlls/winex11.drv/xdnd.c @@ -67,7 +67,7 @@ static HWND XDNDLastTargetWnd; /* might be an ancestor of XDNDLastTargetWnd */ static HWND XDNDLastDropTargetWnd; -static void X11DRV_XDND_InsertXDNDData(int property, int format, HANDLE contents); +static void X11DRV_XDND_InsertXDNDData( Atom property, UINT format, HANDLE contents ); static void X11DRV_XDND_ResolveProperty(Display *display, Window xwin, Time tm, Atom *types, unsigned long count); static BOOL X11DRV_XDND_HasHDROP(void); @@ -492,7 +492,6 @@ void X11DRV_XDND_LeaveEvent( HWND hWnd, XClientMessageEvent *event ) static void X11DRV_XDND_ResolveProperty(Display *display, Window xwin, Time tm, Atom *types, unsigned long count) { - unsigned int i; XDNDDATA *current, *next; BOOL haveHDROP = FALSE; @@ -500,21 +499,8 @@ static void X11DRV_XDND_ResolveProperty(Display *display, Window xwin, Time tm, X11DRV_XDND_FreeDragDropOp(); /* Clear previously cached data */ - for (i = 0; i < count; i++) - { - HANDLE contents; - UINT windowsFormat; - - TRACE("requesting atom %ld from xwin %ld\n", types[i], xwin); - - if (types[i] == 0) - continue; - - contents = X11DRV_CLIPBOARD_ImportSelection( display, xwin, x11drv_atom(XdndSelection), - types[i], &windowsFormat ); - if (contents) - X11DRV_XDND_InsertXDNDData(types[i], windowsFormat, contents); - } + X11DRV_CLIPBOARD_ImportSelection( display, xwin, x11drv_atom(XdndSelection), + types, count, X11DRV_XDND_InsertXDNDData ); /* On Windows when there is a CF_HDROP, there are no other CF_ formats. * foobar2000 relies on this (spaces -> %20's without it). @@ -547,7 +533,7 @@ static void X11DRV_XDND_ResolveProperty(Display *display, Window xwin, Time tm, * * Cache available XDND property */ -static void X11DRV_XDND_InsertXDNDData(int property, int format, HANDLE contents) +static void X11DRV_XDND_InsertXDNDData( Atom property, UINT format, HANDLE contents ) { LPXDNDDATA current = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(XDNDDATA));
1
0
0
0
Alexandre Julliard : winex11: Use a standard import function to retrieve the TARGETS property.
by Alexandre Julliard
22 Sep '16
22 Sep '16
Module: wine Branch: master Commit: 7f39cc3f2be27d849089b333daa2e4a842d17b3e URL:
http://source.winehq.org/git/wine.git/?a=commit;h=7f39cc3f2be27d849089b333d…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Thu Sep 22 12:50:34 2016 +0900 winex11: Use a standard import function to retrieve the TARGETS property. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/winex11.drv/clipboard.c | 83 ++++++++++++++------------------------------ 1 file changed, 27 insertions(+), 56 deletions(-) diff --git a/dlls/winex11.drv/clipboard.c b/dlls/winex11.drv/clipboard.c index dcb1403..8457a03 100644 --- a/dlls/winex11.drv/clipboard.c +++ b/dlls/winex11.drv/clipboard.c @@ -135,6 +135,7 @@ static HANDLE import_string( Atom type, const void *data, size_t size ); static HANDLE import_utf8_string( Atom type, const void *data, size_t size ); static HANDLE import_compound_text( Atom type, const void *data, size_t size ); static HANDLE import_text_uri_list( Atom type, const void *data, size_t size ); +static HANDLE import_targets( Atom type, const void *data, size_t size ); static BOOL export_data( Display *display, Window win, Atom prop, Atom target, HANDLE handle ); static BOOL export_string( Display *display, Window win, Atom prop, Atom target, HANDLE handle ); @@ -206,7 +207,7 @@ static const struct { PNGW, 0, XATOM_image_png, import_data, export_data }, { HTMLFormatW, 0, XATOM_HTML_Format, import_data, export_data }, { HTMLFormatW, 0, XATOM_text_html, import_data, export_text_html }, - { 0, 0, XATOM_TARGETS, NULL, export_targets }, + { 0, 0, XATOM_TARGETS, import_targets, export_targets }, { 0, 0, XATOM_MULTIPLE, NULL, export_multiple }, }; @@ -1832,14 +1833,18 @@ static int is_window_error( Display *display, XErrorEvent *event, void *arg ) } /************************************************************************** - * X11DRV_CLIPBOARD_InsertSelectionProperties + * import_targets * - * Mark properties available for future retrieval. + * Import TARGETS and mark the corresponding clipboard formats as available. */ -static VOID X11DRV_CLIPBOARD_InsertSelectionProperties(Display *display, Atom* properties, UINT count) +static HANDLE import_targets( Atom type, const void *data, size_t size ) { - UINT i, nb_atoms = 0; - Atom *atoms = NULL; + UINT count = size / sizeof(Atom); + const Atom *properties = data; + UINT i, nb_atoms = 0; + Atom *atoms = NULL; + + if (type != XA_ATOM && type != x11drv_atom(TARGETS)) return 0; /* Cache these formats in the clipboard cache */ for (i = 0; i < count; i++) @@ -1878,6 +1883,8 @@ static VOID X11DRV_CLIPBOARD_InsertSelectionProperties(Display *display, Atom* p char **names = HeapAlloc( GetProcessHeap(), 0, nb_atoms * sizeof(*names) ); if (names) { + Display *display = thread_display(); + X11DRV_expect_error( display, is_atom_error, NULL ); if (!XGetAtomNames( display, atoms, nb_atoms, names )) nb_atoms = 0; if (X11DRV_check_error()) @@ -1909,6 +1916,7 @@ static VOID X11DRV_CLIPBOARD_InsertSelectionProperties(Display *display, Atom* p } HeapFree( GetProcessHeap(), 0, atoms ); } + return (HANDLE)1; } @@ -1921,13 +1929,7 @@ static VOID X11DRV_CLIPBOARD_InsertSelectionProperties(Display *display, Atom* p */ static int X11DRV_CLIPBOARD_QueryAvailableData(Display *display) { - Atom atype=AnyPropertyType; - int aformat; - unsigned long remain; - Atom* targetList=NULL; Window w; - unsigned long cSelectionTargets = 0; - Atom prop; if (selectionAcquired & (S_PRIMARY | S_CLIPBOARD)) { @@ -1949,26 +1951,29 @@ static int X11DRV_CLIPBOARD_QueryAvailableData(Display *display) if ((use_primary_selection && XGetSelectionOwner(display,XA_PRIMARY)) || XGetSelectionOwner(display,x11drv_atom(CLIPBOARD))) { - if (use_primary_selection && (prop = convert_selection( display, w, XA_PRIMARY, x11drv_atom(TARGETS) ))) + struct clipboard_format *format = X11DRV_CLIPBOARD_LookupProperty( NULL, x11drv_atom(TARGETS) ); + + assert( format ); + if (use_primary_selection && import_selection( display, w, XA_PRIMARY, format )) selectionCacheSrc = XA_PRIMARY; - else if ((prop = convert_selection( display, w, x11drv_atom(CLIPBOARD), x11drv_atom(TARGETS) ))) + else if (import_selection( display, w, x11drv_atom(CLIPBOARD), format )) selectionCacheSrc = x11drv_atom(CLIPBOARD); else { - Atom xstr = XA_STRING; + HANDLE handle; + format = X11DRV_CLIPBOARD_LookupProperty( NULL, XA_STRING ); + assert( format ); /* Selection Owner doesn't understand TARGETS, try retrieving XA_STRING */ - if (convert_selection( display, w, XA_PRIMARY, XA_STRING )) + if (use_primary_selection && (handle = import_selection( display, w, XA_PRIMARY, format ))) { - X11DRV_CLIPBOARD_InsertSelectionProperties(display, &xstr, 1); + X11DRV_CLIPBOARD_InsertClipboardData( format->id, handle, format, TRUE ); selectionCacheSrc = XA_PRIMARY; - return 1; } - else if (convert_selection( display, w, x11drv_atom(CLIPBOARD), XA_STRING )) + else if ((handle = import_selection( display, w, x11drv_atom(CLIPBOARD), format ))) { - X11DRV_CLIPBOARD_InsertSelectionProperties(display, &xstr, 1); + X11DRV_CLIPBOARD_InsertClipboardData( format->id, handle, format, TRUE ); selectionCacheSrc = x11drv_atom(CLIPBOARD); - return 1; } else { @@ -1976,43 +1981,9 @@ static int X11DRV_CLIPBOARD_QueryAvailableData(Display *display) return -1; } } + return 1; } else return 0; /* No selection owner so report 0 targets available */ - - /* Read the TARGETS property contents */ - if (!XGetWindowProperty(display, w, prop, - 0, 0x3FFF, True, AnyPropertyType/*XA_ATOM*/, &atype, &aformat, &cSelectionTargets, - &remain, (unsigned char**)&targetList)) - { - TRACE( "type %s format %d count %ld remain %ld\n", - debugstr_xatom( atype ), aformat, cSelectionTargets, remain); - /* - * The TARGETS property should have returned us a list of atoms - * corresponding to each selection target format supported. - */ - if (atype == XA_ATOM || atype == x11drv_atom(TARGETS)) - { - if (aformat == 32) - { - X11DRV_CLIPBOARD_InsertSelectionProperties(display, targetList, cSelectionTargets); - } - else if (aformat == 8) /* work around quartz-wm brain damage */ - { - unsigned long i, count = cSelectionTargets / sizeof(CARD32); - Atom *atoms = HeapAlloc( GetProcessHeap(), 0, count * sizeof(Atom) ); - for (i = 0; i < count; i++) - atoms[i] = ((CARD32 *)targetList)[i]; /* FIXME: byte swapping */ - X11DRV_CLIPBOARD_InsertSelectionProperties( display, atoms, count ); - HeapFree( GetProcessHeap(), 0, atoms ); - } - } - - /* Free the list of targets */ - XFree(targetList); - } - else WARN("Failed to read TARGETS property\n"); - - return cSelectionTargets; }
1
0
0
0
Sebastian Lackner : server: Allow to create win32 prefix when directory already exists.
by Alexandre Julliard
22 Sep '16
22 Sep '16
Module: wine Branch: master Commit: 808619b72d1524df2c576ed5faac67dd2093c0f3 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=808619b72d1524df2c576ed5f…
Author: Sebastian Lackner <sebastian(a)fds-team.de> Date: Wed Sep 21 15:24:38 2016 +0200 server: Allow to create win32 prefix when directory already exists. Signed-off-by: Sebastian Lackner <sebastian(a)fds-team.de> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntdll/server.c | 11 ----------- server/registry.c | 8 +++++++- 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/dlls/ntdll/server.c b/dlls/ntdll/server.c index 356d631..25c6473 100644 --- a/dlls/ntdll/server.c +++ b/dlls/ntdll/server.c @@ -1139,17 +1139,6 @@ static void setup_config_dir(void) mkdir( config_dir, 0777 ); if (chdir( config_dir ) == -1) fatal_perror( "chdir to %s\n", config_dir ); - if ((p = getenv( "WINEARCH" )) && !strcmp( p, "win32" )) - { - /* force creation of a 32-bit prefix */ - int fd = open( "system.reg", O_WRONLY | O_CREAT | O_EXCL, 0666 ); - if (fd != -1) - { - static const char regfile[] = "WINE REGISTRY Version 2\n\n#arch=win32\n"; - write( fd, regfile, sizeof(regfile) - 1 ); - close( fd ); - } - } MESSAGE( "wine: created the configuration directory '%s'\n", config_dir ); } diff --git a/server/registry.c b/server/registry.c index 97b16ed..0731b22 100644 --- a/server/registry.c +++ b/server/registry.c @@ -1805,6 +1805,7 @@ void init_registry(void) WCHAR *current_user_path; struct unicode_str current_user_str; struct key *key, *hklm, *hkcu; + char *p; /* switch to the config dir */ @@ -1821,7 +1822,12 @@ void init_registry(void) fatal_error( "could not create Machine registry key\n" ); if (!load_init_registry_from_file( "system.reg", hklm )) - prefix_type = sizeof(void *) > sizeof(int) ? PREFIX_64BIT : PREFIX_32BIT; + { + if ((p = getenv( "WINEARCH" )) && !strcmp( p, "win32" )) + prefix_type = PREFIX_32BIT; + else + prefix_type = sizeof(void *) > sizeof(int) ? PREFIX_64BIT : PREFIX_32BIT; + } else if (prefix_type == PREFIX_UNKNOWN) prefix_type = PREFIX_32BIT;
1
0
0
0
← Newer
1
...
9
10
11
12
13
14
15
...
43
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
Results per page:
10
25
50
100
200