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
November 2016
----- 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
465 discussions
Start a n
N
ew thread
Hans Leidekker : msi: Fix MSIREG_OpenUserComponentsKey and MSIREG_DeleteUpgradeCodesKey for Wow64.
by Alexandre Julliard
29 Nov '16
29 Nov '16
Module: wine Branch: master Commit: 3b5b3ef185fc303b7b64dd27365b5e9992cbe730 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=3b5b3ef185fc303b7b64dd273…
Author: Hans Leidekker <hans(a)codeweavers.com> Date: Tue Nov 29 09:43:59 2016 +0100 msi: Fix MSIREG_OpenUserComponentsKey and MSIREG_DeleteUpgradeCodesKey for Wow64. Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/msi/registry.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/dlls/msi/registry.c b/dlls/msi/registry.c index 1f87cbb..cbc8d8d 100644 --- a/dlls/msi/registry.c +++ b/dlls/msi/registry.c @@ -653,6 +653,7 @@ UINT MSIREG_OpenUserDataFeaturesKey(LPCWSTR szProduct, LPCWSTR szUserSid, MSIINS UINT MSIREG_OpenUserComponentsKey(LPCWSTR szComponent, HKEY *key, BOOL create) { WCHAR squashed_cc[SQUASHED_GUID_SIZE], keypath[0x200]; + REGSAM access = KEY_WOW64_64KEY | KEY_ALL_ACCESS; UINT ret; if (!squash_guid( szComponent, squashed_cc)) return ERROR_FUNCTION_FAILED; @@ -667,7 +668,7 @@ UINT MSIREG_OpenUserComponentsKey(LPCWSTR szComponent, HKEY *key, BOOL create) strcpyW(keypath, szInstaller_Components); strcatW( keypath, squashed_cc ); - return RegOpenKeyW(HKEY_LOCAL_MACHINE, keypath, key); + return RegOpenKeyExW( HKEY_LOCAL_MACHINE, keypath, 0, access, key ); } UINT MSIREG_OpenUserDataComponentKey(LPCWSTR szComponent, LPCWSTR szUserSid, HKEY *key, BOOL create) @@ -942,14 +943,18 @@ UINT MSIREG_OpenUserUpgradeCodesKey(LPCWSTR szUpgradeCode, HKEY* key, BOOL creat UINT MSIREG_DeleteUpgradeCodesKey( const WCHAR *code ) { - WCHAR squashed_code[SQUASHED_GUID_SIZE], keypath[0x200]; + WCHAR squashed_code[SQUASHED_GUID_SIZE]; + REGSAM access = KEY_WOW64_64KEY | KEY_ALL_ACCESS; + HKEY hkey; + LONG ret; if (!squash_guid( code, squashed_code )) return ERROR_FUNCTION_FAILED; TRACE( "%s squashed %s\n", debugstr_w(code), debugstr_w(squashed_code) ); - strcpyW( keypath, szInstaller_UpgradeCodes ); - strcatW( keypath, squashed_code ); - return RegDeleteTreeW( HKEY_LOCAL_MACHINE, keypath ); + if (RegOpenKeyExW( HKEY_LOCAL_MACHINE, szInstaller_UpgradeCodes, 0, access, &hkey )) return ERROR_SUCCESS; + ret = RegDeleteTreeW( hkey, squashed_code ); + RegCloseKey( hkey ); + return ret; } UINT MSIREG_DeleteUserUpgradeCodesKey(LPCWSTR szUpgradeCode)
1
0
0
0
Nikolay Sivov : ntoskrnl: Added RtlCopyMemory() export.
by Alexandre Julliard
29 Nov '16
29 Nov '16
Module: wine Branch: master Commit: 68f22743bd949db2f417a38de93de954388ac62e URL:
http://source.winehq.org/git/wine.git/?a=commit;h=68f22743bd949db2f417a38de…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Tue Nov 29 09:20:42 2016 +0300 ntoskrnl: Added RtlCopyMemory() export. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntoskrnl.exe/ntoskrnl.exe.spec | 1 + 1 file changed, 1 insertion(+) diff --git a/dlls/ntoskrnl.exe/ntoskrnl.exe.spec b/dlls/ntoskrnl.exe/ntoskrnl.exe.spec index ce7c517..b379beb 100644 --- a/dlls/ntoskrnl.exe/ntoskrnl.exe.spec +++ b/dlls/ntoskrnl.exe/ntoskrnl.exe.spec @@ -963,6 +963,7 @@ @ stdcall RtlConvertSidToUnicodeString(ptr ptr long) ntdll.RtlConvertSidToUnicodeString @ stdcall -arch=win32 -ret64 RtlConvertUlongToLargeInteger(long) ntdll.RtlConvertUlongToLargeInteger @ stdcall RtlCopyLuid(ptr ptr) ntdll.RtlCopyLuid +@ stdcall -arch=x86_64 RtlCopyMemory(ptr ptr long) ntdll.RtlCopyMemory @ stub RtlCopyRangeList @ stdcall RtlCopySid(long ptr ptr) ntdll.RtlCopySid @ stdcall RtlCopyString(ptr ptr) ntdll.RtlCopyString
1
0
0
0
Daniel Lehman : msvcrt: Add _lfind_s.
by Alexandre Julliard
29 Nov '16
29 Nov '16
Module: wine Branch: master Commit: cada88a64b8484d1af906caff69e383c944e114a URL:
http://source.winehq.org/git/wine.git/?a=commit;h=cada88a64b8484d1af906caff…
Author: Daniel Lehman <dlehman25(a)gmail.com> Date: Mon Nov 28 19:37:18 2016 -0800 msvcrt: Add _lfind_s. Signed-off-by: Daniel Lehman <dlehman25(a)gmail.com> Signed-off-by: Piotr Caban <piotr(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- .../api-ms-win-crt-utility-l1-1-0.spec | 2 +- dlls/msvcr100/msvcr100.spec | 2 +- dlls/msvcr110/msvcr110.spec | 2 +- dlls/msvcr120/msvcr120.spec | 2 +- dlls/msvcr120_app/msvcr120_app.spec | 2 +- dlls/msvcr80/msvcr80.spec | 2 +- dlls/msvcr90/msvcr90.spec | 2 +- dlls/msvcrt/misc.c | 26 ++++++++ dlls/msvcrt/msvcrt.spec | 2 +- dlls/msvcrt/tests/misc.c | 72 ++++++++++++++++++++++ dlls/ucrtbase/ucrtbase.spec | 2 +- 11 files changed, 107 insertions(+), 9 deletions(-) diff --git a/dlls/api-ms-win-crt-utility-l1-1-0/api-ms-win-crt-utility-l1-1-0.spec b/dlls/api-ms-win-crt-utility-l1-1-0/api-ms-win-crt-utility-l1-1-0.spec index b335cf8..12586d8 100644 --- a/dlls/api-ms-win-crt-utility-l1-1-0/api-ms-win-crt-utility-l1-1-0.spec +++ b/dlls/api-ms-win-crt-utility-l1-1-0/api-ms-win-crt-utility-l1-1-0.spec @@ -3,7 +3,7 @@ @ cdecl _byteswap_ulong(long) ucrtbase._byteswap_ulong @ cdecl _byteswap_ushort(long) ucrtbase._byteswap_ushort @ cdecl _lfind(ptr ptr ptr long ptr) ucrtbase._lfind -@ stub _lfind_s +@ cdecl _lfind_s(ptr ptr ptr long ptr ptr) ucrtbase._lfind_s @ cdecl _lrotl(long long) ucrtbase._lrotl @ cdecl _lrotr(long long) ucrtbase._lrotr @ cdecl _lsearch(ptr ptr ptr long ptr) ucrtbase._lsearch diff --git a/dlls/msvcr100/msvcr100.spec b/dlls/msvcr100/msvcr100.spec index 15d5339..a33d00a 100644 --- a/dlls/msvcr100/msvcr100.spec +++ b/dlls/msvcr100/msvcr100.spec @@ -1040,7 +1040,7 @@ @ cdecl _jn(long double) MSVCRT__jn @ cdecl _kbhit() @ cdecl _lfind(ptr ptr ptr long ptr) -@ stub _lfind_s +@ cdecl _lfind_s(ptr ptr ptr long ptr ptr) @ cdecl _loaddll(str) @ cdecl -arch=x86_64 _local_unwind(ptr ptr) @ cdecl -arch=i386 _local_unwind2(ptr long) diff --git a/dlls/msvcr110/msvcr110.spec b/dlls/msvcr110/msvcr110.spec index e4ca89d..97f39a5 100644 --- a/dlls/msvcr110/msvcr110.spec +++ b/dlls/msvcr110/msvcr110.spec @@ -1386,7 +1386,7 @@ @ cdecl _jn(long double) MSVCRT__jn @ cdecl _kbhit() @ cdecl _lfind(ptr ptr ptr long ptr) -@ stub _lfind_s +@ cdecl _lfind_s(ptr ptr ptr long ptr ptr) @ cdecl -arch=i386 _libm_sse2_acos_precise() MSVCRT___libm_sse2_acos @ cdecl -arch=i386 _libm_sse2_asin_precise() MSVCRT___libm_sse2_asin @ cdecl -arch=i386 _libm_sse2_atan_precise() MSVCRT___libm_sse2_atan diff --git a/dlls/msvcr120/msvcr120.spec b/dlls/msvcr120/msvcr120.spec index f305062..aeb42ee 100644 --- a/dlls/msvcr120/msvcr120.spec +++ b/dlls/msvcr120/msvcr120.spec @@ -1396,7 +1396,7 @@ @ cdecl _ldsign(double) MSVCR120__dsign @ cdecl _ldtest(ptr) MSVCR120__ldtest @ cdecl _lfind(ptr ptr ptr long ptr) -@ stub _lfind_s +@ cdecl _lfind_s(ptr ptr ptr long ptr ptr) @ cdecl -arch=i386 _libm_sse2_acos_precise() MSVCRT___libm_sse2_acos @ cdecl -arch=i386 _libm_sse2_asin_precise() MSVCRT___libm_sse2_asin @ cdecl -arch=i386 _libm_sse2_atan_precise() MSVCRT___libm_sse2_atan diff --git a/dlls/msvcr120_app/msvcr120_app.spec b/dlls/msvcr120_app/msvcr120_app.spec index 449e8e1..cae7585 100644 --- a/dlls/msvcr120_app/msvcr120_app.spec +++ b/dlls/msvcr120_app/msvcr120_app.spec @@ -1260,7 +1260,7 @@ @ cdecl _ldsign(double) msvcr120._ldsign @ cdecl _ldtest(ptr) msvcr120._ldtest @ cdecl _lfind(ptr ptr ptr long ptr) msvcr120._lfind -@ stub _lfind_s +@ cdecl _lfind_s(ptr ptr ptr long ptr ptr) msvcr120._lfind_s @ cdecl -arch=i386 _libm_sse2_acos_precise() msvcr120._libm_sse2_acos_precise @ cdecl -arch=i386 _libm_sse2_asin_precise() msvcr120._libm_sse2_asin_precise @ cdecl -arch=i386 _libm_sse2_atan_precise() msvcr120._libm_sse2_atan_precise diff --git a/dlls/msvcr80/msvcr80.spec b/dlls/msvcr80/msvcr80.spec index 4bcef50..ab81251 100644 --- a/dlls/msvcr80/msvcr80.spec +++ b/dlls/msvcr80/msvcr80.spec @@ -712,7 +712,7 @@ @ cdecl _jn(long double) MSVCRT__jn @ cdecl _kbhit() @ cdecl _lfind(ptr ptr ptr long ptr) -@ stub _lfind_s +@ cdecl _lfind_s(ptr ptr ptr long ptr ptr) @ cdecl _loaddll(str) @ cdecl -arch=x86_64 _local_unwind(ptr ptr) @ cdecl -arch=i386 _local_unwind2(ptr long) diff --git a/dlls/msvcr90/msvcr90.spec b/dlls/msvcr90/msvcr90.spec index 5c34e77..5f7d98f 100644 --- a/dlls/msvcr90/msvcr90.spec +++ b/dlls/msvcr90/msvcr90.spec @@ -690,7 +690,7 @@ @ cdecl _jn(long double) MSVCRT__jn @ cdecl _kbhit() @ cdecl _lfind(ptr ptr ptr long ptr) -@ stub _lfind_s +@ cdecl _lfind_s(ptr ptr ptr long ptr ptr) @ cdecl _loaddll(str) @ cdecl -arch=x86_64 _local_unwind(ptr ptr) @ cdecl -arch=i386 _local_unwind2(ptr long) diff --git a/dlls/msvcrt/misc.c b/dlls/msvcrt/misc.c index c1510ef..23a089a 100644 --- a/dlls/msvcrt/misc.c +++ b/dlls/msvcrt/misc.c @@ -103,6 +103,32 @@ void* CDECL _lfind(const void* match, const void* start, } /********************************************************************* + * _lfind_s (MSVCRT.@) + */ +void* CDECL _lfind_s(const void* match, const void* start, + unsigned int* array_size, unsigned int elem_size, + int (CDECL *cf)(void*,const void*,const void*), + void* context) +{ + unsigned int size; + if (!MSVCRT_CHECK_PMT(match != NULL)) return NULL; + if (!MSVCRT_CHECK_PMT(array_size != NULL)) return NULL; + if (!MSVCRT_CHECK_PMT(start != NULL || *array_size == 0)) return NULL; + if (!MSVCRT_CHECK_PMT(cf != NULL)) return NULL; + if (!MSVCRT_CHECK_PMT(elem_size != 0)) return NULL; + + size = *array_size; + if (size) + do + { + if (cf(context, match, start) == 0) + return (void *)start; /* found */ + start = (const char *)start + elem_size; + } while (--size); + return NULL; +} + +/********************************************************************* * _lsearch (MSVCRT.@) */ void* CDECL _lsearch(const void* match, void* start, diff --git a/dlls/msvcrt/msvcrt.spec b/dlls/msvcrt/msvcrt.spec index 0c1d4ad..d38b0fa 100644 --- a/dlls/msvcrt/msvcrt.spec +++ b/dlls/msvcrt/msvcrt.spec @@ -655,7 +655,7 @@ @ cdecl _jn(long double) MSVCRT__jn @ cdecl _kbhit() @ cdecl _lfind(ptr ptr ptr long ptr) -# stub _lfind_s(ptr ptr ptr long ptr ptr) +@ cdecl _lfind_s(ptr ptr ptr long ptr ptr) @ cdecl _loaddll(str) @ cdecl -arch=x86_64 _local_unwind(ptr ptr) @ cdecl -arch=i386 _local_unwind2(ptr long) diff --git a/dlls/msvcrt/tests/misc.c b/dlls/msvcrt/tests/misc.c index 77f2873..a6d2833 100644 --- a/dlls/msvcrt/tests/misc.c +++ b/dlls/msvcrt/tests/misc.c @@ -59,6 +59,8 @@ static void (__cdecl *p_qsort_s)(void*, MSVCRT_size_t, MSVCRT_size_t, static double (__cdecl *p_atan)(double); static double (__cdecl *p_exp)(double); static double (__cdecl *p_tanh)(double); +static void *(__cdecl *p_lfind_s)(const void*, const void*, unsigned int*, + size_t, int (__cdecl *)(void*, const void*, const void*), void*); static void init(void) { @@ -76,6 +78,7 @@ static void init(void) p_atan = (void *)GetProcAddress(hmod, "atan"); p_exp = (void *)GetProcAddress(hmod, "exp"); p_tanh = (void *)GetProcAddress(hmod, "tanh"); + p_lfind_s = (void *)GetProcAddress(hmod, "_lfind_s"); } static void test_rand_s(void) @@ -597,6 +600,74 @@ static void test_thread_handle_close(void) ok(ret, "ret = %d\n", ret); } +static int __cdecl _lfind_s_comp(void *ctx, const void *l, const void *r) +{ + *(int *)ctx = 0xdeadc0de; + return *(int *)l - *(int *)r; +} + +static void test__lfind_s(void) +{ + static const int tests[] = {9000, 8001, 7002, 6003, 1003, 5004, 4005, 3006, 2007}; + unsigned int num; + void *found; + int ctx; + int key; + + if (!p_lfind_s) + { + win_skip("_lfind_s is not available\n"); + return; + } + + key = 1234; + num = sizeof(tests)/sizeof(tests[0]); + + errno = 0xdeadbeef; + found = p_lfind_s(NULL, tests, &num, sizeof(int), _lfind_s_comp, NULL); + ok(errno == EINVAL, "errno = %d\n", errno); + ok(!found, "Expected NULL, got %p\n", found); + + errno = 0xdeadbeef; + found = p_lfind_s(&key, NULL, &num, sizeof(int), _lfind_s_comp, NULL); + ok(errno == EINVAL, "errno = %d\n", errno); + ok(!found, "Expected NULL, got %p\n", found); + + errno = 0xdeadbeef; + found = p_lfind_s(&key, tests, &num, 0, _lfind_s_comp, NULL); + ok(errno == EINVAL, "errno = %d\n", errno); + ok(!found, "Expected NULL, got %p\n", found); + + errno = 0xdeadbeef; + found = p_lfind_s(&key, tests, &num, sizeof(int), NULL, NULL); + ok(errno == EINVAL, "errno = %d\n", errno); + ok(!found, "Expected NULL, got %p\n", found); + + ctx = -1; + key = 9000; + errno = 0xdeadbeef; + found = p_lfind_s(&key, tests, &num, sizeof(int), _lfind_s_comp, &ctx); + ok(errno == 0xdeadbeef, "errno = %d\n", errno); + ok(found == tests, "Expected %p, got %p\n", tests, found); + ok(ctx == 0xdeadc0de, "Expected 0xdeadc0de, got %x\n", ctx); + + ctx = -1; + key = 2007; + errno = 0xdeadbeef; + found = p_lfind_s(&key, tests, &num, sizeof(int), _lfind_s_comp, &ctx); + ok(errno == 0xdeadbeef, "errno = %d\n", errno); + ok(found == tests+8, "Expected %p, got %p\n", tests+8, found); + ok(ctx == 0xdeadc0de, "Expected 0xdeadc0de, got %x\n", ctx); + + ctx = -1; + key = 1234; + errno = 0xdeadbeef; + found = p_lfind_s(&key, tests, &num, sizeof(int), _lfind_s_comp, &ctx); + ok(errno == 0xdeadbeef, "errno = %d\n", errno); + ok(!found, "Expected NULL, got %p\n", found); + ok(ctx == 0xdeadc0de, "Expected 0xdeadc0de, got %x\n", ctx); +} + START_TEST(misc) { int arg_c; @@ -626,4 +697,5 @@ START_TEST(misc) test_qsort_s(); test_math_functions(); test_thread_handle_close(); + test__lfind_s(); } diff --git a/dlls/ucrtbase/ucrtbase.spec b/dlls/ucrtbase/ucrtbase.spec index 0005850..6253065 100644 --- a/dlls/ucrtbase/ucrtbase.spec +++ b/dlls/ucrtbase/ucrtbase.spec @@ -542,7 +542,7 @@ @ cdecl _ldtest(ptr) MSVCR120__ldtest @ stub _ldunscale @ cdecl _lfind(ptr ptr ptr long ptr) -@ stub _lfind_s +@ cdecl _lfind_s(ptr ptr ptr long ptr ptr) @ cdecl -arch=i386 _libm_sse2_acos_precise() MSVCRT___libm_sse2_acos @ cdecl -arch=i386 _libm_sse2_asin_precise() MSVCRT___libm_sse2_asin @ cdecl -arch=i386 _libm_sse2_atan_precise() MSVCRT___libm_sse2_atan
1
0
0
0
Huw Davies : msi: Correctly size packagecode as it's an unsquashed guid.
by Alexandre Julliard
29 Nov '16
29 Nov '16
Module: wine Branch: master Commit: 5ac02423b0e748e22a9db9683da4e3a114829cc4 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=5ac02423b0e748e22a9db9683…
Author: Huw Davies <huw(a)codeweavers.com> Date: Mon Nov 28 16:29:58 2016 +0000 msi: Correctly size packagecode as it's an unsquashed guid. Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/msi/msi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/msi/msi.c b/dlls/msi/msi.c index 518281d..892c756 100644 --- a/dlls/msi/msi.c +++ b/dlls/msi/msi.c @@ -1108,7 +1108,7 @@ static UINT MSI_GetProductInfo(LPCWSTR szProduct, LPCWSTR szAttribute, MSIINSTALLCONTEXT context = MSIINSTALLCONTEXT_USERUNMANAGED; UINT r = ERROR_UNKNOWN_PROPERTY; HKEY prodkey, userdata, source; - WCHAR *val = NULL, squashed_pc[SQUASHED_GUID_SIZE], packagecode[SQUASHED_GUID_SIZE]; + WCHAR *val = NULL, squashed_pc[SQUASHED_GUID_SIZE], packagecode[GUID_SIZE]; BOOL badconfig = FALSE; LONG res; DWORD type = REG_NONE;
1
0
0
0
Nikolay Sivov : wincodecs: Simplify property name allocation.
by Alexandre Julliard
28 Nov '16
28 Nov '16
Module: wine Branch: master Commit: b0d04e69bbc949324597082e6d36254bdb542171 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=b0d04e69bbc949324597082e6…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Thu Nov 24 12:23:46 2016 +0300 wincodecs: Simplify property name allocation. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Vincent Povirk <vincent(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/windowscodecs/propertybag.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/dlls/windowscodecs/propertybag.c b/dlls/windowscodecs/propertybag.c index 8e81ec0..2f3015c 100644 --- a/dlls/windowscodecs/propertybag.c +++ b/dlls/windowscodecs/propertybag.c @@ -94,7 +94,7 @@ static ULONG WINAPI PropertyBag_Release(IPropertyBag2 *iface) { for (i=0; i < This->prop_count; i++) { - HeapFree(GetProcessHeap(), 0, This->properties[i].pstrName); + CoTaskMemFree(This->properties[i].pstrName); VariantClear( This->values+i ); } } @@ -213,18 +213,14 @@ static HRESULT WINAPI PropertyBag_CountProperties(IPropertyBag2 *iface, ULONG *p return S_OK; } -static HRESULT copy_propbag2(PROPBAG2 *dest, PROPBAG2 *src, BOOL useCoAlloc) +static HRESULT copy_propbag2(PROPBAG2 *dest, PROPBAG2 *src) { dest->cfType = src->cfType; dest->clsid = src->clsid; dest->dwHint = src->dwHint; dest->dwType = src->dwType; dest->vt = src->vt; - if(useCoAlloc) - dest->pstrName = CoTaskMemAlloc((strlenW(src->pstrName)+1) * sizeof(WCHAR)); - else - dest->pstrName = HeapAlloc(GetProcessHeap(), 0, (strlenW(src->pstrName)+1) * sizeof(WCHAR)); - + dest->pstrName = CoTaskMemAlloc((strlenW(src->pstrName)+1) * sizeof(WCHAR)); if(!dest->pstrName) return E_OUTOFMEMORY; @@ -251,7 +247,7 @@ static HRESULT WINAPI PropertyBag_GetPropertyInfo(IPropertyBag2 *iface, ULONG iP for (i=0; i < *pcProperties; i++) { - res = copy_propbag2(pPropBag+i, This->properties+iProperty+i, TRUE); + res = copy_propbag2(pPropBag+i, This->properties+iProperty+i); if (FAILED(res)) { do { @@ -311,7 +307,7 @@ HRESULT CreatePropertyBag2(PROPBAG2 *options, UINT count, else for (i=0; i < count; i++) { - res = copy_propbag2(This->properties+i, options+i, FALSE); + res = copy_propbag2(This->properties+i, options+i); if (FAILED(res)) break; This->properties[i].dwHint = i+1; /* 0 means unset, so we start with 1 */
1
0
0
0
Nikolay Sivov : wincodecs: Implement FilterOption property for PNG encoder.
by Alexandre Julliard
28 Nov '16
28 Nov '16
Module: wine Branch: master Commit: 5107ef7566ea91f9319c7900addd88dd6c9a3445 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=5107ef7566ea91f9319c7900a…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Thu Nov 24 12:23:28 2016 +0300 wincodecs: Implement FilterOption property for PNG encoder. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Vincent Povirk <vincent(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/windowscodecs/pngformat.c | 63 ++++++++++++++++++++++++++++-------- dlls/windowscodecs/tests/converter.c | 19 ++++++++++- include/wincodec.idl | 11 +++++++ 3 files changed, 79 insertions(+), 14 deletions(-) diff --git a/dlls/windowscodecs/pngformat.c b/dlls/windowscodecs/pngformat.c index bb2aef9..9a84162 100644 --- a/dlls/windowscodecs/pngformat.c +++ b/dlls/windowscodecs/pngformat.c @@ -39,8 +39,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(wincodecs); -static const WCHAR wszPngInterlaceOption[] = {'I','n','t','e','r','l','a','c','e','O','p','t','i','o','n',0}; - static inline ULONG read_ulong_be(BYTE* data) { return data[0] << 24 | data[1] << 16 | data[2] << 8 | data[3]; @@ -327,6 +325,7 @@ MAKE_FUNCPTR(png_set_expand_gray_1_2_4_to_8); MAKE_FUNCPTR(png_set_gray_1_2_4_to_8); #endif MAKE_FUNCPTR(png_set_filler); +MAKE_FUNCPTR(png_set_filter); MAKE_FUNCPTR(png_set_gray_to_rgb); MAKE_FUNCPTR(png_set_interlace_handling); MAKE_FUNCPTR(png_set_IHDR); @@ -353,6 +352,9 @@ static CRITICAL_SECTION_DEBUG init_png_cs_debug = }; static CRITICAL_SECTION init_png_cs = { &init_png_cs_debug, -1, 0, 0, 0, 0 }; +static const WCHAR wszPngInterlaceOption[] = {'I','n','t','e','r','l','a','c','e','O','p','t','i','o','n',0}; +static const WCHAR wszPngFilterOption[] = {'F','i','l','t','e','r','O','p','t','i','o','n',0}; + static void *load_libpng(void) { void *result; @@ -392,6 +394,7 @@ static void *load_libpng(void) LOAD_FUNCPTR(png_set_gray_1_2_4_to_8); #endif LOAD_FUNCPTR(png_set_filler); + LOAD_FUNCPTR(png_set_filter); LOAD_FUNCPTR(png_set_gray_to_rgb); LOAD_FUNCPTR(png_set_interlace_handling); LOAD_FUNCPTR(png_set_IHDR); @@ -1356,6 +1359,7 @@ typedef struct PngEncoder { BOOL committed; CRITICAL_SECTION lock; BOOL interlace; + WICPngFilterOption filter; BYTE *data; UINT stride; UINT passes; @@ -1410,31 +1414,44 @@ static HRESULT WINAPI PngFrameEncode_Initialize(IWICBitmapFrameEncode *iface, IPropertyBag2 *pIEncoderOptions) { PngEncoder *This = impl_from_IWICBitmapFrameEncode(iface); + WICPngFilterOption filter; BOOL interlace; - PROPBAG2 opts[1]= {{0}}; - VARIANT opt_values[1]; - HRESULT opt_hres[1]; + PROPBAG2 opts[2]= {{0}}; + VARIANT opt_values[2]; + HRESULT opt_hres[2]; HRESULT hr; TRACE("(%p,%p)\n", iface, pIEncoderOptions); opts[0].pstrName = (LPOLESTR)wszPngInterlaceOption; opts[0].vt = VT_BOOL; + opts[1].pstrName = (LPOLESTR)wszPngFilterOption; + opts[1].vt = VT_UI1; if (pIEncoderOptions) { - hr = IPropertyBag2_Read(pIEncoderOptions, 1, opts, NULL, opt_values, opt_hres); + hr = IPropertyBag2_Read(pIEncoderOptions, sizeof(opts)/sizeof(opts[0]), opts, NULL, opt_values, opt_hres); if (FAILED(hr)) return hr; + + if (V_VT(&opt_values[0]) == VT_EMPTY) + interlace = FALSE; + else + interlace = (V_BOOL(&opt_values[0]) != 0); + + filter = V_UI1(&opt_values[1]); + if (filter > WICPngFilterAdaptive) + { + WARN("Unrecognized filter option value %u.\n", filter); + filter = WICPngFilterUnspecified; + } } else - memset(opt_values, 0, sizeof(opt_values)); - - if (V_VT(&opt_values[0]) == VT_EMPTY) + { interlace = FALSE; - else - interlace = (V_BOOL(&opt_values[0]) != 0); + filter = WICPngFilterUnspecified; + } EnterCriticalSection(&This->lock); @@ -1445,6 +1462,7 @@ static HRESULT WINAPI PngFrameEncode_Initialize(IWICBitmapFrameEncode *iface, } This->interlace = interlace; + This->filter = filter; This->frame_initialized = TRUE; @@ -1617,6 +1635,22 @@ static HRESULT WINAPI PngFrameEncode_WritePixels(IWICBitmapFrameEncode *iface, if (This->interlace) This->passes = ppng_set_interlace_handling(This->png_ptr); + if (This->filter != WICPngFilterUnspecified) + { + static const int png_filter_map[] = + { + /* WICPngFilterUnspecified */ PNG_NO_FILTERS, + /* WICPngFilterNone */ PNG_FILTER_NONE, + /* WICPngFilterSub */ PNG_FILTER_SUB, + /* WICPngFilterUp */ PNG_FILTER_UP, + /* WICPngFilterAverage */ PNG_FILTER_AVG, + /* WICPngFilterPaeth */ PNG_FILTER_PAETH, + /* WICPngFilterAdaptive */ PNG_ALL_FILTERS, + }; + + ppng_set_filter(This->png_ptr, 0, png_filter_map[This->filter]); + } + This->info_written = TRUE; } @@ -1926,7 +1960,7 @@ static HRESULT WINAPI PngEncoder_CreateNewFrame(IWICBitmapEncoder *iface, { PngEncoder *This = impl_from_IWICBitmapEncoder(iface); HRESULT hr; - PROPBAG2 opts[1]= {{0}}; + PROPBAG2 opts[2]= {{0}}; TRACE("(%p,%p,%p)\n", iface, ppIFrameEncode, ppIEncoderOptions); @@ -1947,8 +1981,11 @@ static HRESULT WINAPI PngEncoder_CreateNewFrame(IWICBitmapEncoder *iface, opts[0].pstrName = (LPOLESTR)wszPngInterlaceOption; opts[0].vt = VT_BOOL; opts[0].dwType = PROPBAG2_TYPE_DATA; + opts[1].pstrName = (LPOLESTR)wszPngFilterOption; + opts[1].vt = VT_UI1; + opts[1].dwType = PROPBAG2_TYPE_DATA; - hr = CreatePropertyBag2(opts, 1, ppIEncoderOptions); + hr = CreatePropertyBag2(opts, sizeof(opts)/sizeof(opts[0]), ppIEncoderOptions); if (FAILED(hr)) { LeaveCriticalSection(&This->lock); diff --git a/dlls/windowscodecs/tests/converter.c b/dlls/windowscodecs/tests/converter.c index 7ca201a..2af9857 100644 --- a/dlls/windowscodecs/tests/converter.c +++ b/dlls/windowscodecs/tests/converter.c @@ -418,11 +418,13 @@ typedef struct property_opt_test_data VARTYPE initial_var_type; int i_init_val; float f_init_val; + BOOL skippable; } property_opt_test_data; static const WCHAR wszTiffCompressionMethod[] = {'T','i','f','f','C','o','m','p','r','e','s','s','i','o','n','M','e','t','h','o','d',0}; static const WCHAR wszCompressionQuality[] = {'C','o','m','p','r','e','s','s','i','o','n','Q','u','a','l','i','t','y',0}; static const WCHAR wszInterlaceOption[] = {'I','n','t','e','r','l','a','c','e','O','p','t','i','o','n',0}; +static const WCHAR wszFilterOption[] = {'F','i','l','t','e','r','O','p','t','i','o','n',0}; static const struct property_opt_test_data testdata_tiff_props[] = { { wszTiffCompressionMethod, VT_UI1, VT_UI1, WICTiffCompressionDontCare }, @@ -430,6 +432,12 @@ static const struct property_opt_test_data testdata_tiff_props[] = { { NULL } }; +static const struct property_opt_test_data testdata_png_props[] = { + { wszInterlaceOption, VT_BOOL, VT_BOOL, 0 }, + { wszFilterOption, VT_UI1, VT_UI1, WICPngFilterUnspecified, 0.0f, TRUE /* not supported on XP/2k3 */}, + { NULL } +}; + static int find_property_index(const WCHAR* name, PROPBAG2* all_props, int all_prop_cnt) { int i; @@ -456,6 +464,13 @@ static void test_specific_encoder_properties(IPropertyBag2 *options, const prope hr = IPropertyBag2_Read(options, 1, &pb, NULL, &pvarValue, &phrError); + if (data[i].skippable && idx == -1) + { + win_skip("Property %s is not supported on this machine.\n", wine_dbgstr_w(data[i].name)); + i++; + continue; + } + ok(idx >= 0, "Property %s not in output of GetPropertyInfo\n", wine_dbgstr_w(data[i].name)); if (idx >= 0) @@ -543,8 +558,10 @@ static void test_encoder_properties(const CLSID* clsid_encoder, IPropertyBag2 *o (int)cProperties, (int)cProperties2); } - if (clsid_encoder == &CLSID_WICTiffEncoder) + if (IsEqualCLSID(clsid_encoder, &CLSID_WICTiffEncoder)) test_specific_encoder_properties(options, testdata_tiff_props, all_props, cProperties2); + else if (IsEqualCLSID(clsid_encoder, &CLSID_WICPngEncoder)) + test_specific_encoder_properties(options, testdata_png_props, all_props, cProperties2); for (i=0; i < cProperties2; i++) { diff --git a/include/wincodec.idl b/include/wincodec.idl index 83daba8..406fe6b 100644 --- a/include/wincodec.idl +++ b/include/wincodec.idl @@ -168,6 +168,17 @@ typedef enum WICTiffCompressionOption { WICTIFFCOMPRESSIONOPTION_FORCE_DWORD = CODEC_FORCE_DWORD } WICTiffCompressionOption; +typedef enum WICPngFilterOption { + WICPngFilterUnspecified = 0, + WICPngFilterNone = 1, + WICPngFilterSub = 2, + WICPngFilterUp = 3, + WICPngFilterAverage = 4, + WICPngFilterPaeth = 5, + WICPngFilterAdaptive = 6, + WICPNFFILTEROPTION_FORCE_DWORD = CODEC_FORCE_DWORD +} WICPngFilterOption; + typedef GUID WICPixelFormatGUID; typedef REFGUID REFWICPixelFormatGUID;
1
0
0
0
Nikolay Sivov : wincodecs: Trigger conversion to target format in WriteSource().
by Alexandre Julliard
28 Nov '16
28 Nov '16
Module: wine Branch: master Commit: 62830143d107be38342c27cfb45f30f0fe6d2d04 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=62830143d107be38342c27cfb…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Wed Nov 23 02:43:37 2016 +0300 wincodecs: Trigger conversion to target format in WriteSource(). Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Vincent Povirk <vincent(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/windowscodecs/main.c | 37 ++++++++++++++++++++----------------- 1 file changed, 20 insertions(+), 17 deletions(-) diff --git a/dlls/windowscodecs/main.c b/dlls/windowscodecs/main.c index 442976f..3bed565 100644 --- a/dlls/windowscodecs/main.c +++ b/dlls/windowscodecs/main.c @@ -122,30 +122,20 @@ HRESULT configure_write_source(IWICBitmapFrameEncode *iface, const WICPixelFormatGUID *format, INT width, INT height, double xres, double yres) { - HRESULT hr=S_OK; - WICPixelFormatGUID src_format, dst_format; + HRESULT hr = S_OK; if (width == 0 || height == 0) return WINCODEC_ERR_WRONGSTATE; - hr = IWICBitmapSource_GetPixelFormat(source, &src_format); - if (FAILED(hr)) return hr; - if (!format) { - dst_format = src_format; + WICPixelFormatGUID src_format; - hr = IWICBitmapFrameEncode_SetPixelFormat(iface, &dst_format); + hr = IWICBitmapSource_GetPixelFormat(source, &src_format); if (FAILED(hr)) return hr; - format = &dst_format; - } - - if (!IsEqualGUID(&src_format, format)) - { - /* FIXME: should use WICConvertBitmapSource to convert */ - ERR("format %s unsupported\n", debugstr_guid(&src_format)); - return E_FAIL; + hr = IWICBitmapFrameEncode_SetPixelFormat(iface, &src_format); + if (FAILED(hr)) return hr; } if (xres == 0.0 || yres == 0.0) @@ -164,6 +154,7 @@ HRESULT write_source(IWICBitmapFrameEncode *iface, const WICPixelFormatGUID *format, UINT bpp, INT width, INT height) { + IWICBitmapSource *converted_source; HRESULT hr=S_OK; WICRect rc; UINT stride; @@ -184,12 +175,23 @@ HRESULT write_source(IWICBitmapFrameEncode *iface, if (prc->Width != width || prc->Height <= 0) return E_INVALIDARG; + hr = WICConvertBitmapSource(format, source, &converted_source); + if (FAILED(hr)) + { + ERR("Failed to convert source, target format %s, %#x\n", debugstr_guid(format), hr); + return hr; + } + stride = (bpp * width + 7)/8; pixeldata = HeapAlloc(GetProcessHeap(), 0, stride * prc->Height); - if (!pixeldata) return E_OUTOFMEMORY; + if (!pixeldata) + { + IWICBitmapSource_Release(converted_source); + return E_OUTOFMEMORY; + } - hr = IWICBitmapSource_CopyPixels(source, prc, stride, + hr = IWICBitmapSource_CopyPixels(converted_source, prc, stride, stride*prc->Height, pixeldata); if (SUCCEEDED(hr)) @@ -199,6 +201,7 @@ HRESULT write_source(IWICBitmapFrameEncode *iface, } HeapFree(GetProcessHeap(), 0, pixeldata); + IWICBitmapSource_Release(converted_source); return hr; }
1
0
0
0
Akihiro Sagawa : strmbase: Add validation checks when updating destination rectangle.
by Alexandre Julliard
28 Nov '16
28 Nov '16
Module: wine Branch: master Commit: 40a596fa86f11fc2cf0d7481254692e07571418a URL:
http://source.winehq.org/git/wine.git/?a=commit;h=40a596fa86f11fc2cf0d74812…
Author: Akihiro Sagawa <sagawa.aki(a)gmail.com> Date: Fri Nov 25 01:10:07 2016 +0900 strmbase: Add validation checks when updating destination rectangle. Signed-off-by: Akihiro Sagawa <sagawa.aki(a)gmail.com> Signed-off-by: Andrew Eikum <aeikum(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/quartz/tests/filtergraph.c | 2 +- dlls/strmbase/video.c | 74 +++++++++++++++++++++++++++++------------ 2 files changed, 54 insertions(+), 22 deletions(-) diff --git a/dlls/quartz/tests/filtergraph.c b/dlls/quartz/tests/filtergraph.c index 1b72008..3077b38 100644 --- a/dlls/quartz/tests/filtergraph.c +++ b/dlls/quartz/tests/filtergraph.c @@ -172,7 +172,7 @@ static void test_basic_video(void) todo_wine ok(height == video_height, "expected %d, got %d\n", video_height, height); hr = IBasicVideo_SetDestinationPosition(pbv, 0, 0, 0, 0); - todo_wine ok(hr==E_INVALIDARG, "IBasicVideo_SetDestinationPosition returned: %x\n", hr); + ok(hr==E_INVALIDARG, "IBasicVideo_SetDestinationPosition returned: %x\n", hr); hr = IBasicVideo_SetDestinationPosition(pbv, 0, 0, video_width*2, video_height*2); ok(hr==S_OK, "Cannot put destination position returned: %x\n", hr); diff --git a/dlls/strmbase/video.c b/dlls/strmbase/video.c index 3f4d207..0f05d63 100644 --- a/dlls/strmbase/video.c +++ b/dlls/strmbase/video.c @@ -72,6 +72,14 @@ static HRESULT BaseControlVideoImpl_CheckSourceRect(BaseControlVideo *This, RECT return S_OK; } +static HRESULT BaseControlVideoImpl_CheckTargetRect(BaseControlVideo *This, RECT *pTargetRect) +{ + if (IsRectEmpty(pTargetRect)) + return E_INVALIDARG; + + return S_OK; +} + HRESULT WINAPI BaseControlVideoImpl_GetTypeInfoCount(IBasicVideo *iface, UINT *pctinfo) { BaseControlVideo *This = impl_from_IBasicVideo(iface); @@ -329,14 +337,20 @@ HRESULT WINAPI BaseControlVideoImpl_put_DestinationLeft(IBasicVideo *iface, LONG { RECT DestRect; BaseControlVideo *This = impl_from_IBasicVideo(iface); + HRESULT hr; TRACE("(%p/%p)->(%d)\n", This, iface, DestinationLeft); - This->pFuncsTable->pfnGetTargetRect(This, &DestRect); - DestRect.right = (DestRect.right - DestRect.left) + DestinationLeft; - DestRect.left = DestinationLeft; - This->pFuncsTable->pfnSetTargetRect(This, &DestRect); + hr = This->pFuncsTable->pfnGetTargetRect(This, &DestRect); + if (SUCCEEDED(hr)) + { + DestRect.right = (DestRect.right - DestRect.left) + DestinationLeft; + DestRect.left = DestinationLeft; + hr = BaseControlVideoImpl_CheckTargetRect(This, &DestRect); + } + if (SUCCEEDED(hr)) + hr = This->pFuncsTable->pfnSetTargetRect(This, &DestRect); - return S_OK; + return hr; } HRESULT WINAPI BaseControlVideoImpl_get_DestinationLeft(IBasicVideo *iface, LONG *pDestinationLeft) @@ -357,13 +371,19 @@ HRESULT WINAPI BaseControlVideoImpl_put_DestinationWidth(IBasicVideo *iface, LON { RECT DestRect; BaseControlVideo *This = impl_from_IBasicVideo(iface); + HRESULT hr; TRACE("(%p/%p)->(%d)\n", This, iface, DestinationWidth); - This->pFuncsTable->pfnGetTargetRect(This, &DestRect); - DestRect.right = DestRect.left + DestinationWidth; - This->pFuncsTable->pfnSetTargetRect(This, &DestRect); + hr = This->pFuncsTable->pfnGetTargetRect(This, &DestRect); + if (SUCCEEDED(hr)) + { + DestRect.right = DestRect.left + DestinationWidth; + hr = BaseControlVideoImpl_CheckTargetRect(This, &DestRect); + } + if (SUCCEEDED(hr)) + hr = This->pFuncsTable->pfnSetTargetRect(This, &DestRect); - return S_OK; + return hr; } HRESULT WINAPI BaseControlVideoImpl_get_DestinationWidth(IBasicVideo *iface, LONG *pDestinationWidth) @@ -384,14 +404,20 @@ HRESULT WINAPI BaseControlVideoImpl_put_DestinationTop(IBasicVideo *iface, LONG { RECT DestRect; BaseControlVideo *This = impl_from_IBasicVideo(iface); + HRESULT hr; TRACE("(%p/%p)->(%d)\n", This, iface, DestinationTop); - This->pFuncsTable->pfnGetTargetRect(This, &DestRect); - DestRect.bottom = (DestRect.bottom - DestRect.top) + DestinationTop; - DestRect.top = DestinationTop; - This->pFuncsTable->pfnSetTargetRect(This, &DestRect); + hr = This->pFuncsTable->pfnGetTargetRect(This, &DestRect); + if (SUCCEEDED(hr)) + { + DestRect.bottom = (DestRect.bottom - DestRect.top) + DestinationTop; + DestRect.top = DestinationTop; + hr = BaseControlVideoImpl_CheckTargetRect(This, &DestRect); + } + if (SUCCEEDED(hr)) + hr = This->pFuncsTable->pfnSetTargetRect(This, &DestRect); - return S_OK; + return hr; } HRESULT WINAPI BaseControlVideoImpl_get_DestinationTop(IBasicVideo *iface, LONG *pDestinationTop) @@ -412,13 +438,19 @@ HRESULT WINAPI BaseControlVideoImpl_put_DestinationHeight(IBasicVideo *iface, LO { RECT DestRect; BaseControlVideo *This = impl_from_IBasicVideo(iface); + HRESULT hr; TRACE("(%p/%p)->(%d)\n", This, iface, DestinationHeight); - This->pFuncsTable->pfnGetTargetRect(This, &DestRect); - DestRect.bottom = DestRect.top + DestinationHeight; - This->pFuncsTable->pfnSetTargetRect(This, &DestRect); + hr = This->pFuncsTable->pfnGetTargetRect(This, &DestRect); + if (SUCCEEDED(hr)) + { + DestRect.bottom = DestRect.top + DestinationHeight; + hr = BaseControlVideoImpl_CheckTargetRect(This, &DestRect); + } + if (SUCCEEDED(hr)) + hr = This->pFuncsTable->pfnSetTargetRect(This, &DestRect); - return S_OK; + return hr; } HRESULT WINAPI BaseControlVideoImpl_get_DestinationHeight(IBasicVideo *iface, LONG *pDestinationHeight) @@ -482,9 +514,9 @@ HRESULT WINAPI BaseControlVideoImpl_SetDestinationPosition(IBasicVideo *iface, L TRACE("(%p/%p)->(%d, %d, %d, %d)\n", This, iface, Left, Top, Width, Height); SetRect(&DestRect, Left, Top, Left + Width, Top + Height); - This->pFuncsTable->pfnSetTargetRect(This, &DestRect); - - return S_OK; + if (FAILED(BaseControlVideoImpl_CheckTargetRect(This, &DestRect))) + return E_INVALIDARG; + return This->pFuncsTable->pfnSetTargetRect(This, &DestRect); } HRESULT WINAPI BaseControlVideoImpl_GetDestinationPosition(IBasicVideo *iface, LONG *pLeft, LONG *pTop, LONG *pWidth, LONG *pHeight)
1
0
0
0
Akihiro Sagawa : strmbase: Add validation checks when updating source rectangle.
by Alexandre Julliard
28 Nov '16
28 Nov '16
Module: wine Branch: master Commit: 547f4bc2cf3263c880c99498d4a1ebde7daaf6a1 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=547f4bc2cf3263c880c99498d…
Author: Akihiro Sagawa <sagawa.aki(a)gmail.com> Date: Fri Nov 25 01:10:05 2016 +0900 strmbase: Add validation checks when updating source rectangle. Signed-off-by: Akihiro Sagawa <sagawa.aki(a)gmail.com> Signed-off-by: Andrew Eikum <aeikum(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/quartz/tests/filtergraph.c | 24 ++++++------ dlls/strmbase/video.c | 85 +++++++++++++++++++++++++++++++---------- 2 files changed, 76 insertions(+), 33 deletions(-) diff --git a/dlls/quartz/tests/filtergraph.c b/dlls/quartz/tests/filtergraph.c index 93fb2a0..1b72008 100644 --- a/dlls/quartz/tests/filtergraph.c +++ b/dlls/quartz/tests/filtergraph.c @@ -85,33 +85,33 @@ static void test_basic_video(void) ok(height == video_height, "expected %d, got %d\n", video_height, height); hr = IBasicVideo_SetSourcePosition(pbv, 0, 0, 0, 0); - todo_wine ok(hr==E_INVALIDARG, "IBasicVideo_SetSourcePosition returned: %x\n", hr); + ok(hr==E_INVALIDARG, "IBasicVideo_SetSourcePosition returned: %x\n", hr); hr = IBasicVideo_SetSourcePosition(pbv, 0, 0, video_width*2, video_height*2); - todo_wine ok(hr==E_INVALIDARG, "IBasicVideo_SetSourcePosition returned: %x\n", hr); + ok(hr==E_INVALIDARG, "IBasicVideo_SetSourcePosition returned: %x\n", hr); hr = IBasicVideo_put_SourceTop(pbv, -1); - todo_wine ok(hr==E_INVALIDARG, "IBasicVideo_put_SourceTop returned: %x\n", hr); + ok(hr==E_INVALIDARG, "IBasicVideo_put_SourceTop returned: %x\n", hr); hr = IBasicVideo_put_SourceTop(pbv, 0); ok(hr==S_OK, "Cannot put source top returned: %x\n", hr); hr = IBasicVideo_put_SourceTop(pbv, 1); - todo_wine ok(hr==E_INVALIDARG, "IBasicVideo_put_SourceTop returned: %x\n", hr); + ok(hr==E_INVALIDARG, "IBasicVideo_put_SourceTop returned: %x\n", hr); hr = IBasicVideo_SetSourcePosition(pbv, video_width, 0, video_width, video_height); - todo_wine ok(hr==E_INVALIDARG, "IBasicVideo_SetSourcePosition returned: %x\n", hr); + ok(hr==E_INVALIDARG, "IBasicVideo_SetSourcePosition returned: %x\n", hr); hr = IBasicVideo_SetSourcePosition(pbv, 0, video_height, video_width, video_height); - todo_wine ok(hr==E_INVALIDARG, "IBasicVideo_SetSourcePosition returned: %x\n", hr); + ok(hr==E_INVALIDARG, "IBasicVideo_SetSourcePosition returned: %x\n", hr); hr = IBasicVideo_SetSourcePosition(pbv, -1, 0, video_width, video_height); - todo_wine ok(hr==E_INVALIDARG, "IBasicVideo_SetSourcePosition returned: %x\n", hr); + ok(hr==E_INVALIDARG, "IBasicVideo_SetSourcePosition returned: %x\n", hr); hr = IBasicVideo_SetSourcePosition(pbv, 0, -1, video_width, video_height); - todo_wine ok(hr==E_INVALIDARG, "IBasicVideo_SetSourcePosition returned: %x\n", hr); + ok(hr==E_INVALIDARG, "IBasicVideo_SetSourcePosition returned: %x\n", hr); hr = IBasicVideo_SetSourcePosition(pbv, video_width/2, video_height/2, video_width, video_height); - todo_wine ok(hr==E_INVALIDARG, "IBasicVideo_SetSourcePosition returned: %x\n", hr); + ok(hr==E_INVALIDARG, "IBasicVideo_SetSourcePosition returned: %x\n", hr); hr = IBasicVideo_SetSourcePosition(pbv, video_width/2, video_height/2, video_width, video_height); - todo_wine ok(hr==E_INVALIDARG, "IBasicVideo_SetSourcePosition returned: %x\n", hr); + ok(hr==E_INVALIDARG, "IBasicVideo_SetSourcePosition returned: %x\n", hr); hr = IBasicVideo_SetSourcePosition(pbv, 0, 0, video_width, video_height+1); - todo_wine ok(hr==E_INVALIDARG, "IBasicVideo_SetSourcePosition returned: %x\n", hr); + ok(hr==E_INVALIDARG, "IBasicVideo_SetSourcePosition returned: %x\n", hr); hr = IBasicVideo_SetSourcePosition(pbv, 0, 0, video_width+1, video_height); - todo_wine ok(hr==E_INVALIDARG, "IBasicVideo_SetSourcePosition returned: %x\n", hr); + ok(hr==E_INVALIDARG, "IBasicVideo_SetSourcePosition returned: %x\n", hr); hr = IBasicVideo_SetSourcePosition(pbv, video_width/2, video_height/2, video_width/3+1, video_height/3+1); ok(hr==S_OK, "Cannot set source position returned: %x\n", hr); diff --git a/dlls/strmbase/video.c b/dlls/strmbase/video.c index ce7d26e..3f4d207 100644 --- a/dlls/strmbase/video.c +++ b/dlls/strmbase/video.c @@ -53,6 +53,25 @@ HRESULT WINAPI BaseControlVideo_Destroy(BaseControlVideo *pControlVideo) return BaseDispatch_Destroy(&pControlVideo->baseDispatch); } +static HRESULT BaseControlVideoImpl_CheckSourceRect(BaseControlVideo *This, RECT *pSourceRect) +{ + LONG VideoWidth, VideoHeight; + HRESULT hr; + + if (IsRectEmpty(pSourceRect)) + return E_INVALIDARG; + + hr = BaseControlVideoImpl_GetVideoSize((IBasicVideo *)This, &VideoWidth, &VideoHeight); + if (FAILED(hr)) + return hr; + + if (pSourceRect->top < 0 || pSourceRect->left < 0 || + pSourceRect->bottom > VideoHeight || pSourceRect->right > VideoWidth) + return E_INVALIDARG; + + return S_OK; +} + HRESULT WINAPI BaseControlVideoImpl_GetTypeInfoCount(IBasicVideo *iface, UINT *pctinfo) { BaseControlVideo *This = impl_from_IBasicVideo(iface); @@ -175,14 +194,20 @@ HRESULT WINAPI BaseControlVideoImpl_put_SourceLeft(IBasicVideo *iface, LONG Sour { RECT SourceRect; BaseControlVideo *This = impl_from_IBasicVideo(iface); + HRESULT hr; TRACE("(%p/%p)->(%d)\n", This, iface, SourceLeft); - This->pFuncsTable->pfnGetSourceRect(This, &SourceRect); - SourceRect.right = (SourceRect.right - SourceRect.left) + SourceLeft; - SourceRect.left = SourceLeft; - This->pFuncsTable->pfnSetSourceRect(This, &SourceRect); + hr = This->pFuncsTable->pfnGetSourceRect(This, &SourceRect); + if (SUCCEEDED(hr)) + { + SourceRect.right = (SourceRect.right - SourceRect.left) + SourceLeft; + SourceRect.left = SourceLeft; + hr = BaseControlVideoImpl_CheckSourceRect(This, &SourceRect); + } + if (SUCCEEDED(hr)) + hr = This->pFuncsTable->pfnSetSourceRect(This, &SourceRect); - return S_OK; + return hr; } HRESULT WINAPI BaseControlVideoImpl_get_SourceLeft(IBasicVideo *iface, LONG *pSourceLeft) @@ -203,13 +228,19 @@ HRESULT WINAPI BaseControlVideoImpl_put_SourceWidth(IBasicVideo *iface, LONG Sou { RECT SourceRect; BaseControlVideo *This = impl_from_IBasicVideo(iface); + HRESULT hr; TRACE("(%p/%p)->(%d)\n", This, iface, SourceWidth); - This->pFuncsTable->pfnGetSourceRect(This, &SourceRect); - SourceRect.right = SourceRect.left + SourceWidth; - This->pFuncsTable->pfnSetSourceRect(This, &SourceRect); + hr = This->pFuncsTable->pfnGetSourceRect(This, &SourceRect); + if (SUCCEEDED(hr)) + { + SourceRect.right = SourceRect.left + SourceWidth; + hr = BaseControlVideoImpl_CheckSourceRect(This, &SourceRect); + } + if (SUCCEEDED(hr)) + hr = This->pFuncsTable->pfnSetSourceRect(This, &SourceRect); - return S_OK; + return hr; } HRESULT WINAPI BaseControlVideoImpl_get_SourceWidth(IBasicVideo *iface, LONG *pSourceWidth) @@ -230,14 +261,20 @@ HRESULT WINAPI BaseControlVideoImpl_put_SourceTop(IBasicVideo *iface, LONG Sourc { RECT SourceRect; BaseControlVideo *This = impl_from_IBasicVideo(iface); + HRESULT hr; TRACE("(%p/%p)->(%d)\n", This, iface, SourceTop); - This->pFuncsTable->pfnGetSourceRect(This, &SourceRect); - SourceRect.bottom = (SourceRect.bottom - SourceRect.top) + SourceTop; - SourceRect.top = SourceTop; - This->pFuncsTable->pfnSetSourceRect(This, &SourceRect); + hr = This->pFuncsTable->pfnGetSourceRect(This, &SourceRect); + if (SUCCEEDED(hr)) + { + SourceRect.bottom = (SourceRect.bottom - SourceRect.top) + SourceTop; + SourceRect.top = SourceTop; + hr = BaseControlVideoImpl_CheckSourceRect(This, &SourceRect); + } + if (SUCCEEDED(hr)) + hr = This->pFuncsTable->pfnSetSourceRect(This, &SourceRect); - return S_OK; + return hr; } HRESULT WINAPI BaseControlVideoImpl_get_SourceTop(IBasicVideo *iface, LONG *pSourceTop) @@ -258,13 +295,19 @@ HRESULT WINAPI BaseControlVideoImpl_put_SourceHeight(IBasicVideo *iface, LONG So { RECT SourceRect; BaseControlVideo *This = impl_from_IBasicVideo(iface); + HRESULT hr; TRACE("(%p/%p)->(%d)\n", This, iface, SourceHeight); - This->pFuncsTable->pfnGetSourceRect(This, &SourceRect); - SourceRect.bottom = SourceRect.top + SourceHeight; - This->pFuncsTable->pfnSetSourceRect(This, &SourceRect); + hr = This->pFuncsTable->pfnGetSourceRect(This, &SourceRect); + if (SUCCEEDED(hr)) + { + SourceRect.bottom = SourceRect.top + SourceHeight; + hr = BaseControlVideoImpl_CheckSourceRect(This, &SourceRect); + } + if (SUCCEEDED(hr)) + hr = This->pFuncsTable->pfnSetSourceRect(This, &SourceRect); - return S_OK; + return hr; } HRESULT WINAPI BaseControlVideoImpl_get_SourceHeight(IBasicVideo *iface, LONG *pSourceHeight) @@ -400,9 +443,9 @@ HRESULT WINAPI BaseControlVideoImpl_SetSourcePosition(IBasicVideo *iface, LONG L TRACE("(%p/%p)->(%d, %d, %d, %d)\n", This, iface, Left, Top, Width, Height); SetRect(&SourceRect, Left, Top, Left + Width, Top + Height); - This->pFuncsTable->pfnSetSourceRect(This, &SourceRect); - - return S_OK; + if (FAILED(BaseControlVideoImpl_CheckSourceRect(This, &SourceRect))) + return E_INVALIDARG; + return This->pFuncsTable->pfnSetSourceRect(This, &SourceRect); } HRESULT WINAPI BaseControlVideoImpl_GetSourcePosition(IBasicVideo *iface, LONG *pLeft, LONG *pTop, LONG *pWidth, LONG *pHeight)
1
0
0
0
Akihiro Sagawa : strmbase: Shift source/ destination rectangle when updating top or left property.
by Alexandre Julliard
28 Nov '16
28 Nov '16
Module: wine Branch: master Commit: 69761ae71c6b5cec58b05e02a961c3d09697cc39 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=69761ae71c6b5cec58b05e02a…
Author: Akihiro Sagawa <sagawa.aki(a)gmail.com> Date: Fri Nov 25 01:10:04 2016 +0900 strmbase: Shift source/destination rectangle when updating top or left property. Signed-off-by: Akihiro Sagawa <sagawa.aki(a)gmail.com> Signed-off-by: Andrew Eikum <aeikum(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/quartz/tests/filtergraph.c | 8 ++++---- dlls/strmbase/video.c | 4 ++++ 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/dlls/quartz/tests/filtergraph.c b/dlls/quartz/tests/filtergraph.c index 307bba9..93fb2a0 100644 --- a/dlls/quartz/tests/filtergraph.c +++ b/dlls/quartz/tests/filtergraph.c @@ -134,14 +134,14 @@ static void test_basic_video(void) hr = IBasicVideo_GetSourcePosition(pbv, &left, &top, &width, &height); ok(hr == S_OK, "Cannot get source position returned: %x\n", hr); ok(left == video_width/3, "expected %d, got %d\n", video_width/3, left); - todo_wine ok(width == video_width/3+1, "expected %d, got %d\n", video_width/3+1, width); + ok(width == video_width/3+1, "expected %d, got %d\n", video_width/3+1, width); hr = IBasicVideo_put_SourceTop(pbv, video_height/3); ok(hr==S_OK, "Cannot put source top returned: %x\n", hr); hr = IBasicVideo_GetSourcePosition(pbv, &left, &top, &width, &height); ok(hr == S_OK, "Cannot get source position returned: %x\n", hr); ok(top == video_height/3, "expected %d, got %d\n", video_height/3, top); - todo_wine ok(height == video_height/3+1, "expected %d, got %d\n", video_height/3+1, height); + ok(height == video_height/3+1, "expected %d, got %d\n", video_height/3+1, height); hr = IBasicVideo_put_SourceWidth(pbv, video_width/4+1); ok(hr==S_OK, "Cannot put source width returned: %x\n", hr); @@ -222,14 +222,14 @@ static void test_basic_video(void) hr = IBasicVideo_GetDestinationPosition(pbv, &left, &top, &width, &height); ok(hr == S_OK, "Cannot get source position returned: %x\n", hr); ok(left == video_width/3, "expected %d, got %d\n", video_width/3, left); - todo_wine ok(width == video_width/3+1, "expected %d, got %d\n", video_width/3+1, width); + ok(width == video_width/3+1, "expected %d, got %d\n", video_width/3+1, width); hr = IBasicVideo_put_DestinationTop(pbv, video_height/3); ok(hr==S_OK, "Cannot put destination top returned: %x\n", hr); hr = IBasicVideo_GetDestinationPosition(pbv, &left, &top, &width, &height); ok(hr == S_OK, "Cannot get source position returned: %x\n", hr); ok(top == video_height/3, "expected %d, got %d\n", video_height/3, top); - todo_wine ok(height == video_height/3+1, "expected %d, got %d\n", video_height/3+1, height); + ok(height == video_height/3+1, "expected %d, got %d\n", video_height/3+1, height); hr = IBasicVideo_put_DestinationWidth(pbv, video_width/4+1); ok(hr==S_OK, "Cannot put destination width returned: %x\n", hr); diff --git a/dlls/strmbase/video.c b/dlls/strmbase/video.c index 1b8e3f3..ce7d26e 100644 --- a/dlls/strmbase/video.c +++ b/dlls/strmbase/video.c @@ -178,6 +178,7 @@ HRESULT WINAPI BaseControlVideoImpl_put_SourceLeft(IBasicVideo *iface, LONG Sour TRACE("(%p/%p)->(%d)\n", This, iface, SourceLeft); This->pFuncsTable->pfnGetSourceRect(This, &SourceRect); + SourceRect.right = (SourceRect.right - SourceRect.left) + SourceLeft; SourceRect.left = SourceLeft; This->pFuncsTable->pfnSetSourceRect(This, &SourceRect); @@ -232,6 +233,7 @@ HRESULT WINAPI BaseControlVideoImpl_put_SourceTop(IBasicVideo *iface, LONG Sourc TRACE("(%p/%p)->(%d)\n", This, iface, SourceTop); This->pFuncsTable->pfnGetSourceRect(This, &SourceRect); + SourceRect.bottom = (SourceRect.bottom - SourceRect.top) + SourceTop; SourceRect.top = SourceTop; This->pFuncsTable->pfnSetSourceRect(This, &SourceRect); @@ -287,6 +289,7 @@ HRESULT WINAPI BaseControlVideoImpl_put_DestinationLeft(IBasicVideo *iface, LONG TRACE("(%p/%p)->(%d)\n", This, iface, DestinationLeft); This->pFuncsTable->pfnGetTargetRect(This, &DestRect); + DestRect.right = (DestRect.right - DestRect.left) + DestinationLeft; DestRect.left = DestinationLeft; This->pFuncsTable->pfnSetTargetRect(This, &DestRect); @@ -341,6 +344,7 @@ HRESULT WINAPI BaseControlVideoImpl_put_DestinationTop(IBasicVideo *iface, LONG TRACE("(%p/%p)->(%d)\n", This, iface, DestinationTop); This->pFuncsTable->pfnGetTargetRect(This, &DestRect); + DestRect.bottom = (DestRect.bottom - DestRect.top) + DestinationTop; DestRect.top = DestinationTop; This->pFuncsTable->pfnSetTargetRect(This, &DestRect);
1
0
0
0
← Newer
1
2
3
4
5
6
7
8
9
...
47
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
Results per page:
10
25
50
100
200