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
February 2020
----- 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
874 discussions
Start a n
N
ew thread
Alexandre Julliard : ntdll: Use external codepage tables for the Unix codepage too.
by Alexandre Julliard
11 Feb '20
11 Feb '20
Module: wine Branch: master Commit: 9b01eda7c8ab4d544d612ef0cf270dce94d1893b URL:
https://source.winehq.org/git/wine.git/?a=commit;h=9b01eda7c8ab4d544d612ef0…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Tue Feb 11 09:15:19 2020 +0100 ntdll: Use external codepage tables for the Unix codepage too. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntdll/directory.c | 57 ++++++++++--------------- dlls/ntdll/env.c | 19 ++++----- dlls/ntdll/file.c | 2 +- dlls/ntdll/locale.c | 109 ++++++++++++++++++++++++++++++++++++++---------- dlls/ntdll/ntdll_misc.h | 5 +-- dlls/ntdll/path.c | 28 +++++-------- dlls/ntdll/process.c | 10 ++--- 7 files changed, 136 insertions(+), 94 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=9b01eda7c8ab4d544d61…
1
0
0
0
Alexandre Julliard : unicode: Generate nls files for the codepage tables.
by Alexandre Julliard
11 Feb '20
11 Feb '20
Module: wine Branch: master Commit: fb316c337722f81dc5cce89fd292125545a2b9c6 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=fb316c337722f81dc5cce89f…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Tue Feb 11 09:06:45 2020 +0100 unicode: Generate nls files for the codepage tables. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntdll/locale.c | 93 +-------------------------------------------------- loader/wine.inf.in | 65 +++++++++++++++++++++++++++++++++++ nls/Makefile.in | 65 +++++++++++++++++++++++++++++++++++ nls/c_037.nls | Bin 0 -> 66082 bytes nls/c_10000.nls | Bin 0 -> 66082 bytes nls/c_10001.nls | Bin 0 -> 162850 bytes nls/c_10002.nls | Bin 0 -> 195618 bytes nls/c_10003.nls | Bin 0 -> 177698 bytes nls/c_10004.nls | Bin 0 -> 66082 bytes nls/c_10005.nls | Bin 0 -> 66082 bytes nls/c_10006.nls | Bin 0 -> 66082 bytes nls/c_10007.nls | Bin 0 -> 66082 bytes nls/c_10008.nls | Bin 0 -> 173602 bytes nls/c_10010.nls | Bin 0 -> 66082 bytes nls/c_10017.nls | Bin 0 -> 66082 bytes nls/c_10021.nls | Bin 0 -> 66082 bytes nls/c_10029.nls | Bin 0 -> 66082 bytes nls/c_10079.nls | Bin 0 -> 66082 bytes nls/c_10081.nls | Bin 0 -> 66082 bytes nls/c_10082.nls | Bin 0 -> 66082 bytes nls/c_1026.nls | Bin 0 -> 66082 bytes nls/c_1250.nls | Bin 0 -> 66082 bytes nls/c_1251.nls | Bin 0 -> 66082 bytes nls/c_1252.nls | Bin 0 -> 66082 bytes nls/c_1253.nls | Bin 0 -> 66082 bytes nls/c_1254.nls | Bin 0 -> 66082 bytes nls/c_1255.nls | Bin 0 -> 66082 bytes nls/c_1256.nls | Bin 0 -> 66082 bytes nls/c_1257.nls | Bin 0 -> 66082 bytes nls/c_1258.nls | Bin 0 -> 66082 bytes nls/c_1361.nls | Bin 0 -> 189986 bytes nls/c_20127.nls | Bin 0 -> 66082 bytes nls/c_20866.nls | Bin 0 -> 66082 bytes nls/c_20932.nls | Bin 0 -> 180770 bytes nls/c_21866.nls | Bin 0 -> 66082 bytes nls/c_28591.nls | Bin 0 -> 66082 bytes nls/c_28592.nls | Bin 0 -> 66082 bytes nls/c_28593.nls | Bin 0 -> 66082 bytes nls/c_28594.nls | Bin 0 -> 66082 bytes nls/c_28595.nls | Bin 0 -> 66082 bytes nls/c_28596.nls | Bin 0 -> 66082 bytes nls/c_28597.nls | Bin 0 -> 66082 bytes nls/c_28598.nls | Bin 0 -> 66082 bytes nls/c_28599.nls | Bin 0 -> 66082 bytes nls/c_28603.nls | Bin 0 -> 66082 bytes nls/c_28605.nls | Bin 0 -> 66082 bytes nls/c_437.nls | Bin 0 -> 66594 bytes nls/c_500.nls | Bin 0 -> 66082 bytes nls/c_737.nls | Bin 0 -> 66594 bytes nls/c_775.nls | Bin 0 -> 66594 bytes nls/c_850.nls | Bin 0 -> 66594 bytes nls/c_852.nls | Bin 0 -> 66594 bytes nls/c_855.nls | Bin 0 -> 66594 bytes nls/c_857.nls | Bin 0 -> 66594 bytes nls/c_860.nls | Bin 0 -> 66594 bytes nls/c_861.nls | Bin 0 -> 66594 bytes nls/c_862.nls | Bin 0 -> 66594 bytes nls/c_863.nls | Bin 0 -> 66594 bytes nls/c_864.nls | Bin 0 -> 66594 bytes nls/c_865.nls | Bin 0 -> 66594 bytes nls/c_866.nls | Bin 0 -> 66594 bytes nls/c_869.nls | Bin 0 -> 66594 bytes nls/c_874.nls | Bin 0 -> 66594 bytes nls/c_875.nls | Bin 0 -> 66082 bytes nls/c_932.nls | Bin 0 -> 162850 bytes nls/c_936.nls | Bin 0 -> 196642 bytes nls/c_949.nls | Bin 0 -> 196642 bytes nls/c_950.nls | Bin 0 -> 196642 bytes tools/make_makefiles | 13 +++++-- tools/make_unicode | 78 ++++++++++++++++++++++++++++++++++++++++-- 70 files changed, 217 insertions(+), 97 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=fb316c337722f81dc5cc…
1
0
0
0
Alexandre Julliard : makefiles: Move l_intl.nls to a new nls directory.
by Alexandre Julliard
11 Feb '20
11 Feb '20
Module: wine Branch: master Commit: 42a30a693a8e9a75dfec95e67635ea140d4db877 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=42a30a693a8e9a75dfec95e6…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Tue Feb 11 09:01:27 2020 +0100 makefiles: Move l_intl.nls to a new nls directory. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- Makefile.in | 1 + configure | 4 +++- configure.ac | 3 ++- dlls/ntdll/locale.c | 10 ++++------ loader/Makefile.in | 1 - loader/wine.inf.in | 27 +++++++++++++++------------ nls/Makefile.in | 2 ++ {loader => nls}/l_intl.nls | Bin tools/make_makefiles | 13 +++++++++++++ tools/make_unicode | 2 +- tools/makedep.c | 2 +- 11 files changed, 42 insertions(+), 23 deletions(-) diff --git a/Makefile.in b/Makefile.in index fb67236b68..0e9b50c8f5 100644 --- a/Makefile.in +++ b/Makefile.in @@ -28,6 +28,7 @@ datadir = @datadir@ mandir = @mandir@ includedir = @includedir@ fontdir = ${datadir}/wine/fonts +nlsdir = ${datadir}/wine/nls dlldir = ${libdir}/wine top_srcdir = @top_srcdir@ top_builddir = @top_builddir@ diff --git a/configure b/configure index 9f23d268e8..2f9654fca0 100755 --- a/configure +++ b/configure @@ -1714,6 +1714,7 @@ enable_port enable_wine enable_wpp enable_loader +enable_nls enable_po enable_arp enable_aspnet_regiis @@ -21064,6 +21065,7 @@ wine_fn_config_makefile libs/port enable_port wine_fn_config_makefile libs/wine enable_wine wine_fn_config_makefile libs/wpp enable_wpp wine_fn_config_makefile loader enable_loader +wine_fn_config_makefile nls enable_nls wine_fn_config_makefile po enable_po wine_fn_config_makefile programs/arp enable_arp wine_fn_config_makefile programs/aspnet_regiis enable_aspnet_regiis @@ -21250,10 +21252,10 @@ else TOP_INSTALL_DEV="$TOP_INSTALL_DEV include" TOP_INSTALL_LIB="$TOP_INSTALL_LIB \ fonts \ -loader/l_intl.nls \ loader/wine.inf \ loader/winebus.inf \ loader/winehid.inf \ +nls \ programs/msidb/msidb \ programs/msiexec/msiexec \ programs/notepad/notepad \ diff --git a/configure.ac b/configure.ac index e06743c2ea..28d3173335 100644 --- a/configure.ac +++ b/configure.ac @@ -3871,6 +3871,7 @@ WINE_CONFIG_MAKEFILE(libs/port) WINE_CONFIG_MAKEFILE(libs/wine) WINE_CONFIG_MAKEFILE(libs/wpp) WINE_CONFIG_MAKEFILE(loader) +WINE_CONFIG_MAKEFILE(nls) WINE_CONFIG_MAKEFILE(po) WINE_CONFIG_MAKEFILE(programs/arp) WINE_CONFIG_MAKEFILE(programs/aspnet_regiis) @@ -4074,10 +4075,10 @@ else TOP_INSTALL_DEV="$TOP_INSTALL_DEV include" TOP_INSTALL_LIB="$TOP_INSTALL_LIB \ fonts \ -loader/l_intl.nls \ loader/wine.inf \ loader/winebus.inf \ loader/winehid.inf \ +nls \ programs/msidb/msidb \ programs/msiexec/msiexec \ programs/notepad/notepad \ diff --git a/dlls/ntdll/locale.c b/dlls/ntdll/locale.c index 784203378a..42eedf9b5d 100644 --- a/dlls/ntdll/locale.c +++ b/dlls/ntdll/locale.c @@ -316,8 +316,7 @@ static NTSTATUS open_nls_data_file( ULONG type, ULONG id, HANDLE *file ) static const WCHAR langfmtW[] = {'%','0','4','x',0}; static const WCHAR winedatadirW[] = {'W','I','N','E','D','A','T','A','D','I','R',0}; static const WCHAR winebuilddirW[] = {'W','I','N','E','B','U','I','L','D','D','I','R',0}; - static const WCHAR dataprefixW[] = {'\\',0}; - static const WCHAR buildprefixW[] = {'\\','l','o','a','d','e','r','\\',0}; + static const WCHAR dataprefixW[] = {'\\','n','l','s','\\',0}; static const WCHAR cpdefaultW[] = {'c','_','%','0','3','d','.','n','l','s',0}; static const WCHAR intlW[] = {'l','_','i','n','t','l','.','n','l','s',0}; static const WCHAR normnfcW[] = {'n','o','r','m','n','f','c','.','n','l','s',0}; @@ -332,7 +331,7 @@ static NTSTATUS open_nls_data_file( ULONG type, ULONG id, HANDLE *file ) OBJECT_ATTRIBUTES attr; UNICODE_STRING nameW, valueW; WCHAR buffer[MAX_PATH], value[10]; - const WCHAR *name = NULL, *prefix = buildprefixW; + const WCHAR *name = NULL; KEY_VALUE_PARTIAL_INFORMATION *info; /* get filename from registry */ @@ -413,16 +412,15 @@ static NTSTATUS open_nls_data_file( ULONG type, ULONG id, HANDLE *file ) if (RtlQueryEnvironmentVariable_U( NULL, &nameW, &valueW ) != STATUS_BUFFER_TOO_SMALL) { RtlInitUnicodeString( &nameW, winedatadirW ); - prefix = dataprefixW; if (RtlQueryEnvironmentVariable_U( NULL, &nameW, &valueW ) != STATUS_BUFFER_TOO_SMALL) return status; } - valueW.MaximumLength = valueW.Length + sizeof(buildprefixW) + strlenW(name) * sizeof(WCHAR); + valueW.MaximumLength = valueW.Length + sizeof(dataprefixW) + strlenW(name) * sizeof(WCHAR); if (!(valueW.Buffer = RtlAllocateHeap( GetProcessHeap(), 0, valueW.MaximumLength ))) return STATUS_NO_MEMORY; if (!RtlQueryEnvironmentVariable_U( NULL, &nameW, &valueW )) { - strcatW( valueW.Buffer, prefix ); + strcatW( valueW.Buffer, dataprefixW ); strcatW( valueW.Buffer, name ); valueW.Length = strlenW(valueW.Buffer) * sizeof(WCHAR); InitializeObjectAttributes( &attr, &valueW, 0, 0, NULL ); diff --git a/loader/Makefile.in b/loader/Makefile.in index 11a476103c..f9b2fa9293 100644 --- a/loader/Makefile.in +++ b/loader/Makefile.in @@ -1,5 +1,4 @@ SOURCES = \ - l_intl.nls \ main.c \ preloader.c \ preloader_mac.c \ diff --git a/loader/wine.inf.in b/loader/wine.inf.in index 05fd28fcd7..188737547b 100644 --- a/loader/wine.inf.in +++ b/loader/wine.inf.in @@ -30,7 +30,7 @@ signature="$CHICAGO$" RegisterDlls=RegisterDllsSection WineFakeDlls=FakeDllsWin32,FakeDlls UpdateInis=SystemIni -CopyFiles=l_intl_section, inf_section +CopyFiles=InfFiles,NlsFiles AddReg=\ Classes,\ ContentIndex,\ @@ -54,7 +54,7 @@ AddReg=\ RegisterDlls=RegisterDllsSection WineFakeDlls=FakeDllsWin32,FakeDlls UpdateInis=SystemIni -CopyFiles=l_intl_section, inf_section +CopyFiles=InfFiles,NlsFiles AddReg=\ Classes,\ ContentIndex,\ @@ -80,7 +80,7 @@ RegisterDlls=RegisterDllsSection WineFakeDlls=FakeDllsWin64,FakeDlls WinePreInstall=Wow64 UpdateInis=SystemIni -CopyFiles=l_intl_section, inf_section +CopyFiles=InfFiles,NlsFiles AddReg=\ Classes,\ ContentIndex,\ @@ -107,7 +107,7 @@ RegisterDlls=RegisterDllsSection WineFakeDlls=FakeDllsWin64,FakeDlls WinePreInstall=Wow64 UpdateInis=SystemIni -CopyFiles=l_intl_section, inf_section +CopyFiles=InfFiles,NlsFiles AddReg=\ Classes,\ ContentIndex,\ @@ -132,7 +132,7 @@ AddReg=\ [Wow64Install] RegisterDlls=RegisterDllsSection WineFakeDlls=FakeDllsWin32,FakeDllsWow64 -CopyFiles=l_intl_section +CopyFiles=NlsFiles AddReg=\ CurrentVersion,\ CurrentVersionWow64,\ @@ -3849,13 +3849,16 @@ HKLM,Software\Wine\LicenseInformation,"Shell-InBoxGames-Solitaire-EnableGame",0x HKLM,Software\Wine\LicenseInformation,"Shell-InBoxGames-SpiderSolitaire-EnableGame",0x10001,0x00000001 HKLM,Software\Wine\LicenseInformation,"Shell-PremiumInBoxGames-Chess-EnableGame",0x10001,0x00000001 -[DestinationDirs] -l_intl_section = 11 -inf_section = 17 +[InfFiles] +winebus.inf +winehid.inf -[l_intl_section] +[NlsFiles] l_intl.nls -[inf_section] -winebus.inf -winehid.inf +[WineSourceDirs] +NlsFiles=nls + +[DestinationDirs] +InfFiles = 17 +NlsFiles = 11 diff --git a/nls/Makefile.in b/nls/Makefile.in new file mode 100644 index 0000000000..dc9893030a --- /dev/null +++ b/nls/Makefile.in @@ -0,0 +1,2 @@ +SOURCES = \ + l_intl.nls diff --git a/loader/l_intl.nls b/nls/l_intl.nls similarity index 100% rename from loader/l_intl.nls rename to nls/l_intl.nls diff --git a/tools/make_makefiles b/tools/make_makefiles index 7c376aca92..b96fc4f387 100755 --- a/tools/make_makefiles +++ b/tools/make_makefiles @@ -74,6 +74,7 @@ my @source_vars = ( ); my (@makefiles, %makefiles); +my @nls_files; sub dirname($) { @@ -389,6 +390,10 @@ sub assign_sources_to_makefiles(@) { next unless defined ${$make}{"TESTDLL"}; } + elsif ($name =~ /\.nls$/) + { + push @nls_files, $name if $dir eq "nls"; + } elsif ($dir ne "loader") # loader dir contains misc files { next; @@ -480,6 +485,13 @@ sub update_makefiles(@) replace_in_file( "configure.ac", '^WINE_CONFIG_MAKEFILE', '^dnl End of auto-generated output commands\n$', @lines); } +sub update_wine_inf() +{ + my @lines; + + push @lines, "[NlsFiles]", @nls_files, "\n"; + replace_in_file "loader/wine.inf.in", '^\[NlsFiles\]', '^$', join( "\n", @lines ); +} my $git_dir = $ENV{GIT_DIR} || ".git"; die "needs to be run from a git checkout" unless -d $git_dir; @@ -496,3 +508,4 @@ foreach my $file (sort @makefiles) assign_sources_to_makefiles( @all_files ); update_makefiles( @makefiles ); +update_wine_inf(); diff --git a/tools/make_unicode b/tools/make_unicode index 7b7a02d0d9..bd6126e256 100755 --- a/tools/make_unicode +++ b/tools/make_unicode @@ -2560,10 +2560,10 @@ dump_linebreak( "dlls/usp10/linebreak.c" ); dump_linebreak( "dlls/dwrite/linebreak.c" ); dump_scripts( "dlls/dwrite/scripts" ); dump_indic( "dlls/usp10/indicsyllable.c" ); -dump_intl_nls("loader/l_intl.nls"); dump_vertical( "dlls/gdi32/vertical.c" ); dump_vertical( "dlls/wineps.drv/vertical.c" ); dump_nameprep( "dlls/kernel32/nameprep.c" ); +dump_intl_nls("nls/l_intl.nls"); foreach my $file (@allfiles) { handle_codepage_file( @{$file} ); } diff --git a/tools/makedep.c b/tools/makedep.c index f7261795fc..a819cffca9 100644 --- a/tools/makedep.c +++ b/tools/makedep.c @@ -2921,7 +2921,7 @@ static void output_source_svg( struct makefile *make, struct incl_file *source, static void output_source_nls( struct makefile *make, struct incl_file *source, const char *obj ) { add_install_rule( make, source->name, source->name, - strmake( "D$(datadir)/wine/%s", source->name )); + strmake( "D$(nlsdir)/%s", source->name )); output_srcdir_symlink( make, strmake( "%s.nls", obj )); }
1
0
0
0
Alexandre Julliard : setupapi: Support a WineSourceDirs section to copy files from the Wine build or data dir.
by Alexandre Julliard
11 Feb '20
11 Feb '20
Module: wine Branch: master Commit: aa76bec2417551952eec9cd8f5d8302dcb72f5bd URL:
https://source.winehq.org/git/wine.git/?a=commit;h=aa76bec2417551952eec9cd8…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Tue Feb 11 09:00:43 2020 +0100 setupapi: Support a WineSourceDirs section to copy files from the Wine build or data dir. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/setupapi/install.c | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/dlls/setupapi/install.c b/dlls/setupapi/install.c index f458e8d2e9..730beba721 100644 --- a/dlls/setupapi/install.c +++ b/dlls/setupapi/install.c @@ -119,13 +119,31 @@ static WCHAR *dup_section_line_field( HINF hinf, const WCHAR *section, const WCH */ static BOOL copy_files_callback( HINF hinf, PCWSTR field, void *arg ) { + INFCONTEXT context; struct files_callback_info *info = arg; WCHAR src_root[MAX_PATH], *p; if (!info->src_root) { - lstrcpyW( src_root, PARSER_get_inf_filename( hinf ) ); - if ((p = wcsrchr( src_root, '\\' ))) *p = 0; + const WCHAR *build_dir = _wgetenv( L"WINEBUILDDIR" ); + const WCHAR *data_dir = _wgetenv( L"WINEDATADIR" ); + + if ((build_dir || data_dir) && SetupFindFirstLineW( hinf, L"WineSourceDirs", field, &context )) + { + lstrcpyW( src_root, build_dir ? build_dir : data_dir ); + src_root[1] = '\\'; /* change \??\ to \\?\ */ + p = src_root + lstrlenW(src_root); + *p++ = '\\'; + if (!build_dir || !SetupGetStringFieldW( &context, 2, p, MAX_PATH - (p - src_root), NULL )) + { + if (!SetupGetStringFieldW( &context, 1, p, MAX_PATH - (p - src_root), NULL )) p[-1] = 0; + } + } + else + { + lstrcpyW( src_root, PARSER_get_inf_filename( hinf ) ); + if ((p = wcsrchr( src_root, '\\' ))) *p = 0; + } } if (field[0] == '@') /* special case: copy single file */
1
0
0
0
Alexandre Julliard : setupapi: Use wide character string literals.
by Alexandre Julliard
11 Feb '20
11 Feb '20
Module: wine Branch: master Commit: 32a2cde6c187ac3805303929a16c12d4412df832 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=32a2cde6c187ac3805303929…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Tue Feb 11 09:00:21 2020 +0100 setupapi: Use wide character string literals. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/setupapi/fakedll.c | 132 ++++++++++++++--------------------- dlls/setupapi/install.c | 178 ++++++++++++++++-------------------------------- dlls/setupapi/queue.c | 43 ++++-------- 3 files changed, 124 insertions(+), 229 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=32a2cde6c187ac380530…
1
0
0
0
Dmitry Timoshkov : comctl32/tests: Add more tests for Static/SS_BITMAP control.
by Alexandre Julliard
11 Feb '20
11 Feb '20
Module: wine Branch: master Commit: 2c4f5c0eab4094f13374dc1713eed26fdd91ddc9 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=2c4f5c0eab4094f13374dc17…
Author: Dmitry Timoshkov <dmitry(a)baikal.ru> Date: Mon Feb 10 16:31:44 2020 +0800 comctl32/tests: Add more tests for Static/SS_BITMAP control. Signed-off-by: Dmitry Timoshkov <dmitry(a)baikal.ru> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/comctl32/tests/static.c | 58 ++++++++++++++++++++++++++++++++++++++------ 1 file changed, 51 insertions(+), 7 deletions(-) diff --git a/dlls/comctl32/tests/static.c b/dlls/comctl32/tests/static.c index 0b990d6b39..4efb768579 100644 --- a/dlls/comctl32/tests/static.c +++ b/dlls/comctl32/tests/static.c @@ -134,7 +134,20 @@ static void test_set_text(void) DestroyWindow(hStatic); } -static void test_image(HBITMAP image, BOOL is_dib, BOOL is_premult) +static void remove_alpha(HBITMAP hbitmap) +{ + BITMAP bm; + BYTE *ptr; + int i; + + GetObjectW(hbitmap, sizeof(bm), &bm); + ok(bm.bmBits != NULL, "bmBits is NULL\n"); + + for (i = 0, ptr = bm.bmBits; i < bm.bmWidth * bm.bmHeight; i++, ptr += 4) + ptr[3] = 0; +} + +static void test_image(HBITMAP image, BOOL is_dib, BOOL is_premult, BOOL is_alpha) { BITMAP bm; HDC hdc; @@ -153,9 +166,12 @@ static void test_image(HBITMAP image, BOOL is_dib, BOOL is_premult) todo_wine ok(bits[0] == 0x05 && bits[1] == 0x09 && bits[2] == 0x0e && bits[3] == 0x44, "bits: %02x %02x %02x %02x\n", bits[0], bits[1], bits[2], bits[3]); - else + else if (is_alpha) ok(bits[0] == 0x11 && bits[1] == 0x22 && bits[2] == 0x33 && bits[3] == 0x44, "bits: %02x %02x %02x %02x\n", bits[0], bits[1], bits[2], bits[3]); + else + ok(bits[0] == 0x11 && bits[1] == 0x22 && bits[2] == 0x33 && bits[3] == 0, + "bits: %02x %02x %02x %02x\n", bits[0], bits[1], bits[2], bits[3]); } else ok(bm.bmBits == NULL, "bmBits is not NULL\n"); @@ -180,9 +196,12 @@ todo_wine todo_wine ok(bits[0] == 0x05 && bits[1] == 0x09 && bits[2] == 0x0e && bits[3] == 0x44, "bits: %02x %02x %02x %02x\n", bits[0], bits[1], bits[2], bits[3]); - else + else if (is_alpha) ok(bits[0] == 0x11 && bits[1] == 0x22 && bits[2] == 0x33 && bits[3] == 0x44, "bits: %02x %02x %02x %02x\n", bits[0], bits[1], bits[2], bits[3]); + else + ok(bits[0] == 0x11 && bits[1] == 0x22 && bits[2] == 0x33 && bits[3] == 0, + "bits: %02x %02x %02x %02x\n", bits[0], bits[1], bits[2], bits[3]); } static void test_set_image(void) @@ -193,7 +212,7 @@ static void test_set_image(void) image = LoadImageW(GetModuleHandleW(NULL), MAKEINTRESOURCEW(IDB_BITMAP_1x1_32BPP), IMAGE_BITMAP, 0, 0, 0); ok(image != NULL, "LoadImage failed\n"); - test_image(image, FALSE, FALSE); + test_image(image, FALSE, FALSE, TRUE); bmp1 = (HBITMAP)SendMessageW(hwnd, STM_GETIMAGE, IMAGE_BITMAP, 0); ok(bmp1 == NULL, "got not NULL\n"); @@ -204,17 +223,42 @@ static void test_set_image(void) bmp1 = (HBITMAP)SendMessageW(hwnd, STM_GETIMAGE, IMAGE_BITMAP, 0); ok(bmp1 != NULL, "got NULL\n"); ok(bmp1 != image, "bmp == image\n"); - test_image(bmp1, TRUE, TRUE); + test_image(bmp1, TRUE, TRUE, TRUE); bmp2 = (HBITMAP)SendMessageW(hwnd, STM_SETIMAGE, IMAGE_BITMAP, (LPARAM)image); ok(bmp2 != NULL, "got NULL\n"); ok(bmp2 != image, "bmp == image\n"); ok(bmp1 == bmp2, "bmp1 != bmp2\n"); - test_image(bmp2, TRUE, TRUE); + test_image(bmp2, TRUE, TRUE, TRUE); + + DeleteObject(image); + + image = LoadImageW(GetModuleHandleW(NULL), MAKEINTRESOURCEW(IDB_BITMAP_1x1_32BPP), IMAGE_BITMAP, 0, 0, LR_CREATEDIBSECTION); + ok(image != NULL, "LoadImage failed\n"); + + test_image(image, TRUE, FALSE, TRUE); + remove_alpha(image); + test_image(image, TRUE, FALSE, FALSE); + + bmp1 = (HBITMAP)SendMessageW(hwnd, STM_GETIMAGE, IMAGE_BITMAP, 0); + ok(bmp1 != NULL, "got NULL\n"); + ok(bmp1 != image, "bmp == image\n"); + test_image(bmp1, TRUE, TRUE, TRUE); + + bmp2 = (HBITMAP)SendMessageW(hwnd, STM_SETIMAGE, IMAGE_BITMAP, (LPARAM)image); + ok(bmp2 != NULL, "got NULL\n"); + ok(bmp2 != image, "bmp == image\n"); + ok(bmp1 == bmp2, "bmp1 != bmp2\n"); + test_image(bmp1, TRUE, TRUE, FALSE); + + bmp2 = (HBITMAP)SendMessageW(hwnd, STM_SETIMAGE, IMAGE_BITMAP, (LPARAM)image); + ok(bmp2 != NULL, "got NULL\n"); + ok(bmp2 == image, "bmp1 != image\n"); + test_image(bmp2, TRUE, FALSE, FALSE); DestroyWindow(hwnd); - test_image(bmp2, TRUE, TRUE); + test_image(image, TRUE, FALSE, FALSE); DeleteObject(image); }
1
0
0
0
Dmitry Timoshkov : comctl32: Create an internal copy for 32-bpp bitmaps with an alpha channel for Static control.
by Alexandre Julliard
11 Feb '20
11 Feb '20
Module: wine Branch: master Commit: e2f179d84faa00efe6e34952eef48a6a5652ec92 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=e2f179d84faa00efe6e34952…
Author: Dmitry Timoshkov <dmitry(a)baikal.ru> Date: Mon Feb 10 16:31:41 2020 +0800 comctl32: Create an internal copy for 32-bpp bitmaps with an alpha channel for Static control. Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=47018
Signed-off-by: Dmitry Timoshkov <dmitry(a)baikal.ru> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/comctl32/static.c | 79 ++++++++++++++++++++++++++++++++++++++++++-- dlls/comctl32/tests/static.c | 7 +--- 2 files changed, 77 insertions(+), 9 deletions(-) diff --git a/dlls/comctl32/static.c b/dlls/comctl32/static.c index d08710c06f..b3254e5761 100644 --- a/dlls/comctl32/static.c +++ b/dlls/comctl32/static.c @@ -60,6 +60,7 @@ struct static_extra_info HBITMAP hbitmap; HENHMETAFILE hemf; } image; + BOOL image_has_alpha; }; typedef void (*pfPaint)( HWND hwnd, HDC hdc, DWORD style ); @@ -163,6 +164,52 @@ static HICON STATIC_SetIcon( HWND hwnd, HICON hicon, DWORD style ) return prevIcon; } +static HBITMAP create_alpha_bitmap( HBITMAP hbitmap ) +{ + BITMAP bm; + HBITMAP alpha; + BITMAPINFO info; + HDC hdc; + void *bits; + DWORD i; + BYTE *ptr; + BOOL has_alpha = FALSE; + + GetObjectW( hbitmap, sizeof(bm), &bm ); + if (bm.bmBitsPixel != 32) return 0; + + if (!(hdc = CreateCompatibleDC( 0 ))) return 0; + + info.bmiHeader.biSize = sizeof(BITMAPINFOHEADER); + info.bmiHeader.biWidth = bm.bmWidth; + info.bmiHeader.biHeight = -bm.bmHeight; + info.bmiHeader.biPlanes = 1; + info.bmiHeader.biBitCount = 32; + info.bmiHeader.biCompression = BI_RGB; + info.bmiHeader.biSizeImage = bm.bmWidth * bm.bmHeight * 4; + info.bmiHeader.biXPelsPerMeter = 0; + info.bmiHeader.biYPelsPerMeter = 0; + info.bmiHeader.biClrUsed = 0; + info.bmiHeader.biClrImportant = 0; + if ((alpha = CreateDIBSection( hdc, &info, DIB_RGB_COLORS, &bits, NULL, 0 ))) + { + GetDIBits( hdc, hbitmap, 0, bm.bmHeight, bits, &info, DIB_RGB_COLORS ); + + for (i = 0, ptr = bits; i < bm.bmWidth * bm.bmHeight; i++, ptr += 4) + if ((has_alpha = (ptr[3] != 0))) break; + + if (!has_alpha) + { + DeleteObject( alpha ); + alpha = 0; + } + } + + DeleteDC( hdc ); + + return alpha; +} + /*********************************************************************** * STATIC_SetBitmap * @@ -170,7 +217,7 @@ static HICON STATIC_SetIcon( HWND hwnd, HICON hicon, DWORD style ) */ static HBITMAP STATIC_SetBitmap( HWND hwnd, HBITMAP hBitmap, DWORD style ) { - HBITMAP hOldBitmap; + HBITMAP hOldBitmap, alpha; struct static_extra_info *extra; if ((style & SS_TYPEMASK) != SS_BITMAP) return 0; @@ -185,10 +232,23 @@ static HBITMAP STATIC_SetBitmap( HWND hwnd, HBITMAP hBitmap, DWORD style ) hOldBitmap = extra->image.hbitmap; extra->image.hbitmap = hBitmap; + extra->image_has_alpha = FALSE; + + if (hBitmap) + { + alpha = create_alpha_bitmap( hBitmap ); + if (alpha) + { + extra->image.hbitmap = alpha; + extra->image_has_alpha = TRUE; + } + } + if (hBitmap && !(style & SS_CENTERIMAGE) && !(style & SS_REALSIZECONTROL)) { BITMAP bm; GetObjectW(hBitmap, sizeof(bm), &bm); + /* Windows currently doesn't implement SS_RIGHTJUST */ /* if ((style & SS_RIGHTJUST) != 0) @@ -386,7 +446,12 @@ static LRESULT CALLBACK STATIC_WindowProc( HWND hwnd, UINT uMsg, WPARAM wParam, if (style == SS_ICON) { struct static_extra_info *extra = get_extra_ptr( hwnd, FALSE ); - heap_free( extra ); + if (extra) + { + if (extra->image_has_alpha) + DeleteObject( extra->image.hbitmap ); + heap_free( extra ); + } /* * FIXME * DestroyIcon32( STATIC_SetIcon( wndPtr, 0 ) ); @@ -765,6 +830,8 @@ static void STATIC_PaintBitmapfn(HWND hwnd, HDC hdc, DWORD style ) BITMAP bm; RECT rcClient; LOGBRUSH brush; + BLENDFUNCTION blend = { AC_SRC_OVER, 0, 255, AC_SRC_ALPHA }; + struct static_extra_info *extra = get_extra_ptr( hwnd, FALSE ); GetObjectW(hBitmap, sizeof(bm), &bm); oldbitmap = SelectObject(hMemDC, hBitmap); @@ -785,7 +852,13 @@ static void STATIC_PaintBitmapfn(HWND hwnd, HDC hdc, DWORD style ) rcClient.right = rcClient.left + bm.bmWidth; rcClient.bottom = rcClient.top + bm.bmHeight; } - StretchBlt(hdc, rcClient.left, rcClient.top, rcClient.right - rcClient.left, + + if (extra->image_has_alpha) + GdiAlphaBlend(hdc, rcClient.left, rcClient.top, rcClient.right - rcClient.left, + rcClient.bottom - rcClient.top, hMemDC, + 0, 0, bm.bmWidth, bm.bmHeight, blend); + else + StretchBlt(hdc, rcClient.left, rcClient.top, rcClient.right - rcClient.left, rcClient.bottom - rcClient.top, hMemDC, 0, 0, bm.bmWidth, bm.bmHeight, SRCCOPY); SelectObject(hMemDC, oldbitmap); diff --git a/dlls/comctl32/tests/static.c b/dlls/comctl32/tests/static.c index 0e44c4ed7a..0b990d6b39 100644 --- a/dlls/comctl32/tests/static.c +++ b/dlls/comctl32/tests/static.c @@ -147,18 +147,15 @@ static void test_image(HBITMAP image, BOOL is_dib, BOOL is_premult) ok(bm.bmBitsPixel == 32, "got %d\n", bm.bmBitsPixel); if (is_dib) { -todo_wine ok(bm.bmBits != NULL, "bmBits is NULL\n"); -if (bm.bmBits) -{ memcpy(bits, bm.bmBits, 4); if (is_premult) +todo_wine ok(bits[0] == 0x05 && bits[1] == 0x09 && bits[2] == 0x0e && bits[3] == 0x44, "bits: %02x %02x %02x %02x\n", bits[0], bits[1], bits[2], bits[3]); else ok(bits[0] == 0x11 && bits[1] == 0x22 && bits[2] == 0x33 && bits[3] == 0x44, "bits: %02x %02x %02x %02x\n", bits[0], bits[1], bits[2], bits[3]); -} } else ok(bm.bmBits == NULL, "bmBits is not NULL\n"); @@ -206,13 +203,11 @@ static void test_set_image(void) bmp1 = (HBITMAP)SendMessageW(hwnd, STM_GETIMAGE, IMAGE_BITMAP, 0); ok(bmp1 != NULL, "got NULL\n"); -todo_wine ok(bmp1 != image, "bmp == image\n"); test_image(bmp1, TRUE, TRUE); bmp2 = (HBITMAP)SendMessageW(hwnd, STM_SETIMAGE, IMAGE_BITMAP, (LPARAM)image); ok(bmp2 != NULL, "got NULL\n"); -todo_wine ok(bmp2 != image, "bmp == image\n"); ok(bmp1 == bmp2, "bmp1 != bmp2\n"); test_image(bmp2, TRUE, TRUE);
1
0
0
0
Dmitry Timoshkov : comctl32: Switch to using a structure for extra storage.
by Alexandre Julliard
11 Feb '20
11 Feb '20
Module: wine Branch: master Commit: 0caf5af18e299915970f372a1f416d8e2bda30ef URL:
https://source.winehq.org/git/wine.git/?a=commit;h=0caf5af18e299915970f372a…
Author: Dmitry Timoshkov <dmitry(a)baikal.ru> Date: Mon Feb 10 16:31:39 2020 +0800 comctl32: Switch to using a structure for extra storage. Signed-off-by: Dmitry Timoshkov <dmitry(a)baikal.ru> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/comctl32/static.c | 92 +++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 76 insertions(+), 16 deletions(-) diff --git a/dlls/comctl32/static.c b/dlls/comctl32/static.c index 5cc02ced97..d08710c06f 100644 --- a/dlls/comctl32/static.c +++ b/dlls/comctl32/static.c @@ -36,6 +36,7 @@ #include "winuser.h" #include "commctrl.h" +#include "wine/heap.h" #include "wine/debug.h" #include "comctl32.h" @@ -50,10 +51,16 @@ static void STATIC_PaintBitmapfn( HWND hwnd, HDC hdc, DWORD style ); static void STATIC_PaintEnhMetafn( HWND hwnd, HDC hdc, DWORD style ); static void STATIC_PaintEtchedfn( HWND hwnd, HDC hdc, DWORD style ); -/* offsets for GetWindowLong for static private information */ -#define HFONT_GWL_OFFSET 0 -#define HICON_GWL_OFFSET (sizeof(HFONT)) -#define STATIC_EXTRA_BYTES (HICON_GWL_OFFSET + sizeof(HICON)) +struct static_extra_info +{ + HFONT hfont; + union + { + HICON hicon; + HBITMAP hbitmap; + HENHMETAFILE hemf; + } image; +}; typedef void (*pfPaint)( HWND hwnd, HDC hdc, DWORD style ); @@ -80,6 +87,18 @@ static const pfPaint staticPaintFunc[SS_TYPEMASK+1] = STATIC_PaintEtchedfn, /* SS_ETCHEDFRAME */ }; +static struct static_extra_info *get_extra_ptr( HWND hwnd, BOOL force ) +{ + struct static_extra_info *extra = (struct static_extra_info *)GetWindowLongPtrW( hwnd, 0 ); + if (!extra && force) + { + extra = heap_alloc_zero( sizeof(*extra) ); + if (extra) + SetWindowLongPtrW( hwnd, 0, (ULONG_PTR)extra ); + } + return extra; +} + static BOOL get_icon_size( HICON handle, SIZE *size ) { ICONINFO info; @@ -111,6 +130,7 @@ static HICON STATIC_SetIcon( HWND hwnd, HICON hicon, DWORD style ) { HICON prevIcon; SIZE size; + struct static_extra_info *extra; if ((style & SS_TYPEMASK) != SS_ICON) return 0; if (hicon && !get_icon_size( hicon, &size )) @@ -118,7 +138,12 @@ static HICON STATIC_SetIcon( HWND hwnd, HICON hicon, DWORD style ) WARN("hicon != 0, but invalid\n"); return 0; } - prevIcon = (HICON)SetWindowLongPtrW( hwnd, HICON_GWL_OFFSET, (LONG_PTR)hicon ); + + extra = get_extra_ptr( hwnd, TRUE ); + if (!extra) return 0; + + prevIcon = extra->image.hicon; + extra->image.hicon = hicon; if (hicon && !(style & SS_CENTERIMAGE) && !(style & SS_REALSIZECONTROL)) { /* Windows currently doesn't implement SS_RIGHTJUST */ @@ -146,6 +171,7 @@ static HICON STATIC_SetIcon( HWND hwnd, HICON hicon, DWORD style ) static HBITMAP STATIC_SetBitmap( HWND hwnd, HBITMAP hBitmap, DWORD style ) { HBITMAP hOldBitmap; + struct static_extra_info *extra; if ((style & SS_TYPEMASK) != SS_BITMAP) return 0; if (hBitmap && GetObjectType(hBitmap) != OBJ_BITMAP) @@ -153,7 +179,12 @@ static HBITMAP STATIC_SetBitmap( HWND hwnd, HBITMAP hBitmap, DWORD style ) WARN("hBitmap != 0, but it's not a bitmap\n"); return 0; } - hOldBitmap = (HBITMAP)SetWindowLongPtrW( hwnd, HICON_GWL_OFFSET, (LONG_PTR)hBitmap ); + + extra = get_extra_ptr( hwnd, TRUE ); + if (!extra) return 0; + + hOldBitmap = extra->image.hbitmap; + extra->image.hbitmap = hBitmap; if (hBitmap && !(style & SS_CENTERIMAGE) && !(style & SS_REALSIZECONTROL)) { BITMAP bm; @@ -183,13 +214,23 @@ static HBITMAP STATIC_SetBitmap( HWND hwnd, HBITMAP hBitmap, DWORD style ) */ static HENHMETAFILE STATIC_SetEnhMetaFile( HWND hwnd, HENHMETAFILE hEnhMetaFile, DWORD style ) { + HENHMETAFILE old_hemf; + struct static_extra_info *extra; + if ((style & SS_TYPEMASK) != SS_ENHMETAFILE) return 0; if (hEnhMetaFile && GetObjectType(hEnhMetaFile) != OBJ_ENHMETAFILE) { WARN("hEnhMetaFile != 0, but it's not an enhanced metafile\n"); return 0; } - return (HENHMETAFILE)SetWindowLongPtrW( hwnd, HICON_GWL_OFFSET, (LONG_PTR)hEnhMetaFile ); + + extra = get_extra_ptr( hwnd, TRUE ); + if (!extra) return 0; + + old_hemf = extra->image.hemf; + extra->image.hemf = hEnhMetaFile; + + return old_hemf; } /*********************************************************************** @@ -200,6 +241,8 @@ static HENHMETAFILE STATIC_SetEnhMetaFile( HWND hwnd, HENHMETAFILE hEnhMetaFile, */ static HANDLE STATIC_GetImage( HWND hwnd, WPARAM wParam, DWORD style ) { + struct static_extra_info *extra; + switch (style & SS_TYPEMASK) { case SS_ICON: @@ -215,7 +258,22 @@ static HANDLE STATIC_GetImage( HWND hwnd, WPARAM wParam, DWORD style ) default: return NULL; } - return (HANDLE)GetWindowLongPtrW( hwnd, HICON_GWL_OFFSET ); + + extra = get_extra_ptr( hwnd, FALSE ); + return extra ? extra->image.hbitmap : 0; +} + +static void STATIC_SetFont( HWND hwnd, HFONT hfont ) +{ + struct static_extra_info *extra = get_extra_ptr( hwnd, TRUE ); + if (extra) + extra->hfont = hfont; +} + +static HFONT STATIC_GetFont( HWND hwnd ) +{ + struct static_extra_info *extra = get_extra_ptr( hwnd, FALSE ); + return extra ? extra->hfont : 0; } /*********************************************************************** @@ -327,6 +385,8 @@ static LRESULT CALLBACK STATIC_WindowProc( HWND hwnd, UINT uMsg, WPARAM wParam, case WM_NCDESTROY: if (style == SS_ICON) { + struct static_extra_info *extra = get_extra_ptr( hwnd, FALSE ); + heap_free( extra ); /* * FIXME * DestroyIcon32( STATIC_SetIcon( wndPtr, 0 ) ); @@ -423,14 +483,14 @@ static LRESULT CALLBACK STATIC_WindowProc( HWND hwnd, UINT uMsg, WPARAM wParam, case WM_SETFONT: if (hasTextStyle( full_style )) { - SetWindowLongPtrW( hwnd, HFONT_GWL_OFFSET, wParam ); + STATIC_SetFont( hwnd, (HFONT)wParam ); if (LOWORD(lParam)) RedrawWindow( hwnd, NULL, 0, RDW_INVALIDATE | RDW_ERASE | RDW_UPDATENOW | RDW_ALLCHILDREN ); } break; case WM_GETFONT: - return GetWindowLongPtrW( hwnd, HFONT_GWL_OFFSET ); + return (LRESULT)STATIC_GetFont( hwnd ); case WM_NCHITTEST: if (full_style & SS_NOTIFY) @@ -508,7 +568,7 @@ static void STATIC_PaintOwnerDrawfn( HWND hwnd, HDC hdc, DWORD style ) dis.itemData = 0; GetClientRect( hwnd, &dis.rcItem ); - font = (HFONT)GetWindowLongPtrW( hwnd, HFONT_GWL_OFFSET ); + font = STATIC_GetFont( hwnd ); if (font) oldFont = SelectObject( hdc, font ); SendMessageW( GetParent(hwnd), WM_CTLCOLORSTATIC, (WPARAM)hdc, (LPARAM)hwnd ); SendMessageW( GetParent(hwnd), WM_DRAWITEM, id, (LPARAM)&dis ); @@ -572,7 +632,7 @@ static void STATIC_PaintTextfn( HWND hwnd, HDC hdc, DWORD style ) format |= DT_SINGLELINE | DT_WORD_ELLIPSIS; } - if ((hFont = (HFONT)GetWindowLongPtrW( hwnd, HFONT_GWL_OFFSET ))) + if ((hFont = STATIC_GetFont( hwnd ))) hOldFont = SelectObject( hdc, hFont ); /* SS_SIMPLE controls: WM_CTLCOLORSTATIC is sent, but the returned @@ -668,7 +728,7 @@ static void STATIC_PaintIconfn( HWND hwnd, HDC hdc, DWORD style ) GetClientRect( hwnd, &rc ); hbrush = STATIC_SendWmCtlColorStatic(hwnd, hdc); - hIcon = (HICON)GetWindowLongPtrW( hwnd, HICON_GWL_OFFSET ); + hIcon = STATIC_GetImage( hwnd, IMAGE_ICON, style ); if (!hIcon || !get_icon_size( hIcon, &size )) { FillRect(hdc, &rc, hbrush); @@ -698,7 +758,7 @@ static void STATIC_PaintBitmapfn(HWND hwnd, HDC hdc, DWORD style ) hbrush = STATIC_SendWmCtlColorStatic(hwnd, hdc); - if ((hBitmap = (HBITMAP)GetWindowLongPtrW( hwnd, HICON_GWL_OFFSET )) + if ((hBitmap = STATIC_GetImage( hwnd, IMAGE_BITMAP, style )) && (GetObjectType(hBitmap) == OBJ_BITMAP) && (hMemDC = CreateCompatibleDC( hdc ))) { @@ -742,7 +802,7 @@ static void STATIC_PaintEnhMetafn(HWND hwnd, HDC hdc, DWORD style ) GetClientRect(hwnd, &rc); hbrush = STATIC_SendWmCtlColorStatic(hwnd, hdc); FillRect(hdc, &rc, hbrush); - if ((hEnhMetaFile = (HENHMETAFILE)GetWindowLongPtrW( hwnd, HICON_GWL_OFFSET ))) + if ((hEnhMetaFile = STATIC_GetImage( hwnd, IMAGE_ENHMETAFILE, style ))) { /* The control's current font is not selected into the device context! */ @@ -779,7 +839,7 @@ void STATIC_Register(void) wndClass.style = CS_DBLCLKS | CS_PARENTDC | CS_GLOBALCLASS; wndClass.lpfnWndProc = STATIC_WindowProc; wndClass.cbClsExtra = 0; - wndClass.cbWndExtra = STATIC_EXTRA_BYTES; + wndClass.cbWndExtra = sizeof(struct static_extra_info *); wndClass.hCursor = LoadCursorW(0, (LPWSTR)IDC_ARROW); wndClass.hbrBackground = NULL; wndClass.lpszClassName = WC_STATICW;
1
0
0
0
Zebediah Figura : strmbase: Get rid of current sample tracking.
by Alexandre Julliard
11 Feb '20
11 Feb '20
Module: wine Branch: master Commit: fa72a28c51e2d678f26b5701529d8e9714b941ab URL:
https://source.winehq.org/git/wine.git/?a=commit;h=fa72a28c51e2d678f26b5701…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Mon Feb 10 19:22:20 2020 -0600 strmbase: Get rid of current sample tracking. Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/strmbase/renderer.c | 17 ----------------- include/wine/strmbase.h | 2 -- 2 files changed, 19 deletions(-) diff --git a/dlls/strmbase/renderer.c b/dlls/strmbase/renderer.c index 8470da40f0..1f2154393d 100644 --- a/dlls/strmbase/renderer.c +++ b/dlls/strmbase/renderer.c @@ -84,7 +84,6 @@ static HRESULT renderer_init_stream(struct strmbase_filter *iface) if (filter->sink.pin.peer) ResetEvent(filter->state_event); filter->eos = FALSE; - BaseRendererImpl_ClearPendingSample(filter); ResetEvent(filter->flush_event); if (filter->pFuncsTable->renderer_init_stream) filter->pFuncsTable->renderer_init_stream(filter); @@ -228,7 +227,6 @@ static HRESULT sink_begin_flush(struct strmbase_sink *iface) { struct strmbase_renderer *filter = impl_from_IPin(&iface->pin.IPin_iface); - BaseRendererImpl_ClearPendingSample(filter); SetEvent(filter->flush_event); return S_OK; @@ -279,7 +277,6 @@ void strmbase_renderer_cleanup(struct strmbase_renderer *filter) filter->csRenderLock.DebugInfo->Spare[0] = 0; DeleteCriticalSection(&filter->csRenderLock); - BaseRendererImpl_ClearPendingSample(filter); CloseHandle(filter->state_event); CloseHandle(filter->advise_event); CloseHandle(filter->flush_event); @@ -313,9 +310,6 @@ HRESULT WINAPI BaseRendererImpl_Receive(struct strmbase_renderer *This, IMediaSa DeleteMediaType(pmt); } - This->pMediaSample = pSample; - IMediaSample_AddRef(pSample); - if (This->pFuncsTable->pfnPrepareReceive) hr = This->pFuncsTable->pfnPrepareReceive(This, pSample); if (FAILED(hr)) @@ -388,22 +382,11 @@ HRESULT WINAPI BaseRendererImpl_Receive(struct strmbase_renderer *This, IMediaSa QualityControlRender_DoQOS(This->qcimpl); - BaseRendererImpl_ClearPendingSample(This); LeaveCriticalSection(&This->csRenderLock); return hr; } -HRESULT WINAPI BaseRendererImpl_ClearPendingSample(struct strmbase_renderer *iface) -{ - if (iface->pMediaSample) - { - IMediaSample_Release(iface->pMediaSample); - iface->pMediaSample = NULL; - } - return S_OK; -} - HRESULT WINAPI strmbase_renderer_init(struct strmbase_renderer *filter, IUnknown *outer, const CLSID *clsid, const WCHAR *sink_name, const struct strmbase_renderer_ops *ops) { diff --git a/include/wine/strmbase.h b/include/wine/strmbase.h index 57ff024708..5151e68644 100644 --- a/include/wine/strmbase.h +++ b/include/wine/strmbase.h @@ -483,7 +483,6 @@ struct strmbase_renderer /* Signaled when a flush or state change occurs, i.e. anything that needs * to immediately unblock the streaming thread. */ HANDLE flush_event; - IMediaSample *pMediaSample; REFERENCE_TIME stream_start; IQualityControl *pQSink; @@ -522,7 +521,6 @@ struct strmbase_renderer_ops HRESULT (*renderer_pin_query_interface)(struct strmbase_renderer *iface, REFIID iid, void **out); }; -HRESULT WINAPI BaseRendererImpl_ClearPendingSample(struct strmbase_renderer *filter); HRESULT WINAPI BaseRendererImpl_Receive(struct strmbase_renderer *filter, IMediaSample *sample); HRESULT WINAPI strmbase_renderer_init(struct strmbase_renderer *filter, IUnknown *outer,
1
0
0
0
Zebediah Figura : quartz/videorenderer: Track the current sample locally.
by Alexandre Julliard
11 Feb '20
11 Feb '20
Module: wine Branch: master Commit: 5f9ce6870cea074c713325d8119a29f6d18581ae URL:
https://source.winehq.org/git/wine.git/?a=commit;h=5f9ce6870cea074c713325d8…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Mon Feb 10 19:22:19 2020 -0600 quartz/videorenderer: Track the current sample locally. Only the video renderer uses it. Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/quartz/videorenderer.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/dlls/quartz/videorenderer.c b/dlls/quartz/videorenderer.c index b75f7bc4e7..4383f66e44 100644 --- a/dlls/quartz/videorenderer.c +++ b/dlls/quartz/videorenderer.c @@ -56,6 +56,7 @@ typedef struct VideoRendererImpl DWORD saved_style; HANDLE run_event; + IMediaSample *current_sample; } VideoRendererImpl; static inline VideoRendererImpl *impl_from_BaseWindow(BaseWindow *iface) @@ -177,9 +178,13 @@ static HRESULT WINAPI VideoRenderer_DoRenderSample(struct strmbase_renderer *ifa { const HANDLE events[2] = {filter->run_event, filter->renderer.flush_event}; + filter->current_sample = pSample; + LeaveCriticalSection(&filter->renderer.csRenderLock); WaitForMultipleObjects(2, events, FALSE, INFINITE); EnterCriticalSection(&filter->renderer.csRenderLock); + + filter->current_sample = NULL; } return S_OK; @@ -381,7 +386,7 @@ static HRESULT WINAPI VideoRenderer_GetStaticImage(BaseControlVideo *iface, LONG return VFW_E_NOT_PAUSED; } - if (!filter->renderer.pMediaSample) + if (!filter->current_sample) { LeaveCriticalSection(&filter->renderer.csRenderLock); return E_UNEXPECTED; @@ -394,7 +399,7 @@ static HRESULT WINAPI VideoRenderer_GetStaticImage(BaseControlVideo *iface, LONG } memcpy(image, bih, sizeof(BITMAPINFOHEADER)); - IMediaSample_GetPointer(filter->renderer.pMediaSample, &sample_data); + IMediaSample_GetPointer(filter->current_sample, &sample_data); memcpy((char *)image + sizeof(BITMAPINFOHEADER), sample_data, image_size); LeaveCriticalSection(&filter->renderer.csRenderLock);
1
0
0
0
← Newer
1
...
53
54
55
56
57
58
59
...
88
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
Results per page:
10
25
50
100
200