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
August 2012
----- 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
541 discussions
Start a n
N
ew thread
André Hentschel : kernel32: Fix LocaleNameToLCID on mismatch.
by Alexandre Julliard
17 Aug '12
17 Aug '12
Module: wine Branch: master Commit: 20e1b46d83c1c8e51aee80befc60665cb1f81eff URL:
http://source.winehq.org/git/wine.git/?a=commit;h=20e1b46d83c1c8e51aee80bef…
Author: André Hentschel <nerv(a)dawncrow.de> Date: Fri Aug 17 00:46:31 2012 +0200 kernel32: Fix LocaleNameToLCID on mismatch. --- dlls/kernel32/locale.c | 8 ++++++-- dlls/kernel32/tests/locale.c | 13 +++++++++---- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/dlls/kernel32/locale.c b/dlls/kernel32/locale.c index 29e38c9..1e5b7e5 100644 --- a/dlls/kernel32/locale.c +++ b/dlls/kernel32/locale.c @@ -998,8 +998,12 @@ LCID WINAPI LocaleNameToLCID( LPCWSTR name, DWORD flags ) locale_name.lcid, debugstr_w(name), locale_name.matches ); if (!locale_name.matches) - WARN( "locale %s not recognized, defaulting to English\n", debugstr_w(name) ); - else if (locale_name.matches == 1) + { + SetLastError(ERROR_INVALID_PARAMETER); + return 0; + } + + if (locale_name.matches == 1) WARN( "locale %s not recognized, defaulting to %s\n", debugstr_w(name), debugstr_w(locale_name.lang) ); diff --git a/dlls/kernel32/tests/locale.c b/dlls/kernel32/tests/locale.c index a2a33fa..c264ca3 100644 --- a/dlls/kernel32/tests/locale.c +++ b/dlls/kernel32/tests/locale.c @@ -1869,22 +1869,25 @@ static void test_LocaleNameToLCID(void) /* special cases */ buffer[0] = 0; + SetLastError(0xdeadbeef); lcid = pLocaleNameToLCID(LOCALE_NAME_USER_DEFAULT, 0); ok(lcid == GetUserDefaultLCID() || broken(GetLastError() == ERROR_INVALID_PARAMETER /* Vista */), - "Expected lcid == %08x, got %08x, error %d\n", lcid, GetUserDefaultLCID(), GetLastError()); + "Expected lcid == %08x, got %08x, error %d\n", GetUserDefaultLCID(), lcid, GetLastError()); ret = pLCIDToLocaleName(lcid, buffer, LOCALE_NAME_MAX_LENGTH, 0); ok(ret > 0, "Expected ret > 0, got %d, error %d\n", ret, GetLastError()); trace("%08x, %s\n", lcid, wine_dbgstr_w(buffer)); buffer[0] = 0; + SetLastError(0xdeadbeef); lcid = pLocaleNameToLCID(LOCALE_NAME_SYSTEM_DEFAULT, 0); - todo_wine ok(!lcid && GetLastError() == ERROR_INVALID_PARAMETER, - "Expected lcid != 0, got %08x, error %d\n", lcid, GetLastError()); + ok(!lcid && GetLastError() == ERROR_INVALID_PARAMETER, + "Expected lcid == 0, got %08x, error %d\n", lcid, GetLastError()); ret = pLCIDToLocaleName(lcid, buffer, LOCALE_NAME_MAX_LENGTH, 0); ok(ret > 0, "Expected ret > 0, got %d, error %d\n", ret, GetLastError()); trace("%08x, %s\n", lcid, wine_dbgstr_w(buffer)); buffer[0] = 0; + SetLastError(0xdeadbeef); lcid = pLocaleNameToLCID(LOCALE_NAME_INVARIANT, 0); todo_wine ok(lcid == 0x7F, "Expected lcid = 0x7F, got %08x, error %d\n", lcid, GetLastError()); ret = pLCIDToLocaleName(lcid, buffer, LOCALE_NAME_MAX_LENGTH, 0); @@ -1892,8 +1895,10 @@ static void test_LocaleNameToLCID(void) trace("%08x, %s\n", lcid, wine_dbgstr_w(buffer)); /* bad name */ + SetLastError(0xdeadbeef); lcid = pLocaleNameToLCID(fooW, 0); - todo_wine ok(lcid == 0, "got 0x%04x\n", lcid); + ok(!lcid && GetLastError() == ERROR_INVALID_PARAMETER, + "Expected lcid == 0, got got %08x, error %d\n", lcid, GetLastError()); /* english neutral name */ lcid = pLocaleNameToLCID(enW, 0);
1
0
0
0
André Hentschel : winebuild: Rename IMAGE_FILE_MACHINE_ARMV7 to IMAGE_FILE_MACHINE_ARMNT.
by Alexandre Julliard
17 Aug '12
17 Aug '12
Module: wine Branch: master Commit: ca234e3ed40b44d6a754a11039341c9aefbeaaa7 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=ca234e3ed40b44d6a754a1103…
Author: André Hentschel <nerv(a)dawncrow.de> Date: Thu Aug 16 22:40:14 2012 +0200 winebuild: Rename IMAGE_FILE_MACHINE_ARMV7 to IMAGE_FILE_MACHINE_ARMNT. --- tools/winebuild/spec32.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/winebuild/spec32.c b/tools/winebuild/spec32.c index 7892f22..20fcbc0 100644 --- a/tools/winebuild/spec32.c +++ b/tools/winebuild/spec32.c @@ -36,7 +36,7 @@ #define IMAGE_FILE_MACHINE_I386 0x014c #define IMAGE_FILE_MACHINE_POWERPC 0x01f0 #define IMAGE_FILE_MACHINE_AMD64 0x8664 -#define IMAGE_FILE_MACHINE_ARMV7 0x01C4 +#define IMAGE_FILE_MACHINE_ARMNT 0x01C4 /* Wine extension */ #define IMAGE_FILE_MACHINE_SPARC 0x2000 @@ -517,7 +517,7 @@ void output_module( DLLSPEC *spec ) { case CPU_x86: machine = IMAGE_FILE_MACHINE_I386; break; case CPU_x86_64: machine = IMAGE_FILE_MACHINE_AMD64; break; - case CPU_ARM: machine = IMAGE_FILE_MACHINE_ARMV7; break; + case CPU_ARM: machine = IMAGE_FILE_MACHINE_ARMNT; break; case CPU_POWERPC: machine = IMAGE_FILE_MACHINE_POWERPC; break; case CPU_SPARC: machine = IMAGE_FILE_MACHINE_SPARC; break; } @@ -706,7 +706,7 @@ void output_fake_module( DLLSPEC *spec ) case CPU_x86_64: put_word( IMAGE_FILE_MACHINE_AMD64 ); break; case CPU_POWERPC: put_word( IMAGE_FILE_MACHINE_POWERPC ); break; case CPU_SPARC: put_word( IMAGE_FILE_MACHINE_SPARC ); break; - case CPU_ARM: put_word( IMAGE_FILE_MACHINE_ARMV7 ); break; + case CPU_ARM: put_word( IMAGE_FILE_MACHINE_ARMNT ); break; } put_word( nb_sections ); /* NumberOfSections */ put_dword( 0 ); /* TimeDateStamp */
1
0
0
0
André Hentschel : include: Rename IMAGE_FILE_MACHINE_ARMV7 to IMAGE_FILE_MACHINE_ARMNT.
by Alexandre Julliard
17 Aug '12
17 Aug '12
Module: wine Branch: master Commit: 538a0abbd7dae8bfd23e1c93223cac6dc51765ba URL:
http://source.winehq.org/git/wine.git/?a=commit;h=538a0abbd7dae8bfd23e1c932…
Author: André Hentschel <nerv(a)dawncrow.de> Date: Thu Aug 16 22:39:46 2012 +0200 include: Rename IMAGE_FILE_MACHINE_ARMV7 to IMAGE_FILE_MACHINE_ARMNT. --- dlls/dbghelp/cpu_arm.c | 2 +- dlls/kernel32/tests/file.c | 2 +- dlls/kernel32/tests/loader.c | 2 +- dlls/ntdll/virtual.c | 4 ++-- include/winnt.h | 2 +- programs/winedbg/be_arm.c | 2 +- tools/winedump/pe.c | 2 +- 7 files changed, 8 insertions(+), 8 deletions(-) diff --git a/dlls/dbghelp/cpu_arm.c b/dlls/dbghelp/cpu_arm.c index a38afe8..769bc95 100644 --- a/dlls/dbghelp/cpu_arm.c +++ b/dlls/dbghelp/cpu_arm.c @@ -245,7 +245,7 @@ static BOOL arm_fetch_minidump_module(struct dump_context* dc, unsigned index, u } DECLSPEC_HIDDEN struct cpu cpu_arm = { - IMAGE_FILE_MACHINE_ARMV7, + IMAGE_FILE_MACHINE_ARMNT, 4, CV_ARM_R0 + 11, arm_get_addr, diff --git a/dlls/kernel32/tests/file.c b/dlls/kernel32/tests/file.c index c6e9f18..c046371 100644 --- a/dlls/kernel32/tests/file.c +++ b/dlls/kernel32/tests/file.c @@ -1779,7 +1779,7 @@ static BOOL create_fake_dll( LPCSTR filename ) #elif defined __sparc__ nt->FileHeader.Machine = IMAGE_FILE_MACHINE_SPARC; #elif defined __arm__ - nt->FileHeader.Machine = IMAGE_FILE_MACHINE_ARMV7; + nt->FileHeader.Machine = IMAGE_FILE_MACHINE_ARMNT; #else # error You must specify the machine type #endif diff --git a/dlls/kernel32/tests/loader.c b/dlls/kernel32/tests/loader.c index e98ebc1..e503171 100644 --- a/dlls/kernel32/tests/loader.c +++ b/dlls/kernel32/tests/loader.c @@ -63,7 +63,7 @@ static IMAGE_NT_HEADERS nt_header = #elif defined __sparc__ IMAGE_FILE_MACHINE_SPARC, /* Machine */ #elif defined __arm__ - IMAGE_FILE_MACHINE_ARMV7, /* Machine */ + IMAGE_FILE_MACHINE_ARMNT, /* Machine */ #else # error You must specify the machine type #endif diff --git a/dlls/ntdll/virtual.c b/dlls/ntdll/virtual.c index 806b7a9..88bcdbb 100644 --- a/dlls/ntdll/virtual.c +++ b/dlls/ntdll/virtual.c @@ -1063,7 +1063,7 @@ static NTSTATUS check_architecture( const IMAGE_NT_HEADERS *nt ) if (nt->FileHeader.Machine == IMAGE_FILE_MACHINE_ARM || nt->FileHeader.Machine == IMAGE_FILE_MACHINE_THUMB) return STATUS_SUCCESS; - if (nt->FileHeader.Machine == IMAGE_FILE_MACHINE_ARMV7) + if (nt->FileHeader.Machine == IMAGE_FILE_MACHINE_ARMNT) { SYSTEM_CPU_INFORMATION sci; if (SUCCEEDED(NtQuerySystemInformation( SystemCpuInformation, &sci, sizeof(sci), NULL )) && @@ -1086,7 +1086,7 @@ static NTSTATUS check_architecture( const IMAGE_NT_HEADERS *nt ) case IMAGE_FILE_MACHINE_ALPHA64: arch = "Alpha-64"; break; case IMAGE_FILE_MACHINE_AMD64: arch = "AMD-64"; break; case IMAGE_FILE_MACHINE_ARM: arch = "ARM"; break; - case IMAGE_FILE_MACHINE_ARMV7: arch = "ARMv7"; break; + case IMAGE_FILE_MACHINE_ARMNT: arch = "ARMNT"; break; case IMAGE_FILE_MACHINE_THUMB: arch = "ARM Thumb"; break; case IMAGE_FILE_MACHINE_SPARC: arch = "SPARC"; break; default: arch = wine_dbg_sprintf( "Unknown-%04x", nt->FileHeader.Machine ); break; diff --git a/include/winnt.h b/include/winnt.h index 2f78820..5625e37 100644 --- a/include/winnt.h +++ b/include/winnt.h @@ -2401,7 +2401,7 @@ typedef struct _IMAGE_VXD_HEADER { #define IMAGE_FILE_MACHINE_SH5 0x01a8 #define IMAGE_FILE_MACHINE_ARM 0x01c0 #define IMAGE_FILE_MACHINE_THUMB 0x01c2 -#define IMAGE_FILE_MACHINE_ARMV7 0x01c4 +#define IMAGE_FILE_MACHINE_ARMNT 0x01c4 #define IMAGE_FILE_MACHINE_AM33 0x01d3 #define IMAGE_FILE_MACHINE_POWERPC 0x01f0 #define IMAGE_FILE_MACHINE_POWERPCFP 0x01f1 diff --git a/programs/winedbg/be_arm.c b/programs/winedbg/be_arm.c index f375fe8..2f1021e 100644 --- a/programs/winedbg/be_arm.c +++ b/programs/winedbg/be_arm.c @@ -1189,7 +1189,7 @@ static int be_arm_store_integer(const struct dbg_lvalue* lvalue, unsigned size, struct backend_cpu be_arm = { - IMAGE_FILE_MACHINE_ARMV7, + IMAGE_FILE_MACHINE_ARMNT, 4, be_cpu_linearize, be_cpu_build_addr, diff --git a/tools/winedump/pe.c b/tools/winedump/pe.c index c655451..4cf0b40 100644 --- a/tools/winedump/pe.c +++ b/tools/winedump/pe.c @@ -62,7 +62,7 @@ const char *get_machine_str(int mach) case IMAGE_FILE_MACHINE_AMD64: return "AMD64"; case IMAGE_FILE_MACHINE_IA64: return "IA64"; case IMAGE_FILE_MACHINE_ARM: return "ARM"; - case IMAGE_FILE_MACHINE_ARMV7: return "ARMv7"; + case IMAGE_FILE_MACHINE_ARMNT: return "ARMNT"; case IMAGE_FILE_MACHINE_THUMB: return "ARM Thumb"; case IMAGE_FILE_MACHINE_SPARC: return "SPARC"; }
1
0
0
0
Alexandre Julliard : winex11: Release the keyboard lock before sending input to the server.
by Alexandre Julliard
17 Aug '12
17 Aug '12
Module: wine Branch: master Commit: 03d377eae78243b26df2dbfb32faf8324335a513 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=03d377eae78243b26df2dbfb3…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Fri Aug 17 10:06:41 2012 +0200 winex11: Release the keyboard lock before sending input to the server. --- dlls/winex11.drv/keyboard.c | 17 ++++++++--------- 1 files changed, 8 insertions(+), 9 deletions(-) diff --git a/dlls/winex11.drv/keyboard.c b/dlls/winex11.drv/keyboard.c index 2ccacb7..ae7e72b 100644 --- a/dlls/winex11.drv/keyboard.c +++ b/dlls/winex11.drv/keyboard.c @@ -1417,18 +1417,17 @@ void X11DRV_KeyEvent( HWND hwnd, XEvent *xev ) TRACE_(key)("keycode %u converted to vkey 0x%X scan %02x\n", event->keycode, vkey, bScan); - if (vkey) - { - dwFlags = 0; - if ( event->type == KeyRelease ) dwFlags |= KEYEVENTF_KEYUP; - if ( vkey & 0x100 ) dwFlags |= KEYEVENTF_EXTENDEDKEY; + LeaveCriticalSection( &kbd_section ); - update_lock_state( hwnd, vkey, event->state, event_time ); + if (!vkey) return; - X11DRV_send_keyboard_input( hwnd, vkey & 0xff, bScan, dwFlags, event_time ); - } - LeaveCriticalSection( &kbd_section ); + dwFlags = 0; + if ( event->type == KeyRelease ) dwFlags |= KEYEVENTF_KEYUP; + if ( vkey & 0x100 ) dwFlags |= KEYEVENTF_EXTENDEDKEY; + + update_lock_state( hwnd, vkey, event->state, event_time ); + X11DRV_send_keyboard_input( hwnd, vkey & 0xff, bScan, dwFlags, event_time ); } /**********************************************************************
1
0
0
0
Bruno Jesus : wininet/tests: Add invalid index test for HttpQueryInfo.
by Alexandre Julliard
17 Aug '12
17 Aug '12
Module: wine Branch: master Commit: dc9f5becd16272a7bb814120eeef15222fa16cb2 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=dc9f5becd16272a7bb814120e…
Author: Bruno Jesus <00cpxxx(a)gmail.com> Date: Thu Aug 16 22:39:30 2012 -0300 wininet/tests: Add invalid index test for HttpQueryInfo. --- dlls/wininet/tests/http.c | 8 ++++++++ 1 files changed, 8 insertions(+), 0 deletions(-) diff --git a/dlls/wininet/tests/http.c b/dlls/wininet/tests/http.c index 84e7882..acbaf2e 100644 --- a/dlls/wininet/tests/http.c +++ b/dlls/wininet/tests/http.c @@ -2614,6 +2614,14 @@ static void test_HttpQueryInfo(int port) ok(ret, "HttpQueryInfo failed %u\n", GetLastError()); ok(index == 0, "expected 0 got %u\n", index); + index = 0xdeadbeef; /* invalid start index */ + size = sizeof(buffer); + ret = HttpQueryInfo(hr, HTTP_QUERY_RAW_HEADERS, buffer, &size, &index); + todo_wine ok(!ret, "HttpQueryInfo should have failed\n"); + todo_wine ok(GetLastError() == ERROR_HTTP_HEADER_NOT_FOUND, + "Expected ERROR_HTTP_HEADER_NOT_FOUND, got %u\n", GetLastError()); + + index = 0; size = sizeof(buffer); ret = HttpQueryInfo(hr, HTTP_QUERY_RAW_HEADERS_CRLF, buffer, &size, &index); ok(ret, "HttpQueryInfo failed %u\n", GetLastError());
1
0
0
0
Andrew Eikum : winealsa.drv: Remap mmdevapi channels to correct ALSA channels.
by Alexandre Julliard
17 Aug '12
17 Aug '12
Module: wine Branch: master Commit: d402231e3f148a30ceca15c1223a765f5a388379 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=d402231e3f148a30ceca15c12…
Author: Andrew Eikum <aeikum(a)codeweavers.com> Date: Thu Aug 16 14:12:04 2012 -0500 winealsa.drv: Remap mmdevapi channels to correct ALSA channels. --- dlls/winealsa.drv/mmdevdrv.c | 201 ++++++++++++++++++++++++++++++++++++------ 1 files changed, 173 insertions(+), 28 deletions(-) diff --git a/dlls/winealsa.drv/mmdevdrv.c b/dlls/winealsa.drv/mmdevdrv.c index 0b500ad..3a6bf33 100644 --- a/dlls/winealsa.drv/mmdevdrv.c +++ b/dlls/winealsa.drv/mmdevdrv.c @@ -108,15 +108,20 @@ struct ACImpl { HANDLE event; float *vols; + BOOL need_remapping; + int alsa_channels; + int alsa_channel_map[32]; + BOOL initted, started; REFERENCE_TIME mmdev_period_rt; UINT64 written_frames, last_pos_frames; UINT32 bufsize_frames, held_frames, tmp_buffer_frames, mmdev_period_frames; + snd_pcm_uframes_t remapping_buf_frames; UINT32 lcl_offs_frames; /* offs into local_buffer where valid data starts */ UINT32 hidden_frames; /* ALSA reserve to ensure continuous rendering */ HANDLE timer; - BYTE *local_buffer, *tmp_buffer; + BYTE *local_buffer, *tmp_buffer, *remapping_buf; LONG32 getbuf_last; /* <0 when using tmp_buffer */ CRITICAL_SECTION lock; @@ -885,6 +890,7 @@ static ULONG WINAPI AudioClient_Release(IAudioClient *iface) } HeapFree(GetProcessHeap(), 0, This->vols); HeapFree(GetProcessHeap(), 0, This->local_buffer); + HeapFree(GetProcessHeap(), 0, This->remapping_buf); HeapFree(GetProcessHeap(), 0, This->tmp_buffer); HeapFree(GetProcessHeap(), 0, This->hw_params); CoTaskMemFree(This->fmt); @@ -1071,6 +1077,121 @@ static HRESULT get_audio_session(const GUID *sessionguid, return S_OK; } +static int alsa_channel_index(DWORD flag) +{ + switch(flag){ + case SPEAKER_FRONT_LEFT: + return 0; + case SPEAKER_FRONT_RIGHT: + return 1; + case SPEAKER_BACK_LEFT: + return 2; + case SPEAKER_BACK_RIGHT: + return 3; + case SPEAKER_FRONT_CENTER: + return 4; + case SPEAKER_LOW_FREQUENCY: + return 5; + case SPEAKER_SIDE_LEFT: + return 6; + case SPEAKER_SIDE_RIGHT: + return 7; + } + return -1; +} + +static BOOL need_remapping(ACImpl *This, const WAVEFORMATEX *fmt) +{ + unsigned int i; + for(i = 0; i < fmt->nChannels; ++i){ + if(This->alsa_channel_map[i] != i) + return TRUE; + } + return FALSE; +} + +static DWORD get_channel_mask(unsigned int channels) +{ + switch(channels){ + case 0: + return 0; + case 1: + return KSAUDIO_SPEAKER_MONO; + case 2: + return KSAUDIO_SPEAKER_STEREO; + case 3: + return KSAUDIO_SPEAKER_STEREO | SPEAKER_LOW_FREQUENCY; + case 4: + return KSAUDIO_SPEAKER_QUAD; /* not _SURROUND */ + case 5: + return KSAUDIO_SPEAKER_QUAD | SPEAKER_LOW_FREQUENCY; + case 6: + return KSAUDIO_SPEAKER_5POINT1; /* not 5POINT1_SURROUND */ + case 7: + return KSAUDIO_SPEAKER_5POINT1 | SPEAKER_BACK_CENTER; + case 8: + return KSAUDIO_SPEAKER_7POINT1_SURROUND; /* Vista deprecates 7POINT1 */ + } + FIXME("Unknown speaker configuration: %u\n", channels); + return 0; +} + +static HRESULT map_channels(ACImpl *This, const WAVEFORMATEX *fmt) +{ + if(fmt->wFormatTag == WAVE_FORMAT_EXTENSIBLE || fmt->nChannels > 2){ + WAVEFORMATEXTENSIBLE *fmtex = (void*)fmt; + DWORD mask, flag = SPEAKER_FRONT_LEFT; + UINT i = 0; + + if(fmt->wFormatTag == WAVE_FORMAT_EXTENSIBLE && + fmtex->dwChannelMask != 0) + mask = fmtex->dwChannelMask; + else + mask = get_channel_mask(fmt->nChannels); + + This->alsa_channels = 0; + + while(i < fmt->nChannels && !(flag & SPEAKER_RESERVED)){ + if(mask & flag){ + This->alsa_channel_map[i] = alsa_channel_index(flag); + TRACE("Mapping mmdevapi channel %u (0x%x) to ALSA channel %d\n", + i, flag, This->alsa_channel_map[i]); + if(This->alsa_channel_map[i] >= This->alsa_channels) + This->alsa_channels = This->alsa_channel_map[i] + 1; + ++i; + } + flag <<= 1; + } + + while(i < fmt->nChannels){ + This->alsa_channel_map[i] = This->alsa_channels; + TRACE("Mapping mmdevapi channel %u to ALSA channel %d\n", + i, This->alsa_channel_map[i]); + ++This->alsa_channels; + ++i; + } + + for(i = 0; i < fmt->nChannels; ++i){ + if(This->alsa_channel_map[i] == -1){ + This->alsa_channel_map[i] = This->alsa_channels; + ++This->alsa_channels; + TRACE("Remapping mmdevapi channel %u to ALSA channel %d\n", + i, This->alsa_channel_map[i]); + } + } + + This->need_remapping = need_remapping(This, fmt); + + TRACE("need_remapping: %u, alsa_channels: %d\n", This->need_remapping, This->alsa_channels); + }else{ + This->need_remapping = FALSE; + This->alsa_channels = fmt->nChannels; + TRACE("need_remapping: %u, alsa_channels: %d\n", This->need_remapping, This->alsa_channels); + } + + return S_OK; +} + static HRESULT WINAPI AudioClient_Initialize(IAudioClient *iface, AUDCLNT_SHAREMODE mode, DWORD flags, REFERENCE_TIME duration, REFERENCE_TIME period, const WAVEFORMATEX *fmt, @@ -1135,6 +1256,12 @@ static HRESULT WINAPI AudioClient_Initialize(IAudioClient *iface, dump_fmt(fmt); + if(FAILED(map_channels(This, fmt))){ + WARN("map_channels failed\n"); + hr = AUDCLNT_E_ENDPOINT_CREATE_FAILED; + goto exit; + } + if((err = snd_pcm_hw_params_any(This->pcm_handle, This->hw_params)) < 0){ WARN("Unable to get hw_params: %d (%s)\n", err, snd_strerror(err)); hr = AUDCLNT_E_ENDPOINT_CREATE_FAILED; @@ -1174,7 +1301,7 @@ static HRESULT WINAPI AudioClient_Initialize(IAudioClient *iface, } if((err = snd_pcm_hw_params_set_channels(This->pcm_handle, This->hw_params, - fmt->nChannels)) < 0){ + This->alsa_channels)) < 0){ WARN("Unable to set channels to %u: %d (%s)\n", fmt->nChannels, err, snd_strerror(err)); hr = AUDCLNT_E_UNSUPPORTED_FORMAT; @@ -1428,32 +1555,6 @@ static HRESULT WINAPI AudioClient_GetCurrentPadding(IAudioClient *iface, return S_OK; } -static DWORD get_channel_mask(unsigned int channels) -{ - switch(channels){ - case 0: - return 0; - case 1: - return KSAUDIO_SPEAKER_MONO; - case 2: - return KSAUDIO_SPEAKER_STEREO; - case 3: - return KSAUDIO_SPEAKER_STEREO | SPEAKER_LOW_FREQUENCY; - case 4: - return KSAUDIO_SPEAKER_QUAD; /* not _SURROUND */ - case 5: - return KSAUDIO_SPEAKER_QUAD | SPEAKER_LOW_FREQUENCY; - case 6: - return KSAUDIO_SPEAKER_5POINT1; /* not 5POINT1_SURROUND */ - case 7: - return KSAUDIO_SPEAKER_5POINT1 | SPEAKER_BACK_CENTER; - case 8: - return KSAUDIO_SPEAKER_7POINT1_SURROUND; /* Vista deprecates 7POINT1 */ - } - FIXME("Unknown speaker configuration: %u\n", channels); - return 0; -} - static HRESULT WINAPI AudioClient_IsFormatSupported(IAudioClient *iface, AUDCLNT_SHAREMODE mode, const WAVEFORMATEX *fmt, WAVEFORMATEX **out) @@ -1550,6 +1651,16 @@ static HRESULT WINAPI AudioClient_IsFormatSupported(IAudioClient *iface, closest->nChannels = min; } + if(FAILED(map_channels(This, fmt))){ + hr = AUDCLNT_E_DEVICE_INVALIDATED; + WARN("map_channels failed\n"); + goto exit; + } + if(This->alsa_channels > max){ + hr = S_FALSE; + closest->nChannels = max; + } + if(closest->wFormatTag == WAVE_FORMAT_EXTENSIBLE) ((WAVEFORMATEXTENSIBLE*)closest)->dwChannelMask = get_channel_mask(closest->nChannels); @@ -1706,6 +1817,38 @@ static HRESULT WINAPI AudioClient_GetDevicePeriod(IAudioClient *iface, return S_OK; } +static BYTE *remap_channels(ACImpl *This, BYTE *buf, snd_pcm_uframes_t frames) +{ + snd_pcm_uframes_t i; + UINT c; + UINT bytes_per_sample = This->fmt->wBitsPerSample / 8; + + if(!This->need_remapping) + return buf; + + if(!This->remapping_buf){ + This->remapping_buf = HeapAlloc(GetProcessHeap(), 0, + (This->fmt->wBitsPerSample / 8) * This->alsa_channels * frames); + This->remapping_buf_frames = frames; + }else if(This->remapping_buf_frames < frames){ + This->remapping_buf = HeapReAlloc(GetProcessHeap(), 0, This->remapping_buf, + (This->fmt->wBitsPerSample / 8) * This->alsa_channels * frames); + This->remapping_buf_frames = frames; + } + + snd_pcm_format_set_silence(This->alsa_format, This->remapping_buf, + frames * This->alsa_channels); + + for(i = 0; i < frames; ++i){ + for(c = 0; c < This->fmt->nChannels; ++c){ + memcpy(&This->remapping_buf[(i * This->alsa_channels + This->alsa_channel_map[c]) * bytes_per_sample], + &buf[(i * This->fmt->nChannels + c) * bytes_per_sample], bytes_per_sample); + } + } + + return This->remapping_buf; +} + static snd_pcm_sframes_t alsa_write_best_effort(snd_pcm_t *handle, BYTE *buf, snd_pcm_uframes_t frames, ACImpl *This, BOOL mute) { @@ -1719,6 +1862,8 @@ static snd_pcm_sframes_t alsa_write_best_effort(snd_pcm_t *handle, BYTE *buf, snd_strerror(err)); } + buf = remap_channels(This, buf, frames); + written = snd_pcm_writei(handle, buf, frames); if(written < 0){ int ret;
1
0
0
0
Andrew Eikum : winealsa.drv: Don't cap the allowed number of channels.
by Alexandre Julliard
17 Aug '12
17 Aug '12
Module: wine Branch: master Commit: 36eb79e7f8cde36846120ecb082da4453f74aad3 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=36eb79e7f8cde36846120ecb0…
Author: Andrew Eikum <aeikum(a)codeweavers.com> Date: Thu Aug 16 14:11:57 2012 -0500 winealsa.drv: Don't cap the allowed number of channels. --- dlls/winealsa.drv/mmdevdrv.c | 15 ++------------- 1 files changed, 2 insertions(+), 13 deletions(-) diff --git a/dlls/winealsa.drv/mmdevdrv.c b/dlls/winealsa.drv/mmdevdrv.c index 93e2b8d..0b500ad 100644 --- a/dlls/winealsa.drv/mmdevdrv.c +++ b/dlls/winealsa.drv/mmdevdrv.c @@ -1463,7 +1463,6 @@ static HRESULT WINAPI AudioClient_IsFormatSupported(IAudioClient *iface, snd_pcm_format_t format; HRESULT hr = S_OK; WAVEFORMATEX *closest = NULL; - const WAVEFORMATEXTENSIBLE *fmtex = (const WAVEFORMATEXTENSIBLE *)fmt; unsigned int max = 0, min = 0; int err; @@ -1543,8 +1542,6 @@ static HRESULT WINAPI AudioClient_IsFormatSupported(IAudioClient *iface, WARN("Unable to get max channels: %d (%s)\n", err, snd_strerror(err)); goto exit; } - if(max > 8) - max = 2; if(fmt->nChannels > max){ hr = S_FALSE; closest->nChannels = max; @@ -1553,16 +1550,8 @@ static HRESULT WINAPI AudioClient_IsFormatSupported(IAudioClient *iface, closest->nChannels = min; } - if(closest->wFormatTag == WAVE_FORMAT_EXTENSIBLE){ - DWORD mask = get_channel_mask(closest->nChannels); - - ((WAVEFORMATEXTENSIBLE*)closest)->dwChannelMask = mask; - - if(fmt->wFormatTag == WAVE_FORMAT_EXTENSIBLE && - fmtex->dwChannelMask != 0 && - fmtex->dwChannelMask != mask) - hr = S_FALSE; - } + if(closest->wFormatTag == WAVE_FORMAT_EXTENSIBLE) + ((WAVEFORMATEXTENSIBLE*)closest)->dwChannelMask = get_channel_mask(closest->nChannels); exit: LeaveCriticalSection(&This->lock);
1
0
0
0
Vincent Povirk : windowscodecs: Add test for IWICImagingFactory:: CreateBitmapFromSource.
by Alexandre Julliard
16 Aug '12
16 Aug '12
Module: wine Branch: master Commit: 6c1fcaa3924966e9d0323495975a3da8be0e0095 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=6c1fcaa3924966e9d03234959…
Author: Vincent Povirk <vincent(a)codeweavers.com> Date: Tue Aug 14 16:15:12 2012 -0500 windowscodecs: Add test for IWICImagingFactory::CreateBitmapFromSource. --- dlls/windowscodecs/tests/bitmap.c | 103 +++++++++++++++++++++++++++++++++++++ 1 files changed, 103 insertions(+), 0 deletions(-) diff --git a/dlls/windowscodecs/tests/bitmap.c b/dlls/windowscodecs/tests/bitmap.c index 34305cd..56b4cfd 100644 --- a/dlls/windowscodecs/tests/bitmap.c +++ b/dlls/windowscodecs/tests/bitmap.c @@ -264,6 +264,108 @@ static void test_createbitmap(void) IWICBitmap_Release(bitmap); } +static void test_createbitmapfromsource(void) +{ + HRESULT hr; + IWICBitmap *bitmap, *bitmap2; + IWICPalette *palette; + IWICBitmapLock *lock; + int i; + WICRect rc; + const BYTE bitmap_data[27] = { + 128,128,255, 128,128,128, 128,255,128, + 128,128,128, 128,128,128, 255,255,255, + 255,128,128, 255,255,255, 255,255,255}; + BYTE returned_data[27] = {0}; + BYTE *lock_buffer=NULL; + UINT lock_buffer_stride=0; + UINT lock_buffer_size=0; + WICPixelFormatGUID pixelformat = {0}; + UINT width=0, height=0; + double dpix=10.0, dpiy=10.0; + + hr = IWICImagingFactory_CreateBitmap(factory, 3, 3, &GUID_WICPixelFormat24bppBGR, + WICBitmapCacheOnLoad, &bitmap); + ok(hr == S_OK, "IWICImagingFactory_CreateBitmap failed hr=%x\n", hr); + + if (FAILED(hr)) + return; + + hr = IWICImagingFactory_CreatePalette(factory, &palette); + ok(hr == S_OK, "IWICImagingFactory_CreatePalette failed hr=%x\n", hr); + + hr = IWICPalette_InitializePredefined(palette, WICBitmapPaletteTypeFixedGray256, FALSE); + ok(hr == S_OK, "IWICPalette_InitializePredefined failed hr=%x\n", hr); + + hr = IWICBitmap_SetPalette(bitmap, palette); + ok(hr == S_OK, "IWICBitmap_SetPalette failed hr=%x\n", hr); + + IWICPalette_Release(palette); + + rc.X = rc.Y = 0; + rc.Width = 3; + rc.Height = 3; + hr = IWICBitmap_Lock(bitmap, &rc, WICBitmapLockWrite, &lock); + ok(hr == S_OK, "IWICBitmap_Lock failed hr=%x\n", hr); + if (SUCCEEDED(hr)) + { + hr = IWICBitmapLock_GetStride(lock, &lock_buffer_stride); + ok(hr == S_OK, "IWICBitmapLock_GetStride failed hr=%x\n", hr); + ok(lock_buffer_stride == 12, "got %i, expected 12\n", lock_buffer_stride); + + hr = IWICBitmapLock_GetDataPointer(lock, &lock_buffer_size, &lock_buffer); + ok(hr == S_OK, "IWICBitmapLock_GetDataPointer failed hr=%x\n", hr); + ok(lock_buffer_size == 33, "got %i, expected 33\n", lock_buffer_size); + ok(lock_buffer != NULL, "got NULL data pointer\n"); + + for (i=0; i<3; i++) + memcpy(lock_buffer + lock_buffer_stride*i, bitmap_data + i*9, 9); + + IWICBitmapLock_Release(lock); + } + + hr = IWICBitmap_SetResolution(bitmap, 12.0, 34.0); + ok(hr == S_OK, "IWICBitmap_SetResolution failed hr=%x\n", hr); + + hr = IWICImagingFactory_CreateBitmapFromSource(factory, (IWICBitmapSource*)bitmap, + WICBitmapCacheOnLoad, &bitmap2); + todo_wine ok(hr == S_OK, "IWICImagingFactory_CreateBitmapFromSource failed hr=%x\n", hr); + + IWICBitmap_Release(bitmap); + + if (FAILED(hr)) return; + + hr = IWICImagingFactory_CreatePalette(factory, &palette); + ok(hr == S_OK, "IWICImagingFactory_CreatePalette failed hr=%x\n", hr); + + hr = IWICBitmap_CopyPalette(bitmap2, palette); + ok(hr == WINCODEC_ERR_PALETTEUNAVAILABLE, "IWICBitmap_CopyPalette failed hr=%x\n", hr); + + IWICPalette_Release(palette); + + hr = IWICBitmap_CopyPixels(bitmap2, NULL, 9, 27, returned_data); + ok(hr == S_OK, "IWICBitmap_CopyPixels failed hr=%x\n", hr); + + for (i=0; i<27; i++) + ok(returned_data[i] == bitmap_data[i], "returned_data[%i] == %i\n", i, returned_data[i]); + + hr = IWICBitmap_GetPixelFormat(bitmap2, &pixelformat); + ok(hr == S_OK, "IWICBitmap_GetPixelFormat failed hr=%x\n", hr); + ok(IsEqualGUID(&pixelformat, &GUID_WICPixelFormat24bppBGR), "unexpected pixel format\n"); + + hr = IWICBitmap_GetResolution(bitmap2, &dpix, &dpiy); + ok(hr == S_OK, "IWICBitmap_GetResolution failed hr=%x\n", hr); + ok(dpix == 12.0, "got %f, expected 12.0\n", dpix); + ok(dpiy == 34.0, "got %f, expected 34.0\n", dpiy); + + hr = IWICBitmap_GetSize(bitmap2, &width, &height); + ok(hr == S_OK, "IWICBitmap_GetSize failed hr=%x\n", hr); + ok(width == 3, "got %d, expected 3\n", width); + ok(height == 3, "got %d, expected 3\n", height); + + IWICBitmap_Release(bitmap2); +} + START_TEST(bitmap) { HRESULT hr; @@ -275,6 +377,7 @@ START_TEST(bitmap) ok(SUCCEEDED(hr), "CoCreateInstance failed, hr=%x\n", hr); test_createbitmap(); + test_createbitmapfromsource(); IWICImagingFactory_Release(factory);
1
0
0
0
Vincent Povirk : windowscodecs: Implement IWICBitmap:: SetResolution and GetResolution.
by Alexandre Julliard
16 Aug '12
16 Aug '12
Module: wine Branch: master Commit: 3e88d4ff0fcde40879228f129d430198f0d13f4b URL:
http://source.winehq.org/git/wine.git/?a=commit;h=3e88d4ff0fcde40879228f129…
Author: Vincent Povirk <vincent(a)codeweavers.com> Date: Tue Aug 14 15:54:10 2012 -0500 windowscodecs: Implement IWICBitmap::SetResolution and GetResolution. --- dlls/windowscodecs/bitmap.c | 30 ++++++++++++++++++++++++++---- dlls/windowscodecs/tests/bitmap.c | 2 -- 2 files changed, 26 insertions(+), 6 deletions(-) diff --git a/dlls/windowscodecs/bitmap.c b/dlls/windowscodecs/bitmap.c index 22a4876..520fdef 100644 --- a/dlls/windowscodecs/bitmap.c +++ b/dlls/windowscodecs/bitmap.c @@ -44,6 +44,8 @@ typedef struct BitmapImpl { UINT stride; UINT bpp; WICPixelFormatGUID pixelformat; + double dpix, dpiy; + CRITICAL_SECTION cs; } BitmapImpl; typedef struct BitmapLockImpl { @@ -256,6 +258,8 @@ static ULONG WINAPI BitmapImpl_Release(IWICBitmap *iface) if (ref == 0) { if (This->palette) IWICPalette_Release(This->palette); + This->cs.DebugInfo->Spare[0] = 0; + DeleteCriticalSection(&This->cs); HeapFree(GetProcessHeap(), 0, This->data); HeapFree(GetProcessHeap(), 0, This); } @@ -295,9 +299,18 @@ static HRESULT WINAPI BitmapImpl_GetPixelFormat(IWICBitmap *iface, static HRESULT WINAPI BitmapImpl_GetResolution(IWICBitmap *iface, double *pDpiX, double *pDpiY) { - FIXME("(%p,%p,%p)\n", iface, pDpiX, pDpiY); + BitmapImpl *This = impl_from_IWICBitmap(iface); + TRACE("(%p,%p,%p)\n", iface, pDpiX, pDpiY); + + if (!pDpiX || !pDpiY) + return E_INVALIDARG; + + EnterCriticalSection(&This->cs); + *pDpiX = This->dpix; + *pDpiY = This->dpiy; + LeaveCriticalSection(&This->cs); - return E_NOTIMPL; + return S_OK; } static HRESULT WINAPI BitmapImpl_CopyPalette(IWICBitmap *iface, @@ -408,9 +421,15 @@ static HRESULT WINAPI BitmapImpl_SetPalette(IWICBitmap *iface, IWICPalette *pIPa static HRESULT WINAPI BitmapImpl_SetResolution(IWICBitmap *iface, double dpiX, double dpiY) { - FIXME("(%p,%f,%f)\n", iface, dpiX, dpiY); + BitmapImpl *This = impl_from_IWICBitmap(iface); + TRACE("(%p,%f,%f)\n", iface, dpiX, dpiY); - return E_NOTIMPL; + EnterCriticalSection(&This->cs); + This->dpix = dpiX; + This->dpiy = dpiY; + LeaveCriticalSection(&This->cs); + + return S_OK; } static const IWICBitmapVtbl BitmapImpl_Vtbl = { @@ -462,6 +481,9 @@ HRESULT BitmapImpl_Create(UINT uiWidth, UINT uiHeight, This->stride = stride; This->bpp = bpp; memcpy(&This->pixelformat, pixelFormat, sizeof(GUID)); + This->dpix = This->dpiy = 0.0; + InitializeCriticalSection(&This->cs); + This->cs.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": BitmapImpl.lock"); *ppIBitmap = &This->IWICBitmap_iface; diff --git a/dlls/windowscodecs/tests/bitmap.c b/dlls/windowscodecs/tests/bitmap.c index a0926ab..34305cd 100644 --- a/dlls/windowscodecs/tests/bitmap.c +++ b/dlls/windowscodecs/tests/bitmap.c @@ -243,7 +243,6 @@ static void test_createbitmap(void) ok(hr == S_OK, "IWICBitmap_GetPixelFormat failed hr=%x\n", hr); ok(IsEqualGUID(&pixelformat, &GUID_WICPixelFormat24bppBGR), "unexpected pixel format\n"); -todo_wine { hr = IWICBitmap_GetResolution(bitmap, &dpix, &dpiy); ok(hr == S_OK, "IWICBitmap_GetResolution failed hr=%x\n", hr); ok(dpix == 0.0, "got %f, expected 0.0\n", dpix); @@ -256,7 +255,6 @@ todo_wine { ok(hr == S_OK, "IWICBitmap_GetResolution failed hr=%x\n", hr); ok(dpix == 12.0, "got %f, expected 12.0\n", dpix); ok(dpiy == 34.0, "got %f, expected 34.0\n", dpiy); -} hr = IWICBitmap_GetSize(bitmap, &width, &height); ok(hr == S_OK, "IWICBitmap_GetSize failed hr=%x\n", hr);
1
0
0
0
Vincent Povirk : windowscodecs: Implement IWICBitmap::GetSize.
by Alexandre Julliard
16 Aug '12
16 Aug '12
Module: wine Branch: master Commit: a62bd245a4d36ef18a931ed93d959f7e953b9617 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=a62bd245a4d36ef18a931ed93…
Author: Vincent Povirk <vincent(a)codeweavers.com> Date: Tue Aug 14 15:49:02 2012 -0500 windowscodecs: Implement IWICBitmap::GetSize. --- dlls/windowscodecs/bitmap.c | 11 +++++++++-- dlls/windowscodecs/tests/bitmap.c | 2 +- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/dlls/windowscodecs/bitmap.c b/dlls/windowscodecs/bitmap.c index 0a7ecf5..22a4876 100644 --- a/dlls/windowscodecs/bitmap.c +++ b/dlls/windowscodecs/bitmap.c @@ -266,9 +266,16 @@ static ULONG WINAPI BitmapImpl_Release(IWICBitmap *iface) static HRESULT WINAPI BitmapImpl_GetSize(IWICBitmap *iface, UINT *puiWidth, UINT *puiHeight) { - FIXME("(%p,%p,%p)\n", iface, puiWidth, puiHeight); + BitmapImpl *This = impl_from_IWICBitmap(iface); + TRACE("(%p,%p,%p)\n", iface, puiWidth, puiHeight); - return E_NOTIMPL; + if (!puiWidth || !puiHeight) + return E_INVALIDARG; + + *puiWidth = This->width; + *puiHeight = This->height; + + return S_OK; } static HRESULT WINAPI BitmapImpl_GetPixelFormat(IWICBitmap *iface, diff --git a/dlls/windowscodecs/tests/bitmap.c b/dlls/windowscodecs/tests/bitmap.c index fc45375..a0926ab 100644 --- a/dlls/windowscodecs/tests/bitmap.c +++ b/dlls/windowscodecs/tests/bitmap.c @@ -256,12 +256,12 @@ todo_wine { ok(hr == S_OK, "IWICBitmap_GetResolution failed hr=%x\n", hr); ok(dpix == 12.0, "got %f, expected 12.0\n", dpix); ok(dpiy == 34.0, "got %f, expected 34.0\n", dpiy); +} hr = IWICBitmap_GetSize(bitmap, &width, &height); ok(hr == S_OK, "IWICBitmap_GetSize failed hr=%x\n", hr); ok(width == 3, "got %d, expected 3\n", width); ok(height == 3, "got %d, expected 3\n", height); -} IWICBitmap_Release(bitmap); }
1
0
0
0
← Newer
1
...
26
27
28
29
30
31
32
...
55
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
Results per page:
10
25
50
100
200